X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FCore_notify_recur.php;h=81e3e7c60c93f762dda8e74d1288430bcc7243b6;hp=84b99a3e6c95336b37d53f73c295ec2a6592ed38;hb=ed43051791c52e45c675d6ea746f9d64d2d09a49;hpb=de8f805c1c52d611427e7e29ead1fd890eb5aa8c diff --git a/DataObjects/Core_notify_recur.php b/DataObjects/Core_notify_recur.php index 84b99a3e..81e3e7c6 100644 --- a/DataObjects/Core_notify_recur.php +++ b/DataObjects/Core_notify_recur.php @@ -66,6 +66,7 @@ class Pman_Core_DataObjects_Core_notify_recur extends DB_DataObject $start = date('Y-m-d H:i:s', max(strtotime("NOW"), strtotime($this->dtstart))); $end = date('Y-m-d H:i:s', min(strtotime("NOW + $advance DAYS"), strtotime($this->dtend))); + return array($start, $end); } function method() @@ -109,14 +110,18 @@ class Pman_Core_DataObjects_Core_notify_recur extends DB_DataObject $usedays[] = date("Y-m-d", $ut); } } - + //print_r($this); foreach($usedays as $d){ foreach($hours as $h){ $date = new DateTime($d. ' ' . $h, new DateTimeZone($this->tz)); - $date->setTimezone(new DateTimeZone(ini_get('date.timezone'))); + $tz= ini_get('date.timezone'); + if(!empty($tz)){ + $date->setTimezone(new DateTimeZone($tz)); + } + $ret[] = $date->format('Y-m-d H:i:s'); } } @@ -141,7 +146,7 @@ class Pman_Core_DataObjects_Core_notify_recur extends DB_DataObject $notifytimes = $this->notifyTimes(2); - ////print_R($notifytimes); + //print_R($notifytimes); $newSearch = DB_DataObject::factory('core_notify'); $newSearch->whereAdd( 'act_start > NOW()'); @@ -150,7 +155,6 @@ class Pman_Core_DataObjects_Core_notify_recur extends DB_DataObject // returns array('2012-12-xx'=>12, 'date' => id....) - foreach($notifytimes as $time){ if (isset($old[$time])) { @@ -168,7 +172,7 @@ class Pman_Core_DataObjects_Core_notify_recur extends DB_DataObject if (strtotime($time) < time()) { // will not get deleted.. //echo "SKIP BEFORE NOW"; - unset($old[$time]); +// unset($old[$time]); continue; } // do not have a notify event... creat it.. @@ -211,4 +215,5 @@ class Pman_Core_DataObjects_Core_notify_recur extends DB_DataObject // should delete old events that have not occurred... $n->delete(DB_DATAOBJECT_WHEREADD_ONLY); } + }