3 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
22 $ilDB = $DIC->database();
24 if (!
$ilDB->tableExists(self::$tbl_userconfig)) {
26 'usr_id' => array(
'type' =>
'integer',
'notnull' =>
true,
'length' => 4),
27 'module' => array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 100),
28 'channel' => array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 100),
30 $ilDB->createTable(self::$tbl_userconfig, $fields);
31 $ilDB->addPrimaryKey(self::$tbl_userconfig, array(
'usr_id',
'module',
'channel'));
34 if (!
$ilDB->tableExists(self::$tbl_userlistener)) {
36 'usr_id' => array(
'type' =>
'integer',
'notnull' =>
true,
'length' => 4),
37 'module' => array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 100),
38 'sender_id' => array(
'type' =>
'integer',
'notnull' =>
true,
'length' => 4),
39 'disabled' => array(
'type' =>
'integer',
'notnull' =>
true,
'length' => 1),
41 $ilDB->createTable(self::$tbl_userlistener, $fields);
42 $ilDB->addPrimaryKey(self::$tbl_userlistener, array(
'usr_id',
'module',
'sender_id'));
45 if (!
$ilDB->tableExists(self::$tbl_notification_data)) {
47 'notification_id' => array(
'type' =>
'integer',
'notnull' =>
true,
'length' => 4),
48 'serialized' => array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 4000),
50 $ilDB->createTable(self::$tbl_notification_data, $fields);
51 $ilDB->addPrimaryKey(self::$tbl_notification_data, array(
'notification_id'));
53 $ilDB->createSequence(self::$tbl_notification_data);
56 if (!
$ilDB->tableExists(self::$tbl_notification_queue)) {
58 'notification_id' => array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
59 'usr_id' => array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
60 #
'notification_channel' => array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 100),
61 'valid_until' => array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
63 $ilDB->createTable(self::$tbl_notification_queue, $fields);
64 #$ilDB->addPrimaryKey(self::$tbl_notification_queue, array('notification_id', 'usr_id', 'notification_channel')); 65 $ilDB->addPrimaryKey(self::$tbl_notification_queue, array(
'notification_id',
'usr_id'));
68 if (!
$ilDB->tableExists(self::$tbl_notification_osd_handler)) {
70 'notification_osd_id' => array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
71 'usr_id' => array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
72 'serialized' => array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 4000),
73 'valid_until' => array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
74 'time_added' => array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
75 'type' => array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 100),
77 $ilDB->createTable(self::$tbl_notification_osd_handler, $fields);
79 $ilDB->addPrimaryKey(self::$tbl_notification_osd_handler, array(
'notification_osd_id'));
83 #$ilDB->addIndex(self::$tbl_notification_osd_handler, array('usr_id', 'valid_until', 'time_added')); 85 $ilDB->createSequence(self::$tbl_notification_osd_handler);
88 if (!
$ilDB->tableExists(self::$tbl_notification_channels)) {
90 'channel_name' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
91 'title' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
92 'description' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 4000),
93 'class' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
94 'include' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
95 'config_type' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 30),
97 $ilDB->createTable(self::$tbl_notification_channels, $fields);
99 $ilDB->addPrimaryKey(self::$tbl_notification_channels, array(
'channel_name'));
105 if (!
$ilDB->tableExists(self::$tbl_notification_types)) {
107 'type_name' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
108 'title' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
109 'description' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
110 'notification_group' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
111 'config_type' => array(
'type' =>
'text',
'notnull' =>
true,
'length' => 30),
113 $ilDB->createTable(self::$tbl_notification_types, $fields);
114 $ilDB->addPrimaryKey(self::$tbl_notification_types, array(
'type_name'));
static $tbl_notification_queue
static $tbl_notification_types
static registerChannel($name, $title, $description, $class, $classfile, $config_type='set_by_user')
Helper class for initial database setup and registration of notification.
static registerChannel($name, $title, $description, $class, $classfile, $config_type)
Registers a new notification channel for distributing notifications.
static registerType($name, $title, $description, $notification_group, $config_type)
Registers a new notification type.
static $tbl_notification_osd_handler
static $tbl_notification_channels
static registerType($name, $title, $description, $notification_group, $config_type='set_by_user')
static $tbl_notification_data