summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/notification/helpers/notification_event.php6
-rw-r--r--modules/notification/helpers/notification_installer.php10
2 files changed, 15 insertions, 1 deletions
diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php
index 3fccdfbe..1568b854 100644
--- a/modules/notification/helpers/notification_event.php
+++ b/modules/notification/helpers/notification_event.php
@@ -23,7 +23,11 @@ class notification_event_Core {
}
static function item_created($item) {
- notification::send_item_add($item);
+ $batch_id = Session::instance()->get("batch_id");
+ if (!batch::in_progress("add") {
+ notification::send_item_add($item);
+ } else {
+ }
}
static function item_before_delete($item) {
diff --git a/modules/notification/helpers/notification_installer.php b/modules/notification/helpers/notification_installer.php
index 473ae169..d3ea2582 100644
--- a/modules/notification/helpers/notification_installer.php
+++ b/modules/notification/helpers/notification_installer.php
@@ -1,3 +1,4 @@
+
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
@@ -32,6 +33,14 @@ class notification_installer {
UNIQUE KEY (`user_id`, `item_id`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
+ $db->query("CREATE TABLE IF NOT EXISTS {pending_notifications} (
+ `id` int(9) NOT NULL auto_increment,
+ `item_id` int(9) NOT NULL,
+ `batch_id` int(9) NOT NULL,
+ `time` int(9) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY (`batch_id`, `item_id`),
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;");
module::set_version("notification", 1);
}
}
@@ -39,6 +48,7 @@ class notification_installer {
static function uninstall() {
$db = Database::instance();
$db->query("DROP TABLE IF EXISTS {subscriptions};");
+ $db->query("DROP TABLE IF EXISTS {notification_queue};");
module::delete("notification");
}