php8
[web.mtrack] / MTrackWeb / Report.php
index 11d100c..0a61fcc 100644 (file)
@@ -17,7 +17,9 @@ class MTrackWeb_Report extends MTrackWeb
     function get($pi=0)
     {
        
-       
+        if (isset($_REQUEST['ajax_body2'])) {
+            return $this->get2($pi);
+        }
         if (!isset($_REQUEST['ajax_body'])) {
             return;
         }
@@ -98,15 +100,12 @@ class MTrackWeb_Report extends MTrackWeb
 
     }
     
-    function get2()
+    function get2($pi)
     {
         // the ajax version...
         // just returns data which can be rendered using the jtemplate code..
         
-        
-         if (!isset($_REQUEST['ajax_body'])) {
-            return;
-        }
+    
         $this->id = $pi ?  $pi: (isset($_GET['id']) ? $_GET['id'] : 0);
         $this->id  = $this->id  == 'new' ? 0 : $this->id;
         $this->id  = (int) $this->id;
@@ -154,8 +153,9 @@ class MTrackWeb_Report extends MTrackWeb
         }
         // in theory... everything else is a 'save'...
         try {
+            // this does not match api!??
             $cs = DB_DataObject::Factory('mtrack_change');
-            $cs->begin( "report:" . $rep->summary, $_POST['comment']);
+            $cs->beginChange( "report:" . $rep->summary, $_POST['comment']);
             $rep->save($cs);
             $cs->commit();
             return $this->get($pi);