ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 @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
 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] does belong to the parent 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...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 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)
 
 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 ()
 
 createActionDispatcherGUI ()
 
 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...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 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...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 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...
 
 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...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

ilCalendarSettings $calendar_settings
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
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 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
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Detailed Description

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
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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 410 of file class.ilObjCalendarSettingsGUI.php.

410 : array
411 {
412 switch ($a_form_id) {
414
415 $this->initCalendarSettings();
416
417 $fields = array();
418
419 $subitems = array(
420 'cal_setting_global_crs_act' => [
421 $this->calendar_settings->isCourseCalendarEnabled(),
423 ],
424 'cal_setting_global_crs_vis' =>
425 array($this->calendar_settings->isCourseCalendarVisible(),
427 ),
428
429 );
430 $fields['cal_setting_global_vis_repos'] = array(null, null, $subitems);
431
432 $subitems = array(
433 'cal_notification_crsgrp' => array($this->calendar_settings->isNotificationEnabled(),
435 ),
436 'cal_notification_users' => array($this->calendar_settings->isUserNotificationEnabled(),
438 )
439 );
440 $fields['cal_notification'] = array(null, null, $subitems);
441
442 $fields['cal_cg_registrations'] = array($this->calendar_settings->isCGRegistrationEnabled(),
444 );
445
446 return array(array("settings", $fields));
447
449
450 $this->initCalendarSettings();
451
452 $fields = array();
453
454 $subitems = array(
455 'cal_setting_global_grp_act' => [
456 $this->calendar_settings->isGroupCalendarEnabled(),
458 ],
459 'cal_setting_global_grp_vis' =>
460 array($this->calendar_settings->isGroupCalendarVisible(),
462 ),
463
464 );
465
466 $fields['cal_setting_global_vis_repos'] = array(null, null, $subitems);
467
468 $subitems = array(
469 'cal_notification_crsgrp' => array($this->calendar_settings->isNotificationEnabled(),
471 ),
472 'cal_notification_users' => array($this->calendar_settings->isUserNotificationEnabled(),
474 )
475 );
476 $fields['cal_notification'] = array(null, null, $subitems);
477
478 $fields['cal_cg_registrations'] = array($this->calendar_settings->isCGRegistrationEnabled(),
480 );
481
482 return array(array("settings", $fields));
483 }
484 return [];
485 }

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)

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 154 of file class.ilObjCalendarSettingsGUI.php.

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

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 163 of file class.ilObjCalendarSettingsGUI.php.

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

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->enableCourseCalendar((bool) $form->getInput('enabled_crs'));
124 $this->calendar_settings->setCourseCalendarVisible((bool) $form->getInput('visible_crs'));
125 $this->calendar_settings->enableGroupCalendar((bool) $form->getInput('enabled_grp'));
126 $this->calendar_settings->setGroupCalendarVisible((bool) $form->getInput('visible_grp'));
127 $this->calendar_settings->setDefaultDayStart((int) $form->getInput('dst'));
128 $this->calendar_settings->setDefaultDayEnd((int) $form->getInput('den'));
129 $this->calendar_settings->enableSynchronisationCache((bool) $form->getInput('sync_cache'));
130 $this->calendar_settings->setSynchronisationCacheMinutes((int) $form->getInput('sync_cache_time'));
131 $this->calendar_settings->setCacheMinutes((int) $form->getInput('cache_time'));
132 $this->calendar_settings->useCache((bool) $form->getInput('cache'));
133 $this->calendar_settings->enableNotification((bool) $form->getInput('cn'));
134 $this->calendar_settings->enableUserNotification((bool) $form->getInput('cnu'));
135 $this->calendar_settings->enableConsultationHours((bool) $form->getInput('ch'));
136 $this->calendar_settings->enableCGRegistration((bool) $form->getInput('cgr'));
137 $this->calendar_settings->enableWebCalSync((bool) $form->getInput('webcal'));
138 $this->calendar_settings->setWebCalSyncHours((int) $form->getInput('webcal_hours'));
139 $this->calendar_settings->setShowWeeks((bool) $form->getInput('show_weeks'));
140 $this->calendar_settings->enableBatchFileDownloads((bool) $form->getInput('batch_files'));
141 $this->calendar_settings->setDefaultCal((int) $form->getInput('default_calendar_view'));
142 $this->calendar_settings->setDefaultPeriod((int) $form->getInput('default_period'));
143 $this->calendar_settings->save();
144 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
145 $this->ctrl->redirect($this, 'settings');
146 }
147 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'), true);
148 $this->settings($form);
149 }
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', 'components/ILIAS/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: