plugins/calendar

Thomas Brüderli bruederli at kolabsys.com
Mon Sep 22 15:38:05 CEST 2014


 plugins/calendar/drivers/calendar_driver.php |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit bde037ce0e9edf87661258c4fee33b5b3c319bcd
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Mon Sep 22 15:37:55 2014 +0200

    Restore calendar_driver::dismiss_birthday_alarm() method which accidentally got removed in commit 51fe7c26

diff --git a/plugins/calendar/drivers/calendar_driver.php b/plugins/calendar/drivers/calendar_driver.php
index 8872ed0..702dd22 100644
--- a/plugins/calendar/drivers/calendar_driver.php
+++ b/plugins/calendar/drivers/calendar_driver.php
@@ -685,6 +685,25 @@ abstract class calendar_driver
   }
 
   /**
+   * Store alarm dismissal for birtual birthay events
+   *
+   * @param  string  Event identifier
+   * @param  integer Suspend the alarm for this number of seconds
+   */
+  public function dismiss_birthday_alarm($event_id, $snooze = 0)
+  {
+    $rcmail = rcmail::get_instance();
+    $cache  = $rcmail->get_cache('calendar.birthdayalarms', 'db', 86400 * 30);
+    $cache->remove($event_id);
+
+    // compute new notification time or disable if not snoozed
+    $notifyat = $snooze > 0 ? time() + $snooze : null;
+    $cache->set($event_id, array('snooze' => $snooze, 'notifyat' => $notifyat));
+
+    return true;
+  }
+
+  /**
    * Handler for user_delete plugin hook
    *
    * @param array Hash array with hook arguments




More information about the commits mailing list