ILIAS  release_8 Revision v8.24
ilObjCalendarSettingsGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ 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 @access public. More...
 
 executeCommand ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 settings (?ilPropertyFormGUI $form=null)
 
 addToExternalSettingsForm (int $a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 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 More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. 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 @access protected More...
 
 initCalendarSettings ()
 init calendar settings More...
 
 initFormSettings ()
 Init settings property form @access protected. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 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 More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $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...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

ilCalendarSettings $calendar_settings
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om @ilCtrl_Calls ilObjCalendarSettingsGUI: ilPermissionGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor @access public.

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

35 {
36 global $DIC;
37
38 $this->type = 'cals';
39 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
40 $this->initCalendarSettings();
41
42 $this->lng->loadLanguageModule('dateplaner');
43 $this->lng->loadLanguageModule('jscalendar');
44 }
initCalendarSettings()
init calendar settings
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjCalendarSettingsGUI::addToExternalSettingsForm ( int  $a_form_id)

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

422 : array
423 {
424 switch ($a_form_id) {
426
427 $this->initCalendarSettings();
428
429 $fields = array();
430
431 $subitems = array(
432 'cal_setting_global_crs_act' => [
433 $this->calendar_settings->isCourseCalendarEnabled(),
435 ],
436 'cal_setting_global_crs_vis' =>
437 array($this->calendar_settings->isCourseCalendarVisible(),
439 ),
440
441 );
442 $fields['cal_setting_global_vis_repos'] = array(null, null, $subitems);
443
444 $subitems = array(
445 'cal_notification_crsgrp' => array($this->calendar_settings->isNotificationEnabled(),
447 ),
448 'cal_notification_users' => array($this->calendar_settings->isUserNotificationEnabled(),
450 )
451 );
452 $fields['cal_notification'] = array(null, null, $subitems);
453
454 $fields['cal_cg_registrations'] = array($this->calendar_settings->isCGRegistrationEnabled(),
456 );
457
458 return array(array("settings", $fields));
459
461
462 $this->initCalendarSettings();
463
464 $fields = array();
465
466 $subitems = array(
467 'cal_setting_global_grp_act' => [
468 $this->calendar_settings->isGroupCalendarEnabled(),
470 ],
471 'cal_setting_global_grp_vis' =>
472 array($this->calendar_settings->isGroupCalendarVisible(),
474 ),
475
476 );
477
478 $fields['cal_setting_global_vis_repos'] = array(null, null, $subitems);
479
480 $subitems = array(
481 'cal_notification_crsgrp' => array($this->calendar_settings->isNotificationEnabled(),
483 ),
484 'cal_notification_users' => array($this->calendar_settings->isUserNotificationEnabled(),
486 )
487 );
488 $fields['cal_notification'] = array(null, null, $subitems);
489
490 $fields['cal_cg_registrations'] = array($this->calendar_settings->isCGRegistrationEnabled(),
492 );
493
494 return array(array("settings", $fields));
495 }
496 return [];
497 }

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

+ Here is the call graph for this function:

◆ executeCommand()

ilObjCalendarSettingsGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

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

46 : void
47 {
48 $next_class = $this->ctrl->getNextClass($this);
49 $cmd = $this->ctrl->getCmd();
50
51 $this->prepareOutput();
52
53 if (!$this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
54 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
55 }
56
57 switch ($next_class) {
58 case 'ilpermissiongui':
59 $this->tabs_gui->setTabActive('perm_settings');
60 $perm_gui = new ilPermissionGUI($this);
61 $ret = $this->ctrl->forwardCommand($perm_gui);
62 break;
63
64 default:
65 $this->tabs_gui->setTabActive('settings');
66 $this->initCalendarSettings();
67 if (!$cmd || $cmd == 'view') {
68 $cmd = "settings";
69 }
70 $this->$cmd();
71 break;
72 }
73 }
error(string $a_errmsg)
prepareOutput(bool $show_sub_objects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References ILIAS\Repository\ctrl(), error(), initCalendarSettings(), ILIAS\Repository\lng(), and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjCalendarSettingsGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

75 : void
76 {
77 if ($this->access->checkAccess("read", '', $this->object->getRefId())) {
78 $this->tabs_gui->addTarget(
79 "settings",
80 $this->ctrl->getLinkTarget($this, "settings"),
81 array("settings", "view")
82 );
83 }
84
85 if ($this->access->checkAccess('edit_permission', '', $this->object->getRefId())) {
86 $this->tabs_gui->addTarget(
87 "perm_settings",
88 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
89 array(),
90 'ilpermissiongui'
91 );
92 }
93 }

References ILIAS\Repository\access(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initCalendarSettings()

ilObjCalendarSettingsGUI::initCalendarSettings ( )
protected

init calendar settings

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

155 : void
156 {
157 $this->calendar_settings = ilCalendarSettings::_getInstance();
158 }

References ilCalendarSettings\_getInstance().

Referenced by __construct(), addToExternalSettingsForm(), and executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjCalendarSettingsGUI::initFormSettings ( )
protected

Init settings property form @access protected.

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

165 {
166 $form = new ilPropertyFormGUI();
167 $form->setFormAction($this->ctrl->getFormAction($this));
168 $form->setTitle($this->lng->txt('cal_global_settings'));
169
170 if ($this->checkPermissionBool('write')) {
171 $form->addCommandButton('save', $this->lng->txt('save'));
172 }
173
174 $check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable');
175 $check->setValue('1');
176 $check->setChecked($this->calendar_settings->isEnabled() ? true : false);
177 $form->addItem($check);
178
179 // show weeks
180 $cb = new ilCheckboxInputGUI($this->lng->txt("cal_def_show_weeks"), "show_weeks");
181 $cb->setInfo($this->lng->txt("cal_show_weeks_info"));
182 $cb->setValue('1');
183 $cb->setChecked($this->calendar_settings->getShowWeeks());
184 $form->addItem($cb);
185
188 $form,
189 $this
190 );
191
192 //Batch File Downloads in Calendar
193 $batch_files_download = new ilCheckboxInputGUI($this->lng->txt('cal_batch_file_downloads'), "batch_files");
194 $batch_files_download->setValue('1');
195 $batch_files_download->setChecked($this->calendar_settings->isBatchFileDownloadsEnabled());
196 $batch_files_download->setInfo($this->lng->txt('cal_batch_file_downloads_info'));
197 $form->addItem($batch_files_download);
198
199 $def = new ilFormSectionHeaderGUI();
200 $def->setTitle($this->lng->txt('cal_default_settings'));
201 $form->addItem($def);
202
203 $server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz'));
204 $server_tz->setValue(ilTimeZone::_getDefaultTimeZone());
205 $form->addItem($server_tz);
206
207 $select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone');
208 $select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
209 $select->setInfo($this->lng->txt('cal_def_timezone_info'));
210 $select->setValue($this->calendar_settings->getDefaultTimeZone());
211 $form->addItem($select);
212
213 $year = date("Y");
214 $select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format');
215 $select->setOptions(array(
216 ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year,
217 ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31",
218 ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year
219 ));
220 $select->setInfo($this->lng->txt('cal_def_date_format_info'));
221 $select->setValue($this->calendar_settings->getDefaultDateFormat());
222 $form->addItem($select);
223
224 $select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format');
225 $select->setOptions(array(
228 ));
229 $select->setInfo($this->lng->txt('cal_def_time_format_info'));
230 $select->setValue($this->calendar_settings->getDefaultTimeFormat());
231 $form->addItem($select);
232
233 // Weekstart
234 $radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start');
235 $radio->setValue((string) $this->calendar_settings->getDefaultWeekStart());
236
237 $option = new ilRadioOption($this->lng->txt('l_su'), '0');
238 $radio->addOption($option);
239 $option = new ilRadioOption($this->lng->txt('l_mo'), '1');
240 $radio->addOption($option);
241
242 $form->addItem($radio);
243
244 $default_cal_view = new ilRadioGroupInputGUI($this->lng->txt('cal_def_view'), 'default_calendar_view');
245
246 $option = new ilRadioOption($this->lng->txt("day"), (string) ilCalendarSettings::DEFAULT_CAL_DAY);
247 $default_cal_view->addOption($option);
248 $option = new ilRadioOption($this->lng->txt("week"), (string) ilCalendarSettings::DEFAULT_CAL_WEEK);
249 $default_cal_view->addOption($option);
250 $option = new ilRadioOption($this->lng->txt("month"), (string) ilCalendarSettings::DEFAULT_CAL_MONTH);
251 $default_cal_view->addOption($option);
252
253 $option = new ilRadioOption($this->lng->txt("cal_list"), (string) ilCalendarSettings::DEFAULT_CAL_LIST);
254
255 $list_views = new ilSelectInputGUI($this->lng->txt("cal_list"), "default_period");
256 $list_views->setOptions([
257 ilCalendarAgendaListGUI::PERIOD_DAY => "1 " . $this->lng->txt("day"),
258 ilCalendarAgendaListGUI::PERIOD_WEEK => "1 " . $this->lng->txt("week"),
259 ilCalendarAgendaListGUI::PERIOD_MONTH => "1 " . $this->lng->txt("month"),
260 ilCalendarAgendaListGUI::PERIOD_HALF_YEAR => "6 " . $this->lng->txt("months")
261 ]);
262
263 $list_views->setValue($this->calendar_settings->getDefaultPeriod());
264 $option->addSubItem($list_views);
265 $default_cal_view->addOption($option);
266 $default_cal_view->setValue((string) $this->calendar_settings->getDefaultCal());
267
268 $form->addItem($default_cal_view);
269
270 // Day start
271 $day_start = new ilSelectInputGUI($this->lng->txt('cal_def_day_start'), 'dst');
272 $day_start->setOptions(
273 ilCalendarUtil::getHourSelection($this->calendar_settings->getDefaultTimeFormat())
274 );
275 $day_start->setValue($this->calendar_settings->getDefaultDayStart());
276 $form->addItem($day_start);
277
278 $day_end = new ilSelectInputGUI($this->lng->txt('cal_def_day_end'), 'den');
279 $day_end->setOptions(
280 ilCalendarUtil::getHourSelection($this->calendar_settings->getDefaultTimeFormat())
281 );
282 $day_end->setValue($this->calendar_settings->getDefaultDayEnd());
283 $form->addItem($day_end);
284
285 // enable milestone planning in groups
286 $mil = new ilFormSectionHeaderGUI();
287 $mil->setTitle($this->lng->txt('cal_milestone_settings'));
288 $form->addItem($mil);
289
290 $checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones');
291 $checkm->setValue('1');
292 $checkm->setChecked($this->calendar_settings->getEnableGroupMilestones());
293 $checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc'));
294 $form->addItem($checkm);
295
296 // Consultation hours
297 $con = new ilFormSectionHeaderGUI();
298 $con->setTitle($this->lng->txt('cal_ch_form_header'));
299 $form->addItem($con);
300
301 $ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch');
302 $ch->setInfo($this->lng->txt('cal_ch_form_info'));
303 $ch->setValue('1');
304 $ch->setChecked($this->calendar_settings->areConsultationHoursEnabled());
305 $form->addItem($ch);
306
307 // repository visibility default
308 $rep = new ilFormSectionHeaderGUI();
309 $rep->setTitle($GLOBALS['DIC']['lng']->txt('cal_setting_global_vis_repos'));
310 $form->addItem($rep);
311
312 $crs_active = new ilCheckboxInputGUI(
313 $this->lng->txt('cal_setting_global_crs_act'),
314 'enabled_crs'
315 );
316 $crs_active->setInfo($this->lng->txt('cal_setting_global_crs_act_info'));
317 $crs_active->setValue('1');
318 $crs_active->setChecked($this->calendar_settings->isCourseCalendarEnabled());
319 $form->addItem($crs_active);
320
321 $crs = new ilCheckboxInputGUI($GLOBALS['DIC']['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs');
322 $crs->setInfo($GLOBALS['DIC']['lng']->txt('cal_setting_global_crs_vis_info'));
323 $crs->setValue('1');
324 $crs->setChecked($this->calendar_settings->isCourseCalendarVisible());
325 $crs_active->addSubItem($crs);
326
327 $grp_active = new ilCheckboxInputGUI(
328 $this->lng->txt('cal_setting_global_grp_act'),
329 'enabled_grp'
330 );
331 $grp_active->setInfo($this->lng->txt('cal_setting_global_grp_act_info'));
332 $grp_active->setValue('1');
333 $grp_active->setChecked($this->calendar_settings->isGroupCalendarEnabled());
334 $form->addItem($grp_active);
335
336 $grp = new ilCheckboxInputGUI($GLOBALS['DIC']['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp');
337 $grp->setInfo($GLOBALS['DIC']['lng']->txt('cal_setting_global_grp_vis_info'));
338 $grp->setValue('1');
339 $grp->setInfo($GLOBALS['DIC']['lng']->txt('cal_setting_global_grp_vis_info'));
340 $grp->setChecked($this->calendar_settings->isGroupCalendarVisible());
341 $grp_active->addSubItem($grp);
342
343 // Notifications
344 $not = new ilFormSectionHeaderGUI();
345 $not->setTitle($this->lng->txt('notifications'));
346 $form->addItem($not);
347
348 $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_notification'), 'cn');
349 $cgn->setOptionTitle($this->lng->txt('cal_notification_crsgrp'));
350 $cgn->setValue('1');
351 $cgn->setChecked($this->calendar_settings->isNotificationEnabled());
352 $cgn->setInfo($this->lng->txt('cal_adm_notification_info'));
353 $form->addItem($cgn);
354
355 $cnu = new ilCheckboxInputGUI('', 'cnu');
356 $cnu->setOptionTitle($this->lng->txt('cal_notification_users'));
357 $cnu->setValue('1');
358 $cnu->setChecked($this->calendar_settings->isUserNotificationEnabled());
359 $cnu->setInfo($this->lng->txt('cal_adm_notification_user_info'));
360 $form->addItem($cnu);
361
362 // Registration
363 $book = new ilFormSectionHeaderGUI();
364 $book->setTitle($this->lng->txt('cal_registrations'));
365 $form->addItem($book);
366
367 $cgn = new ilCheckboxInputGUI($this->lng->txt('cal_cg_registrations'), 'cgr');
368 $cgn->setValue('1');
369 $cgn->setChecked($this->calendar_settings->isCGRegistrationEnabled());
370 $cgn->setInfo($this->lng->txt('cal_cg_registration_info'));
371 $form->addItem($cgn);
372
373 // Synchronisation cache
374 $sec = new ilFormSectionHeaderGUI();
375 $sec->setTitle($this->lng->txt('cal_cache_settings'));
376 $form->addItem($sec);
377
378 $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_sync_cache'), 'sync_cache');
379 $cache->setValue((string) (int) $this->calendar_settings->isSynchronisationCacheEnabled());
380 $cache->setInfo($this->lng->txt('cal_sync_cache_info'));
381 $cache->setRequired(true);
382
383 $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_disabled'), '0');
384 $cache->addOption($sync_cache);
385
386 $sync_cache = new ilRadioOption($this->lng->txt('cal_sync_enabled'), '1');
387 $cache->addOption($sync_cache);
388
389 $cache_t = new ilNumberInputGUI('', 'sync_cache_time');
390 $cache_t->setValue((string) $this->calendar_settings->getSynchronisationCacheMinutes());
391 $cache_t->setMinValue(0);
392 $cache_t->setSize(3);
393 $cache_t->setMaxLength(3);
394 $cache_t->setSuffix($this->lng->txt('form_minutes'));
395 $sync_cache->addSubItem($cache_t);
396
397 $form->addItem($cache);
398
399 // Calendar cache
400 $cache = new ilRadioGroupInputGUI($this->lng->txt('cal_cache'), 'cache');
401 $cache->setValue((string) (int) $this->calendar_settings->isCacheUsed());
402 $cache->setInfo($this->lng->txt('cal_cache_info'));
403 $cache->setRequired(true);
404
405 $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_disabled'), '0');
406 $cache->addOption($sync_cache);
407
408 $sync_cache = new ilRadioOption($this->lng->txt('cal_cache_enabled'), '1');
409 $cache->addOption($sync_cache);
410
411 $cache_t = new ilNumberInputGUI('', 'cache_time');
412 $cache_t->setValue((string) $this->calendar_settings->getCacheMinutes());
413 $cache_t->setMinValue(0);
414 $cache_t->setSize(3);
415 $cache_t->setMaxLength(3);
416 $cache_t->setSuffix($this->lng->txt('form_minutes'));
417 $sync_cache->addSubItem($cache_t);
418 $form->addItem($cache);
419 return $form;
420 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$check
Definition: buildRTE.php:81
static addFieldsToForm(int $a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
static _getShortTimeZoneList()
get short timezone list
static getHourSelection(int $a_format)
Get hour selection depending on user specific hour format.
This class represents a checkbox property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a number property in a property form.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This class represents a property form user interface.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
static _getDefaultTimeZone()
Calculate and set default time zone.

References $check, $GLOBALS, ilTimeZone\_getDefaultTimeZone(), ilCalendarUtil\_getShortTimeZoneList(), ilAdministrationSettingsFormHandler\addFieldsToForm(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), 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, ilAdministrationSettingsFormHandler\FORM_CALENDAR, ilCalendarUtil\getHourSelection(), ILIAS\Repository\lng(), ilCalendarAgendaListGUI\PERIOD_DAY, ilCalendarAgendaListGUI\PERIOD_HALF_YEAR, ilCalendarAgendaListGUI\PERIOD_MONTH, ilCalendarAgendaListGUI\PERIOD_WEEK, ilCalendarSettings\TIME_FORMAT_12, and ilCalendarSettings\TIME_FORMAT_24.

Referenced by save(), and settings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilObjCalendarSettingsGUI::save ( )
protected

save settings @access protected

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

113 {
114 $this->checkPermission('write');
115
116 $form = $this->initFormSettings();
117 if ($form->checkInput()) {
118 $this->calendar_settings->setEnabled((bool) $form->getInput('enable'));
119 $this->calendar_settings->setDefaultWeekStart((int) $form->getInput('default_week_start'));
120 $this->calendar_settings->setDefaultTimeZone($form->getInput('default_timezone'));
121 $this->calendar_settings->setDefaultDateFormat((int) $form->getInput('default_date_format'));
122 $this->calendar_settings->setDefaultTimeFormat((int) $form->getInput('default_time_format'));
123 $this->calendar_settings->setEnableGroupMilestones((bool) $form->getInput('enable_grp_milestones'));
124 $this->calendar_settings->enableCourseCalendar((bool) $form->getInput('enabled_crs'));
125 $this->calendar_settings->setCourseCalendarVisible((bool) $form->getInput('visible_crs'));
126 $this->calendar_settings->enableGroupCalendar((bool) $form->getInput('enabled_grp'));
127 $this->calendar_settings->setGroupCalendarVisible((bool) $form->getInput('visible_grp'));
128 $this->calendar_settings->setDefaultDayStart((int) $form->getInput('dst'));
129 $this->calendar_settings->setDefaultDayEnd((int) $form->getInput('den'));
130 $this->calendar_settings->enableSynchronisationCache((bool) $form->getInput('sync_cache'));
131 $this->calendar_settings->setSynchronisationCacheMinutes((int) $form->getInput('sync_cache_time'));
132 $this->calendar_settings->setCacheMinutes((int) $form->getInput('cache_time'));
133 $this->calendar_settings->useCache((bool) $form->getInput('cache'));
134 $this->calendar_settings->enableNotification((bool) $form->getInput('cn'));
135 $this->calendar_settings->enableUserNotification((bool) $form->getInput('cnu'));
136 $this->calendar_settings->enableConsultationHours((bool) $form->getInput('ch'));
137 $this->calendar_settings->enableCGRegistration((bool) $form->getInput('cgr'));
138 $this->calendar_settings->enableWebCalSync((bool) $form->getInput('webcal'));
139 $this->calendar_settings->setWebCalSyncHours((int) $form->getInput('webcal_hours'));
140 $this->calendar_settings->setShowWeeks((bool) $form->getInput('show_weeks'));
141 $this->calendar_settings->enableBatchFileDownloads((bool) $form->getInput('batch_files'));
142 $this->calendar_settings->setDefaultCal((int) $form->getInput('default_calendar_view'));
143 $this->calendar_settings->setDefaultPeriod((int) $form->getInput('default_period'));
144 $this->calendar_settings->save();
145 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
146 $this->ctrl->redirect($this, 'settings');
147 }
148 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'), true);
149 $this->settings($form);
150 }
initFormSettings()
Init settings property form @access protected.
settings(?ilPropertyFormGUI $form=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), initFormSettings(), ILIAS\Repository\lng(), and settings().

+ Here is the call graph for this function:

◆ settings()

ilObjCalendarSettingsGUI::settings ( ?ilPropertyFormGUI  $form = null)

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

95 : void
96 {
97 if (!$this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
98 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
99 }
100 $this->tabs_gui->setTabActive('settings');
101 if (!$form instanceof ilPropertyFormGUI) {
102 $form = $this->initFormSettings();
103 }
104 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.settings.html', 'Services/Calendar');
105 $this->tpl->setVariable('CAL_SETTINGS', $form->getHTML());
106 }

References error(), initFormSettings(), and ILIAS\Repository\lng().

Referenced by save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $calendar_settings

ilCalendarSettings ilObjCalendarSettingsGUI::$calendar_settings
protected

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


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