2006-09-25 09:04:22 +02:00
|
|
|
<?php
|
2008-10-07 09:21:23 +02:00
|
|
|
/**
|
2011-04-14 15:43:16 +02:00
|
|
|
* EGroupware - Setup
|
2008-10-07 09:21:23 +02:00
|
|
|
* http://www.egroupware.org
|
|
|
|
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de
|
|
|
|
*
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @package notifications
|
|
|
|
* @subpackage setup
|
|
|
|
*/
|
2006-09-25 09:04:22 +02:00
|
|
|
|
2008-10-07 09:21:23 +02:00
|
|
|
function notifications_upgrade0_5()
|
|
|
|
{
|
|
|
|
$GLOBALS['egw_setup']->oProc->AlterColumn('egw_notificationpopup','account_id',array(
|
|
|
|
'type' => 'int',
|
|
|
|
'precision' => '20',
|
|
|
|
'nullable' => False
|
|
|
|
));
|
2006-09-25 09:04:22 +02:00
|
|
|
|
2008-10-07 09:21:23 +02:00
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '0.6';
|
|
|
|
}
|
2006-09-25 09:04:22 +02:00
|
|
|
|
2007-04-30 11:10:36 +02:00
|
|
|
|
2008-10-07 09:21:23 +02:00
|
|
|
function notifications_upgrade0_6()
|
|
|
|
{
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '1.4';
|
|
|
|
}
|
2007-04-30 11:10:36 +02:00
|
|
|
|
2008-10-07 09:21:23 +02:00
|
|
|
|
|
|
|
function notifications_upgrade1_4()
|
|
|
|
{
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '1.6';
|
|
|
|
}
|
2010-09-05 17:24:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
function notifications_upgrade1_6()
|
|
|
|
{
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '1.8';
|
|
|
|
}
|
2011-04-13 19:51:02 +02:00
|
|
|
|
|
|
|
function notifications_upgrade1_8()
|
|
|
|
{
|
|
|
|
$GLOBALS['egw_setup']->oProc->DropColumn('egw_notificationpopup',array(
|
|
|
|
'fd' => array(
|
|
|
|
'account_id' => array('type' => 'int','precision' => '20','nullable' => False),
|
|
|
|
'message' => array('type' => 'longtext')
|
|
|
|
),
|
|
|
|
'pk' => array(),
|
|
|
|
'fk' => array(),
|
|
|
|
'ix' => array('account_id'),
|
|
|
|
'uc' => array()
|
|
|
|
),'session_id');
|
|
|
|
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '1.9.001';
|
|
|
|
}
|
|
|
|
|
2011-04-14 15:43:16 +02:00
|
|
|
/**
|
|
|
|
* Empty notificaton table, as it can contain thousands of old entries, not delivered before
|
|
|
|
*/
|
2011-04-14 07:55:55 +02:00
|
|
|
function notifications_upgrade1_9_001()
|
|
|
|
{
|
|
|
|
// empty notificationpopup table, as it can contain thousands of old entries, not delivered before
|
|
|
|
$GLOBALS['egw_setup']->db->query('DELETE FROM egw_notificationpopup');
|
|
|
|
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '1.9.002';
|
|
|
|
}
|
2011-04-14 15:43:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add primary key to easy identify notifications in ajax request, a automatic timestamp and table prefix
|
|
|
|
*/
|
|
|
|
function notifications_upgrade1_9_002()
|
|
|
|
{
|
|
|
|
$GLOBALS['egw_setup']->oProc->RefreshTable('egw_notificationpopup',array(
|
|
|
|
'fd' => array(
|
|
|
|
'notify_id' => array('type' => 'auto','nullable' => False,'comment' => 'primary key'),
|
|
|
|
'account_id' => array('type' => 'int','precision' => '20','nullable' => False,'comment' => 'user to notify'),
|
|
|
|
'notify_message' => array('type' => 'text','comment' => 'notification message'),
|
|
|
|
'notify_created' => array('type' => 'timestamp','default' => 'current_timestamp','comment' => 'creation time of notification')
|
|
|
|
),
|
|
|
|
'pk' => array('notify_id'),
|
|
|
|
'fk' => array(),
|
|
|
|
'ix' => array('account_id','notify_created'),
|
|
|
|
'uc' => array()
|
|
|
|
),array(
|
|
|
|
'notify_message' => 'message',
|
|
|
|
));
|
|
|
|
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '1.9.003';
|
|
|
|
}
|
|
|
|
|
2012-12-09 06:56:42 +01:00
|
|
|
|
|
|
|
function notifications_upgrade1_9_003()
|
|
|
|
{
|
|
|
|
$GLOBALS['egw_setup']->oProc->AddColumn('egw_notificationpopup','notify_type',array(
|
|
|
|
'type' => 'varchar',
|
|
|
|
'precision' => '32',
|
|
|
|
'comment' => 'notification type'
|
|
|
|
));
|
|
|
|
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '1.9.004';
|
|
|
|
}
|
|
|
|
|
2014-06-24 12:00:50 +02:00
|
|
|
|
|
|
|
function notifications_upgrade1_9_004()
|
|
|
|
{
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '14.1';
|
|
|
|
}
|
2015-07-11 15:56:50 +02:00
|
|
|
|
|
|
|
function notifications_upgrade14_1()
|
|
|
|
{
|
|
|
|
$GLOBALS['egw_setup']->oProc->AlterColumn('egw_notificationpopup','notify_message',array(
|
|
|
|
'type' => 'varchar',
|
|
|
|
'precision' => '16384',
|
|
|
|
'comment' => 'notification message'
|
|
|
|
));
|
|
|
|
$GLOBALS['egw_setup']->oProc->AlterColumn('egw_notificationpopup','notify_type',array(
|
|
|
|
'type' => 'ascii',
|
|
|
|
'precision' => '32',
|
|
|
|
'comment' => 'notification type'
|
|
|
|
));
|
|
|
|
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '14.3';
|
|
|
|
}
|
|
|
|
|
2016-05-06 11:19:36 +02:00
|
|
|
function notifications_upgrade14_3()
|
|
|
|
{
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '16.1';
|
|
|
|
}
|
2017-05-16 18:03:50 +02:00
|
|
|
|
|
|
|
function notifications_upgrade16_1()
|
|
|
|
{
|
|
|
|
$GLOBALS['egw_setup']->oProc->AddColumn('egw_notificationpopup','notify_status',array(
|
|
|
|
'type' => 'varchar',
|
|
|
|
'precision' => '32',
|
|
|
|
'comment' => 'notification status'
|
|
|
|
));
|
|
|
|
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '17.1';
|
|
|
|
}
|
2018-01-24 19:02:35 +01:00
|
|
|
|
|
|
|
function notifications_upgrade17_1()
|
|
|
|
{
|
|
|
|
$GLOBALS['egw_setup']->oProc->AddColumn('egw_notificationpopup','notify_data',array(
|
|
|
|
'type' => 'varchar',
|
|
|
|
'precision' => '4096',
|
|
|
|
'comment' => 'notification actions'
|
|
|
|
));
|
|
|
|
|
|
|
|
return $GLOBALS['setup_info']['notifications']['currentver'] = '17.1.001';
|
|
|
|
}
|