summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas B <roundcube@gmail.com>2012-04-24 08:14:01 (GMT)
committerThomas Bruederli <thomas@roundcube.net>2012-05-10 18:08:57 (GMT)
commita5c25804317e0241c1fbe52b17c13bb5f6a587a3 (patch)
tree9eebbe1f3388d2f778e8c48ab245298ed0187544
parent154aebfc3c5dd06bc5ca88a54c44e42a9223cfc7 (diff)
downloadroundcubemail-plugins-kolab-a5c25804317e0241c1fbe52b17c13bb5f6a587a3.tar.gz
Don't use REPLACE INTO which is mysql only (#650)
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 1978079..320a932 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -832,15 +832,18 @@ class kolab_driver extends calendar_driver
*/
public function dismiss_alarm($event_id, $snooze = 0)
{
+ // delete old alarm entry
+ $this->rc->db->query("DELETE FROM kolab_alarms WHERE event_id=?", $event_id);
+
// set new notifyat time or unset if not snoozed
$notifyat = $snooze > 0 ? date('Y-m-d H:i:s', time() + $snooze) : null;
-
+
$query = $this->rc->db->query(
- "REPLACE INTO kolab_alarms
+ "INSERT INTO kolab_alarms
(event_id, dismissed, notifyat)
VALUES(?, ?, ?)",
$event_id,
- $snooze > 0 ? 0 : 1,
+ $snooze > 0 ? 0 : 1,
$notifyat
);