X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_notify.php;h=44a3160a320a9e49e73b0f4ef26e4e6bc24ad3d7;hb=f95c0f6901fbe224a69d9561c0178c3161c2f459;hp=a6f207132ea9ef0a9d11edaebcbae3eec08efeda;hpb=0306d9280f082231ec885b1e2aaf9d9d8bfd3b18;p=Pman.Core diff --git a/DataObjects/Core_notify.php b/DataObjects/Core_notify.php index a6f20713..44a3160a 100644 --- a/DataObjects/Core_notify.php +++ b/DataObjects/Core_notify.php @@ -64,11 +64,11 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject return $set; } $c = DB_DataObject::factory($this->ontable); + if ($this->onid == 0) { return $c; // empty dataobject. } - $c->get(1); - print_r($c);exit; + $c->autoJoin(); if ($c->get($this->onid)) { @@ -102,7 +102,7 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject } function delivered() { - return !empty($msgid); + return !empty($this->msgid); } function status() // used by commandline reporting at present.. @@ -142,6 +142,25 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject $this->whereAdd( "join_person_id_id.name LIKE '{$this->escape($q['query']['person_id_name'])}%'"); } + if (!empty($q['query']['status'])) { + switch ($q['query']['status']) { + + case 'SUCCESS'; + $this->whereAdd("msgid != ''"); + break; + case 'FAILED'; + $this->whereAdd('event_id > 0 AND act_when <= NOW() '); + $this->is_active = 0; + break; + case 'PENDING'; + + $this->is_active = 0; + break; + case 'ALL': + default: + break; + } + }