evtype and handle no matching evtype call
authorAlan <alan@roojs.com>
Thu, 5 Oct 2023 08:13:53 +0000 (16:13 +0800)
committerAlan <alan@roojs.com>
Thu, 5 Oct 2023 08:13:53 +0000 (16:13 +0800)
DataObjects/Core_watch.php
NotifySend.php

index e41d10d..2e207ff 100644 (file)
@@ -282,6 +282,7 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject
             $n->trigger_event_id = $event->id;
             $n->person_id = $watch->person_id;
             $n->watch_id =  $watch->id;
+            $n->evtype   = $watch->medium;
             
             // does this watch already have a flag...
             $nf = clone($n);
@@ -295,9 +296,7 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject
             $n->act_start( empty($n->act_start) ? date("Y-m-d H:i:s") : $n->act_start );
             $n->insert();
         }
-        
-        
-        
+         
     }
     function initDatabase($roo, $data) {
         foreach($data as $d) {
index 07c1e9f..132930b 100644 (file)
@@ -257,6 +257,7 @@ class Pman_Core_NotifySend extends Pman
                     ."\n");
         }
         
+         
         
         if (isset($email['later'])) {
             $old = clone($w);
@@ -654,7 +655,8 @@ class Pman_Core_NotifySend extends Pman
             echo "calling :" . get_class($object) . '::' .$m . "\n";
             return $object->$m($rcpt, $last_sent_date, $notify, $force);
         }
-                
+        // fallback if evtype is empty..
+        
         if (method_exists($object, 'toMailerData')) {
             return $object->toMailerData(array(
                 'rcpts'=>$rcpt,
@@ -663,8 +665,12 @@ class Pman_Core_NotifySend extends Pman
             //var_Dump($object);
             //exit;
         }
+        if (method_exists($object, 'toEmail')) {
+            return $object->toEmail($rcpt, $last_sent_date, $notify, $force);
+        }
+        // no way to send this.. - this needs to handle core_notify how we have used it for the approval stuff..
         
-        return $object->toEmail($rcpt, $last_sent_date, $notify, $force);
+        return false;
     }
     
     function debug($str)