php8
[web.mtrack] / MTrackWeb / Gitlive.php
index 2da94d1..3db2ba2 100644 (file)
@@ -18,7 +18,7 @@ class MTrackWeb_Gitlive extends MTrackWeb
         if (!isset($_SERVER['PHP_AUTH_USER'])) {
             $this->h401();
         } 
-        $u = DB_DataObject::factory('Person');
+        $u = DB_DataObject::factory('core_person');
         //$u->active = 1;
         $u->whereAdd('LENGTH(passwd) > 1');
         //$u->company_id = $this->company->id;
@@ -56,16 +56,28 @@ class MTrackWeb_Gitlive extends MTrackWeb
         if (!$this->projectPerm($r->project_id, 'MTrack.Issue', 'S')) {
             $this->jerr("no perms");
         }
-        
+        //DB_DAtaObject::DebugLevel(1);
         $t = DB_DataObject::Factory('mtrack_ticket');
         $t->autoJoin();
-        //$t->whereAdd("status_name = 'open'");
+        $t->whereAdd("join_status_id.name IN ( 'open', 'new')");
         $t->project_id = $r->project_id;
         // only need id / name / status?
         //$ar = $t->fetchAll('id', ');
-        $ar = $t->fetchAll();
-        print_R($ar);
+        $t->selectAdd();
+        $t->selectAdd('
+                mtrack_ticket.id as id ,
+                mtrack_ticket.summary as summary,
+                mtrack_ticket.description as description
+        ');
         
+        $t->find();
+        $ret = array();
+        while ($t->fetch()) {
+            $ret[] = $t->toArray('%s', 0);
+        }
+         
+    //    print_R($ar);
+        $this->jok($ret);
         $this->jok("WORKED!");
         
     }