return $a->fetchAll();
}
+ function changesSince($object,$lasttime)
+ {
+ $q = DB_DataObject::factory('mtrack_change');
+ $q->onid = $object->id;
+ $q->ontable = $object->tableName();
+
+ $q->whereAdd("person_id != $uid"); /// unless they are commits?
+
+ $q->whereAdd(implode(' OR ', $conds));
+ $q->whereAdd("changedate > '$since'");
+ $q->orderBy('changedate ASC');
+ // we are going to end up with a list of objects that have changed.
+ // eg. a ticket or a repo..
+
+ $cs_ar = $q->fetchAll();
+
+
+ }
+
function gatherChanges($since, $uid, $ar) {
// array contains a list of project:X repo:X ticket:X etc..
- // 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) {
-
- // this should perhaps call a method on each type its looking up...
- 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;
-
- case 'Repo':
- // this means that commits get logged as mtrack_repo change..
- $conds[] = "(
- ontable = 'mtrack_repo'
- AND
- onid = $id
- )";
- break;
-
-
-
- }
-
-
- }
$q->whereAdd("person_id != $uid"); /// unless they are commits?
$q->whereAdd(implode(' OR ', $conds));