public static function setupTables()
 {
     global $ilDB;
     if (!$ilDB->tableExists(self::$tbl_userconfig)) {
         $fields = array('usr_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4), 'module' => array('type' => 'text', 'notnull' => true, 'length' => 100), 'channel' => array('type' => 'text', 'notnull' => true, 'length' => 100));
         $ilDB->createTable(self::$tbl_userconfig, $fields);
         $ilDB->addPrimaryKey(self::$tbl_userconfig, array('usr_id', 'module', 'channel'));
     }
     if (!$ilDB->tableExists(self::$tbl_userlistener)) {
         $fields = array('usr_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4), 'module' => array('type' => 'text', 'notnull' => true, 'length' => 100), 'sender_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4), 'disabled' => array('type' => 'integer', 'notnull' => true, 'length' => 1));
         $ilDB->createTable(self::$tbl_userlistener, $fields);
         $ilDB->addPrimaryKey(self::$tbl_userlistener, array('usr_id', 'module', 'sender_id'));
     }
     if (!$ilDB->tableExists(self::$tbl_notification_data)) {
         $fields = array('notification_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4), 'serialized' => array('type' => 'text', 'notnull' => true, 'length' => 4000));
         $ilDB->createTable(self::$tbl_notification_data, $fields);
         $ilDB->addPrimaryKey(self::$tbl_notification_data, array('notification_id'));
         $ilDB->createSequence(self::$tbl_notification_data);
     }
     if (!$ilDB->tableExists(self::$tbl_notification_queue)) {
         $fields = array('notification_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4), 'usr_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4), 'valid_until' => array('type' => 'integer', 'notnull' => true, 'length' => 4));
         $ilDB->createTable(self::$tbl_notification_queue, $fields);
         #$ilDB->addPrimaryKey(self::$tbl_notification_queue, array('notification_id', 'usr_id', 'notification_channel'));
         $ilDB->addPrimaryKey(self::$tbl_notification_queue, array('notification_id', 'usr_id'));
     }
     if (!$ilDB->tableExists(self::$tbl_notification_osd_handler)) {
         $fields = array('notification_osd_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4), 'usr_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4), 'serialized' => array('type' => 'text', 'notnull' => true, 'length' => 4000), 'valid_until' => array('type' => 'integer', 'notnull' => true, 'length' => 4), 'time_added' => array('type' => 'integer', 'notnull' => true, 'length' => 4), 'type' => array('type' => 'text', 'notnull' => true, 'length' => 100));
         $ilDB->createTable(self::$tbl_notification_osd_handler, $fields);
         $ilDB->addPrimaryKey(self::$tbl_notification_osd_handler, array('notification_osd_id'));
         /**
          * @todo hier wird ein fehler geworfen...
          */
         #$ilDB->addIndex(self::$tbl_notification_osd_handler, array('usr_id', 'valid_until', 'time_added'));
         $ilDB->createSequence(self::$tbl_notification_osd_handler);
     }
     if (!$ilDB->tableExists(self::$tbl_notification_channels)) {
         $fields = array('channel_name' => array('type' => 'text', 'notnull' => true, 'length' => 100), 'title' => array('type' => 'text', 'notnull' => true, 'length' => 100), 'description' => array('type' => 'text', 'notnull' => true, 'length' => 4000), 'class' => array('type' => 'text', 'notnull' => true, 'length' => 100), 'include' => array('type' => 'text', 'notnull' => true, 'length' => 100), 'config_type' => array('type' => 'text', 'notnull' => true, 'length' => 30));
         $ilDB->createTable(self::$tbl_notification_channels, $fields);
         $ilDB->addPrimaryKey(self::$tbl_notification_channels, array('channel_name'));
         ilNotificationSetupHelper::registerChannel('mail', 'mail', 'mail_desc', 'ilNotificationMailHandler', 'Services/Notifications/classes/class.ilNotificationMailHandler.php');
         ilNotificationSetupHelper::registerChannel('osd', 'osd', 'osd_desc', 'ilNotificationOSDHandler', 'Services/Notifications/classes/class.ilNotificationOSDHandler.php');
     }
     if (!$ilDB->tableExists(self::$tbl_notification_types)) {
         $fields = array('type_name' => array('type' => 'text', 'notnull' => true, 'length' => 100), 'title' => array('type' => 'text', 'notnull' => true, 'length' => 100), 'description' => array('type' => 'text', 'notnull' => true, 'length' => 100), 'notification_group' => array('type' => 'text', 'notnull' => true, 'length' => 100), 'config_type' => array('type' => 'text', 'notnull' => true, 'length' => 30));
         $ilDB->createTable(self::$tbl_notification_types, $fields);
         $ilDB->addPrimaryKey(self::$tbl_notification_types, array('type_name'));
         ilNotificationSetupHelper::registerType('chat_invitation', 'chat_invitation', 'chat_invitation_description', 'chat');
         //ilNotificationSetupHelper::registerType('adobe_connect_invitation', 'adobe_connect_invitation', 'adobe_connect_invitation_description', 'adobe_connect');
         ilNotificationSetupHelper::registerType('osd_maint', 'osd_maint', 'osd_maint_description', 'osd_notification');
     }
 }
Exemple #2
0
if (!$ilDB->tableColumnExists('usr_portfolio', 'img')) {
    $ilDB->addTableColumn('usr_portfolio', 'img', array('type' => 'text', 'length' => 255, 'notnull' => false));
}
?>
<#3413>
<?php 
$ilCtrlStructureReader->getStructure();
?>
<#3414>
<?php 
require_once 'Modules/Chatroom/classes/class.ilChatroomFormFactory.php';
require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
require_once 'Modules/Chatroom/classes/class.ilChatroomInstaller.php';
ilChatroomInstaller::install();
require_once 'Services/Notifications/classes/class.ilNotificationSetupHelper.php';
ilNotificationSetupHelper::setupTables();
$settings = new ilSetting('notifications');
$settings->set('enable_mail', 1);
$ilDB->insert('notification_usercfg', array('usr_id' => array('integer', -1), 'module' => array('text', 'chat_invitation'), 'channel' => array('text', 'mail')));
$ilDB->insert('notification_usercfg', array('usr_id' => array('integer', -1), 'module' => array('text', 'chat_invitation'), 'channel' => array('text', 'osd')));
$ilDB->insert('notification_usercfg', array('usr_id' => array('integer', -1), 'module' => array('text', 'osd_main'), 'channel' => array('text', 'osd')));
$ilDB->manipulate("UPDATE notification_channels SET config_type = 'set_by_admin'");
?>
<#3415>
<?php 
$ilCtrlStructureReader->getStructure();
?>
<#3416>
<?php 
$ilDB->manipulate('INSERT INTO rbac_templates (rol_id, type, ops_id, parent) VALUES (' . $ilDB->quote(4, 'integer') . ', ' . $ilDB->quote('chtr', 'text') . ', ' . $ilDB->quote(2, 'integer') . ', ' . $ilDB->quote(8, 'integer') . ')');
$ilDB->manipulate('INSERT INTO rbac_templates (rol_id, type, ops_id, parent) VALUES (' . $ilDB->quote(4, 'integer') . ', ' . $ilDB->quote('chtr', 'text') . ', ' . $ilDB->quote(3, 'integer') . ', ' . $ilDB->quote(8, 'integer') . ')');