DataObjects/Mtrack_change.php
authorAlan Knowles <alan@akbkhome.com>
Fri, 25 Mar 2011 11:24:33 +0000 (19:24 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 25 Mar 2011 11:24:33 +0000 (19:24 +0800)
DataObjects/Mtrack_change.php

index c14c933..ea6f5fc 100644 (file)
@@ -188,6 +188,41 @@ class Pman_MTrack_DataObjects_Mtrack_change extends DB_DataObject
         // we need to return a nice list of changes
         // we can ignore changes done by the user (they do not need emails about stuff they have done..)
         // although commit messages might be usefull..???? need to work out how we can Flag that.
+        $q = DB_DataObject::factory('mtrack_change');
+        
+        $conds = array(); // list of 'OR' conditions
+        foreach($ar as $kv) {
+            list($table,$id) = explode(':', $kv);
+            switch($table) {
+                case 'Project':
+                    // all tickets for that project..
+                    $conds[] = "( 
+                        ontable = 'mtrack_ticket'
+                        AND 
+                        onid IN (
+                            SELECT id from mtrack_ticket where project_id = $id
+                        )
+                    )";
+                    break;
+                
+                case 'Ticket':
+                    $conds[] = "( 
+                        ontable = 'mtrack_ticket'
+                        AND 
+                        onid = $id
+                    )";
+                    break;
+                
+                
+                
+                
+                
+            }
+            
+            
+        }
+        
+