From 7c72c711a42c036356ca854b3e9a5bedcd239bdf Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 5 Oct 2023 16:13:53 +0800 Subject: [PATCH] evtype and handle no matching evtype call --- DataObjects/Core_watch.php | 5 ++--- NotifySend.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/DataObjects/Core_watch.php b/DataObjects/Core_watch.php index e41d10d8..2e207ff2 100644 --- a/DataObjects/Core_watch.php +++ b/DataObjects/Core_watch.php @@ -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) { diff --git a/NotifySend.php b/NotifySend.php index 07c1e9ff..132930b7 100644 --- a/NotifySend.php +++ b/NotifySend.php @@ -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) -- 2.39.2