46 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
53 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
56 $this->lng->loadLanguageModule(
'dateplaner');
57 $this->lng->loadLanguageModule(
'jscalendar');
71 $ilAccess = $DIC[
'ilAccess'];
73 $next_class = $this->ctrl->getNextClass($this);
74 $cmd = $this->ctrl->getCmd();
78 if (!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId())) {
79 $ilErr->raiseError($this->lng->txt(
'no_permission'),
$ilErr->WARNING);
82 switch ($next_class) {
83 case 'ilpermissiongui':
84 $this->tabs_gui->setTabActive(
'perm_settings');
85 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
87 $ret = &$this->ctrl->forwardCommand($perm_gui);
91 $this->tabs_gui->setTabActive(
'settings');
93 if (!$cmd || $cmd ==
'view') {
114 $rbacsystem = $DIC[
'rbacsystem'];
115 $ilAccess = $DIC[
'ilAccess'];
117 if ($ilAccess->checkAccess(
"read",
'', $this->object->getRefId())) {
118 $this->tabs_gui->addTarget(
120 $this->ctrl->getLinkTarget($this,
"settings"),
121 array(
"settings",
"view")
125 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->object->getRefId())) {
126 $this->tabs_gui->addTarget(
128 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
142 $this->tabs_gui->setTabActive(
'settings');
144 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.settings.html',
'Services/Calendar');
145 $this->tpl->setVariable(
'CAL_SETTINGS', $this->form->getHTML());
159 $this->
settings->setDefaultWeekStart((
int) $_POST[
'default_week_start']);
161 $this->
settings->setDefaultDateFormat((
int) $_POST[
'default_date_format']);
162 $this->
settings->setDefaultTimeFormat((
int) $_POST[
'default_time_format']);
163 $this->
settings->setEnableGroupMilestones((
int) $_POST[
'enable_grp_milestones']);
164 $this->
settings->enableCourseCalendar((
int) $_POST[
'visible_crs']);
165 $this->
settings->enableGroupCalendar((
int) $_POST[
'visible_grp']);
166 $this->
settings->setDefaultDayStart((
int) $_POST[
'dst']);
167 $this->
settings->setDefaultDayEnd((
int) $_POST[
'den']);
168 $this->
settings->enableSynchronisationCache((
bool) $_POST[
'sync_cache']);
169 $this->
settings->setSynchronisationCacheMinutes((
int) $_POST[
'sync_cache_time']);
170 $this->
settings->setCacheMinutes((
int) $_POST[
'cache_time']);
171 $this->
settings->useCache((
bool) $_POST[
'cache']);
172 $this->
settings->enableNotification((
bool) $_POST[
'cn']);
173 $this->
settings->enableUserNotification((
bool) $_POST[
'cnu']);
174 $this->
settings->enableConsultationHours((
bool) $_POST[
'ch']);
175 $this->
settings->enableCGRegistration((
bool) $_POST[
'cgr']);
176 $this->
settings->enableWebCalSync((
bool) $_POST[
'webcal']);
177 $this->
settings->setWebCalSyncHours((
int) $_POST[
'webcal_hours']);
178 $this->
settings->setShowWeeks((
int) $_POST[
'show_weeks']);
179 $this->
settings->enableBatchFileDownloads((
bool) $_POST[
'batch_files']);
181 if (((
int) $_POST[
'den']) < (
int) $_POST[
'dst']) {
189 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
200 include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
211 if (is_object($this->form)) {
216 $this->form->setFormAction($this->ctrl->getFormAction($this));
217 $this->form->setTitle($this->lng->txt(
'cal_global_settings'));
221 $this->form->addCommandButton(
'save', $this->lng->txt(
'save'));
226 $check->setChecked($this->
settings->isEnabled() ? true :
false);
227 $this->form->addItem($check);
231 $this->form->addItem($server_tz);
233 $select =
new ilSelectInputGUI($this->lng->txt(
'cal_def_timezone'),
'default_timezone');
235 $select->setInfo($this->lng->txt(
'cal_def_timezone_info'));
236 $select->setValue($this->
settings->getDefaultTimeZone());
237 $this->form->addItem($select);
240 $select =
new ilSelectInputGUI($this->lng->txt(
'cal_def_date_format'),
'default_date_format');
245 $select->setInfo($this->lng->txt(
'cal_def_date_format_info'));
246 $select->setValue($this->
settings->getDefaultDateFormat());
247 $this->form->addItem($select);
249 $select =
new ilSelectInputGUI($this->lng->txt(
'cal_def_time_format'),
'default_time_format');
253 $select->setInfo($this->lng->txt(
'cal_def_time_format_info'));
254 $select->setValue($this->
settings->getDefaultTimeFormat());
255 $this->form->addItem($select);
262 $radio->addOption($option);
264 $radio->addOption($option);
266 $this->form->addItem($radio);
270 $cb->
setInfo($this->lng->txt(
"cal_show_weeks_info"));
272 $cb->setChecked($this->
settings->getShowWeeks());
273 $this->form->addItem($cb);
277 $day_start =
new ilSelectInputGUI($this->lng->txt(
'cal_def_day_start'),
'dst');
281 $day_start->setValue($this->
settings->getDefaultDayStart());
282 $this->form->addItem($day_start);
288 $day_end->setValue($this->
settings->getDefaultDayEnd());
289 $this->form->addItem($day_end);
294 $sync->setInfo($this->lng->txt(
'cal_webcal_sync_info'));
297 $sync_min->setSize(2);
298 $sync_min->setMaxLength(3);
299 $sync_min->setValue($this->
settings->getWebCalSyncHours());
300 $sync_min->setSuffix($this->lng->txt(
'hours'));
301 $sync->addSubItem($sync_min);
303 $this->form->addItem(
$sync);
306 $batch_files_download =
new ilCheckboxInputGUI($this->lng->txt(
'cal_batch_file_downloads'),
"batch_files");
308 $batch_files_download->setChecked($this->
settings->isBatchFileDownloadsEnabled());
309 $batch_files_download->setInfo($this->lng->txt(
'cal_batch_file_downloads_info'));
310 $this->form->addItem($batch_files_download);
314 $mil->setTitle($this->lng->txt(
'cal_milestone_settings'));
315 $this->form->addItem($mil);
317 $checkm =
new ilCheckboxInputGUI($this->lng->txt(
'cal_enable_group_milestones'),
'enable_grp_milestones');
319 $checkm->setChecked($this->
settings->getEnableGroupMilestones() ? true :
false);
320 $checkm->setInfo($this->lng->txt(
'cal_enable_group_milestones_desc'));
321 $this->form->addItem($checkm);
325 $con->setTitle($this->lng->txt(
'cal_ch_form_header'));
326 $this->form->addItem($con);
329 $ch->
setInfo($this->lng->txt(
'cal_ch_form_info'));
331 $ch->setChecked($this->
settings->areConsultationHoursEnabled());
332 $this->form->addItem($ch);
336 $rep->setTitle(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_setting_global_vis_repos'));
337 $this->form->addItem($rep);
340 $crs->setInfo(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_setting_global_crs_vis_info'));
342 $crs->setInfo(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_setting_global_crs_vis_info'));
343 $crs->setChecked($this->
settings->isCourseCalendarEnabled());
344 $this->form->addItem($crs);
347 $grp->setInfo(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_setting_global_grp_vis_info'));
349 $grp->setInfo(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_setting_global_grp_vis_info'));
350 $grp->setChecked($this->
settings->isGroupCalendarEnabled());
351 $this->form->addItem($grp);
358 $not->setTitle($this->lng->txt(
'notifications'));
359 $this->form->addItem($not);
364 $cgn->setChecked($this->
settings->isNotificationEnabled());
365 $cgn->setInfo($this->lng->txt(
'cal_adm_notification_info'));
366 $this->form->addItem($cgn);
369 $cnu->setOptionTitle($this->lng->txt(
'cal_notification_users'));
371 $cnu->setChecked($this->
settings->isUserNotificationEnabled());
372 $cnu->setInfo($this->lng->txt(
'cal_adm_notification_user_info'));
373 $this->form->addItem($cnu);
378 $book->setTitle($this->lng->txt(
'cal_registrations'));
379 $this->form->addItem($book);
383 $cgn->setChecked($this->
settings->isCGRegistrationEnabled());
384 $cgn->setInfo($this->lng->txt(
'cal_cg_registration_info'));
385 $this->form->addItem($cgn);
389 $sec->setTitle($this->lng->txt(
'cal_cache_settings'));
390 $this->form->addItem($sec);
394 $cache->setInfo($this->lng->txt(
'cal_sync_cache_info'));
395 $cache->setRequired(
true);
397 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_sync_disabled'), 0);
398 $cache->addOption($sync_cache);
400 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_sync_enabled'), 1);
401 $cache->addOption($sync_cache);
404 $cache_t->setValue($this->
settings->getSynchronisationCacheMinutes());
405 $cache_t->setMinValue(0);
406 $cache_t->setSize(3);
407 $cache_t->setMaxLength(3);
408 $cache_t->setSuffix($this->lng->txt(
'form_minutes'));
409 $sync_cache->addSubItem($cache_t);
411 $this->form->addItem($cache);
416 $cache->setInfo($this->lng->txt(
'cal_cache_info'));
417 $cache->setRequired(
true);
419 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_cache_disabled'), 0);
420 $cache->addOption($sync_cache);
422 $sync_cache =
new ilRadioOption($this->lng->txt(
'cal_cache_enabled'), 1);
423 $cache->addOption($sync_cache);
426 $cache_t->setValue($this->
settings->getCacheMinutes());
427 $cache_t->setMinValue(0);
428 $cache_t->setSize(3);
429 $cache_t->setMaxLength(3);
430 $cache_t->setSuffix($this->lng->txt(
'form_minutes'));
431 $sync_cache->addSubItem($cache_t);
432 $this->form->addItem($cache);
437 switch ($a_form_id) {
445 $fields[
'cal_setting_global_vis_repos'] = array(null, null, $subitems);
451 $fields[
'cal_notification'] = array(null, null, $subitems);
455 return array(array(
"settings", $fields));
464 $fields[
'cal_setting_global_vis_repos'] = array(null, null, $subitems);
470 $fields[
'cal_notification'] = array(null, null, $subitems);
474 return array(array(
"settings", $fields));
static _getDefaultTimeZone()
Calculate and set default time zone.
This class represents an option in a radio group.
executeCommand()
Execute command.
static _getInstance()
get singleton instance
setValue($a_value)
Set Value.
static getHourSelection($a_format)
Get hour selectio depending on user specific hour format.
static _getShortTimeZoneList()
get short timezone list
addToExternalSettingsForm($a_form_id)
prepareOutput($a_show_subobjects=true)
prepare output
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Constructor.
Class ilObjectGUI Basic methods of all Output classes.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a non editable value in a property form.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
initCalendarSettings()
init calendar settings
initFormSettings()
Init settings property form.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.