add hooks for events

This commit is contained in:
Georg Ehrke 2012-06-09 12:30:09 +02:00
parent 7ed30649bb
commit a9b561430a
1 changed files with 8 additions and 2 deletions

View File

@ -108,7 +108,7 @@ class OC_Calendar_Object{
$object_id = OCP\DB::insertid('*PREFIX*calendar_objects');
OC_Calendar_Calendar::touchCalendar($id);
OCP\Util::emitHook('OC_Calendar', 'addEvent', array('event_id' => $object_id));
return $object_id;
}
@ -128,7 +128,7 @@ class OC_Calendar_Object{
$object_id = OCP\DB::insertid('*PREFIX*calendar_objects');
OC_Calendar_Calendar::touchCalendar($id);
OCP\Util::emitHook('OC_Calendar', 'addEvent', array('event_id' => $object_id));
return $object_id;
}
@ -149,6 +149,7 @@ class OC_Calendar_Object{
$stmt->execute(array($type,$startdate,$enddate,$repeating,$summary,$data,time(),$id));
OC_Calendar_Calendar::touchCalendar($oldobject['calendarid']);
OCP\Util::emitHook('OC_Calendar', 'editEvent', array('event_id' => $id));
return true;
}
@ -170,6 +171,7 @@ class OC_Calendar_Object{
$stmt->execute(array($type,$startdate,$enddate,$repeating,$summary,$data,time(),$oldobject['id']));
OC_Calendar_Calendar::touchCalendar($oldobject['calendarid']);
OCP\Util::emitHook('OC_Calendar', 'editEvent', array('event_id' => $oldobject['id']));
return true;
}
@ -184,6 +186,7 @@ class OC_Calendar_Object{
$stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*calendar_objects WHERE id = ?' );
$stmt->execute(array($id));
OC_Calendar_Calendar::touchCalendar($oldobject['calendarid']);
OCP\Util::emitHook('OC_Calendar', 'deleteEvent', array('event_id' => $id));
return true;
}
@ -195,9 +198,11 @@ class OC_Calendar_Object{
* @return boolean
*/
public static function deleteFromDAVData($cid,$uri){
$oldobject = self::findWhereDAVDataIs($cid, $uri);
$stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*calendar_objects WHERE calendarid = ? AND uri=?' );
$stmt->execute(array($cid,$uri));
OC_Calendar_Calendar::touchCalendar($cid);
OCP\Util::emitHook('OC_Calendar', 'deleteEvent', array('event_id' => $oldobject['id']));
return true;
}
@ -207,6 +212,7 @@ class OC_Calendar_Object{
$stmt->execute(array($calendarid,$id));
OC_Calendar_Calendar::touchCalendar($id);
OCP\Util::emitHook('OC_Calendar', 'moveEvent', array('event_id' => $id));
return true;
}