calendar event before delete inspect event
authorMichael Spahn <m.spahn@metaways.de>
Wed, 19 Jul 2017 10:17:41 +0000 (12:17 +0200)
committerMichael Spahn <m.spahn@metaways.de>
Wed, 19 Jul 2017 11:41:26 +0000 (13:41 +0200)
Change-Id: Iaa0927dd235ac5f75c2bf02a03557f5fec28fe94
Reviewed-on: http://gerrit.tine20.com/customers/5248
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Michael Spahn <m.spahn@metaways.de>
Tested-by: Michael Spahn <m.spahn@metaways.de>
tine20/Calendar/Controller/Event.php
tine20/Calendar/Event/InspectDeleteEvent.php [new file with mode: 0644]

index 9445124..f6c4d01 100644 (file)
@@ -2135,6 +2135,11 @@ class Calendar_Controller_Event extends Tinebase_Controller_Record_Abstract impl
                     . ' Implicitly deleting ' . (count($exceptionIds) - 1 ) . ' persistent exception(s) for recurring series with uid' . $event->uid);
                 $_ids = array_merge($_ids, $exceptionIds);
             }
+
+            Tinebase_Record_PersistentObserver::getInstance()->fireEvent(new Calendar_Event_InspectDeleteEvent([
+                'observable' => $event,
+                'deletedIds' => $_ids
+            ]));
         }
         
         $this->_deleteAlarmsForIds($_ids);
diff --git a/tine20/Calendar/Event/InspectDeleteEvent.php b/tine20/Calendar/Event/InspectDeleteEvent.php
new file mode 100644 (file)
index 0000000..3a1ae5a
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Tine 2.0
+ *
+ * @license      http://www.gnu.org/licenses/agpl.html AGPL Version 3
+ * @author       Michael Spahn <m.spahn@metaways.de>
+ * @copyright    Copyright (c) 2017 Metaways Infosystems GmbH (http://www.metaways.de)
+ *
+ */
+
+/**
+ * event class for event deletion inspection
+ *
+ * @package     Calendar
+ */
+class Calendar_Event_InspectDeleteEvent extends Tinebase_Event_Observer_Abstract
+{
+    /**
+     * the event to inspect
+     *
+     * @var Calendar_Model_Event
+     */
+    public $observable;
+
+    /**
+     * All deleted ids
+     *
+     * @var array
+     */
+    public $deletedIds;
+}
\ No newline at end of file