1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
7 require_once 'MTrack/Attachment.php';
8 require_once 'MTrackWeb.php';
10 class MTrackWeb_Timeline extends MTrackWeb
14 var $title = 'Timeline';
16 var $start_time = '-2 weeks';
18 // fixme = this should be alot more efficient...
23 function get($only_users)
27 if (!isset($_REQUEST['ajax_body'])) {
32 $this->masterTemplate = 'timeline.html';
34 $pid = $this->currentProject();
35 //DB_DataObject::debugLevel(1);
37 $e = DB_DataObject::factory('mtrack_change');
38 $e->orderBy('changedate DESC');
42 ( ontable='mtrack_ticket' AND
43 onid IN (SELECT id FROM mtrack_ticket where project_id = $pid)
47 $this->events = array();
48 //$this->hist= array();
50 foreach($ar as $i=>$h) {
51 $h->cls = $i % 2 ? 'odd' : '';
53 $ts = strtotime($h->changedate);
54 $day = date('D, M d Y', $ts);
55 $time = date('g:ia', $ts);
57 if ($day !== $last_day) {
58 $this->events[] = (object) array(
69 $h->object = $h->objectCached();