3 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
22 if (!$ilDB->tableExists(self::$tbl_userconfig)) {
24 'usr_id' =>
array(
'type' =>
'integer',
'notnull' =>
true,
'length' => 4),
25 'module' =>
array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 100),
26 'channel' =>
array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 100),
28 $ilDB->createTable(self::$tbl_userconfig, $fields);
29 $ilDB->addPrimaryKey(self::$tbl_userconfig,
array(
'usr_id',
'module',
'channel'));
32 if (!$ilDB->tableExists(self::$tbl_userlistener)) {
34 'usr_id' =>
array(
'type' =>
'integer',
'notnull' =>
true,
'length' => 4),
35 'module' =>
array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 100),
36 'sender_id' =>
array(
'type' =>
'integer',
'notnull' =>
true,
'length' => 4),
37 'disabled' =>
array(
'type' =>
'integer',
'notnull' =>
true,
'length' => 1),
39 $ilDB->createTable(self::$tbl_userlistener, $fields);
40 $ilDB->addPrimaryKey(self::$tbl_userlistener,
array(
'usr_id',
'module',
'sender_id'));
43 if (!$ilDB->tableExists(self::$tbl_notification_data)) {
45 'notification_id' =>
array(
'type' =>
'integer',
'notnull' =>
true,
'length' => 4),
46 'serialized' =>
array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 4000),
48 $ilDB->createTable(self::$tbl_notification_data, $fields);
49 $ilDB->addPrimaryKey(self::$tbl_notification_data,
array(
'notification_id'));
51 $ilDB->createSequence(self::$tbl_notification_data);
54 if (!$ilDB->tableExists(self::$tbl_notification_queue)) {
56 'notification_id' =>
array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
57 'usr_id' =>
array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
58 #
'notification_channel' =>
array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 100),
59 'valid_until' =>
array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
61 $ilDB->createTable(self::$tbl_notification_queue, $fields);
62 #$ilDB->addPrimaryKey(self::$tbl_notification_queue, array('notification_id', 'usr_id', 'notification_channel')); 63 $ilDB->addPrimaryKey(self::$tbl_notification_queue,
array(
'notification_id',
'usr_id'));
66 if (!$ilDB->tableExists(self::$tbl_notification_osd_handler)) {
68 'notification_osd_id' =>
array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
69 'usr_id' =>
array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
70 'serialized' =>
array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 4000),
71 'valid_until' =>
array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
72 'time_added' =>
array(
'type' =>
'integer' ,
'notnull' =>
true,
'length' => 4),
73 'type' =>
array(
'type' =>
'text' ,
'notnull' =>
true,
'length' => 100),
75 $ilDB->createTable(self::$tbl_notification_osd_handler, $fields);
77 $ilDB->addPrimaryKey(self::$tbl_notification_osd_handler,
array(
'notification_osd_id'));
81 #$ilDB->addIndex(self::$tbl_notification_osd_handler, array('usr_id', 'valid_until', 'time_added')); 83 $ilDB->createSequence(self::$tbl_notification_osd_handler);
86 if (!$ilDB->tableExists(self::$tbl_notification_channels)) {
88 'channel_name'=>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
89 'title' =>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
90 'description'=>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 4000),
91 'class' =>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
92 'include' =>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
93 'config_type' =>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 30),
95 $ilDB->createTable(self::$tbl_notification_channels, $fields);
97 $ilDB->addPrimaryKey(self::$tbl_notification_channels,
array(
'channel_name'));
103 if (!$ilDB->tableExists(self::$tbl_notification_types)) {
105 'type_name'=>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
106 'title' =>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
107 'description' =>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
108 'notification_group' =>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 100),
109 'config_type' =>
array(
'type' =>
'text',
'notnull' =>
true,
'length' => 30),
111 $ilDB->createTable(self::$tbl_notification_types, $fields);
112 $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
Create styles array
The data for the language used.
static registerType($name, $title, $description, $notification_group, $config_type='set_by_user')
static $tbl_notification_data