DataObjects/Core_notify.php
[Pman.Core] / DataObjects / Core_notify.php
index 4f0d684..1fd7bbd 100644 (file)
@@ -90,6 +90,13 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject
         }
         
     }
+    function beforeUpdate($old, $request,$roo)
+    {
+        if (empty($request['act_when']) && !empty($request['act_start'])) {
+            $this->act_start($request['act_start']);
+        }
+    }
+    
     
     function act_start($set = false)
     {
@@ -179,7 +186,7 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject
             "; 
             $this->selectAs($d, 'core_notify_%s');
         } 
-        if (isset($q['query']['person_id_name']) ) {
+        if (!empty($q['query']['person_id_name']) ) {
             $this->whereAdd( "join_person_id_id.name LIKE '{$this->escape($q['query']['person_id_name'])}%'");
              
         }
@@ -208,10 +215,21 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject
             }
         }
         
-        
-        
-        
-        
+        if(!empty($q['_evtype_align'])){
+            $this->selectAdd("
+                (SELECT
+                        display_name
+                FROM
+                        core_enum
+                WHERE
+                        etype = 'Core.NotifyType'
+                    AND
+                        name = core_notify.evtype
+                    AND
+                        active = 1
+                ) AS evtype_align
+            ");
+        }
         
     }