mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-23 05:41:02 +01:00
Add custom option to Calendar default alarm regular and wholeday preferences. In order to be able to set custom number of days,hours or minutes
This commit is contained in:
parent
0ad7db79d4
commit
426687e888
@ -434,22 +434,42 @@ class calendar_hooks
|
|||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Default alarm for regular events',
|
'label' => 'Default alarm for regular events',
|
||||||
'name' => 'default-alarm',
|
'name' => 'default-alarm',
|
||||||
'values' => isset($bo) ? array(0 => lang('None'))+$bo->alarms : array(),
|
'values' => isset($bo) ? array(0 => lang('None'), -1 => lang('Custom'))+$bo->alarms : array(),
|
||||||
'help' => 'Alarm added automatic to new events before event start-time',
|
'help' => 'Alarm added automatic to new events before event start-time',
|
||||||
'xmlrpc' => True,
|
'xmlrpc' => True,
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
|
'onchange' => 'app.preferences.cal_def_alarm_onchange'
|
||||||
|
),
|
||||||
|
'custom-default-alarm' => array(
|
||||||
|
'type' => 'date-duration',
|
||||||
|
'label' => 'Enter custom default alarm time',
|
||||||
|
'name' => 'custom-default-alarm',
|
||||||
|
'help' => 'Alarm added automatic to new events before event start-time.',
|
||||||
|
'xmlrpc' => True,
|
||||||
|
'admin' => False,
|
||||||
|
'default' => 0,
|
||||||
),
|
),
|
||||||
'default-alarm-wholeday' => array(
|
'default-alarm-wholeday' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Default alarm for whole-day events',
|
'label' => 'Default alarm for whole-day events',
|
||||||
'name' => 'default-alarm-wholeday',
|
'name' => 'default-alarm-wholeday',
|
||||||
'values' => isset($bo) ? array(0 => lang('None'))+$bo->alarms : array(),
|
'values' => isset($bo) ? array(0 => lang('None'), -1 => lang('Custom'))+$bo->alarms : array(),
|
||||||
'help' => lang('Alarm added automatic to new events before event start-time').' ('.lang('Midnight').')',
|
'help' => lang('Alarm added automatic to new events before event start-time').' ('.lang('Midnight').')',
|
||||||
'xmlrpc' => True,
|
'xmlrpc' => True,
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
)
|
'onchange' => 'app.preferences.cal_def_alarm_onchange'
|
||||||
|
),
|
||||||
|
'custom-default-alarm-wholeday' => array(
|
||||||
|
'type' => 'date-duration',
|
||||||
|
'label' => 'Enter custom default alarm time for wholeday event',
|
||||||
|
'name' => 'custom-default-alarm-wholeday',
|
||||||
|
'help' => lang('Alarm added automatic to new events before event start-time').' ('.lang('Midnight').')',
|
||||||
|
'xmlrpc' => True,
|
||||||
|
'admin' => False,
|
||||||
|
'default' => 0,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
if (isset($bo)) // add custom time-spans set by CalDAV clients, not in our prefs
|
if (isset($bo)) // add custom time-spans set by CalDAV clients, not in our prefs
|
||||||
{
|
{
|
||||||
|
@ -1269,8 +1269,12 @@ class calendar_uiforms extends calendar_ui
|
|||||||
}
|
}
|
||||||
// Set alarm sel_options
|
// Set alarm sel_options
|
||||||
$alarm_options = array();
|
$alarm_options = array();
|
||||||
$default_alarm = $this->cal_prefs['default-alarm'];
|
$default_alarm = $this->cal_prefs['default-alarm'] != -1?$this->cal_prefs['default-alarm']:$this->cal_prefs['custom-default-alarm'] * 60;
|
||||||
if (!empty($event['whole_day']) && $event['whole_day']) $default_alarm = $this->cal_prefs['default-alarm-wholeday'];
|
if (!empty($event['whole_day']) && $event['whole_day'])
|
||||||
|
{
|
||||||
|
$default_alarm = $this->cal_prefs['default-alarm-wholeday'] != -1?$this->cal_prefs['default-alarm-wholeday']:
|
||||||
|
$this->cal_prefs['custom-default-alarm-wholeday'] * 60;
|
||||||
|
}
|
||||||
if (!array_key_exists($default_alarm, $this->bo->alarms) && $default_alarm > 0)
|
if (!array_key_exists($default_alarm, $this->bo->alarms) && $default_alarm > 0)
|
||||||
{
|
{
|
||||||
$alarm_options = $this->bo->alarms + array($default_alarm => calendar_bo::secs2label ($default_alarm));
|
$alarm_options = $this->bo->alarms + array($default_alarm => calendar_bo::secs2label ($default_alarm));
|
||||||
|
Loading…
Reference in New Issue
Block a user