* Calendar: New preference so default alarm can be for current user or all participants

This commit is contained in:
nathan 2022-03-10 11:00:25 -07:00
parent 6ebd09b275
commit 5f997299e5
4 changed files with 37 additions and 23 deletions

View File

@ -376,17 +376,17 @@ class calendar_hooks
'xmlrpc' => False,
'admin' => False
),
'default_category' => array(
'type' => 'multiselect',
'label' => 'New event category',
'name' => 'default_category',
'help' => 'Category automatically added to new events',
'values' => $default_cat_seloptions,
'default' => '',
'xmlrpc' => False,
'admin' => False
'default_category' => array(
'type' => 'multiselect',
'label' => 'New event category',
'name' => 'default_category',
'help' => 'Category automatically added to new events',
'values' => $default_cat_seloptions,
'default' => '',
'xmlrpc' => False,
'admin' => False
),
'default-alarm' => array(
'default-alarm' => array(
'type' => 'date-duration',//'select',
'label' => lang('Default alarm for regular events').' ('.lang('empty = no alarm').')',
'name' => 'default-alarm',
@ -396,12 +396,22 @@ class calendar_hooks
'default' => '',
),
'default-alarm-wholeday' => array(
'type' => 'date-duration',//'select',
'label' => lang('Default alarm for whole-day events').' ('.lang('empty = no alarm').')',
'name' => 'default-alarm-wholeday',
'help' => lang('Alarm added automatic to new events before event start-time').' ('.lang('Midnight').')',
'xmlrpc' => True,
'admin' => False,
'type' => 'date-duration',//'select',
'label' => lang('Default alarm for whole-day events') . ' (' . lang('empty = no alarm') . ')',
'name' => 'default-alarm-wholeday',
'help' => lang('Alarm added automatic to new events before event start-time') . ' (' . lang('Midnight') . ')',
'xmlrpc' => True,
'admin' => False,
'default' => '',
),
'default-alarm-for' => array(
'type' => 'select',
'label' => lang('Default alarm for'),
'name' => 'default-alarm-for',
'values' => [lang("just me"), 'all' => lang('all participants')],
'help' => lang('Default alarm added for yourself or all participants'),
'xmlrpc' => True,
'admin' => False,
'default' => '',
),
);

View File

@ -237,16 +237,16 @@ class calendar_uiforms extends calendar_ui
$alarm_pref = $whole_day ? 'default-alarm-wholeday' : 'default-alarm';
// if default alarm set in prefs --> add it
// we assume here that user does NOT have a whole-day but no regular default-alarm, no whole-day!
if ((string)$this->cal_prefs[$alarm_pref] !== '')
if((string)$this->cal_prefs[$alarm_pref] !== '')
{
$offset = 60 * $this->cal_prefs[$alarm_pref];
$alarms[1] = array(
$alarms[1] = array(
'default' => 1,
'offset' => $offset,
'time' => $start - $offset,
'all' => false,
'owner' => $owner,
'id' => 1,
'offset' => $offset,
'time' => $start - $offset,
'all' => $this->cal_prefs['default-alarm-for'] === 'all',
'owner' => $owner,
'id' => 1,
);
}
// add automatic alarm 5min before videoconference for all participants

View File

@ -142,6 +142,8 @@ days calendar de Tage
days of the week for a weekly repeated event calendar de Wochentage für wöchentlich wiederholten Termin
days repeated calendar de wiederholte Tage
dayview calendar de Tagesansicht
default alarm added for yourself or all participants calendar de Der Alarm wird automatisch bei neuen Terminen eingefügt für sie selbst oder alle Teilnehmer
default alarm for calendar de Standard-Alarm für
default alarm for regular events calendar de Standard-Alarm für normale Termine
default alarm for whole-day events calendar de Standard-Alarm für ganztägige Termine
default appointment length (in minutes) calendar de Standardlänge eines neuen Kalendereintrags (in Minuten)

View File

@ -142,6 +142,8 @@ days calendar en Days
days of the week for a weekly repeated event calendar en Days of the week for a weekly repeated event
days repeated calendar en Days repeated
dayview calendar en Day view
default alarm added for yourself or all participants calendar en Default alarm added for yourself or all participants
default alarm for calendar en Default alarm for
default alarm for regular events calendar en Default alarm for regular events
default alarm for whole-day events calendar en Default alarm for whole-day events
default appointment length (in minutes) calendar en Default appointment length in minutes