php8
[web.mtrack] / MTrackWeb / TicketEdit.php
index 1b6736a..41e5176 100644 (file)
@@ -139,11 +139,14 @@ class MTrackWeb_TicketEdit extends MTrackWeb
         
         if (!empty($_REQUEST['act_now'])) { //=+ adding act now..
             // check project / assigned person / !closed for more than 3 'act_now'
-            $xx = DB_DataObject::factroy('mtrack_ticket');
+            //DB_DataObject::DebugLevel(1);
+            $xx = DB_DataObject::factory('mtrack_ticket');
             $xx->owner_id = $this->issue->owner_id;
             $xx->project_id  = $this->issue->project_id;
+            $xx->act_now = 1;
             $xx->resolution_id = 0;
-            if ($xx->count() > 3) {
+            $xx->whereAdd('id != ' . ((int) $this->issue->id)); // just in case we are double setting...
+            if ($xx->count() > 2) {
                 $this->jerr("To many act-now tasks assigned to that person, wait until the have completed some");
             }
             
@@ -217,6 +220,10 @@ class MTrackWeb_TicketEdit extends MTrackWeb
             empty($_POST['estimate']) ? 0 : $_POST['estimate']
         );
         */
+        
+        
+        
+        
         $this->issue->project_id = $this->currentProject();
         
         
@@ -225,7 +232,10 @@ class MTrackWeb_TicketEdit extends MTrackWeb
        
         
         if ($this->issue->id) {
-            $this->issue->update($old);
+            if (0 === $this->issue->update($old)) {
+                $this->jerr("nothing changed?");
+            
+            }
         } else {
             $this->issue->insert();
             $old = false;
@@ -370,7 +380,7 @@ class MTrackWeb_TicketEdit extends MTrackWeb
         $pd = DB_DataObject::factory('ProjectDirectory');
         $pd->project_id = $this->currentProject();
         $pd->whereAdd("ProjectDirectory.role != ''");
-        $pd->joinAdd(DB_DataObject::factory('Person'), 'LEFT');
+        $pd->joinAdd(DB_DataObject::factory('core_person'), 'LEFT');
         $pd->selectAdd();
         $pd->selectAdd("distinct(Person.id) as id ,  CONCAT(Person.name , '<', Person.email , '>') as name");
         $pd->groupBy('Person.id, Person.name');