DataObjects/Core_notify.php
authorAlan <alan@roojs.com>
Fri, 6 Oct 2023 04:54:04 +0000 (12:54 +0800)
committerAlan <alan@roojs.com>
Fri, 6 Oct 2023 04:54:04 +0000 (12:54 +0800)
DataObjects/Core_notify.php

index 8c0e628..652f070 100644 (file)
@@ -345,4 +345,23 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject
         return true;
     }
     
+    function flagDone($event,$msgid)
+    {
+        $ww = clone($this);
+        if(strtotime($this->act_when) > strtotime("NOW")){
+            $this->act_when = $this->sqlValue('NOW()');
+        }
+        $this->sent = $this->sent == '0000-00-00 00:00:00' ? $this->sqlValue('NOW()') :$this->sent; // do not update if sent.....
+        $this->msgid = '';
+        $this->event_id = $event->id;
+        $this->update($ww);
+    }
+    
+    function flagLater($when)
+    {
+        $ww = clone($this);
+        $this->act_when = $when;
+        $this->update($ww);
+    }
+    
 }