mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-03 20:09:27 +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',
|
||||
'label' => 'Default alarm for regular events',
|
||||
'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',
|
||||
'xmlrpc' => True,
|
||||
'admin' => False,
|
||||
'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(
|
||||
'type' => 'select',
|
||||
'label' => 'Default alarm for whole-day events',
|
||||
'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').')',
|
||||
'xmlrpc' => True,
|
||||
'admin' => False,
|
||||
'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
|
||||
{
|
||||
|
@ -1269,8 +1269,12 @@ class calendar_uiforms extends calendar_ui
|
||||
}
|
||||
// Set alarm sel_options
|
||||
$alarm_options = array();
|
||||
$default_alarm = $this->cal_prefs['default-alarm'];
|
||||
if (!empty($event['whole_day']) && $event['whole_day']) $default_alarm = $this->cal_prefs['default-alarm-wholeday'];
|
||||
$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'] != -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)
|
||||
{
|
||||
$alarm_options = $this->bo->alarms + array($default_alarm => calendar_bo::secs2label ($default_alarm));
|
||||
|
Loading…
Reference in New Issue
Block a user