X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_notify.php;h=fd7ece8ebf6dbcd25e6af3fe3ff9a817e9e53932;hb=af88561c2c3db4fdbee16380202e9f1b912355e4;hp=cd30a2a1389793c9ad60e7efe0dfe5705a9d4436;hpb=9c4e8e5b741fe9dcd74411f91e7bc6acd89dcfbb;p=Pman.Core diff --git a/DataObjects/Core_notify.php b/DataObjects/Core_notify.php index cd30a2a1..fd7ece8e 100644 --- a/DataObjects/Core_notify.php +++ b/DataObjects/Core_notify.php @@ -77,6 +77,11 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject return false; } + function beforeDelete($dependants_array, $roo) { + if ($this->delivered()) { + $roo->jerr("you can not delete a record of a successfull delivery"); + } + } function act_start($set = false) @@ -130,7 +135,11 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject //DB_DAtaObject::DebugLevel(1); // then we can build a join.. $d = DB_DataObject::Factory($q['ontable']); - $d->autoJoin(); + $ji = $d->autoJoin(); + //print_R($jinfo); + // get cols + + //$this->selectAdd($d->_query['data_select']); -- this will cause the same dataIndex... $this->_join .= " LEFT JOIN {$d->tableName()} ON {$this->tableName()}.onid = {$d->tableName()}.id @@ -146,10 +155,11 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject switch ($q['query']['status']) { case 'SUCCESS'; - $this->whereAdd("msg_id != ''"); + $this->whereAdd("msgid != ''"); break; case 'FAILED'; - $this->whereAdd('event_id > 0 AND act_when <= NOW() '); + + $this->whereAdd("msgid = '' AND event_id > 0 AND act_when < NOW()"); break; case 'PENDING';