From d2d4ce40c678f7d7cb5bab76dc4792c5a0888966 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Gr=C3=BCnewald?= '+egw.htmlspecialchars(this.options.value.description)+' ' + egw.htmlspecialchars(this.options.value.description) + '
This time is also used as a default starttime for new events.',
- 'xmlrpc' => True,
- 'admin' => False,
- 'default'=> 9,
- ),
- 'workdayends' => array(
- 'type' => 'select',
- 'label' => 'work day ends on',
- 'name' => 'workdayends',
- 'values' => $times,
- 'help' => 'This defines the end of your dayview. Events after this time, are shown below the dayview.',
- 'xmlrpc' => True,
- 'admin' => False,
- 'default'=> 18,
- ),
- 'interval' => array(
- 'type' => 'select',
- 'label' => 'Length of the time interval',
- 'name' => 'interval',
- 'values' => $intervals,
- 'help' => 'How many minutes should each interval last?',
- 'xmlrpc' => True,
- 'admin' => False,
- 'default'=> 30,
- ),
- 'day_consolidate' => array(
- 'type' => 'select',
- 'label' => 'Minimum number of users for showing day view as consolidated.',
- 'name' => 'day_consolidate',
- 'values'=> $consolidated,
- 'help' => 'How many separate calendars to show before merging them together',
- 'default'=> 6
- ),
- 'week_consolidate' => array(
- 'type' => 'select',
- 'label' => 'Minimum number of users for showing week view as consolidated.',
- 'name' => 'week_consolidate',
- 'values'=> $consolidated,
- 'help' => 'How many separate calendars to show before merging them together',
- 'default'=> 4
- ),
- 'use_time_grid' => array(
- 'type' => 'multiselect',
- 'label' => 'Views showing a list of events',
- 'name' => 'use_time_grid',
- 'values' => $list_views,
- 'help' => 'For which views should calendar just a list of events instead of distinct lines with a fixed time interval.',
- 'xmlrpc' => True,
- 'admin' => False,
+ 'workdaystarts' => array(
+ 'type' => 'select',
+ 'label' => 'work day starts on',
+ 'name' => 'workdaystarts',
+ 'values' => $times,
+ 'help' => 'This defines the start of your dayview. Events before this time, are shown above the dayview.
This time is also used as a default starttime for new events.',
+ 'xmlrpc' => True,
+ 'admin' => False,
+ 'default' => 9,
+ ),
+ 'workdayends' => array(
+ 'type' => 'select',
+ 'label' => 'work day ends on',
+ 'name' => 'workdayends',
+ 'values' => $times,
+ 'help' => 'This defines the end of your dayview. Events after this time, are shown below the dayview.',
+ 'xmlrpc' => True,
+ 'admin' => False,
+ 'default' => 18,
+ ),
+ 'interval' => array(
+ 'type' => 'select',
+ 'label' => 'Length of the time interval',
+ 'name' => 'interval',
+ 'values' => $intervals,
+ 'help' => 'How many minutes should each interval last?',
+ 'xmlrpc' => True,
+ 'admin' => False,
+ 'default' => 30,
+ ),
+ 'day_consolidate' => array(
+ 'type' => 'select',
+ 'label' => 'Minimum number of users for showing day view as consolidated.',
+ 'name' => 'day_consolidate',
+ 'values' => $consolidated,
+ 'help' => 'How many separate calendars to show before merging them together',
+ 'default' => 6
+ ),
+ 'week_consolidate' => array(
+ 'type' => 'select',
+ 'label' => 'Minimum number of users for showing week view as consolidated.',
+ 'name' => 'week_consolidate',
+ 'values' => $consolidated,
+ 'help' => 'How many separate calendars to show before merging them together',
+ 'default' => 4
+ ),
+ 'use_time_grid' => array(
+ 'type' => 'multiselect',
+ 'label' => 'Views showing a list of events',
+ 'name' => 'use_time_grid',
+ 'values' => $list_views,
+ 'help' => 'For which views should calendar just a list of events instead of distinct lines with a fixed time interval.',
+ 'xmlrpc' => True,
+ 'admin' => False,
'default' => ['weekN', 'month'],
),
'auto_update_on_sidebox_change' => array(
- 'type' => 'check',
- 'label' => 'Update calendar view immediately when navigation calendar in sidebox is changed',
- 'name' => 'auto_update_on_sidebox_change',
- 'help' => 'When changing the month',
- 'default'=> false
- ),
- '2.section' => array(
- 'type' => 'section',
- 'title' => lang('appointment settings'),
- 'no_lang'=> true,
- 'xmlrpc' => False,
- 'admin' => False
+ 'type' => 'check',
+ 'label' => 'Update calendar view immediately when navigation calendar in sidebox is changed',
+ 'name' => 'auto_update_on_sidebox_change',
+ 'help' => 'When changing the month',
+ 'default' => false
+ ),
+ '2.section' => array(
+ 'type' => 'section',
+ 'title' => lang('appointment settings'),
+ 'no_lang' => true,
+ 'xmlrpc' => False,
+ 'admin' => False
),
- 'defaultlength' => array(
+ 'defaultlength' => array(
'type' => 'input',
'label' => 'default appointment length (in minutes)',
'name' => 'defaultlength',
'help' => 'Default length of newly created events. The length is in minutes, eg. 60 for 1 hour.',
'default' => '',
'size' => 3,
- 'xmlrpc' => True,
- 'admin' => False,
- 'default'=> 60,
- ),
- 'default_participant' => array(
- 'type' => 'select',
- 'label' => 'New event participants',
- 'name' => 'default_participant',
- 'values'=> $default_participants,
- 'help' => 'Participants automatically added to new events',
- 'default' => 'selected',
- '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(
- 'type' => 'date-duration',//'select',
- 'label' => lang('Default alarm for regular events').' ('.lang('empty = no alarm').')',
- 'name' => 'default-alarm',
- 'help' => 'Alarm added automatic to new events before event start-time',
- 'xmlrpc' => True,
- 'admin' => False,
+ 'xmlrpc' => True,
+ 'admin' => False,
+ 'default' => 60,
+ ),
+ 'default_participant' => array(
+ 'type' => 'select',
+ 'label' => 'New event participants',
+ 'name' => 'default_participant',
+ 'values' => $default_participants,
+ 'help' => 'Participants automatically added to new events',
+ 'default' => 'selected',
+ '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(
+ 'type' => 'date-duration',//'select',
+ 'label' => lang('Default alarm for regular events') . ' (' . lang('empty = no alarm') . ')',
+ 'name' => 'default-alarm',
+ 'help' => 'Alarm added automatic to new events before event start-time',
+ 'xmlrpc' => True,
+ 'admin' => False,
'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,
+ '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,
'default' => '',
),
);
- 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
{
$prefs = $GLOBALS['egw_info']['user']['preferences']['calendar'];
$data = array(
- 'prefs' => &$prefs, // use reference to get preference value back
+ 'prefs' => &$prefs, // use reference to get preference value back
'preprocess' => true,
- 'type' => 'user',
+ 'type' => 'user',
);
self::verify_settings_reference($data);
}
$settings += array(
- 'defaultresource_sel' => array(
- 'type' => 'select',
- 'label' => 'default type of resources selection',
- 'name' => 'defaultresource_sel',
- 'values' => $defaultresource_sel,
- 'help' => 'Default type of resources application selected in the calendar participants research form.',
- 'xmlrpc' => True,
- 'admin' => False,
- 'default' => 'resources'
- ),
- 'default_private' => array(
- 'type' => 'check',
- 'label' => 'Set new events to private',
- 'name' => 'default_private',
- 'help' => 'Should new events created as private by default ?',
+ 'defaultresource_sel' => array(
+ 'type' => 'select',
+ 'label' => 'default type of resources selection',
+ 'name' => 'defaultresource_sel',
+ 'values' => $defaultresource_sel,
+ 'help' => 'Default type of resources application selected in the calendar participants research form.',
+ 'xmlrpc' => True,
+ 'admin' => False,
+ 'default' => 'resources'
+ ),
+ 'default_private' => array(
+ 'type' => 'check',
+ 'label' => 'Set new events to private',
+ 'name' => 'default_private',
+ 'help' => 'Should new events created as private by default ?',
'xmlrpc' => True,
'admin' => False,
'forced' => '0',
),
- 'reset_stati' => array(
- 'type' => 'select',
- 'label' => 'Reset participant stati on event shifts',
- 'name' => 'reset_stati',
- 'help' => 'Select whether you want the participant stati reset to unknown, if an event is shifted later on.',
- 'values' => $reset_stati_on_shifts,
+ 'reset_stati' => array(
+ 'type' => 'select',
+ 'label' => 'Reset participant stati on event shifts',
+ 'name' => 'reset_stati',
+ 'help' => 'Select whether you want the participant stati reset to unknown, if an event is shifted later on.',
+ 'values' => $reset_stati_on_shifts,
'default' => 'all',
- 'xmlrpc' => True,
- 'admin' => False,
+ 'xmlrpc' => True,
+ 'admin' => False,
),
'no_category_custom_color' => array(
- 'type' => 'color',
- 'label' => 'Custom event color',
+ 'type' => 'color',
+ 'label' => 'Custom event color',
'no_lang' => true,
- 'name' => 'no_category_custom_color',
- 'help' => lang('Custom color for events without category color'),
- 'xmlrpc' => True,
- 'admin' => False,
- ),
- '2.5.section' => array(
- 'type' => 'section',
- 'title' => lang('Configuration settings'),
- 'no_lang'=> true,
- 'xmlrpc' => False,
- 'admin' => False
- ),
- 'new_event_dialog' => array(
- 'type' => 'select',
- 'label' => 'Add appointments via shortened dialog or complete edit window',
- 'name' => 'new_event_dialog',
- 'values'=> array('add' => lang('Quick add'), 'edit' => lang('Regular edit')),
- 'help' => 'Use quick add or full edit dialog when creating a new event',
- 'default' => 'add',
- ),
- 'limit_des_lines' => array(
+ 'name' => 'no_category_custom_color',
+ 'help' => lang('Custom color for events without category color'),
+ 'xmlrpc' => True,
+ 'admin' => False,
+ ),
+ 'participant_names' => array(
+ 'type' => 'check',
+ 'label' => 'Show participant names on event',
+ 'name' => 'participant_names',
+ 'help' => 'Controls whether names of participants are shown alongside the title of an appointment.',
+ 'default' => false
+ ),
+ '2.5.section' => array(
+ 'type' => 'section',
+ 'title' => lang('Configuration settings'),
+ 'no_lang' => true,
+ 'xmlrpc' => False,
+ 'admin' => False
+ ),
+ 'new_event_dialog' => array(
+ 'type' => 'select',
+ 'label' => 'Add appointments via shortened dialog or complete edit window',
+ 'name' => 'new_event_dialog',
+ 'values' => array('add' => lang('Quick add'), 'edit' => lang('Regular edit')),
+ 'help' => 'Use quick add or full edit dialog when creating a new event',
+ 'default' => 'add',
+ ),
+ 'limit_des_lines' => array(
'type' => 'input',
'size' => 5,
'label' => 'Limit number of description lines in list view (default 5, 0 for no limit)',
@@ -455,22 +462,22 @@ static function settings($hook_data)
'xmlrpc' => True,
'admin' => False
),
- 'limit_all_day_lines' => array(
- 'type' => 'input',
- 'size' => 5,
- 'label' => 'Limit number of lines for all day events',
- 'name' => 'limit_all_day_lines',
- 'help' => 'How many lines of all day events should be directly visible. Further lines are available via a mouseover.',
- 'xmlrpc' => True,
- 'default'=> 3,
- 'admin' => False
- ),
- 'planner_show_empty_rows' => array(
+ 'limit_all_day_lines' => array(
+ 'type' => 'input',
+ 'size' => 5,
+ 'label' => 'Limit number of lines for all day events',
+ 'name' => 'limit_all_day_lines',
+ 'help' => 'How many lines of all day events should be directly visible. Further lines are available via a mouseover.',
+ 'xmlrpc' => True,
+ 'default' => 3,
+ 'admin' => False
+ ),
+ 'planner_show_empty_rows' => array(
'type' => 'select',
'label' => 'Show empty rows in Planner',
'name' => 'planner_show_empty_rows',
'values' => array(
- 0 => lang('no'),
+ 0 => lang('no'),
'user' => lang('Planner by user'),
'cat' => lang('Planner by category'),
'both' => lang('All'),
@@ -480,71 +487,71 @@ static function settings($hook_data)
'admin' => False,
'forced' => 'user',
),
- 'birthdays_as_events' => array(
- 'type' => 'multiselect',
- 'values' => $birthdays_as_events,
- 'label' => 'Show birthdays as events',
- 'name' => 'birthdays_as_events',
- 'help' => 'Show birthdays as all day non-blocking events as well as via mouseover of the date.',
- 'default'=> 'none'
- ),
- 'link_title' => array(
- 'type' => 'multiselect',
- 'label' => 'Link title for events to show',
- 'name' => 'link_title',
- 'values' => $link_title_options,
- 'help' => 'What should links to the calendar events display in other applications.',
- 'xmlrpc' => True,
- 'admin' => false,
- 'default'=> '',
+ 'birthdays_as_events' => array(
+ 'type' => 'multiselect',
+ 'values' => $birthdays_as_events,
+ 'label' => 'Show birthdays as events',
+ 'name' => 'birthdays_as_events',
+ 'help' => 'Show birthdays as all day non-blocking events as well as via mouseover of the date.',
+ 'default' => 'none'
+ ),
+ 'link_title' => array(
+ 'type' => 'multiselect',
+ 'label' => 'Link title for events to show',
+ 'name' => 'link_title',
+ 'values' => $link_title_options,
+ 'help' => 'What should links to the calendar events display in other applications.',
+ 'xmlrpc' => True,
+ 'admin' => false,
+ 'default' => '',
),
- '3.section' => array(
- 'type' => 'section',
- 'title' => lang('notification settings'),
- 'no_lang'=> true,
- 'xmlrpc' => False,
- 'admin' => False
- ),
- 'receive_updates' => array(
- 'type' => 'select',
- 'label' => 'Receive email updates',
- 'name' => 'receive_updates',
- 'values' => $updates,
- 'help' => "Do you want to be notified about new or changed appointments? You be notified about changes you make yourself.
You can limit the notifications to certain changes only. Each item includes all the notification listed above it. All modifications include changes of title, description, participants, but no participant responses. If the owner of an event requested any notifcations, he will always get the participant responses like acceptions and rejections too.",
- 'xmlrpc' => True,
- 'admin' => False,
- 'default'=> 'time_change',
- ),
- 'receive_own_updates' => array(
- 'type' => 'select',
- 'label' => 'Receive notifications about events you created/modified/deleted',
- 'name' => 'receive_own_updates',
- 'values' => $yesno,
- 'help' => "Do you want to be notified about changes of appointments you modified?",
- 'xmlrpc' => True,
- 'admin' => False,
- 'default'=> 'false',
+ '3.section' => array(
+ 'type' => 'section',
+ 'title' => lang('notification settings'),
+ 'no_lang' => true,
+ 'xmlrpc' => False,
+ 'admin' => False
+ ),
+ 'receive_updates' => array(
+ 'type' => 'select',
+ 'label' => 'Receive email updates',
+ 'name' => 'receive_updates',
+ 'values' => $updates,
+ 'help' => "Do you want to be notified about new or changed appointments? You be notified about changes you make yourself.
You can limit the notifications to certain changes only. Each item includes all the notification listed above it. All modifications include changes of title, description, participants, but no participant responses. If the owner of an event requested any notifcations, he will always get the participant responses like acceptions and rejections too.",
+ 'xmlrpc' => True,
+ 'admin' => False,
+ 'default' => 'time_change',
+ ),
+ 'receive_own_updates' => array(
+ 'type' => 'select',
+ 'label' => 'Receive notifications about events you created/modified/deleted',
+ 'name' => 'receive_own_updates',
+ 'values' => $yesno,
+ 'help' => "Do you want to be notified about changes of appointments you modified?",
+ 'xmlrpc' => True,
+ 'admin' => False,
+ 'default' => 'false',
),
'receive_not_participating' => array(
- 'type' => 'select',
- 'label' => 'Do you want responses from events you created, but are not participating in?',
- 'name' => 'receive_not_participating',
- 'values' => $yesno,
- 'help' => 'Do you want to be notified about participant responses from events you created, but are not participating in?',
- 'default'=> '1'
- ),
- 'notify_externals' => array(
- 'type' => 'select',
- 'label' => 'Notify non-EGroupware users about event updates',
- 'name' => 'notify_externals',
- 'values' => $updates,
- 'help' => 'Do you want non-EGroupware participants of events you created to be automatically notified about new or changed appointments?',
- 'xmlrpc' => True,
- 'admin' => False,
- 'default'=> 'no',
- ),
- 'update_format' => array(
+ 'type' => 'select',
+ 'label' => 'Do you want responses from events you created, but are not participating in?',
+ 'name' => 'receive_not_participating',
+ 'values' => $yesno,
+ 'help' => 'Do you want to be notified about participant responses from events you created, but are not participating in?',
+ 'default' => '1'
+ ),
+ 'notify_externals' => array(
+ 'type' => 'select',
+ 'label' => 'Notify non-EGroupware users about event updates',
+ 'name' => 'notify_externals',
+ 'values' => $updates,
+ 'help' => 'Do you want non-EGroupware participants of events you created to be automatically notified about new or changed appointments?',
+ 'xmlrpc' => True,
+ 'admin' => False,
+ 'default' => 'no',
+ ),
+ 'update_format' => array(
'type' => 'select',
'label' => 'Format of event updates',
'name' => 'update_format',
@@ -554,146 +561,146 @@ static function settings($hook_data)
'admin' => False,
'forced' => 'ical',
),
- 'notifyAdded' => array(
- 'type' => 'notify',
- 'label' => 'Notification messages for added events',
- 'name' => 'notifyAdded',
- 'rows' => 5,
- 'cols' => 50,
- 'help' => 'This message is sent to every participant of events you own, who has requested notifcations about new events.
You can use certain variables which get substituted with the data of the event. The first line is the subject of the email.',
- 'default' => '',
- 'values' => $event_details,
- 'xmlrpc' => True,
- 'admin' => False,
- ),
- 'notifyCanceled' => array(
- 'type' => 'notify',
- 'label' => 'Notification messages for canceled events',
- 'name' => 'notifyCanceled',
- 'rows' => 5,
- 'cols' => 50,
- 'help' => 'This message is sent for canceled or deleted events.',
+ 'notifyAdded' => array(
+ 'type' => 'notify',
+ 'label' => 'Notification messages for added events',
+ 'name' => 'notifyAdded',
+ 'rows' => 5,
+ 'cols' => 50,
+ 'help' => 'This message is sent to every participant of events you own, who has requested notifcations about new events.
You can use certain variables which get substituted with the data of the event. The first line is the subject of the email.',
'default' => '',
- 'values' => $event_details,
+ 'values' => $event_details,
+ 'xmlrpc' => True,
+ 'admin' => False,
+ ),
+ 'notifyCanceled' => array(
+ 'type' => 'notify',
+ 'label' => 'Notification messages for canceled events',
+ 'name' => 'notifyCanceled',
+ 'rows' => 5,
+ 'cols' => 50,
+ 'help' => 'This message is sent for canceled or deleted events.',
+ 'default' => '',
+ 'values' => $event_details,
'subst_help' => False,
- 'xmlrpc' => True,
- 'admin' => False,
- ),
- 'notifyModified' => array(
- 'type' => 'notify',
- 'label' => 'Notification messages for modified events',
- 'name' => 'notifyModified',
- 'rows' => 5,
- 'cols' => 50,
- 'help' => 'This message is sent for modified or moved events.',
- 'default' => '',
- 'values' => $event_details,
+ 'xmlrpc' => True,
+ 'admin' => False,
+ ),
+ 'notifyModified' => array(
+ 'type' => 'notify',
+ 'label' => 'Notification messages for modified events',
+ 'name' => 'notifyModified',
+ 'rows' => 5,
+ 'cols' => 50,
+ 'help' => 'This message is sent for modified or moved events.',
+ 'default' => '',
+ 'values' => $event_details,
'subst_help' => False,
- 'xmlrpc' => True,
- 'admin' => False,
- ),
- 'notifyDisinvited' => array(
- 'type' => 'notify',
- 'label' => 'Notification messages for uninvited participants',
- 'name' => 'notifyDisinvited',
- 'rows' => 5,
- 'cols' => 50,
- 'help' => 'This message is sent to uninvited participants.',
- 'values' => $event_details,
+ 'xmlrpc' => True,
+ 'admin' => False,
+ ),
+ 'notifyDisinvited' => array(
+ 'type' => 'notify',
+ 'label' => 'Notification messages for uninvited participants',
+ 'name' => 'notifyDisinvited',
+ 'rows' => 5,
+ 'cols' => 50,
+ 'help' => 'This message is sent to uninvited participants.',
+ 'values' => $event_details,
'subst_help' => False,
- 'xmlrpc' => True,
- 'admin' => False,
- ),
- 'notifyResponse' => array(
- 'type' => 'notify',
- 'label' => 'Notification messages for your responses',
- 'name' => 'notifyResponse',
- 'rows' => 5,
- 'cols' => 50,
- 'help' => 'This message is sent when you accept, tentative accept or reject an event.',
- 'values' => $event_details,
+ 'xmlrpc' => True,
+ 'admin' => False,
+ ),
+ 'notifyResponse' => array(
+ 'type' => 'notify',
+ 'label' => 'Notification messages for your responses',
+ 'name' => 'notifyResponse',
+ 'rows' => 5,
+ 'cols' => 50,
+ 'help' => 'This message is sent when you accept, tentative accept or reject an event.',
+ 'values' => $event_details,
'subst_help' => False,
- 'xmlrpc' => True,
- 'admin' => False,
- ),
- 'notifyAlarm' => array(
- 'type' => 'notify',
- 'label' => 'Notification messages for your alarms',
- 'name' => 'notifyAlarm',
- 'rows' => 5,
- 'cols' => 50,
- 'help' => 'This message is sent when you set an Alarm for a certain event. Include all information you might need.',
- 'values' => $event_details,
+ 'xmlrpc' => True,
+ 'admin' => False,
+ ),
+ 'notifyAlarm' => array(
+ 'type' => 'notify',
+ 'label' => 'Notification messages for your alarms',
+ 'name' => 'notifyAlarm',
+ 'rows' => 5,
+ 'cols' => 50,
+ 'help' => 'This message is sent when you set an Alarm for a certain event. Include all information you might need.',
+ 'values' => $event_details,
'subst_help' => False,
- 'xmlrpc' => True,
- 'admin' => False,
+ 'xmlrpc' => True,
+ 'admin' => False,
),
- '4.section' => array(
- 'type' => 'section',
- 'title' => lang('Data exchange settings'),
- 'no_lang'=> true,
- 'xmlrpc' => False,
- 'admin' => False
+ '4.section' => array(
+ 'type' => 'section',
+ 'title' => lang('Data exchange settings'),
+ 'no_lang' => true,
+ 'xmlrpc' => False,
+ 'admin' => False
),
);
// Merge print
- if ($GLOBALS['egw_info']['user']['apps']['filemanager'])
+ if($GLOBALS['egw_info']['user']['apps']['filemanager'])
{
$settings['default_document'] = array(
- 'type' => 'vfs_file',
- 'size' => 60,
- 'label' => 'Default document to insert entries',
- 'name' => 'default_document',
- 'help' => lang('If you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. That icon allows to download the specified document with the data inserted.',lang('calendar')).' '.
- lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','calendar_title').' '.
- lang('The following document-types are supported:'). implode(',',Api\Storage\Merge::get_file_extensions()),
+ 'type' => 'vfs_file',
+ 'size' => 60,
+ 'label' => 'Default document to insert entries',
+ 'name' => 'default_document',
+ 'help' => lang('If you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. That icon allows to download the specified document with the data inserted.', lang('calendar')) . ' ' .
+ lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'calendar_title') . ' ' .
+ lang('The following document-types are supported:') . implode(',', Api\Storage\Merge::get_file_extensions()),
'run_lang' => false,
- 'xmlrpc' => True,
- 'admin' => False,
+ 'xmlrpc' => True,
+ 'admin' => False,
);
$settings['document_dir'] = array(
- 'type' => 'vfs_dirs',
- 'size' => 60,
- 'label' => 'Directory with documents to insert entries',
- 'name' => 'document_dir',
- 'help' => lang('If you specify a directory (full vfs path) here, %1 displays an action for each document. That action allows to download the specified document with the data inserted.',lang('calendar')).' '.
- lang('The document can contain placeholder like {{%1}}, to be replaced with the data.','calendar_title').' '.
- lang('The following document-types are supported:'). implode(',',Api\Storage\Merge::get_file_extensions()),
+ 'type' => 'vfs_dirs',
+ 'size' => 60,
+ 'label' => 'Directory with documents to insert entries',
+ 'name' => 'document_dir',
+ 'help' => lang('If you specify a directory (full vfs path) here, %1 displays an action for each document. That action allows to download the specified document with the data inserted.', lang('calendar')) . ' ' .
+ lang('The document can contain placeholder like {{%1}}, to be replaced with the data.', 'calendar_title') . ' ' .
+ lang('The following document-types are supported:') . implode(',', Api\Storage\Merge::get_file_extensions()),
'run_lang' => false,
- 'xmlrpc' => True,
- 'admin' => False,
- 'default' => '/templates/calendar',
+ 'xmlrpc' => True,
+ 'admin' => False,
+ 'default' => '/templates/calendar',
);
}
$settings += array(
'export_timezone' => array(
- 'type' => 'select',
- 'label' => 'Timezone of event iCal file import/export',
- 'name' => 'export_timezone',
- 'values' => $export_tzs,
- 'help' => 'Use this timezone to import/export calendar data.',
- 'xmlrpc' => True,
- 'admin' => False,
+ 'type' => 'select',
+ 'label' => 'Timezone of event iCal file import/export',
+ 'name' => 'export_timezone',
+ 'values' => $export_tzs,
+ 'help' => 'Use this timezone to import/export calendar data.',
+ 'xmlrpc' => True,
+ 'admin' => False,
'default' => '0', // Use event's TZ
),
- 'freebusy' => array(
- 'type' => 'select',
- 'label' => 'Make freebusy information available to not logged in persons?',
- 'name' => 'freebusy',
- 'help' => $freebusy_help,
- 'values' => $freebusy_values,
- 'run_lang' => false,
+ 'freebusy' => array(
+ 'type' => 'select',
+ 'label' => 'Make freebusy information available to not logged in persons?',
+ 'name' => 'freebusy',
+ 'help' => $freebusy_help,
+ 'values' => $freebusy_values,
+ 'run_lang' => false,
'subst_help' => False,
- 'xmlrpc' => True,
- 'admin' => False,
- 'forced' => 0,
+ 'xmlrpc' => True,
+ 'admin' => False,
+ 'forced' => 0,
),
- 'freebusy_pw' => array(
- 'type' => 'input',
- 'label' => 'Password for not loged in users to your freebusy information?',
- 'name' => 'freebusy_pw',
- 'help' => 'If you dont set a password here, the information is available to everyone, who knows the URL!!!',
+ 'freebusy_pw' => array(
+ 'type' => 'input',
+ 'label' => 'Password for not loged in users to your freebusy information?',
+ 'name' => 'freebusy_pw',
+ 'help' => 'If you dont set a password here, the information is available to everyone, who knows the URL!!!',
'xmlrpc' => True,
'admin' => False,
'forced' => ''
@@ -728,30 +735,30 @@ public static function verify_settings_reference(array &$data)
{
//error_log(__METHOD__."(".array2string($data).")");
// caldav perfs are always user specific and cant by switched off
- if ($data['type'] != 'user') return;
+ if($data['type'] != 'user') return;
$account_lid = $GLOBALS['egw_info']['user']['account_lid'];
foreach(array(
- 'default-alarm' => 'default-alarm-vevent-datetime:/'.$account_lid.'/:urn:ietf:params:xml:ns:caldav',
- 'default-alarm-wholeday' => 'default-alarm-vevent-date:/'.$account_lid.'/:urn:ietf:params:xml:ns:caldav',
- ) as $name => $dav)
+ 'default-alarm' => 'default-alarm-vevent-datetime:/' . $account_lid . '/:urn:ietf:params:xml:ns:caldav',
+ 'default-alarm-wholeday' => 'default-alarm-vevent-date:/' . $account_lid . '/:urn:ietf:params:xml:ns:caldav',
+ ) as $name => $dav)
{
$pref =& $GLOBALS['egw_info']['user']['preferences']['groupdav'][$dav];
- if (true) $pref = str_replace("\r", '', $pref); // remove CR messing up multiline preg_match
+ if(true) $pref = str_replace("\r", '', $pref); // remove CR messing up multiline preg_match
$val =& $data['prefs'][$name];
//error_log(__METHOD__."() groupdav[$dav]=$pref, calendar[$name]=$val");
- if ($data['preprocess']) // showing preferences
+ if($data['preprocess']) // showing preferences
{
- if (!isset($val)) // no calendar pref --> read value from caldav
+ if(!isset($val)) // no calendar pref --> read value from caldav
{
$matches = null;
- if (preg_match('/^ACTION:NONE$/mi', $pref))
+ if(preg_match('/^ACTION:NONE$/mi', $pref))
{
$val = '';
}
- elseif (preg_match('/^TRIGGER:-PT(\d+(M|H|D))$/mi', $pref, $matches))
+ elseif(preg_match('/^TRIGGER:-PT(\d+(M|H|D))$/mi', $pref, $matches))
{
static $factors = array(
'M' => 1,
@@ -759,7 +766,7 @@ public static function verify_settings_reference(array &$data)
'D' => 1440,
);
$factor = $factors[strtoupper($matches[2])];
- $val = $factor*(int)$matches[1];
+ $val = $factor * (int)$matches[1];
}
else
{
@@ -769,9 +776,9 @@ public static function verify_settings_reference(array &$data)
//error_log(__METHOD__."() setting $name={$val} from $dav='$pref'");
}
}
- else // storing preferences
+ else // storing preferences
{
- if (empty($pref) || !preg_match('/^TRIGGER:/m', $pref))
+ if(empty($pref) || !preg_match('/^TRIGGER:/m', $pref))
{
$pref = 'BEGIN:VALARM
TRIGGER:-PT1H
@@ -780,17 +787,17 @@ public static function verify_settings_reference(array &$data)
END:VALARM';
}
$trigger = $val < 0 ? 'TRIGGER:PT' : 'TRIGGER:-PT';
- if ((string)$val === '')
+ if((string)$val === '')
{
$pref = preg_replace('/^ACTION:.*$/m', 'ACTION:NONE', $pref);
}
- elseif (abs($val) < 60)
+ elseif(abs($val) < 60)
{
- $pref = preg_replace('/^TRIGGER:.*$/m', $trigger.number_format(abs($val), 0).'M', $pref);
+ $pref = preg_replace('/^TRIGGER:.*$/m', $trigger . number_format(abs($val), 0) . 'M', $pref);
}
else
{
- $pref = preg_replace('/^TRIGGER:.*$/m', $trigger.number_format(abs($val)/60, 0).'H', $pref);
+ $pref = preg_replace('/^TRIGGER:.*$/m', $trigger . number_format(abs($val) / 60, 0) . 'H', $pref);
}
$GLOBALS['egw']->preferences->add('groupdav', $dav, $pref, 'user');
//error_log(__METHOD__."() storing $name=$val --> $dav='$pref'");
@@ -806,9 +813,9 @@ public static function verify_settings_reference(array &$data)
public static function sync_default_alarms()
{
self::verify_settings(array(
- 'prefs' => array(),
+ 'prefs' => array(),
'preprocess' => true,
- 'type' => 'user',
+ 'type' => 'user',
));
}
@@ -836,7 +843,7 @@ public static function acl_rights($params)
);
$require_acl_invite = $GLOBALS['egw_info']['server']['require_acl_invite'];
- if (!$require_acl_invite || $require_acl_invite == 'groups' && !($params['owner'] < 0))
+ if(!$require_acl_invite || $require_acl_invite == 'groups' && !($params['owner'] < 0))
{
unset($rights[Acl::CUSTOM3]);
}
@@ -851,7 +858,7 @@ public static function acl_rights($params)
*/
public static function categories($data)
{
- unset($data); // not used, but in function signature for hooks
+ unset($data); // not used, but in function signature for hooks
return true;
}
@@ -862,11 +869,11 @@ public static function categories($data)
*/
public static function mail_import($args)
{
- unset($args); // not used, but required by function signature
+ unset($args); // not used, but required by function signature
- return array (
+ return array(
'menuaction' => 'calendar.calendar_uiforms.mail_import',
- 'popup' => Link::get_registry('calendar', 'edit_popup')
+ 'popup' => Link::get_registry('calendar', 'edit_popup')
);
}
@@ -876,29 +883,29 @@ public static function mail_import($args)
* @param type $params
* @return type
*/
- public static function notifications_actions ($params)
+ public static function notifications_actions($params)
{
Api\Translation::add_app('calendar');
// do not set actions for alarm type
- if ($params['data']['type'] == 6) return array();
+ if($params['data']['type'] == 6) return array();
return array(
array(
- 'id' => 'A',
- 'caption' => lang('Accept'),
- 'icon' => 'accepted',
- 'onExecute' => 'egw().json("calendar.calendar_uiforms.ajax_status",['.$params['data']['event_id'].','.$params['data']['user_id'].','.'"A"'.']).sendRequest(true);this.button_delete(arguments[0], arguments[1]);'
+ 'id' => 'A',
+ 'caption' => lang('Accept'),
+ 'icon' => 'accepted',
+ 'onExecute' => 'egw().json("calendar.calendar_uiforms.ajax_status",[' . $params['data']['event_id'] . ',' . $params['data']['user_id'] . ',' . '"A"' . ']).sendRequest(true);this.button_delete(arguments[0], arguments[1]);'
),
array(
- 'id' => 'R',
- 'caption' => lang('Reject'),
- 'icon' => 'rejected',
- 'onExecute' => 'egw().json("calendar.calendar_uiforms.ajax_status",['.$params['data']['event_id'].','.$params['data']['user_id'].','.'"R"'.']).sendRequest(true);this.button_delete(arguments[0], arguments[1]);'
+ 'id' => 'R',
+ 'caption' => lang('Reject'),
+ 'icon' => 'rejected',
+ 'onExecute' => 'egw().json("calendar.calendar_uiforms.ajax_status",[' . $params['data']['event_id'] . ',' . $params['data']['user_id'] . ',' . '"R"' . ']).sendRequest(true);this.button_delete(arguments[0], arguments[1]);'
),
array(
- 'id' => 'T',
- 'caption' => lang('Tentative'),
- 'icon' => 'tentative',
- 'onExecute' => 'egw().json("calendar.calendar_uiforms.ajax_status",['.$params['data']['event_id'].','.$params['data']['user_id'].','.'"T"'.']).sendRequest(true);this.button_delete(arguments[0], arguments[1]);'
+ 'id' => 'T',
+ 'caption' => lang('Tentative'),
+ 'icon' => 'tentative',
+ 'onExecute' => 'egw().json("calendar.calendar_uiforms.ajax_status",[' . $params['data']['event_id'] . ',' . $params['data']['user_id'] . ',' . '"T"' . ']).sendRequest(true);this.button_delete(arguments[0], arguments[1]);'
)
);
}
diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php
index 3c5ee71bd9e..eb7de4d14f0 100644
--- a/calendar/inc/class.calendar_ui.inc.php
+++ b/calendar/inc/class.calendar_ui.inc.php
@@ -33,7 +33,7 @@ class calendar_ui
/**
* @var $debug mixed integer level or string function-name
*/
- var $debug=false;
+ var $debug = false;
/**
* instance of the bocal or bocalupdate class
*
@@ -127,7 +127,7 @@ class calendar_ui
/**
* @var array $states_to_save all states that will be saved to the user prefs
*/
- var $states_to_save = array('owner','status_filter','filter','cat_id','view','sortby','planner_view','weekend');
+ var $states_to_save = array('owner', 'status_filter', 'filter', 'cat_id', 'view', 'sortby', 'planner_view', 'weekend');
/**
* Constructor
@@ -135,9 +135,9 @@ class calendar_ui
* @param boolean $use_boupdate use bocalupdate as parenent instead of bocal
* @param array $set_states to manualy set / change one of the states, default NULL = use $_REQUEST
*/
- function __construct($use_boupdate=false,$set_states=NULL)
+ function __construct($use_boupdate = false, $set_states = NULL)
{
- if ($use_boupdate)
+ if($use_boupdate)
{
$this->bo = new calendar_boupdate();
}
@@ -146,27 +146,27 @@ function __construct($use_boupdate=false,$set_states=NULL)
$this->bo = new calendar_bo();
}
- $this->categories = new Api\Categories($this->user,'calendar');
+ $this->categories = new Api\Categories($this->user, 'calendar');
- $this->common_prefs = &$GLOBALS['egw_info']['user']['preferences']['common'];
- $this->cal_prefs = &$GLOBALS['egw_info']['user']['preferences']['calendar'];
+ $this->common_prefs = &$GLOBALS['egw_info']['user']['preferences']['common'];
+ $this->cal_prefs = &$GLOBALS['egw_info']['user']['preferences']['calendar'];
$this->bo->check_set_default_prefs();
- $this->wd_start = 60*$this->cal_prefs['workdaystarts'];
- $this->wd_end = 60*$this->cal_prefs['workdayends'];
- $this->interval_m = $this->cal_prefs['interval'];
+ $this->wd_start = 60 * $this->cal_prefs['workdaystarts'];
+ $this->wd_end = 60 * $this->cal_prefs['workdayends'];
+ $this->interval_m = $this->cal_prefs['interval'];
$this->user = $GLOBALS['egw_info']['user']['account_id'];
$this->manage_states($set_states);
- $GLOBALS['uical'] = &$this; // make us available for ExecMethod, else it creates a new instance
+ $GLOBALS['uical'] = &$this; // make us available for ExecMethod, else it creates a new instance
// calendar does not work with hidden sidebox atm.
unset($GLOBALS['egw_info']['user']['preferences']['common']['auto_hide_sidebox']);
// make sure the hook for export_limit is registered
- if (!Api\Hooks::exists('export_limit','calendar')) Api\Hooks::read(true);
+ if(!Api\Hooks::exists('export_limit', 'calendar')) Api\Hooks::read(true);
}
/**
@@ -179,36 +179,36 @@ function __construct($use_boupdate=false,$set_states=NULL)
function check_owners_access($users = null, &$no_access = array())
{
$no_access = $no_access_group = array();
- $owner_array = $users ? $users : explode(',',$this->owner);
+ $owner_array = $users ? $users : explode(',', $this->owner);
foreach($owner_array as $idx => $owner)
{
$owner = trim($owner);
- if (is_numeric($owner) && $GLOBALS['egw']->accounts->get_type($owner) == 'g')
+ if(is_numeric($owner) && $GLOBALS['egw']->accounts->get_type($owner) == 'g')
{
foreach($GLOBALS['egw']->accounts->members($owner, true) as $member)
{
- if (!$this->bo->check_perms(Acl::READ|calendar_bo::ACL_READ_FOR_PARTICIPANTS|calendar_bo::ACL_FREEBUSY,0,$member))
+ if(!$this->bo->check_perms(Acl::READ | calendar_bo::ACL_READ_FOR_PARTICIPANTS | calendar_bo::ACL_FREEBUSY, 0, $member))
{
$no_access_group[$member] = $this->bo->participant_name($member);
}
}
}
- elseif (!$this->bo->check_perms(Acl::READ|calendar_bo::ACL_READ_FOR_PARTICIPANTS|calendar_bo::ACL_FREEBUSY,0,$owner))
+ elseif(!$this->bo->check_perms(Acl::READ | calendar_bo::ACL_READ_FOR_PARTICIPANTS | calendar_bo::ACL_FREEBUSY, 0, $owner))
{
$no_access[$owner] = $this->bo->participant_name($owner);
unset($owner_array[$idx]);
}
}
- if (count($no_access))
+ if(count($no_access))
{
- $message = lang('Access denied to the calendar of %1 !!!',implode(', ',$no_access));
- Framework::message($message,'error');
- $this->owner = implode(',',$owner_array);
+ $message = lang('Access denied to the calendar of %1 !!!', implode(', ', $no_access));
+ Framework::message($message, 'error');
+ $this->owner = implode(',', $owner_array);
return $message;
}
- if (count($no_access_group))
+ if(count($no_access_group))
{
- $this->bo->warnings['groupmembers'] = lang('Groupmember(s) %1 not included, because you have no access.',implode(', ',$no_access_group));
+ $this->bo->warnings['groupmembers'] = lang('Groupmember(s) %1 not included, because you have no access.', implode(', ', $no_access_group));
}
return false;
}
@@ -218,116 +218,116 @@ function check_owners_access($users = null, &$no_access = array())
*
* The state of all these controls is updated if they are set in $_REQUEST or $set_states and saved in the session.
* The following states are used:
- * - date or year, month, day: the actual date of the period displayed
- * - cat_id: the selected category
- * - owner: the owner of the displayed calendar
- * - save_owner: the overriden owner of the planner
- * - status_filter: the used filter: all or hideprivate
- * - sortby: category or user of planner
- * - view: the actual view, where dialogs should return to or which they refresh
+ * - date or year, month, day: the actual date of the period displayed
+ * - cat_id: the selected category
+ * - owner: the owner of the displayed calendar
+ * - save_owner: the overriden owner of the planner
+ * - status_filter: the used filter: all or hideprivate
+ * - sortby: category or user of planner
+ * - view: the actual view, where dialogs should return to or which they refresh
* @param array $set_states array to manualy set / change one of the states, default NULL = use $_REQUEST
*/
- function manage_states($set_states=NULL)
+ function manage_states($set_states = NULL)
{
// retrieve saved states from prefs
$states = is_array($this->bo->cal_prefs['saved_states']) ?
$this->bo->cal_prefs['saved_states'] : unserialize($this->bo->cal_prefs['saved_states']);
// only look at _REQUEST, if we are in the calendar (prefs and admin show our sidebox menu too!)
- if (is_null($set_states))
+ if(is_null($set_states))
{
// ajax-exec call has get-parameter in some json
- if (isset($_REQUEST['json_data']) && ($json_data = json_decode($_REQUEST['json_data'], true)) &&
+ if(isset($_REQUEST['json_data']) && ($json_data = json_decode($_REQUEST['json_data'], true)) &&
!empty($json_data['request']['parameters'][0]))
{
- if (is_array($json_data['request']['parameters'][0]))
+ if(is_array($json_data['request']['parameters'][0]))
{
//error_log(__METHOD__.__LINE__.array2string($json_data['request']['parameters'][0]));
$set_states = $json_data['request']['parameters'][0];
}
else
{
- parse_str(substr($json_data['request']['parameters'][0], 10), $set_states); // cut off "/index.php?"
+ parse_str(substr($json_data['request']['parameters'][0], 10), $set_states); // cut off "/index.php?"
}
}
else
{
- $set_states = substr($_GET['menuaction'],0,9) == 'calendar.' ? $_REQUEST : array();
+ $set_states = substr($_GET['menuaction'], 0, 9) == 'calendar.' ? $_REQUEST : array();
}
}
- if (!$states['date'] && $states['year'] && $states['month'] && $states['day'])
+ if(!$states['date'] && $states['year'] && $states['month'] && $states['day'])
{
$states['date'] = $this->bo->date2string($states);
}
foreach(array(
- 'date' => $this->bo->date2string($this->bo->now_su),
- 'cat_id' => 0,
- 'status_filter' => 'default',
- 'owner' => $this->user,
- 'save_owner' => 0,
- 'sortby' => 'category',
- 'planner_view'=> 'month', // full month
- 'view' => ($this->bo->cal_prefs['defaultcalendar']?$this->bo->cal_prefs['defaultcalendar']:'day'), // use pref, if exists else use the dayview
- 'listview_days'=> '', // no range
- 'test' => 'false',
- ) as $state => $default)
- {
- if (isset($set_states[$state]))
+ 'date' => $this->bo->date2string($this->bo->now_su),
+ 'cat_id' => 0,
+ 'status_filter' => 'default',
+ 'owner' => $this->user,
+ 'save_owner' => 0,
+ 'sortby' => 'category',
+ 'planner_view' => 'month', // full month
+ 'view' => ($this->bo->cal_prefs['defaultcalendar'] ? $this->bo->cal_prefs['defaultcalendar'] : 'day'), // use pref, if exists else use the dayview
+ 'listview_days' => '', // no range
+ 'test' => 'false',
+ ) as $state => $default)
+ {
+ if(isset($set_states[$state]))
{
- if ($state == 'owner')
+ if($state == 'owner')
{
// only change the owners of the same resource-type as given in set_state[owner]
- $set_owners = is_array($set_states['owner']) ? $set_states['owner'] : explode(',',$set_states['owner']);
- if ((string)$set_owners[0] === '0') // set exactly the specified owners (without the 0)
+ $set_owners = is_array($set_states['owner']) ? $set_states['owner'] : explode(',', $set_states['owner']);
+ if((string)$set_owners[0] === '0') // set exactly the specified owners (without the 0)
{
- if ($set_states['owner'] === '0,r0') // small fix for resources
+ if($set_states['owner'] === '0,r0') // small fix for resources
{
- $set_states['owner'] = $default; // --> set default, instead of none
+ $set_states['owner'] = $default; // --> set default, instead of none
}
else
{
- $set_states['owner'] = substr($set_states['owner'],2);
+ $set_states['owner'] = substr($set_states['owner'], 2);
}
}
- else // change only the owners of the given type
+ else // change only the owners of the given type
{
$res_type = is_numeric($set_owners[0]) ? false : $set_owners[0][0];
$owners = $states['owner'] ? $states['owner'] : $default;
if(!is_array($owners))
{
- $owners = explode(',',$owners);
+ $owners = explode(',', $owners);
}
foreach($owners as $key => $owner)
{
- if (!$res_type && is_numeric($owner) || $res_type && $owner[0] == $res_type)
+ if(!$res_type && is_numeric($owner) || $res_type && $owner[0] == $res_type)
{
unset($owners[$key]);
}
}
- if (!$res_type || !in_array($res_type.'0',$set_owners))
+ if(!$res_type || !in_array($res_type . '0', $set_owners))
{
- $owners = array_merge($owners,$set_owners);
+ $owners = array_merge($owners, $set_owners);
}
- $set_states['owner'] = implode(',',$owners);
+ $set_states['owner'] = implode(',', $owners);
}
}
// for the uiforms class (eg. edit), dont store the (new) owner, as it might change the view
- if (substr($_GET['menuaction'],0,25) == 'calendar.calendar_uiforms')
+ if(substr($_GET['menuaction'], 0, 25) == 'calendar.calendar_uiforms')
{
$this->owner = $set_states[$state];
continue;
}
$states[$state] = $set_states[$state];
}
- elseif (!is_array($states) || !isset($states[$state]))
+ elseif(!is_array($states) || !isset($states[$state]))
{
$states[$state] = $default;
}
- if ($state == 'date')
+ if($state == 'date')
{
$date_arr = $this->bo->date2array($states['date']);
- foreach(array('year','month','day') as $name)
+ foreach(array('year', 'month', 'day') as $name)
{
$this->$name = $states[$name] = $date_arr[$name];
}
@@ -335,117 +335,118 @@ function manage_states($set_states=NULL)
$this->$state = $states[$state];
}
// remove a given calendar from the view
- if (isset($_GET['close']) && ($k = array_search($_GET['close'], $owners=explode(',',$this->owner))) !== false)
+ if(isset($_GET['close']) && ($k = array_search($_GET['close'], $owners = explode(',', $this->owner))) !== false)
{
unset($owners[$k]);
- $this->owner = $states['owner'] = implode(',',$owners);
+ $this->owner = $states['owner'] = implode(',', $owners);
}
if(is_array($this->owner))
{
- $this->owner = implode(',',$this->owner);
+ $this->owner = implode(',', $this->owner);
}
- if (substr($this->view,0,8) == 'planner_')
+ if(substr($this->view, 0, 8) == 'planner_')
{
$states['sortby'] = $this->sortby = $this->view == 'planner_cat' ? 'category' : 'user';
$states['view'] = $this->view = 'planner';
}
// set the actual view as return_to
- if (isset($_GET['menuaction']))
+ if(isset($_GET['menuaction']))
{
- list(,$class,$func) = explode('.',$_GET['menuaction']);
- if ($func == 'index')
+ list(, $class, $func) = explode('.', $_GET['menuaction']);
+ if($func == 'index')
{
- $func = $this->view; $this->view = 'index'; // switch to the default view
+ $func = $this->view;
+ $this->view = 'index'; // switch to the default view
}
}
- else // eg. calendar/index.php
+ else // eg. calendar/index.php
{
$func = $this->view;
$class = $this->view == 'listview' ? 'calendar_uilist' : 'calendar_uiviews';
}
- if ($class == 'calendar_uiviews' || $class == 'calendar_uilist')
+ if($class == 'calendar_uiviews' || $class == 'calendar_uilist')
{
$this->view = $states['view'] = $func;
}
$this->view_menuaction = $this->view == 'listview' ? 'calendar.calendar_uilist.listview' : 'calendar.calendar_uiviews.index';
- if ($this->debug > 0 || $this->debug == 'manage_states') $this->bo->debug_message('uical::manage_states(%1), states now %3',True,$set_states,$states);
+ if($this->debug > 0 || $this->debug == 'manage_states') $this->bo->debug_message('uical::manage_states(%1), states now %3', True, $set_states, $states);
// save the states in the session only when we are in calendar
- if ($GLOBALS['egw_info']['flags']['currentapp']=='calendar')
+ if($GLOBALS['egw_info']['flags']['currentapp'] == 'calendar')
{
// save defined states into the user-prefs
if(!empty($states) && is_array($states))
{
- $saved_states = array_intersect_key($states,array_flip($this->states_to_save));
- if ($saved_states != $this->cal_prefs['saved_states'])
+ $saved_states = array_intersect_key($states, array_flip($this->states_to_save));
+ if($saved_states != $this->cal_prefs['saved_states'])
{
- $GLOBALS['egw']->preferences->add('calendar','saved_states',$saved_states);
- $GLOBALS['egw']->preferences->save_repository(false,'user',true);
+ $GLOBALS['egw']->preferences->add('calendar', 'saved_states', $saved_states);
+ $GLOBALS['egw']->preferences->save_repository(false, 'user', true);
}
}
}
}
/**
- * gets the icons displayed for a given event
- *
- * @param array $event
- * @return array of 'img' / 'title' pairs
- */
+ * gets the icons displayed for a given event
+ *
+ * @param array $event
+ * @return array of 'img' / 'title' pairs
+ */
function event_icons($event)
{
- $is_private = !$event['public'] && !$this->bo->check_perms(Acl::READ,$event);
+ $is_private = !$event['public'] && !$this->bo->check_perms(Acl::READ, $event);
$icons = array();
- if (!$is_private)
+ if(!$is_private)
{
if($event['priority'] == 3)
{
- $icons[] = Api\Html::image('calendar','high',lang('high priority'));
+ $icons[] = Api\Html::image('calendar', 'high', lang('high priority'));
}
if($event['recur_type'] != MCAL_RECUR_NONE)
{
- $icons[] = Api\Html::image('calendar','recur',lang('recurring event'));
+ $icons[] = Api\Html::image('calendar', 'recur', lang('recurring event'));
}
// icons for single user, multiple users or group(s) and resources
- foreach(array_keys($event['participants']) as $uid)
+ foreach(array_keys($event['participants']) as $uid)
{
if(is_numeric($uid) || !isset($this->bo->resources[$uid[0]]['icon']))
{
- if (isset($icons['single']) || $GLOBALS['egw']->accounts->get_type($uid) == 'g')
+ if(isset($icons['single']) || $GLOBALS['egw']->accounts->get_type($uid) == 'g')
{
unset($icons['single']);
- $icons['multiple'] = Api\Html::image('calendar','users');
+ $icons['multiple'] = Api\Html::image('calendar', 'users');
}
- elseif (!isset($icons['multiple']))
+ elseif(!isset($icons['multiple']))
{
- $icons['single'] = Api\Html::image('calendar','single');
+ $icons['single'] = Api\Html::image('calendar', 'single');
}
}
elseif(!isset($icons[$uid[0]]) && isset($this->bo->resources[$uid[0]]) && isset($this->bo->resources[$uid[0]]['icon']))
{
- $icons[$uid[0]] = Api\Html::image($this->bo->resources[$uid[0]]['app'],
- ($this->bo->resources[$uid[0]]['icon'] ? $this->bo->resources[$uid[0]]['icon'] : 'navbar'),
- lang($this->bo->resources[$uid[0]]['app']),
- 'width="16px" height="16px"');
+ $icons[$uid[0]] = Api\Html::image($this->bo->resources[$uid[0]]['app'],
+ ($this->bo->resources[$uid[0]]['icon'] ? $this->bo->resources[$uid[0]]['icon'] : 'navbar'),
+ lang($this->bo->resources[$uid[0]]['app']),
+ 'width="16px" height="16px"');
}
}
}
if($event['non_blocking'])
{
- $icons[] = Api\Html::image('calendar','nonblocking',lang('non blocking'));
+ $icons[] = Api\Html::image('calendar', 'nonblocking', lang('non blocking'));
}
if($event['public'] == 0)
{
- $icons[] = Api\Html::image('calendar','private',lang('private'));
+ $icons[] = Api\Html::image('calendar', 'private', lang('private'));
}
if(isset($event['alarm']) && count($event['alarm']) >= 1 && !$is_private)
{
- $icons[] = Api\Html::image('calendar','alarm',lang('alarm'));
+ $icons[] = Api\Html::image('calendar', 'alarm', lang('alarm'));
}
if($event['participants'][$this->user][0] == 'U')
{
- $icons[] = Api\Html::image('calendar','needs-action',lang('Needs action'));
+ $icons[] = Api\Html::image('calendar', 'needs-action', lang('Needs action'));
}
return $icons;
}
@@ -460,18 +461,18 @@ function event_icons($event)
* @param array $vars
* @return string the link incl. content
*/
- function add_link($content,$date=null,$hour=null,$minute=0,array $vars=null)
+ function add_link($content, $date = null, $hour = null, $minute = 0, array $vars = null)
{
$vars['menuaction'] = 'calendar.calendar_uiforms.edit';
- $vars['date'] = $date ? $date : $this->date;
+ $vars['date'] = $date ? $date : $this->date;
- if (!is_null($hour))
+ if(!is_null($hour))
{
$vars['hour'] = $hour;
$vars['minute'] = $minute;
}
- return Api\Html::a_href($content,'',$vars,' data-date="' .$vars['date'].'|'.$vars['hour'].'|'.$vars['minute']
- . '" title="'.Api\Html::htmlspecialchars(lang('Add')).'"');
+ return Api\Html::a_href($content, '', $vars, ' data-date="' . $vars['date'] . '|' . $vars['hour'] . '|' . $vars['minute']
+ . '" title="' . Api\Html::htmlspecialchars(lang('Add')) . '"');
}
/**
@@ -482,51 +483,51 @@ function sidebox_menu()
// Magic etemplate2 favorites menu (from framework)
display_sidebox('calendar', lang('Favorites'), Framework\Favorites::list_favorites('calendar'));
- $file = array('menuOpened' => true); // menu open by default
+ $file = array('menuOpened' => true); // menu open by default
// Target for etemplate
$file[] = array(
'no_lang' => true,
- 'text'=>'',
- 'link'=>false,
- 'icon' => false
+ 'text' => '',
+ 'link' => false,
+ 'icon' => false
);
// Merge print placeholders (selectbox in etemplate)
- if ($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'])
+ if($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'])
{
- $file['Placeholders'] = Egw::link('/index.php','menuaction=calendar.calendar_merge.show_replacements');
+ $file['Placeholders'] = Egw::link('/index.php', 'menuaction=calendar.calendar_merge.show_replacements');
}
$appname = 'calendar';
$menu_title = lang('Calendar Menu');
- display_sidebox($appname,$menu_title,$file);
+ display_sidebox($appname, $menu_title, $file);
$this->sidebox_etemplate();
// resources menu hooks
- foreach ($this->bo->resources as $resource)
+ foreach($this->bo->resources as $resource)
{
if(!is_array($resource['cal_sidebox'])) continue;
$menu_title = $resource['cal_sidebox']['menu_title'] ? $resource['cal_sidebox']['menu_title'] : lang($resource['app']);
- $file = ExecMethod($resource['cal_sidebox']['file'],array(
+ $file = ExecMethod($resource['cal_sidebox']['file'], array(
'menuaction' => $this->view_menuaction,
- 'owner' => $this->owner,
+ 'owner' => $this->owner,
));
- display_sidebox($appname,$menu_title,$file);
+ display_sidebox($appname, $menu_title, $file);
}
- if ($GLOBALS['egw_info']['user']['apps']['admin'])
+ if($GLOBALS['egw_info']['user']['apps']['admin'])
{
$file = Array(
- 'Site configuration'=>Egw::link('/index.php','menuaction=admin.admin_config.index&appname=calendar&ajax=true'),
- 'Custom Fields'=>Egw::link('/index.php','menuaction=admin.admin_customfields.index&appname=calendar&ajax=true'),
- 'Global Categories' =>Egw::link('/index.php','menuaction=admin.admin_categories.index&appname=calendar&ajax=true'),
+ 'Site configuration' => Egw::link('/index.php', 'menuaction=admin.admin_config.index&appname=calendar&ajax=true'),
+ 'Custom Fields' => Egw::link('/index.php', 'menuaction=admin.admin_customfields.index&appname=calendar&ajax=true'),
+ 'Global Categories' => Egw::link('/index.php', 'menuaction=admin.admin_categories.index&appname=calendar&ajax=true'),
);
- $GLOBALS['egw']->framework->sidebox($appname,lang('Admin'),$file,'admin');
+ $GLOBALS['egw']->framework->sidebox($appname, lang('Admin'), $file, 'admin');
}
- display_sidebox('calendar', lang('Utilities'), array('Category report' => "javascript:egw_openWindowCentered2('".
- Egw::link('/index.php',array('menuaction'=>'calendar.calendar_category_report.index','ajax'=>true),false).
- "','_blank',870,500,'yes')" ));
+ display_sidebox('calendar', lang('Utilities'), array('Category report' => "javascript:egw_openWindowCentered2('" .
+ Egw::link('/index.php', array('menuaction' => 'calendar.calendar_category_report.index', 'ajax' => true), false) .
+ "','_blank',870,500,'yes')"));
}
/**
@@ -537,10 +538,10 @@ function sidebox_etemplate($content = array())
if($content['merge'])
{
// View from sidebox is JSON encoded
- $this->manage_states(array_merge($content,(array)json_decode($content['view'],true)));
+ $this->manage_states(array_merge($content, (array)json_decode($content['view'], true)));
if($content['first'])
{
- $this->first = Api\DateTime::to($content['first'],'ts');
+ $this->first = Api\DateTime::to($content['first'], 'ts');
}
if($content['last'])
{
@@ -560,28 +561,28 @@ function sidebox_etemplate($content = array())
$sidebox = new Etemplate('calendar.sidebox');
$cont = $this->cal_prefs['saved_states'];
- if (!is_array($cont)) $cont = array();
+ if(!is_array($cont)) $cont = array();
$cont['view'] = $this->view ? $this->view : 'week';
$cont['date'] = $this->date ? $this->date : new Api\DateTime();
- $cont['owner'] = $this->owner ? (is_array($this->owner) ? $this->owner : explode(',',$this->owner) ) : $cont['owner'];
+ $cont['owner'] = $this->owner ? (is_array($this->owner) ? $this->owner : explode(',', $this->owner)) : $cont['owner'];
- $cont['year'] = (int)Api\DateTime::to($cont['date'],'Y');
+ $cont['year'] = (int)Api\DateTime::to($cont['date'], 'Y');
$cont['holidays'] = $this->bo->read_holidays($cont['year']);
$readonlys = array();
$sel_options['status_filter'] = array(
- array('value' => 'default', 'label' => lang('Not rejected'), 'title' => lang('Show all status, but rejected')),
- array('value' => 'accepted', 'label' => lang('Accepted'), 'title' => lang('Show only accepted events')),
- array('value' => 'unknown', 'label' => lang('Invitations'), 'title' => lang('Show only invitations, not yet accepted or rejected')),
- array('value' => 'tentative', 'label' => lang('Tentative'), 'title' => lang('Show only tentative accepted events')),
- array('value' => 'delegated', 'label' => lang('Delegated'), 'title' => lang('Show only delegated events')),
- array('value' => 'rejected', 'label' => lang('Rejected'),'title' => lang('Show only rejected events')),
- array('value' => 'owner', 'label' => lang('Owner too'),'title' => lang('Show also events just owned by selected user')),
- array('value' => 'all', 'label' => lang('All incl. rejected'),'title' => lang('Show all status incl. rejected events')),
- array('value' => 'hideprivate', 'label' => lang('Hide private infos'),'title' => lang('Show all events, as if they were private')),
- array('value' => 'showonlypublic', 'label' => lang('Hide private events'),'title' => lang('Show only events flagged as public, (not checked as private)')),
- array('value' => 'no-enum-groups', 'label' => lang('only group-events'),'title' => lang('Do not include events of group members')),
- array('value' => 'not-unknown', 'label' => lang('No meeting requests'),'title' => lang('Show all status, but unknown')),
+ array('value' => 'default', 'label' => lang('Not rejected'), 'title' => lang('Show all status, but rejected')),
+ array('value' => 'accepted', 'label' => lang('Accepted'), 'title' => lang('Show only accepted events')),
+ array('value' => 'unknown', 'label' => lang('Invitations'), 'title' => lang('Show only invitations, not yet accepted or rejected')),
+ array('value' => 'tentative', 'label' => lang('Tentative'), 'title' => lang('Show only tentative accepted events')),
+ array('value' => 'delegated', 'label' => lang('Delegated'), 'title' => lang('Show only delegated events')),
+ array('value' => 'rejected', 'label' => lang('Rejected'), 'title' => lang('Show only rejected events')),
+ array('value' => 'owner', 'label' => lang('Owner too'), 'title' => lang('Show also events just owned by selected user')),
+ array('value' => 'all', 'label' => lang('All incl. rejected'), 'title' => lang('Show all status incl. rejected events')),
+ array('value' => 'hideprivate', 'label' => lang('Hide private infos'), 'title' => lang('Show all events, as if they were private')),
+ array('value' => 'showonlypublic', 'label' => lang('Hide private events'), 'title' => lang('Show only events flagged as public, (not checked as private)')),
+ array('value' => 'no-enum-groups', 'label' => lang('only group-events'), 'title' => lang('Do not include events of group members')),
+ array('value' => 'not-unknown', 'label' => lang('No meeting requests'), 'title' => lang('Show all status, but unknown')),
);
if($GLOBALS['egw_info']['server']['calendar_delete_history'])
{
@@ -589,23 +590,23 @@ function sidebox_etemplate($content = array())
}
// Merge print
- try {
- if (class_exists('EGroupware\\collabora\\Bo') &&
- $GLOBALS['egw_info']['user']['apps']['collabora'] &&
- $discovery = \EGroupware\collabora\Bo::discover()
+ try
+ {
+ if(class_exists('EGroupware\\collabora\\Bo') &&
+ $GLOBALS['egw_info']['user']['apps']['collabora'] &&
+ $discovery = \EGroupware\collabora\Bo::discover()
)
{
$cont['collabora_enabled'] = true;
}
- }
- catch (\Exception $e)
+ } catch(\Exception $e)
{
// ignore failed discovery
unset($e);
}
- if ($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'])
+ if($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'])
{
- $sel_options['merge'] = calendar_merge::get_documents($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'], '', null,'calendar');
+ $sel_options['merge'] = calendar_merge::get_documents($GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir'], '', null, 'calendar');
}
else
@@ -631,14 +632,14 @@ function sidebox_etemplate($content = array())
* @param Api\DateTime $recurrence_date
*
* @return boolean True if the event was updated, false if it could not be
- * updated or was removed.
+ * updated or was removed.
*/
public function update_client($event_id, Api\DateTime $recurrence_date = null)
{
if(!$event_id) return false;
- if(is_string($event_id) && strpos($event_id,':') !== FALSE)
+ if(is_string($event_id) && strpos($event_id, ':') !== FALSE)
{
- list($event_id, $date) = explode(':',$event_id);
+ list($event_id, $date) = explode(':', $event_id);
$recurrence_date = new Api\DateTime($date);
}
@@ -652,23 +653,23 @@ public function update_client($event_id, Api\DateTime $recurrence_date = null)
// the event because it should no longer be displayed
$filter_match = true;
if($event && ($this->cal_prefs['saved_states']['status_filter'] != 'all' ||
- $this->cal_prefs['saved_states']['cat_id']))
+ $this->cal_prefs['saved_states']['cat_id']))
{
$filter_check = array(
- 'start' => $event['start'],
- 'users' => $this->cal_prefs['saved_states']['owner'],
- 'cat_id' => $this->cal_prefs['saved_states']['cat_id'],
- 'filter' => $this->cal_prefs['saved_states']['status_filter'],
+ 'start' => $event['start'],
+ 'users' => $this->cal_prefs['saved_states']['owner'],
+ 'cat_id' => $this->cal_prefs['saved_states']['cat_id'],
+ 'filter' => $this->cal_prefs['saved_states']['status_filter'],
'num_rows' => 1
);
- $filter_match = count($this->bo->search($filter_check, $this->bo->so->cal_table.".cal_id = {$event['id']}")) > 0;
+ $filter_match = count($this->bo->search($filter_check, $this->bo->so->cal_table . ".cal_id = {$event['id']}")) > 0;
}
if(!$event || !$filter_match)
{
// Sending null will trigger a removal
$uid = 'calendar::' . $event_id;
- if ($recurrence_date)
+ if($recurrence_date)
{
$uid .= ':' . $recurrence_date->getTimestamp();
}
@@ -679,10 +680,10 @@ public function update_client($event_id, Api\DateTime $recurrence_date = null)
if(!$event['recur_type'] || $recurrence_date)
{
$this->to_client($event);
- $response->generic('data', array('uid' => 'calendar::'.$event['row_id'], 'data' => $event));
+ $response->generic('data', array('uid' => 'calendar::' . $event['row_id'], 'data' => $event));
}
// If it's recurring, try to send the next month or so
- else if($event['recur_type'] )
+ else if($event['recur_type'])
{
$this_month = new Api\DateTime('next month');
$rrule = calendar_rrule::event2rrule($event, true);
@@ -692,10 +693,9 @@ public function update_client($event_id, Api\DateTime $recurrence_date = null)
$occurrence = $rrule->current();
$converted = $this->bo->read($event['id'], $occurrence);
$this->to_client($converted);
- $response->generic('data', array('uid' => 'calendar::'.$converted['row_id'], 'data' => $converted));
+ $response->generic('data', array('uid' => 'calendar::' . $converted['row_id'], 'data' => $converted));
$rrule->next();
- }
- while ($rrule->valid() && $occurrence <= $this_month );
+ } while($rrule->valid() && $occurrence <= $this_month);
}
return true;
}
@@ -715,27 +715,27 @@ public function to_client(&$event)
static $sent_groups = array();
- if (!$this->bo->check_perms(Acl::EDIT,$event))
+ if(!$this->bo->check_perms(Acl::EDIT, $event))
{
$event['class'] .= 'rowNoEdit ';
}
// Delete disabled for other applications
- if (!$this->bo->check_perms(Acl::DELETE,$event) || !is_numeric($event['id']))
+ if(!$this->bo->check_perms(Acl::DELETE, $event) || !is_numeric($event['id']))
{
$event['class'] .= 'rowNoDelete ';
}
// mark deleted events
- if ($event['deleted'])
+ if($event['deleted'])
{
$event['class'] .= 'rowDeleted ';
}
$event['recure'] = $this->bo->recure2string($event);
- if (empty($event['description'])) $event['description'] = ' '; // no description screws the titles horz. alignment
- if (empty($event['location'])) $event['location'] = ' '; // no location screws the owner horz. alignment
+ if(empty($event['description'])) $event['description'] = ' '; // no description screws the titles horz. alignment
+ if(empty($event['location'])) $event['location'] = ' '; // no location screws the owner horz. alignment
// respect category permissions
if(!empty($event['category']))
@@ -745,23 +745,23 @@ public function to_client(&$event)
$event['non_blocking'] = (bool)$event['non_blocking'];
$matches = null;
- if(!(int)$event['id'] && preg_match('/^([a-z_-]+)([0-9]+)$/i',$event['id'],$matches))
+ if(!(int)$event['id'] && preg_match('/^([a-z_-]+)([0-9]+)$/i', $event['id'], $matches))
{
$app = $matches[1];
$app_id = $matches[2];
$icons = array();
- if(!($is_private = calendar_bo::integration_get_private($app,$app_id,$event)))
+ if(!($is_private = calendar_bo::integration_get_private($app, $app_id, $event)))
{
- $icons = calendar_uiviews::integration_get_icons($app,$app_id,$event);
+ $icons = calendar_uiviews::integration_get_icons($app, $app_id, $event);
}
$event['app'] = $app;
$event['app_id'] = $app_id;
}
else
{
- $is_private = !$this->bo->check_perms(Acl::READ,$event);
+ $is_private = !$this->bo->check_perms(Acl::READ, $event);
}
- if ($is_private)
+ if($is_private)
{
$event['is_private'] = true;
$event['class'] .= 'rowNoView ';
@@ -776,17 +776,20 @@ public function to_client(&$event)
$event['app_id'] = $event['id'];
}
- if ($event['recur_type'] != MCAL_RECUR_NONE)
+ if($event['recur_type'] != MCAL_RECUR_NONE)
{
- $event['app_id'] .= ':'.Api\DateTime::to($event['recur_date'] ? $event['recur_date'] : $event['start'],'ts');
+ $event['app_id'] .= ':' . Api\DateTime::to($event['recur_date'] ? $event['recur_date'] : $event['start'], 'ts');
}
// set id for grid
- $event['row_id'] = $event['id'].($event['recur_type'] ? ':'.Api\DateTime::to($event['recur_date'] ? $event['recur_date'] : $event['start'],'ts') : '');
+ $event['row_id'] = $event['id'] . ($event['recur_type'] ? ':' . Api\DateTime::to($event['recur_date'] ? $event['recur_date'] : $event['start'], 'ts') : '');
// Set up participant section of tooltip
- $participants = $this->bo->participants($event,false);
- $event['parts'] = implode("\n",$participants);
+ $participants = $this->bo->participants($event, false);
+ $event['parts'] = implode("\n", $participants);
$event['participant_types'] = array();
+ // semicolon-separated string of participants that may (optionally) be shown alongside title
+ $participantNames = "";
+
foreach($participants as $uid => $text)
{
$user_type = $user_id = null;
@@ -798,11 +801,18 @@ public function to_client(&$event)
// Make sure group membership info is on the client
Api\Json\Response::get()->apply(
'egw.set_account_cache', array(
- array($uid => $GLOBALS['egw']->accounts->members($uid) ),
+ array($uid => $GLOBALS['egw']->accounts->members($uid)),
'account_id'
));
}
+ $participantNames .= ($this->bo->participant_name($user_id) . "; ");
+ }
+ // add the names of all participants as semicolon-separated string
+ if($GLOBALS['egw_info']['user']['preferences']['calendar']['participant_names'])
+ {
+ $event['participant_names'] = substr($participantNames, 0, -2);
}
+
$event['date'] = $this->bo->date2string($event['start']);
// Change dates
@@ -833,43 +843,43 @@ public function merge($timespan = array())
if(!$timespan)
{
// Try to make time span into appropriate ranges to match
- if(stripos($_GET['merge'],'month') !== false || stripos($_GET['merge'],lang('month')) !== false) $template = 'month';
- if(stripos($_GET['merge'],'week') !== false || stripos($_GET['merge'],lang('week')) !== false) $template = 'week';
+ if(stripos($_GET['merge'], 'month') !== false || stripos($_GET['merge'], lang('month')) !== false) $template = 'month';
+ if(stripos($_GET['merge'], 'week') !== false || stripos($_GET['merge'], lang('week')) !== false) $template = 'week';
//error_log("Detected template $template");
- switch ($template)
+ switch($template)
{
case 'month':
// Trim to _only_ the month, do not pad to week start / end
$time = new Api\DateTime($this->date);
$timespan = array(array(
- 'start' => Api\DateTime::to($time->format('Y-m-01 00:00:00'),'ts'),
- 'end' => Api\DateTime::to($time->format('Y-m-t 23:59:59'),'ts')
- ));
+ 'start' => Api\DateTime::to($time->format('Y-m-01 00:00:00'), 'ts'),
+ 'end' => Api\DateTime::to($time->format('Y-m-t 23:59:59'), 'ts')
+ ));
break;
case 'week':
$timespan = array();
$start = new Api\DateTime($this->first);
$t = clone $start;
$t->modify('+1 week')->modify('-1 second');
- if($t->format('ts') < Api\DateTime::to($this->last,'ts'))
+ if($t->format('ts') < Api\DateTime::to($this->last, 'ts'))
{
do
{
$timespan[] = array(
'start' => $start->format('ts'),
- 'end' => $t->format('ts')
+ 'end' => $t->format('ts')
);
$start->modify('+1 week');
$t->modify('+1 week');
- } while( $start->format('ts') < $this->last);
+ } while($start->format('ts') < $this->last);
break;
}
- // Fall through
+ // Fall through
default:
$timespan = array(array(
- 'start' => is_array($this->first) ? $this->bo->date2ts($this->first) : $this->first,
- 'end' => is_array($this->last) ? $this->bo->date2ts($this->last) : $this->last
- ));
+ 'start' => is_array($this->first) ? $this->bo->date2ts($this->first) : $this->first,
+ 'end' => is_array($this->last) ? $this->bo->date2ts($this->last) : $this->last
+ ));
}
}
$document = $_GET['merge'];
@@ -882,7 +892,7 @@ public function merge($timespan = array())
{
return false;
}
- else if (!$error)
+ else if(!$error)
{
//error_log($_GET['merge'] . ' Timespan: ');foreach($timespan as $t) error_log(Api\DateTime::to($t['start']) . ' - ' . Api\DateTime::to($t['end']));
$error = $merge->download($document, $timespan, '', $GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir']);
@@ -896,7 +906,7 @@ public function merge($timespan = array())
// This doesn't give message either, but at least it doesn't give a blank screen
Framework::redirect_link('/index.php', array(
'msg' => $error,
- 'cd' => 'yes'
+ 'cd' => 'yes'
));
}
}
@@ -912,28 +922,27 @@ protected function merge_collabora($document, $timespan)
$editable_mimes = array();
try
{
- if (class_exists('EGroupware\\collabora\\Bo') &&
- $GLOBALS['egw_info']['user']['apps']['collabora'] &&
- $discovery = \EGroupware\collabora\Bo::discover()
+ if(class_exists('EGroupware\\collabora\\Bo') &&
+ $GLOBALS['egw_info']['user']['apps']['collabora'] &&
+ $discovery = \EGroupware\collabora\Bo::discover()
)
{
$editable_mimes = $discovery;
}
- }
- catch (\Exception $e)
+ } catch(\Exception $e)
{
return false;
}
$timespan = json_encode($timespan);
- if ($editable_mimes[$file['mime']])
+ if($editable_mimes[$file['mime']])
{
Framework::popup(Framework::link('/index.php', array(
'menuaction' => 'collabora.EGroupware\\collabora\\Ui.merge_edit',
'document' => $document,
'merge' => 'calendar_merge',
'id' => $timespan
- )),'_blank',false);
+ )), '_blank', false);
return true;
}
diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js
index de5b480edcc..26f60bfb10f 100644
--- a/calendar/js/et2_widget_event.js
+++ b/calendar/js/et2_widget_event.js
@@ -69,7 +69,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
this.div = jQuery(document.createElement("div"))
.addClass("calendar_calEvent")
.addClass(this.options.class)
- .css('width',this.options.width)
+ .css('width', this.options.width)
.on('mouseenter', function() {
// Bind actions on first mouseover for faster creation
if(event._need_actions_linked)
@@ -89,22 +89,22 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
// Hacky to remove egw's tooltip border and let the mouse in
window.setTimeout(function() {
jQuery('body .egw_tooltip')
- .css('border','none')
+ .css('border', 'none')
.on('mouseenter', function() {
event.div.off('mouseleave.tooltip');
jQuery('body.egw_tooltip').remove();
jQuery('body').append(this);
jQuery(this).stop(true).fadeTo(400, 1)
- .on('mouseleave', function() {
- jQuery(this).fadeOut('400', function() {
- jQuery(this).remove();
- // Set up to work again
- event.set_statustext(event._tooltip());
- });
- });
+ .on('mouseleave', function() {
+ jQuery(this).fadeOut('400', function() {
+ jQuery(this).remove();
+ // Set up to work again
+ event.set_statustext(event._tooltip());
+ });
+ });
});
- },105);
+ }, 105);
});
this.title = jQuery(document.createElement('div'))
.addClass("calendar_calEventHeader")
@@ -128,7 +128,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
if(this.options.value && this.options.value.row_id)
{
egw.dataRegisterUID(
- 'calendar::'+this.options.value.row_id,
+ 'calendar::' + this.options.value.row_id,
this._UID_callback,
this,
this.getInstanceManager().execId,
@@ -162,7 +162,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
if(this.options.value)
{
var old_app_id = this.options.value.row_id;
- egw.dataUnregisterUID('calendar::'+old_app_id,false,this);
+ egw.dataUnregisterUID('calendar::' + old_app_id, false, this);
}
},
@@ -173,7 +173,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
var old_id = this.options.value.row_id;
if(!_value || !_value.row_id || old_id !== _value.row_id)
{
- egw.dataUnregisterUID('calendar::'+old_id,false,this);
+ egw.dataUnregisterUID('calendar::' + old_id, false, this);
}
}
this.options.value = _value;
@@ -182,11 +182,11 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
var id = this.options.value.row_id;
if(!old_id || old_id !== id)
{
- egw.dataRegisterUID('calendar::'+id, this._UID_callback ,this,this.getInstanceManager().execId,this.id);
+ egw.dataRegisterUID('calendar::' + id, this._UID_callback, this, this.getInstanceManager().execId, this.id);
}
- if(_value && !egw.dataHasUID('calendar::'+id))
+ if(_value && !egw.dataHasUID('calendar::' + id))
{
- egw.dataStoreUID('calendar::'+id, _value);
+ egw.dataStoreUID('calendar::' + id, _value);
}
},
@@ -195,7 +195,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
*/
_UID_callback: function _UID_callback(event) {
// Copy to avoid changes, which may cause nm problems
- var value = event === null ? null : jQuery.extend({},event);
+ var value = event === null ? null : jQuery.extend({}, event);
let parent = this.getParent();
let parent_owner = parent.getDOMNode(parent).dataset['owner'] || parent.getParent().options.owner;
@@ -221,7 +221,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
}
// Copy to avoid changes, which may cause nm problems
- this.options.value = jQuery.extend({},value);
+ this.options.value = jQuery.extend({}, value);
if(this._parent.options.date)
{
@@ -246,7 +246,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
// Update to reflect new information
var event = this.options.value;
- var id = event.row_id ? event.row_id : event.id + (event.recur_type ? ':'+event.recur_date : '');
+ var id = event.row_id ? event.row_id : event.id + (event.recur_type ? ':' + event.recur_date : '');
var formatted_start = event.start.toJSON();
this.set_id('event_' + id);
@@ -262,9 +262,11 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
// immediately.
var im = this.getInstanceManager();
et2_selectbox.cat_options({
- _type:'select-cat',
- getInstanceManager: function() {return im}
- }, {application:event.app||'calendar'});
+ _type: 'select-cat',
+ getInstanceManager: function() {
+ return im
+ }
+ }, {application: event.app || 'calendar'});
// Need cleaning? (DnD helper removes content)
if(!this.div.has(this.title).length)
@@ -278,7 +280,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
{
this.div
// Let timegrid always get the drag
- .droppable('option','greedy',false);
+ .droppable('option', 'greedy', false);
}
// DOM nodes
this.div
@@ -292,11 +294,11 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
.attr('data-start', formatted_start)
.attr('data-owner', event.owner)
.attr('data-recur_type', event.recur_type)
- .attr('data-resize', event.whole_day ? 'WD' : '' + (event.recur_type ? 'S':''))
+ .attr('data-resize', event.whole_day ? 'WD' : '' + (event.recur_type ? 'S' : ''))
.attr('data-priority', event.priority)
// Remove any category classes
.removeClass(function(index, css) {
- return (css.match (/(^|\s)cat_\S+/g) || []).join(' ');
+ return (css.match(/(^|\s)cat_\S+/g) || []).join(' ');
})
// Remove any status classes
.removeClass(function(index, css) {
@@ -327,14 +329,15 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
var title = !event.is_private ? egw.htmlspecialchars(event['title']) : egw.lang('private');
this.title
- .html(''+this._get_timespan(event) + '
')
- .append(''+title+'')
+ .html('' + this._get_timespan(event) + '
')
+ .append('' + this._getTitle(event) + '')
// Colors - don't make them transparent if there is no color
- if(jQuery.Color("rgba(0,0,0,0)").toRgbaString() != jQuery.Color(this.div,'background-color').toRgbaString())
+ if(jQuery.Color("rgba(0,0,0,0)").toRgbaString() != jQuery.Color(this.div, 'background-color')
+ .toRgbaString())
{
// Most statuses use colored borders
- this.div.css('border-color',this.div.css('background-color') );
+ this.div.css('border-color', this.div.css('background-color'));
}
this.icons.appendTo(this.title)
@@ -343,7 +346,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
// Body
if(event.whole_day_on_top)
{
- this.body.html(title);
+ this.body.html(this._getTitle(event));
}
else
{
@@ -359,12 +362,12 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
).trim();
this.body
- .html(''+title+'')
- .append(''+start_time + '');
+ .html('' + this._getTitle(event) + '')
+ .append('' + start_time + '');
if(this.options.value.description.trim())
{
this.body
- .append('
'+type_name+':
';
+ participants += '
' + type_name + ':
';
participants += this.options.value.participant_types[type_name].join("
");
}
}
- return '