+
+ foreach($notifytimes as $time){
+ if (strtotime($time) < time()) {
+ continue;
+ }
+ if (isset($old[$time])) {
+ // we already have it...
+ unset($old[$time]);
+ continue;
+ }
+
+ // do not have a notify event... creat it..
+ $add = DB_DataObject::factory('core_notify');
+ $add->setFrom(array(
+ "recur_id" => $w->id,
+ "act_start" => $time,
+ "act_when" => $time,
+ "person_id" => $w->person_id,
+ "onid" => $w->onid,
+ "ontable" => $w->ontable
+ ));
+ $add->insert();
+ }
+ foreach($old as $date => $id ) {
+ $del = DB_DataObject::factory('core_notify');
+ $del->get($id);
+ $del->delete();
+ }