ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjCalendarSettingsGUI Class Reference
+ Inheritance diagram for ilObjCalendarSettingsGUI:
+ Collaboration diagram for ilObjCalendarSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 Get tabs. More...
 
 settings ()
 Edit settings. More...
 
 addToExternalSettingsForm ($a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 save ()
 save settings More...
 
 initCalendarSettings ()
 init calendar settings More...
 
 initFormSettings ()
 Init settings property form. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $dic
 
 $settings
 
 $rbacsystem
 
 $error
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjCalendarSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Constructor.

public

Definition at line 58 of file class.ilObjCalendarSettingsGUI.php.

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

59  {
60  global $DIC;
61 
62  $this->type = 'cals';
63  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
64 
65  $this->dic = $DIC;
66  $this->error = $DIC['ilErr'];
67  $this->rbacsystem = $this->dic->rbac()->system();
68  $this->lng = $this->dic->language();
69  $this->lng->loadLanguageModule('dateplaner');
70  $this->lng->loadLanguageModule('jscalendar');
71  }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjCalendarSettingsGUI::addToExternalSettingsForm (   $a_form_id)

Definition at line 495 of file class.ilObjCalendarSettingsGUI.php.

References ilAdministrationSettingsFormHandler\FORM_COURSE, ilAdministrationSettingsFormHandler\FORM_GROUP, initCalendarSettings(), settings(), and ilAdministrationSettingsFormHandler\VALUE_BOOL.

496  {
497  switch ($a_form_id) {
499 
500  $this->initCalendarSettings();
501 
502  $fields = array();
503 
504  $subitems = array(
505  'cal_setting_global_crs_act' => [
506  $this->settings->isCourseCalendarEnabled(), ilAdministrationSettingsFormHandler::VALUE_BOOL
507  ],
508  'cal_setting_global_crs_vis' =>
509  array($this->settings->isCourseCalendarVisible(), ilAdministrationSettingsFormHandler::VALUE_BOOL),
510 
511  );
512  $fields['cal_setting_global_vis_repos'] = array(null, null, $subitems);
513 
514  $subitems = array(
515  'cal_notification_crsgrp' => array($this->settings->isNotificationEnabled(), ilAdministrationSettingsFormHandler::VALUE_BOOL),
516  'cal_notification_users' => array($this->settings->isUserNotificationEnabled(), ilAdministrationSettingsFormHandler::VALUE_BOOL)
517  );
518  $fields['cal_notification'] = array(null, null, $subitems);
519 
520  $fields['cal_cg_registrations'] = array($this->settings->isCGRegistrationEnabled(), ilAdministrationSettingsFormHandler::VALUE_BOOL);
521 
522  return array(array("settings", $fields));
523 
525 
526  $this->initCalendarSettings();
527 
528  $fields = array();
529 
530  $subitems = array(
531  'cal_setting_global_grp_act' => [
532  $this->settings->isGroupCalendarEnabled(), ilAdministrationSettingsFormHandler::VALUE_BOOL
533  ],
534  'cal_setting_global_grp_vis' =>
535  array($this->settings->isGroupCalendarVisible(), ilAdministrationSettingsFormHandler::VALUE_BOOL),
536 
537  );
538 
539  $fields['cal_setting_global_vis_repos'] = array(null, null, $subitems);
540 
541  $subitems = array(
542  'cal_notification_crsgrp' => array($this->settings->isNotificationEnabled(), ilAdministrationSettingsFormHandler::VALUE_BOOL),
543  'cal_notification_users' => array($this->settings->isUserNotificationEnabled(), ilAdministrationSettingsFormHandler::VALUE_BOOL)
544  );
545  $fields['cal_notification'] = array(null, null, $subitems);
546 
547  $fields['cal_cg_registrations'] = array($this->settings->isCGRegistrationEnabled(), ilAdministrationSettingsFormHandler::VALUE_BOOL);
548 
549  return array(array("settings", $fields));
550  }
551  }
initCalendarSettings()
init calendar settings
+ Here is the call graph for this function:

◆ executeCommand()

ilObjCalendarSettingsGUI::executeCommand ( )

Execute command.

public

Definition at line 79 of file class.ilObjCalendarSettingsGUI.php.

References $ret, initCalendarSettings(), and ilObjectGUI\prepareOutput().

80  {
81  $next_class = $this->ctrl->getNextClass($this);
82  $cmd = $this->ctrl->getCmd();
83 
84  $this->prepareOutput();
85 
86  if (!$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
87  $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
88  }
89 
90  switch ($next_class) {
91  case 'ilpermissiongui':
92  $this->tabs_gui->setTabActive('perm_settings');
93  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
94  $perm_gui = new ilPermissionGUI($this);
95  $ret = &$this->ctrl->forwardCommand($perm_gui);
96  break;
97 
98  default:
99  $this->tabs_gui->setTabActive('settings');
100  $this->initCalendarSettings();
101  if (!$cmd || $cmd == 'view') {
102  $cmd = "settings";
103  }
104 
105  $this->$cmd();
106  break;
107  }
108  return true;
109  }
prepareOutput($a_show_subobjects=true)
prepare output
$ret
Definition: parser.php:6
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
initCalendarSettings()
init calendar settings
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjCalendarSettingsGUI::getAdminTabs ( )

Get tabs.

public

Definition at line 118 of file class.ilObjCalendarSettingsGUI.php.

References $DIC, and $rbacsystem.

119  {
120  global $DIC;
121 
122  $rbacsystem = $DIC['rbacsystem'];
123  $ilAccess = $DIC['ilAccess'];
124 
125  if ($ilAccess->checkAccess("read", '', $this->object->getRefId())) {
126  $this->tabs_gui->addTarget(
127  "settings",
128  $this->ctrl->getLinkTarget($this, "settings"),
129  array("settings", "view")
130  );
131  }
132 
133  if ($ilAccess->checkAccess('edit_permission', '', $this->object->getRefId())) {
134  $this->tabs_gui->addTarget(
135  "perm_settings",
136  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
137  array(),
138  'ilpermissiongui'
139  );
140  }
141  }
global $DIC
Definition: goto.php:24

◆ initCalendarSettings()

ilObjCalendarSettingsGUI::initCalendarSettings ( )
protected

init calendar settings

protected

Definition at line 214 of file class.ilObjCalendarSettingsGUI.php.

References ilCalendarSettings\_getInstance(), and settings().

Referenced by addToExternalSettingsForm(), and executeCommand().

215  {
216  include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
218  }
static _getInstance()
get singleton instance
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjCalendarSettingsGUI::initFormSettings ( )
protected

Init settings property form.

protected

Definition at line 225 of file class.ilObjCalendarSettingsGUI.php.

References $GLOBALS, ilTimeZone\_getDefaultTimeZone(), ilCalendarUtil\_getShortTimeZoneList(), ilSubEnabledFormPropertyGUI\addSubItem(), ilObjectGUI\checkPermissionBool(), ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, ilCalendarSettings\DEFAULT_CAL_DAY, ilCalendarSettings\DEFAULT_CAL_LIST, ilCalendarSettings\DEFAULT_CAL_MONTH, ilCalendarSettings\DEFAULT_CAL_WEEK, ilCalendarUtil\getHourSelection(), ilCalendarAgendaListGUI\PERIOD_DAY, ilCalendarAgendaListGUI\PERIOD_HALF_YEAR, ilCalendarAgendaListGUI\PERIOD_MONTH, ilCalendarAgendaListGUI\PERIOD_WEEK, ilFormPropertyGUI\setInfo(), ilCheckboxInputGUI\setOptionTitle(), settings(), ilCheckboxInputGUI\setValue(), ilRadioGroupInputGUI\setValue(), ilRadioOption\setValue(), ilNonEditableValueGUI\setValue(), ilCalendarSettings\TIME_FORMAT_12, and ilCalendarSettings\TIME_FORMAT_24.

Referenced by settings().

226  {
227  if (is_object($this->form)) {
228  return true;
229  }
230 
231  $this->form = new ilPropertyFormGUI();
232  $this->form->setFormAction($this->ctrl->getFormAction($this));
233  $this->form->setTitle($this->lng->txt('cal_global_settings'));
234 
235 
236  if ($this->checkPermissionBool('write')) {
237  $this->form->addCommandButton('save', $this->lng->txt('save'));
238  }
239 
240  $check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable');
241  $check->setValue(1);
242  $check->setChecked($this->settings->isEnabled() ? true : false);
243  $this->form->addItem($check);
244 
245  // show weeks
246  $cb = new ilCheckboxInputGUI($this->lng->txt("cal_def_show_weeks"), "show_weeks");
247  $cb->setInfo($this->lng->txt("cal_show_weeks_info"));
248  $cb->setValue(1);
249  $cb->setChecked($this->settings->getShowWeeks());
250  $this->form->addItem($cb);
251 
252  $sync = new ilCheckboxInputGUI($this->lng->txt('cal_webcal_sync'), 'webcal');
253  $sync->setValue(1);
254  $sync->setChecked($this->settings->isWebCalSyncEnabled());
255  $sync->setInfo($this->lng->txt('cal_webcal_sync_info'));
256 
257  $sync_min = new ilNumberInputGUI('', 'webcal_hours');
258  $sync_min->setSize(2);
259  $sync_min->setMaxLength(3);
260  $sync_min->setValue($this->settings->getWebCalSyncHours());
261  $sync_min->setSuffix($this->lng->txt('hours'));
262  $sync->addSubItem($sync_min);
263 
264  $this->form->addItem($sync);
265 
266  //Batch File Downloads in Calendar
267  $batch_files_download = new ilCheckboxInputGUI($this->lng->txt('cal_batch_file_downloads'), "batch_files");
268  $batch_files_download->setValue(1);
269  $batch_files_download->setChecked($this->settings->isBatchFileDownloadsEnabled());
270  $batch_files_download->setInfo($this->lng->txt('cal_batch_file_downloads_info'));
271  $this->form->addItem($batch_files_download);
272 
273  $def = new ilFormSectionHeaderGUI();
274  $def->setTitle($this->lng->txt('cal_default_settings'));
275  $this->form->addItem($def);
276 
277  $server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz'));
279  $this->form->addItem($server_tz);
280 
281  $select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone');
282  $select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
283  $select->setInfo($this->lng->txt('cal_def_timezone_info'));
284  $select->setValue($this->settings->getDefaultTimeZone());
285  $this->form->addItem($select);
286 
287  $year = date("Y");
288  $select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format');
289  $select->setOptions(array(
290  ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year,
291  ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31",
292  ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year));
293  $select->setInfo($this->lng->txt('cal_def_date_format_info'));
294  $select->setValue($this->settings->getDefaultDateFormat());
295  $this->form->addItem($select);
296 
297  $select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format');
298  $select->setOptions(array(
301  $select->setInfo($this->lng->txt('cal_def_time_format_info'));
302  $select->setValue($this->settings->getDefaultTimeFormat());
303  $this->form->addItem($select);
304 
305  // Weekstart
306  $radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start');
307  $radio->setValue($this->settings->getDefaultWeekStart());
308 
309  $option = new ilRadioOption($this->lng->txt('l_su'), 0);
310  $radio->addOption($option);
311  $option = new ilRadioOption($this->lng->txt('l_mo'), 1);
312  $radio->addOption($option);
313 
314  $this->form->addItem($radio);
315 
316  $default_cal_view = new ilRadioGroupInputGUI($this->lng->txt('cal_def_view'), 'default_calendar_view');
317 
318  $option = new ilRadioOption($this->lng->txt("day"), ilCalendarSettings::DEFAULT_CAL_DAY);
319  $default_cal_view->addOption($option);
320  $option = new ilRadioOption($this->lng->txt("week"), ilCalendarSettings::DEFAULT_CAL_WEEK);
321  $default_cal_view->addOption($option);
322  $option = new ilRadioOption($this->lng->txt("month"), ilCalendarSettings::DEFAULT_CAL_MONTH);
323  $default_cal_view->addOption($option);
324 
325  $option = new ilRadioOption($this->lng->txt("cal_list"), ilCalendarSettings::DEFAULT_CAL_LIST);
326 
327  $list_views = new ilSelectInputGUI($this->lng->txt("cal_list"), "default_period");
328  $list_views->setOptions([
329  ilCalendarAgendaListGUI::PERIOD_DAY => "1 " . $this->lng->txt("day"),
330  ilCalendarAgendaListGUI::PERIOD_WEEK => "1 " . $this->lng->txt("week"),
331  ilCalendarAgendaListGUI::PERIOD_MONTH => "1 " . $this->lng->txt("month"),
332  ilCalendarAgendaListGUI::PERIOD_HALF_YEAR => "6 " . $this->lng->txt("months")
333  ]);
334 
335 
336  $list_views->setValue($this->settings->getDefaultPeriod());
337  $option->addSubItem($list_views);
338  $default_cal_view->addOption($option);
339  $default_cal_view->setValue($this->settings->getDefaultCal());
340 
341  $this->form->addItem($default_cal_view);
342 
343  // Day start
344  $day_start = new ilSelectInputGUI($this->lng->txt('cal_def_day_start'), 'dst');
345  $day_start->setOptions(
346  ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())
347  );
348  $day_start->setValue($this->settings->getDefaultDayStart());
349  $this->form->addItem($day_start);
350 
351  $day_end = new ilSelectInputGUI($this->lng->txt('cal_def_day_end'), 'den');
352  $day_end->setOptions(
353  ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())
354  );
355  $day_end->setValue($this->settings->getDefaultDayEnd());
356  $this->form->addItem($day_end);
357 
358  // enable milestone planning in groups
359  $mil = new ilFormSectionHeaderGUI();
360  $mil->setTitle($this->lng->txt('cal_milestone_settings'));
361  $this->form->addItem($mil);
362 
363  $checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones');
364  $checkm->setValue(1);
365  $checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false);
366  $checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc'));
367  $this->form->addItem($checkm);
368 
369  // Consultation hours
370  $con = new ilFormSectionHeaderGUI();
371  $con->setTitle($this->lng->txt('cal_ch_form_header'));
372  $this->form->addItem($con);
373 
374  $ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch');
375  $ch->setInfo($this->lng->txt('cal_ch_form_info'));
376  $ch->setValue(1);
377  $ch->setChecked($this->settings->areConsultationHoursEnabled());
378  $this->form->addItem($ch);
379 
380  // repository visibility default
381  $rep = new ilFormSectionHeaderGUI();
382  $rep->setTitle($GLOBALS['DIC']['lng']->txt('cal_setting_global_vis_repos'));
383  $this->form->addItem($rep);
384 
385  $crs_active = new ilCheckboxInputGUI(
386  $this->lng->txt('cal_setting_global_crs_act'),
387  'enabled_crs'
388  );
389  $crs_active->setInfo($this->lng->txt('cal_setting_global_crs_act_info'));
390  $crs_active->setValue(1);
391  $crs_active->setChecked($this->settings->isCourseCalendarEnabled());
392  $this->form->addItem($crs_active);
393 
394  $crs = new ilCheckboxInputGUI($GLOBALS['DIC']['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs');
395  $crs->setInfo($GLOBALS['DIC']['lng']->txt('cal_setting_global_crs_vis_info'));
396  $crs->setValue(1);
397  $crs->setChecked($this->settings->isCourseCalendarVisible());
398  $crs_active->addSubItem($crs);
399 
400  $grp_active = new ilCheckboxInputGUI(
401  $this->lng->txt('cal_setting_global_grp_act'),
402  'enabled_grp'
403  );
404  $grp_active->setInfo($this->lng->txt('cal_setting_global_grp_act_info'));
405  $grp_active->setValue(1);
406  $grp_active->setChecked($this->settings->isGroupCalendarEnabled());
407  $this->form->addItem($grp_active);
408 
409  $grp = new ilCheckboxInputGUI($GLOBALS['DIC']['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp');
410  $grp->setInfo($GLOBALS['DIC']['lng']->txt('cal_setting_global_grp_vis_info'));
411  $grp->setValue(1);
412  $grp->setInfo($GLOBALS['DIC']['lng']->txt('cal_setting_global_grp_vis_info'));
413  $grp->setChecked($this->settings->isGroupCalendarVisible());
414  $grp_active->addSubItem($grp);
415 
416  // Notifications
417  $not = new ilFormSectionHeaderGUI();
418  $not->setTitle($this->lng->txt('notifications'));
419  $this->form->addItem($not);
420 
421  $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_notification'), 'cn');
422  $cgn->setOptionTitle($this->lng->txt('cal_notification_crsgrp'));
423  $cgn->setValue(1);
424  $cgn->setChecked($this->settings->isNotificationEnabled());
425  $cgn->setInfo($this->lng->txt('cal_adm_notification_info'));
426  $this->form->addItem($cgn);
427 
428  $cnu = new ilCheckboxInputGUI('', 'cnu');
429  $cnu->setOptionTitle($this->lng->txt('cal_notification_users'));
430  $cnu->setValue(1);
431  $cnu->setChecked($this->settings->isUserNotificationEnabled());
432  $cnu->setInfo($this->lng->txt('cal_adm_notification_user_info'));
433  $this->form->addItem($cnu);
434 
435 
436  // Registration
437  $book = new ilFormSectionHeaderGUI();
438  $book->setTitle($this->lng->txt('cal_registrations'));
439  $this->form->addItem($book);
440 
441  $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_cg_registrations'), 'cgr');
442  $cgn->setValue(1);
443  $cgn->setChecked($this->settings->isCGRegistrationEnabled());
444  $cgn->setInfo($this->lng->txt('cal_cg_registration_info'));
445  $this->form->addItem($cgn);
446 
447  // Synchronisation cache
448  $sec = new ilFormSectionHeaderGUI();
449  $sec->setTitle($this->lng->txt('cal_cache_settings'));
450  $this->form->addItem($sec);
451 
452  $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_sync_cache'), 'sync_cache');
453  $cache->setValue((int) $this->settings->isSynchronisationCacheEnabled());
454  $cache->setInfo($this->lng->txt('cal_sync_cache_info'));
455  $cache->setRequired(true);
456 
457  $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_disabled'), 0);
458  $cache->addOption($sync_cache);
459 
460  $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_enabled'), 1);
461  $cache->addOption($sync_cache);
462 
463  $cache_t = new ilNumberInputGUI('', 'sync_cache_time');
464  $cache_t->setValue($this->settings->getSynchronisationCacheMinutes());
465  $cache_t->setMinValue(0);
466  $cache_t->setSize(3);
467  $cache_t->setMaxLength(3);
468  $cache_t->setSuffix($this->lng->txt('form_minutes'));
469  $sync_cache->addSubItem($cache_t);
470 
471  $this->form->addItem($cache);
472 
473  // Calendar cache
474  $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_cache'), 'cache');
475  $cache->setValue((int) $this->settings->isCacheUsed());
476  $cache->setInfo($this->lng->txt('cal_cache_info'));
477  $cache->setRequired(true);
478 
479  $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_disabled'), 0);
480  $cache->addOption($sync_cache);
481 
482  $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_enabled'), 1);
483  $cache->addOption($sync_cache);
484 
485  $cache_t = new ilNumberInputGUI('', 'cache_time');
486  $cache_t->setValue($this->settings->getCacheMinutes());
487  $cache_t->setMinValue(0);
488  $cache_t->setSize(3);
489  $cache_t->setMaxLength(3);
490  $cache_t->setSuffix($this->lng->txt('form_minutes'));
491  $sync_cache->addSubItem($cache_t);
492  $this->form->addItem($cache);
493  }
static _getDefaultTimeZone()
Calculate and set default time zone.
This class represents an option in a radio group.
This class represents a property form user interface.
static getHourSelection($a_format)
Get hour selectio depending on user specific hour format.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
static _getShortTimeZoneList()
get short timezone list
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
setValue($a_value)
Set Value.
This class represents a number property in a property form.
setValue($a_value)
Set Value.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
This class represents a non editable value in a property form.
setOptionTitle($a_optiontitle)
Set Option Title (optional).
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilObjCalendarSettingsGUI::save ( )
protected

save settings

protected

Definition at line 166 of file class.ilObjCalendarSettingsGUI.php.

References $_POST, ilObjectGUI\checkPermission(), ilUtil\sendFailure(), settings(), and ilUtil\stripSlashes().

167  {
168  $this->checkPermission('write');
169 
170  $this->settings->setEnabled((int) $_POST['enable']);
171  $this->settings->setDefaultWeekStart((int) $_POST['default_week_start']);
172  $this->settings->setDefaultTimeZone(ilUtil::stripSlashes($_POST['default_timezone']));
173  $this->settings->setDefaultDateFormat((int) $_POST['default_date_format']);
174  $this->settings->setDefaultTimeFormat((int) $_POST['default_time_format']);
175  $this->settings->setEnableGroupMilestones((int) $_POST['enable_grp_milestones']);
176  $this->settings->enableCourseCalendar((int) $_POST['enabled_crs']);
177  $this->settings->setCourseCalendarVisible((int) $_POST['visible_crs']);
178  $this->settings->enableGroupCalendar((int) $_POST['enabled_grp']);
179  $this->settings->setGroupCalendarVisible((int) $_POST['visible_grp']);
180  $this->settings->setDefaultDayStart((int) $_POST['dst']);
181  $this->settings->setDefaultDayEnd((int) $_POST['den']);
182  $this->settings->enableSynchronisationCache((bool) $_POST['sync_cache']);
183  $this->settings->setSynchronisationCacheMinutes((int) $_POST['sync_cache_time']);
184  $this->settings->setCacheMinutes((int) $_POST['cache_time']);
185  $this->settings->useCache((bool) $_POST['cache']);
186  $this->settings->enableNotification((bool) $_POST['cn']);
187  $this->settings->enableUserNotification((bool) $_POST['cnu']);
188  $this->settings->enableConsultationHours((bool) $_POST['ch']);
189  $this->settings->enableCGRegistration((bool) $_POST['cgr']);
190  $this->settings->enableWebCalSync((bool) $_POST['webcal']);
191  $this->settings->setWebCalSyncHours((int) $_POST['webcal_hours']);
192  $this->settings->setShowWeeks((int) $_POST['show_weeks']);
193  $this->settings->enableBatchFileDownloads((bool) $_POST['batch_files']);
194  $this->settings->setDefaultCal((int) $_POST['default_calendar_view']);
195  $this->settings->setDefaultPeriod((int) $_POST['default_period']);
196 
197  if (((int) $_POST['den']) < (int) $_POST['dst']) {
198  ilUtil::sendFailure($this->lng->txt('cal_dstart_dend_warn'));
199  $this->settings();
200  return false;
201  }
202 
203  $this->settings->save();
204 
205  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
206  $this->settings();
207  }
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.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
+ Here is the call graph for this function:

◆ settings()

ilObjCalendarSettingsGUI::settings ( )

Edit settings.

Definition at line 146 of file class.ilObjCalendarSettingsGUI.php.

References ilObjectGUI\$ilErr, and initFormSettings().

Referenced by addToExternalSettingsForm(), initCalendarSettings(), initFormSettings(), and save().

147  {
148  global $ilErr;
149 
150  if (!$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
151  $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
152  }
153 
154  $this->tabs_gui->setTabActive('settings');
155  $this->initFormSettings();
156  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.settings.html', 'Services/Calendar');
157  $this->tpl->setVariable('CAL_SETTINGS', $this->form->getHTML());
158  return true;
159  }
initFormSettings()
Init settings property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $dic

ilObjCalendarSettingsGUI::$dic
protected

Definition at line 39 of file class.ilObjCalendarSettingsGUI.php.

◆ $error

ilObjCalendarSettingsGUI::$error
protected

Definition at line 51 of file class.ilObjCalendarSettingsGUI.php.

◆ $rbacsystem

ilObjCalendarSettingsGUI::$rbacsystem
protected

Definition at line 47 of file class.ilObjCalendarSettingsGUI.php.

Referenced by getAdminTabs().

◆ $settings

ilObjCalendarSettingsGUI::$settings
protected

Definition at line 43 of file class.ilObjCalendarSettingsGUI.php.


The documentation for this class was generated from the following file: