ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjSessionGUI Class Reference
+ Inheritance diagram for ilObjSessionGUI:
+ Collaboration diagram for ilObjSessionGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 
 executeCommand ()
 
 prepareOutput (bool $show_subobjects=true)
 
 registerObject ()
 
 joinObject ()
 
 unregisterObject (bool $a_refuse_participation=false)
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 modifyItemGUI (ilObjectListGUI $a_item_list_gui, array $a_item_data, bool $a_show_path)
 
 showJoinRequestButtonInCalendar (ilToolbarGUI $a_ilToolbar)
 show join request This method is only needed to keep showJoinRequestButton method protected. More...
 
 sendFileObject ()
 
 saveObject (bool $a_redirect_on_success=true)
 
 handleFileUpload ()
 
 editObject ()
 
 updateObject ()
 
 updateSessionTypeObject ()
 change session type More...
 
 confirmDeleteFilesObject ()
 
 deleteFilesObject ()
 
 materialsObject ()
 
 applyFilter ()
 
 resetFilter ()
 
 removeMaterialsObject ()
 
 saveMaterialsObject ()
 
 postUpdateMaterials ()
 redirect to list of materials without offset/page. More...
 
 attendanceListObject ()
 
 getAttendanceListUserData (int $a_user_id, array $a_filters)
 
 eventsListObject ()
 
 afterSaveCallback (ilObject $a_obj)
 Custom callback after object is created (in parent container) More...
 
 readMemberData (array $a_usr_ids)
 Used for waiting list. More...
 
 getContainerRefId ()
 
 getDefaultMemberRole ()
 
 getLocalRoles ()
 
 createMailSignature ()
 
- 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)
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 Add desktop item public. More...
 
 removeFromDeskObject ()
 Remove from desktop public. More...
 

Static Public Member Functions

static _goto (string $a_target)
 
- 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

ilLanguage $lng
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilObjectDefinition $objDefinition
 
- 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
 

Protected Member Functions

 membersObject ()
 
 refuseParticipationObject ()
 
 showJoinRequestButton (?ilToolbarGUI $ilToolbar=null)
 
 initCreateForm ($a_new_type)
 
 saveAndAssignMaterialsObject ()
 
 createRecurringSessions (bool $a_activate_lp=true)
 
 initContainer (bool $a_init_participants=false)
 
 initAttendanceList ()
 
 printAttendanceListObject ()
 
 __showButton (string $cmd, string $text, string $target='')
 
 initForm (string $a_mode)
 
 load ()
 
 loadRecurrenceSettings ()
 
 __toUnix (array $date, array $time)
 
 addLocatorItems ()
 
 redirectToParentContentPageObject ()
 
 getTabs ()
 
 cancelEditObject ()
 
- 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 ()
 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

ILIAS DI UIServices $ui
 
ilAppEventHandler $event
 
ILIAS FileUpload FileUpload $upload
 
ilHelpGUI $help
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ilErrorHandling $ilErr
 
ilObjectService $object_service
 
ilTabsGUI $tabs_gui
 
ilLocatorGUI $locator
 
ilRbacReview $rbacreview
 
int $container_ref_id = 0
 
int $container_obj_id = 0
 
array $files = []
 
ilPropertyFormGUI $form = null
 
ilAdvancedMDRecordGUI $record_gui = null
 
ilEventRecurrence $rec = null
 
ilEventItems $event_items = null
 
ilEventParticipants $event_part = null
 
int $requested_ref_id = 0
 
int $requested_user_id = 0
 
int $requested_file_id = 0
 
int $requested_offset = 0
 
string $requested_sort_by = ""
 
string $requested_sort_order = ""
 
array $requested_items = []
 
- 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 = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 71 of file class.ilObjSessionGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\locator(), ILIAS\Repository\refinery(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), ILIAS\Repository\upload(), and ILIAS\Repository\user().

72  {
73  global $DIC;
74 
75  $this->ctrl = $DIC->ctrl();
76  $this->lng = $DIC->language();
77  $this->tpl = $DIC->ui()->mainTemplate();
78  $this->user = $DIC->user();
79  $this->tree = $DIC->repositoryTree();
80  $this->access = $DIC->access();
81  $this->toolbar = $DIC->toolbar();
82  $this->ilErr = $DIC["ilErr"];
83  $this->object_service = $DIC->object();
84  $this->objDefinition = $DIC['objDefinition'];
85  $this->tabs_gui = $DIC->tabs();
86  $this->locator = $DIC["ilLocator"];
87  $this->rbacreview = $DIC->rbac()->review();
88  $this->event = $DIC->event();
89  $this->upload = $DIC->upload();
90  $this->help = $DIC->help();
91  $this->http = $DIC->http();
92  $this->refinery = $DIC->refinery();
93 
94  $this->type = "sess";
95  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
96 
97  $this->lng->loadLanguageModule("event");
98  $this->lng->loadLanguageModule('crs');
99  $this->lng->loadLanguageModule('trac');
100  $this->lng->loadLanguageModule('sess');
101 
102  if ($this->http->wrapper()->query()->has('ref_id')) {
103  $this->requested_ref_id = $this->http->wrapper()->query()->retrieve(
104  'ref_id',
105  $this->refinery->kindlyTo()->int()
106  );
107  }
108 
109  if ($this->http->wrapper()->query()->has('user_id')) {
110  $this->requested_user_id = $this->http->wrapper()->query()->retrieve(
111  'user_id',
112  $this->refinery->kindlyTo()->int()
113  );
114  }
115 
116  if ($this->http->wrapper()->post()->has('file_id')) {
117  $this->requested_file_id = $this->http->wrapper()->post()->retrieve(
118  'file_id',
119  $this->refinery->kindlyTo()->int()
120  );
121  } elseif ($this->http->wrapper()->query()->has('file_id')) {
122  $this->requested_file_id = $this->http->wrapper()->query()->retrieve(
123  'file_id',
124  $this->refinery->kindlyTo()->int()
125  );
126  }
127 
128  if ($this->http->wrapper()->query()->has('offset')) {
129  $this->requested_offset = $this->http->wrapper()->query()->retrieve(
130  'offset',
131  $this->refinery->kindlyTo()->int()
132  );
133  }
134 
135  if ($this->http->wrapper()->query()->has('sort_by')) {
136  $this->requested_sort_by = $this->http->wrapper()->query()->retrieve(
137  'sort_by',
138  $this->refinery->kindlyTo()->string()
139  );
140  }
141 
142  if ($this->http->wrapper()->query()->has('sort_order')) {
143  $this->requested_sort_order = $this->http->wrapper()->query()->retrieve(
144  'sort_order',
145  $this->refinery->kindlyTo()->string()
146  );
147  }
148 
149  if ($this->http->wrapper()->post()->has('items')) {
150  $this->requested_items = $this->http->wrapper()->post()->retrieve(
151  'items',
152  $this->refinery->kindlyTo()->listOf(
153  $this->refinery->kindlyTo()->int()
154  )
155  );
156  }
157  $this->ui = $DIC->ui();
158  }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ __showButton()

ilObjSessionGUI::__showButton ( string  $cmd,
string  $text,
string  $target = '' 
)
protected

Definition at line 1473 of file class.ilObjSessionGUI.php.

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

Referenced by eventsListObject().

1473  : void
1474  {
1475  $this->toolbar->addButton($text, $this->ctrl->getLinkTarget($this, $cmd), $target);
1476  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __toUnix()

ilObjSessionGUI::__toUnix ( array  $date,
array  $time 
)
protected

Definition at line 1850 of file class.ilObjSessionGUI.php.

1850  : int
1851  {
1852  return mktime($time['h'], $time['m'], 0, $date['m'], $date['d'], $date['y']);
1853  }

◆ _goto()

static ilObjSessionGUI::_goto ( string  $a_target)
static

Definition at line 455 of file class.ilObjSessionGUI.php.

References $DIC, $parts, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ILIAS\Repository\int(), ROOT_FOLDER_ID, and ilLanguage\txt().

455  : void
456  {
457  global $DIC;
458  $main_tpl = $DIC->ui()->mainTemplate();
459 
460  $ilAccess = $DIC->access();
461  $lng = $DIC->language();
462 
463  $ilCtrl = $DIC->ctrl();
464  $parts = explode('_', $a_target);
465  $a_target = (int) $parts[0];
466 
467  if ($ilAccess->checkAccess('write', '', $a_target)) {
468  if (isset($parts[1]) && 'part' === $parts[1]) {
469  $ilCtrl->setTargetScript('ilias.php');
470  $ilCtrl->setParameterByClass('ilSessionMembershipGUI', 'ref_id', $a_target);
471  $ilCtrl->setTargetScript('ilias.php');
472  $ilCtrl->redirectByClass(array('ilRepositoryGUI', __CLASS__, 'ilSessionMembershipGUI'));
473  }
474  }
475 
476  if ($ilAccess->checkAccess('visible', "", $a_target)) {
477  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
478  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
479  $main_tpl->setOnScreenMessage('failure', sprintf(
480  $lng->txt("msg_no_perm_read_item"),
482  ), true);
484  }
485  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const ROOT_FOLDER_ID
Definition: constants.php:32
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
static _gotoRepositoryNode(int $ref_id, string $cmd="")
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSessionGUI::addLocatorItems ( )
protected

Definition at line 1855 of file class.ilObjSessionGUI.php.

References $locator, $requested_ref_id, ilLocatorGUI\addItem(), ILIAS\Repository\ctrl(), ilObjectGUI\getCreationMode(), and ILIAS\Repository\object().

1855  : void
1856  {
1857  $ilLocator = $this->locator;
1858 
1859  if (!$this->getCreationMode()) {
1860  // see prepareOutput()
1861  $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
1862  $title = $this->object->getFirstAppointment()->appointmentToString() . $title;
1863 
1864  $ilLocator->addItem($title, $this->ctrl->getLinkTarget($this, "infoScreen"), "", $this->requested_ref_id);
1865  }
1866  }
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
+ Here is the call graph for this function:

◆ afterSaveCallback()

ilObjSessionGUI::afterSaveCallback ( ilObject  $a_obj)

Custom callback after object is created (in parent container)

Definition at line 1993 of file class.ilObjSessionGUI.php.

References ilEventItems\addItem(), ilObject\getRefId(), ILIAS\Repository\object(), and ilEventItems\update().

1993  : void
1994  {
1995  // add new object to materials
1996  $event_items = new ilEventItems($this->object->getId());
1997  $event_items->addItem($a_obj->getRefId());
1998  $event_items->update();
1999  }
addItem(int $a_item_ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ applyFilter()

ilObjSessionGUI::applyFilter ( )

Definition at line 1230 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\ctrl().

1230  : void
1231  {
1232  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1233  $tbl->writeFilterToSession(); // writes filter to session
1234  $tbl->resetOffset(); // sets record offest to 0 (first page)
1235  $this->ctrl->redirect($this, "materials");
1236  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ attendanceListObject()

ilObjSessionGUI::attendanceListObject ( )

Definition at line 1285 of file class.ilObjSessionGUI.php.

References $tabs_gui, $tpl, ilObjectGUI\checkPermission(), ilPropertyFormGUI\getHTML(), initAttendanceList(), and ilGlobalTemplateInterface\setContent().

1285  : void
1286  {
1287  $tpl = $this->tpl;
1288  $ilTabs = $this->tabs_gui;
1289 
1290  $this->checkPermission('manage_members');
1291  $ilTabs->setTabActive('event_edit_members');
1292 
1293  $list = $this->initAttendanceList();
1294  $form = $list->initForm('printAttendanceList');
1296  }
setContent(string $a_html)
Sets content for standard template.
ilPropertyFormGUI $form
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ cancelEditObject()

ilObjSessionGUI::cancelEditObject ( )
protected

Definition at line 2021 of file class.ilObjSessionGUI.php.

References $ctrl, $tree, and ilTree\getParentId().

2021  : void
2022  {
2023  $ilCtrl = $this->ctrl;
2024  $tree = $this->tree;
2025 
2026  $parent_id = $tree->getParentId($this->requested_ref_id);
2027 
2028  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent_id);
2029 
2030  $ilCtrl->redirectByClass("ilrepositorygui", "");
2031  }
getParentId(int $a_node_id)
get parent id of given node
+ Here is the call graph for this function:

◆ confirmDeleteFilesObject()

ilObjSessionGUI::confirmDeleteFilesObject ( )

Definition at line 1102 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\ctrl(), editObject(), and ILIAS\Repository\lng().

1102  : bool
1103  {
1104  $this->tabs_gui->setTabActive('settings');
1105 
1106  if (!count($this->requested_file_id)) {
1107  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1108  $this->editObject();
1109  return false;
1110  }
1111 
1112  $c_gui = new ilConfirmationGUI();
1113 
1114  // set confirm/cancel commands
1115  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteFiles"));
1116  $c_gui->setHeaderText($this->lng->txt("info_delete_sure"));
1117  $c_gui->setCancel($this->lng->txt("cancel"), "edit");
1118  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteFiles");
1119 
1120  // add items to delete
1121  foreach ($this->requested_file_id as $file_id) {
1122  $file = new ilSessionFile($file_id);
1123  if ($file->getSessionId() != $this->object->getEventId()) {
1124  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1125  $this->editObject();
1126  return false;
1127  }
1128  $c_gui->addItem("file_id[]", $file_id, $file->getFileName());
1129  }
1130 
1131  $this->tpl->setContent($c_gui->getHTML());
1132  return true;
1133  }
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...
+ Here is the call graph for this function:

◆ createMailSignature()

ilObjSessionGUI::createMailSignature ( )

Definition at line 2058 of file class.ilObjSessionGUI.php.

References ilLink\_getLink(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

2058  : string
2059  {
2060  $link = chr(13) . chr(10) . chr(13) . chr(10);
2061  $link .= $this->lng->txt('sess_mail_permanent_link');
2062  $link .= chr(13) . chr(10) . chr(13) . chr(10);
2063  $link .= ilLink::_getLink($this->object->getRefId());
2064  return rawurlencode(base64_encode($link));
2065  }
+ Here is the call graph for this function:

◆ createRecurringSessions()

ilObjSessionGUI::createRecurringSessions ( bool  $a_activate_lp = true)
protected

Definition at line 896 of file class.ilObjSessionGUI.php.

References $rec, $tree, ilCalendarRecurrenceCalculator\calculateDateList(), ilObjectGUI\getDidacticTemplateVar(), ilEventItems\getItems(), ilTree\getParentId(), IL_CAL_UNIX, IL_CAL_YEAR, ilLPObjSettings\LP_MODE_DEACTIVATED, ILIAS\Repository\object(), ilEventItems\setItems(), and ilLPObjSettings\setMode().

Referenced by saveObject().

896  : bool
897  {
898  $tree = $this->tree;
899 
900  if (!$this->rec->getFrequenceType()) {
901  return true;
902  }
903  $calc = new ilCalendarRecurrenceCalculator($this->object->getFirstAppointment(), $this->rec);
904 
905  $period_start = clone $this->object->getFirstAppointment()->getStart();
906 
907 
908  $period_end = clone $this->object->getFirstAppointment()->getStart();
909  $period_end->increment(IL_CAL_YEAR, 5);
910  $date_list = $calc->calculateDateList($period_start, $period_end);
911 
912  $period_diff = $this->object->getFirstAppointment()->getEnd()->get(IL_CAL_UNIX) -
913  $this->object->getFirstAppointment()->getStart()->get(IL_CAL_UNIX);
914  $parent_id = $tree->getParentId($this->object->getRefId());
915 
916  $evi = new ilEventItems($this->object->getId());
917  $eitems = $evi->getItems();
918 
919  $counter = 0;
920  foreach ($date_list->get() as $date) {
921  if (!$counter++) {
922  continue;
923  }
924 
925  $new_obj = $this->object->cloneObject($parent_id);
926 
927  // apply didactic template?
928  $dtpl = $this->getDidacticTemplateVar("dtpl");
929  if ($dtpl) {
930  $new_obj->applyDidacticTemplate($dtpl);
931  }
932 
933  $new_obj->read();
934  $new_obj->getFirstAppointment()->setStartingTime($date->get(IL_CAL_UNIX));
935  $new_obj->getFirstAppointment()->setEndingTime($date->get(IL_CAL_UNIX) + $period_diff);
936  $new_obj->getFirstAppointment()->update();
937  $new_obj->update(true);
938 
939  // #14547 - active is default
940  if (!$a_activate_lp) {
941  $lp_obj_settings = new ilLPObjSettings($new_obj->getId());
943  $lp_obj_settings->update(false);
944  }
945 
946  $new_evi = new ilEventItems($new_obj->getId());
947  $new_evi->setItems($eitems);
948  $new_evi->update();
949  }
950 
951  return true;
952  }
setItems(array $a_items)
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
const IL_CAL_UNIX
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getParentId(int $a_node_id)
get parent id of given node
ilEventRecurrence $rec
calculateDateList(ilDateTime $a_start, ilDateTime $a_end, int $a_limit=-1)
calculate date list
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_CAL_YEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteFilesObject()

ilObjSessionGUI::deleteFilesObject ( )

Definition at line 1135 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$id, editObject(), and ILIAS\Repository\lng().

1135  : bool
1136  {
1137  if (!count($this->requested_file_id)) {
1138  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1139  $this->editObject();
1140  return false;
1141  }
1142  foreach ($this->requested_file_id as $id) {
1143  $file = new ilSessionFile($id);
1144  $file->delete();
1145  }
1146  $this->object->initFiles();
1147  $this->editObject();
1148  return true;
1149  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ editObject()

ilObjSessionGUI::editObject ( )

Definition at line 954 of file class.ilObjSessionGUI.php.

References $rows, ILIAS\Repository\form(), initForm(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by confirmDeleteFilesObject(), deleteFilesObject(), and updateObject().

954  : void
955  {
956  $this->tabs_gui->setTabActive('settings');
957 
958  $this->initForm('edit');
959  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit.html', 'Modules/Session');
960  $this->tpl->setVariable('EVENT_EDIT_TABLE', $this->form->getHTML());
961 
962  if (!count($this->object->getFiles())) {
963  return;
964  }
965  $rows = [];
966  foreach ($this->object->getFiles() as $file) {
967  $table_data['id'] = $file->getFileId();
968  $table_data['filename'] = $file->getFileName();
969  $table_data['filetype'] = $file->getFileType();
970  $table_data['filesize'] = $file->getFileSize();
971 
972  $rows[] = $table_data;
973  }
974 
975  $table_gui = new ilSessionFileTableGUI($this, "edit");
976  $table_gui->setTitle($this->lng->txt("event_files"));
977  $table_gui->setData($rows);
978  $table_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
979  $table_gui->addMultiCommand("confirmDeleteFiles", $this->lng->txt("delete"));
980  $table_gui->setSelectAllCheckbox("file_id");
981  $this->tpl->setVariable('EVENT_FILE_TABLE', $table_gui->getHTML());
982  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd)
initForm(string $a_mode)
$rows
Definition: xhr_table.php:10
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eventsListObject()

ilObjSessionGUI::eventsListObject ( )

Definition at line 1359 of file class.ilObjSessionGUI.php.

References $access, $i, $ilUser, $name, $tree, $user, __showButton(), ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilUtil\_sortIds(), ilTree\checkForParentType(), ILIAS\Repository\ctrl(), ilSession\get(), ilUtil\getImagePath(), ilObjectFactory\getInstanceByRefId(), ilTree\getNodeData(), ilTree\getSubTree(), ilEventParticipants\hasParticipated(), initContainer(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

1359  : void
1360  {
1361  $ilAccess = $this->access;
1362  $ilUser = $this->user;
1363  $tree = $this->tree;
1364 
1365  if (!$ilAccess->checkAccess('manage_members', '', $this->object->getRefId())) {
1366  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE);
1367  }
1368 
1369  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_list.html', 'Modules/Session');
1370  $this->__showButton($this->ctrl->getLinkTarget($this, 'exportCSV'), $this->lng->txt('event_csv_export'));
1371 
1372  $this->tpl->addBlockFile("EVENTS_TABLE", "events_table", "tpl.table.html");
1373  $this->tpl->addBlockFile('TBL_CONTENT', 'tbl_content', 'tpl.sess_list_row.html', 'Modules/Session');
1374 
1375  $members_obj = $this->initContainer(true);
1376  $members = $members_obj->getParticipants();
1377  $members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
1378 
1379  // Table
1380  $tbl = new ilTableGUI();
1381  $tbl->setTitle(
1382  $this->lng->txt("event_overview"),
1383  'icon_usr.svg',
1384  $this->lng->txt('obj_usr')
1385  );
1386  $this->ctrl->setParameter($this, 'offset', $this->requested_offset);
1387 
1388  $course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1389  $events = [];
1390  foreach ($tree->getSubTree($tree->getNodeData($course_ref_id), false, ['sess']) as $event_id) {
1391  $tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
1392  if (!is_object($tmp_event) || $tmp_event->getType() != 'sess') {
1393  continue;
1394  }
1395  $events[] = $tmp_event;
1396  }
1397 
1398  $headerNames = [];
1399  $headerVars = [];
1400  $colWidth = [];
1401 
1402  $headerNames[] = $this->lng->txt('name');
1403  $headerVars[] = "name";
1404  $colWidth[] = '20%';
1405 
1406  for ($i = 1; $i <= count($events); $i++) {
1407  $headerNames[] = $i;
1408  $headerVars[] = "event_" . $i;
1409  $colWidth[] = 80 / count($events) . "%";
1410  }
1411 
1412  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1413  $tbl->setHeaderNames($headerNames);
1414  $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this));
1415  $tbl->setColumnWidth($colWidth);
1416 
1417  $tbl->setOrderColumn($this->requested_sort_by);
1418  $tbl->setOrderDirection($this->requested_sort_order);
1419  $tbl->setOffset($this->requested_offset);
1420  $tbl->setLimit((int) $ilUser->getPref("hits_per_page"));
1421  $tbl->setMaxCount(count($members));
1422  $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
1423 
1424  $sliced_users = array_slice($members, $this->requested_offset, ilSession::get("tbl_limit"));
1425  $tbl->disable('sort');
1426  $tbl->render();
1427 
1428  $counter = 0;
1429  foreach ($sliced_users as $user_id) {
1430  foreach ($events as $event_obj) {
1431  $this->tpl->setCurrentBlock("eventcols");
1432 
1433  $event_part = new ilEventParticipants($this->object->getId());
1434 
1435  {
1436  $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1437  ilUtil::getImagePath('icon_ok.svg') :
1438  ilUtil::getImagePath('icon_not_ok.svg'));
1439 
1440  $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
1441  $this->lng->txt('event_participated') :
1442  $this->lng->txt('event_not_participated'));
1443  }
1444 
1445  $this->tpl->parseCurrentBlock();
1446  }
1447 
1448  $this->tpl->setCurrentBlock("tbl_content");
1449  $name = ilObjUser::_lookupName($user_id);
1450  $this->tpl->setVariable("LASTNAME", $name['lastname']);
1451  $this->tpl->setVariable("FIRSTNAME", $name['firstname']);
1452  $this->tpl->setVariable("LOGIN", ilObjUser::_lookupLogin($user_id));
1453  $this->tpl->parseCurrentBlock();
1454  }
1455 
1456  $this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));
1457  $this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
1458  $this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
1459  $this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
1460  $this->tpl->setVariable("HEAD_TXT_DATE_TIME", $this->lng->txt("event_date_time"));
1461  $i = 1;
1462  foreach ($events as $event_obj) {
1463  $this->tpl->setCurrentBlock("legend_loop");
1464  $this->tpl->setVariable("LEGEND_DIGIT", $i++);
1465  $this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
1466  $this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1467  $this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1468  $this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1469  $this->tpl->parseCurrentBlock();
1470  }
1471  }
static get(string $a_var)
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
initContainer(bool $a_init_participants=false)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _lookupName(int $a_user_id)
lookup user name
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($format !==null) $name
Definition: metadata.php:247
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilEventParticipants $event_part
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),&#39;usr_data&#39;,&#39;lastname&#39;,&#39;usr_id&#39;) => sorts by lastname.
__showButton(string $cmd, string $text, string $target='')
$ilUser
Definition: imgupload.php:34
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
ilAccessHandler $access
$i
Definition: metadata.php:41
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSessionGUI::executeCommand ( )

Definition at line 160 of file class.ilObjSessionGUI.php.

References $access, $ctrl, $form, $GLOBALS, $ilUser, $tree, $user, ilLink\_getLink(), ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilTree\getParentId(), initCreateForm(), initForm(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ILIAS\Repository\object(), and prepareOutput().

160  : void
161  {
163  $ilCtrl = $this->ctrl;
164  $ilAccess = $this->access;
165 
166  $next_class = $this->ctrl->getNextClass($this);
167  $cmd = $this->ctrl->getCmd();
168 
169  if (
170  !$this->getCreationMode() &&
171  $ilAccess->checkAccess('read', '', $this->requested_ref_id)
172  ) {
173  $GLOBALS['DIC']['ilNavigationHistory']->addItem(
174  $this->requested_ref_id,
175  ilLink::_getLink($this->requested_ref_id, 'sess'),
176  'sess',
177  $this->object->getPresentationTitle()
178  );
179  }
180 
181  $this->prepareOutput();
182  switch ($next_class) {
183  case 'ilsessionmembershipgui':
184  $this->tabs_gui->activateTab('members');
185  $mem_gui = new ilSessionMembershipGUI($this, $this->object);
186  $this->ctrl->forwardCommand($mem_gui);
187  break;
188 
189  case "ilinfoscreengui":
190  $this->checkPermission("visible");
191  $this->infoScreen(); // forwards command
192  break;
193 
194  case 'ilobjectmetadatagui':
195  $this->checkPermission('edit_metadata');
196  $this->tabs_gui->activateTab('metadata');
197  $md_gui = new ilObjectMetaDataGUI($this->object);
198  $this->ctrl->forwardCommand($md_gui);
199  break;
200 
201  case 'ilpermissiongui':
202  $this->tabs_gui->setTabActive('perm_settings');
203  $perm_gui = new ilPermissionGUI($this);
204  $ret = $this->ctrl->forwardCommand($perm_gui);
205  break;
206 
207  case 'ilobjectcopygui':
208  $cp = new ilObjectCopyGUI($this);
209  $cp->setType('sess');
210  $this->ctrl->forwardCommand($cp);
211  break;
212 
213  case "ilexportgui":
214  // $this->prepareOutput();
215  $this->tabs_gui->setTabActive("export");
216  $exp_gui = new ilExportGUI($this);
217  $exp_gui->addFormat("xml");
218  $ret = $this->ctrl->forwardCommand($exp_gui);
219  // $this->tpl->show();
220  break;
221 
222  case "ilcommonactiondispatchergui":
224  $this->ctrl->forwardCommand($gui);
225  break;
226 
227  case 'ilmembershipgui':
228  $this->ctrl->setReturn($this, 'members');
229  $mem = new ilMembershipMailGUI($this);
230  $this->ctrl->forwardCommand($mem);
231  break;
232 
233  case "illearningprogressgui":
234  $new_gui = new ilLearningProgressGUI(
236  $this->object->getRefId(),
237  $this->requested_user_id ?: $ilUser->getId()
238  );
239  $this->ctrl->forwardCommand($new_gui);
240  $this->tabs_gui->setTabActive('learning_progress');
241  break;
242 
243  case "ilpropertyformgui":
244  // only case is currently adv metadata internal link in info settings, see #24497
245  if (!is_object($this->object)) {
246  $form = $this->initCreateForm("sess");
247  } else {
248  $form = $this->initForm("edit");
249  if ($form === true) {
250  $form = $this->form;
251  }
252  }
253  $ilCtrl->forwardCommand($form);
254  break;
255 
256  case "ilbookinggatewaygui":
257  $tree = $this->tree;
258  $parent_id = $tree->getParentId($this->requested_ref_id);
259 
260  $this->tabs_gui->activateTab('obj_tool_setting_booking');
261  $gui = new ilBookingGatewayGUI($this, $parent_id);
262  $this->ctrl->forwardCommand($gui);
263  break;
264 
265  default:
266  if ($cmd == "applyFilter") {
267  $this->$cmd();
268  } elseif ($cmd == "resetFilter") {
269  $this->$cmd();
270  }
271  if (!$cmd) {
272  $cmd = "infoScreen";
273  }
274  $cmd .= "Object";
275  $this->$cmd();
276 
277  break;
278  }
279 
280  $this->addHeaderAction();
281  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
GUI class for the workflow of copying objects.
This class is used for integration of the booking manager as a service into other repository objects...
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...
ilPropertyFormGUI $form
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
getParentId(int $a_node_id)
get parent id of given node
initForm(string $a_mode)
prepareOutput(bool $show_subobjects=true)
$ilUser
Definition: imgupload.php:34
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
addHeaderAction()
Add header action menu.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
ilAccessHandler $access
+ Here is the call graph for this function:

◆ getAttendanceListUserData()

ilObjSessionGUI::getAttendanceListUserData ( int  $a_user_id,
array  $a_filters 
)

Definition at line 1341 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$data, and ILIAS\Repository\lng().

1341  : ?array
1342  {
1343  $data = $this->event_part->getUser($a_user_id);
1344 
1345  if ($a_filters && $a_filters["registered"] && !$data["registered"]) {
1346  return null;
1347  }
1348 
1349  $data['registered'] = $data['registered'] ?
1350  $this->lng->txt('yes') :
1351  $this->lng->txt('no');
1352  $data['participated'] = $data['participated'] ?
1353  $this->lng->txt('yes') :
1354  $this->lng->txt('no');
1355 
1356  return $data;
1357  }
+ Here is the call graph for this function:

◆ getContainerRefId()

ilObjSessionGUI::getContainerRefId ( )

Definition at line 2013 of file class.ilObjSessionGUI.php.

References $container_ref_id, and initContainer().

Referenced by materialsObject().

2013  : int
2014  {
2015  if (!$this->container_ref_id) {
2016  $this->initContainer();
2017  }
2018  return $this->container_ref_id;
2019  }
initContainer(bool $a_init_participants=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultMemberRole()

ilObjSessionGUI::getDefaultMemberRole ( )

Definition at line 2033 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$rbac_review, $rbacreview, ilObject\_lookupTitle(), ilRbacReview\getRolesOfRoleFolder(), and ILIAS\Repository\object().

2033  : int
2034  {
2036 
2037  $local_roles = $rbac_review->getRolesOfRoleFolder($this->object->getRefId(), false);
2038 
2039  foreach ($local_roles as $role_id) {
2040  $title = ilObject::_lookupTitle($role_id);
2041  if (substr($title, 0, 19) == 'il_sess_participant') {
2042  return $role_id;
2043  }
2044  }
2045  return 0;
2046  }
ilRbacReview $rbac_review
static _lookupTitle(int $obj_id)
getRolesOfRoleFolder(int $a_ref_id, bool $a_nonassignable=true)
get all roles of a role folder including linked local roles that are created due to stopped inheritan...
+ Here is the call graph for this function:

◆ getLocalRoles()

ilObjSessionGUI::getLocalRoles ( )
Returns
int[]

Definition at line 2051 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$rbac_review, $rbacreview, ilRbacReview\getRolesOfRoleFolder(), and ILIAS\Repository\object().

2051  : array
2052  {
2054 
2055  return $this->rbacreview->getRolesOfRoleFolder($this->object->getRefId(), false);
2056  }
ilRbacReview $rbac_review
getRolesOfRoleFolder(int $a_ref_id, bool $a_nonassignable=true)
get all roles of a role folder including linked local roles that are created due to stopped inheritan...
+ Here is the call graph for this function:

◆ getTabs()

ilObjSessionGUI::getTabs ( )
protected

Definition at line 1886 of file class.ilObjSessionGUI.php.

References $access, $ctrl, $help, $ilUser, $tabs_gui, $tree, $user, ilContainer\_lookupContainerSetting(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjectServiceSettingsGUI\BOOKING, ilLearningProgressAccess\checkAccess(), ILIAS\Repository\ctrl(), ilTree\getParentId(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

1886  : void
1887  {
1888  $ilAccess = $this->access;
1889  $ilTabs = $this->tabs_gui;
1890  $tree = $this->tree;
1891  $ilCtrl = $this->ctrl;
1892  $ilHelp = $this->help;
1893  $ilUser = $this->user;
1894 
1895  $ilHelp->setScreenIdComponent("sess");
1896 
1897  $parent_id = $tree->getParentId($this->object->getRefId());
1898 
1899  // #11650
1900  $parent_type = ilObject::_lookupType($parent_id, true);
1901 
1902  $this->tabs_gui->setBackTarget(
1903  $this->lng->txt('back_to_' . $parent_type . '_content'),
1904  $ilCtrl->getLinkTarget($this, "redirectToParentContentPage")
1905  );
1906 
1907  $this->tabs_gui->addTarget(
1908  'info_short',
1909  $this->ctrl->getLinkTarget($this, 'infoScreen')
1910  );
1911 
1912  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1913  $this->tabs_gui->addTarget(
1914  'settings',
1915  $this->ctrl->getLinkTarget($this, 'edit')
1916  );
1917  }
1918  if ($ilAccess->checkAccess('manage_materials', '', $this->object->getRefId())) {
1919  $this->tabs_gui->addTab(
1920  'materials',
1921  $this->lng->txt('crs_materials'),
1922  $this->ctrl->getLinkTarget($this, 'materials')
1923  );
1924  }
1925 
1926  // booking
1927  $parent_id = $tree->getParentId($this->requested_ref_id);
1928 
1929  if ($ilAccess->checkAccess('write', '', $this->ref_id) && ilContainer::_lookupContainerSetting(
1930  ilObject::_lookupObjId($parent_id),
1932  )) {
1933  $this->tabs_gui->addTarget(
1934  "obj_tool_setting_booking",
1935  $this->ctrl->getLinkTargetByClass(array("ilbookinggatewaygui"), "")
1936  );
1937  }
1938 
1939  // member tab
1940  $is_participant = $this->object->getMembersObject()->isAssigned($ilUser->getId());
1941  $membership_gui = new ilSessionMembershipGUI($this, $this->object);
1942  $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
1943 
1944 
1945  // learning progress
1946  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1947  $this->tabs_gui->addTarget(
1948  'learning_progress',
1949  $this->ctrl->getLinkTargetByClass(array('ilobjsessiongui','illearningprogressgui'), ''),
1950  '',
1951  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
1952  );
1953  }
1954 
1955  // meta data
1956  if ($ilAccess->checkAccess('edit_metadata', '', $this->ref_id)) {
1957  $mdgui = new ilObjectMetaDataGUI($this->object);
1958  $mdtab = $mdgui->getTab();
1959  if ($mdtab) {
1960  $this->tabs_gui->addTab(
1961  "metadata",
1962  $this->lng->txt('meta_data'),
1963  $mdtab
1964  );
1965  }
1966  }
1967 
1968  // export
1969  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1970  $this->tabs_gui->addTarget(
1971  "export",
1972  $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1973  "",
1974  "ilexportgui"
1975  );
1976  }
1977 
1978 
1979  // edit permissions
1980  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
1981  $this->tabs_gui->addTarget(
1982  "perm_settings",
1983  $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"),
1984  array("perm","info","owner"),
1985  'ilpermissiongui'
1986  );
1987  }
1988  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getParentId(int $a_node_id)
get parent id of given node
$ilUser
Definition: imgupload.php:34
static _lookupType(int $id, bool $reference=false)
ilAccessHandler $access
+ Here is the call graph for this function:

◆ handleFileUpload()

ilObjSessionGUI::handleFileUpload ( )

Definition at line 853 of file class.ilObjSessionGUI.php.

References $tree, $upload, ilEventItems\getItems(), ilTree\getParentId(), ILIAS\Repository\object(), ilEventItems\setItems(), and ilUtil\stripSlashes().

Referenced by saveObject(), and updateObject().

853  : void
854  {
855  $tree = $this->tree;
856 
857  $ev = new ilEventItems($this->object->getId());
858  $items = $ev->getItems();
859 
860  $counter = 0;
861  while (true) {
862  if (!isset($_FILES['files']['name'][$counter])) {
863  break;
864  }
865  if (!strlen($_FILES['files']['name'][$counter])) {
866  $counter++;
867  continue;
868  }
869 
870  $file = new ilObjFile();
871  $file->setTitle(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
872  $file->setDescription('');
873  $file->setFileName(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
874  $file->create();
875  $new_ref_id = $file->createReference();
876  $file->putInTree($tree->getParentId($this->object->getRefId()));
877  $file->setPermissions($tree->getParentId($this->object->getRefId()));
878 
880  if (!$upload->hasBeenProcessed()) {
881  $upload->process();
882  }
883  $file->getUploadFile(
884  $_FILES['files']['tmp_name'][$counter],
885  $_FILES['files']['name'][$counter]
886  );
887 
888  $items[] = $new_ref_id;
889  $counter++;
890  }
891 
892  $ev->setItems($items);
893  $ev->update();
894  }
setItems(array $a_items)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
Class ilObjFile.
getParentId(int $a_node_id)
get parent id of given node
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS FileUpload FileUpload $upload
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjSessionGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 492 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\ctrl().

492  : void
493  {
494  $this->ctrl->setCmd("showSummary");
495  $this->ctrl->setCmdClass("ilinfoscreengui");
496  $this->infoScreen();
497  }
+ Here is the call graph for this function:

◆ initAttendanceList()

ilObjSessionGUI::initAttendanceList ( )
protected

Definition at line 1298 of file class.ilObjSessionGUI.php.

References ilDatePresentation\formatPeriod(), initContainer(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilDatePresentation\setUseRelativeDates().

Referenced by attendanceListObject(), and printAttendanceListObject().

1299  {
1300  $members_obj = $this->initContainer(true);
1301 
1302  $list = new ilAttendanceList(
1303  $this,
1304  $this->object,
1305  $members_obj
1306  );
1307  $list->setId('sessattlst');
1308 
1309  $event_app = $this->object->getFirstAppointment();
1311  $desc = ilDatePresentation::formatPeriod($event_app->getStart(), $event_app->getEnd());
1313  $desc .= " " . $this->object->getTitle();
1314  $list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
1315 
1316  $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
1317  $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
1318  if ($this->object->enabledRegistration()) {
1319  $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
1320  }
1321  $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1322  $list->addBlank($this->lng->txt('sess_signature'));
1323 
1324  $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1325 
1326  return $list;
1327  }
initContainer(bool $a_init_participants=false)
Base class for attendance lists.
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
static setUseRelativeDates(bool $a_status)
set use relative dates
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initContainer()

ilObjSessionGUI::initContainer ( bool  $a_init_participants = false)
protected
Returns
bool|ilParticipants

Definition at line 1154 of file class.ilObjSessionGUI.php.

References $tree, ilCourseParticipants\_getInstanceByObjId(), ilGroupParticipants\_getInstanceByObjId(), ilObject\_lookupObjId(), ilTree\checkForParentType(), and ILIAS\Repository\object().

Referenced by eventsListObject(), getContainerRefId(), and initAttendanceList().

1155  {
1156  $tree = $this->tree;
1157 
1158  $is_course = $is_group = false;
1159 
1160  // #13178
1161  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
1162  if ($this->container_ref_id) {
1163  $is_group = true;
1164  }
1165  if (!$this->container_ref_id) {
1166  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1167  if ($this->container_ref_id) {
1168  $is_course = true;
1169  }
1170  }
1171  if (!$this->container_ref_id) {
1172  $this->tpl->setOnScreenMessage('failure', 'No container object found. Aborting');
1173  return true;
1174  }
1175  $this->container_obj_id = ilObject::_lookupObjId($this->container_ref_id);
1176 
1177  if ($a_init_participants && $this->container_obj_id) {
1178  if ($is_course) {
1179  return ilCourseParticipants::_getInstanceByObjId($this->container_obj_id);
1180  } elseif ($is_group) {
1181  return ilGroupParticipants::_getInstanceByObjId($this->container_obj_id);
1182  }
1183  }
1184 
1185  return false;
1186  }
static _lookupObjId(int $ref_id)
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
static _getInstanceByObjId(int $a_obj_id)
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

ilObjSessionGUI::initCreateForm (   $a_new_type)
protected

Definition at line 749 of file class.ilObjSessionGUI.php.

References $form, ILIAS\Repository\form(), and initForm().

Referenced by executeCommand().

750  {
751  if (!is_object($this->object)) {
752  $this->object = new ilObjSession();
753  }
754  if (!$this->form instanceof ilPropertyFormGUI) {
755  $this->initForm('create');
756  }
757  return $this->form;
758  }
ilPropertyFormGUI $form
form( $class_path, string $cmd)
initForm(string $a_mode)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilObjSessionGUI::initForm ( string  $a_mode)
protected

Definition at line 1478 of file class.ilObjSessionGUI.php.

References ILIAS\LTI\ToolProvider\$details, $form, $ilUser, $object_service, $user, ilObjectGUI\checkPermissionBool(), ilObjectService\commonSettings(), ILIAS\Repository\ctrl(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ILIAS\Repository\form(), ilObjectGUI\initDidacticTemplate(), ilYuiUtil\initDomEvent(), ilObjectServiceSettingsGUI\initServiceSettingsForm(), ILIAS\Repository\lng(), ilObjSession\MAIL_ALLOWED_ADMIN, ilObjSession\MAIL_ALLOWED_ALL, ilAdvancedMDRecordGUI\MODE_EDITOR, ILIAS\Repository\object(), ilMembershipRegistrationSettings\REGISTRATION_LIMITED_USERS, ilCheckboxInputGUI\setChecked(), ilFileWizardInputGUI\setFilenames(), ilFormPropertyGUI\setInfo(), ilAdvancedMDRecordGUI\setPropertyForm(), ilCalendarRecurrence\setRecurrence(), ilFormPropertyGUI\setRequired(), ilRadioGroupInputGUI\setValue(), ilTextAreaInputGUI\setValue(), ilMembershipRegistrationSettings\TYPE_DIRECT, ilMembershipRegistrationSettings\TYPE_NONE, ilMembershipRegistrationSettings\TYPE_REQUEST, and ilMembershipRegistrationSettings\TYPE_TUTOR.

Referenced by editObject(), executeCommand(), initCreateForm(), saveObject(), and updateObject().

1478  : bool
1479  {
1480  if ($this->form instanceof ilPropertyFormGUI) {
1481  return true;
1482  }
1483  $ilUser = $this->user;
1485  $this->lng->loadLanguageModule('dateplaner');
1486 
1488 
1489  $this->form = new ilPropertyFormGUI();
1490  $this->form->setMultipart(true);
1491  $this->form->setTableWidth('600px');
1492  $this->form->setFormAction($this->ctrl->getFormAction($this));
1493  $this->form->setMultipart(true);
1494 
1495  $this->form = $this->initDidacticTemplate($this->form);
1496 
1497  $this->lng->loadLanguageModule('dateplaner');
1498  $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
1499  $dur->setRequired(true);
1500  $dur->enableToggleFullTime(
1501  $this->lng->txt('event_fulltime_info'),
1502  $this->object->getFirstAppointment()->enabledFulltime()
1503  );
1504  $dur->setShowTime(true);
1505  $dur->setStart($this->object->getFirstAppointment()->getStart());
1506  $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1507 
1508  $this->form->addItem($dur);
1509 
1510 
1511  // Recurrence
1512  if ($a_mode == 'create') {
1513  if (!is_object($this->rec)) {
1514  $this->rec = new ilEventRecurrence();
1515  }
1516  $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
1517  $rec->allowUnlimitedRecurrences(false);
1518  $rec->setRecurrence($this->rec);
1519  $this->form->addItem($rec);
1520 
1521  // #14547
1522  $lp = new ilCheckboxInputGUI($this->lng->txt("sess_lp_preset"), "lp_preset");
1523  $lp->setInfo($this->lng->txt("sess_lp_preset_info"));
1524  $lp->setChecked(true);
1525  $this->form->addItem($lp);
1526  }
1527 
1528  $section = new ilFormSectionHeaderGUI();
1529  $section->setTitle($this->lng->txt('event_section_information'));
1530  $this->form->addItem($section);
1531 
1532  // title
1533  $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title');
1534  $title->setRequired(true);
1535  $title->setValue($this->object->getTitle());
1536  $title->setSize(50);
1537  $title->setMaxLength(70);
1538  $this->form->addItem($title);
1539 
1540  // desc
1541  $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc');
1542  $desc->setValue($this->object->getLongDescription());
1543  $desc->setRows(4);
1544  $desc->setCols(50);
1545  $this->form->addItem($desc);
1546 
1547  // location
1548  $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location');
1549  $desc->setValue($this->object->getLocation());
1550  $desc->setRows(4);
1551  $desc->setCols(50);
1552  $this->form->addItem($desc);
1553 
1554  // workflow
1555  $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details');
1556  $details->setValue($this->object->getDetails());
1557  $details->setCols(50);
1558  $details->setRows(4);
1559  $this->form->addItem($details);
1560 
1561  if ($a_mode == 'create') {
1562  $this->record_gui = new ilAdvancedMDRecordGUI(
1564  'sess'
1565  );
1566  $this->record_gui->setRefId($this->requested_ref_id);
1567  $this->record_gui->setPropertyForm($this->form);
1568  $this->record_gui->parse();
1569  } elseif ($this->checkPermissionBool('edit_metadata')) {
1570  $this->record_gui = new ilAdvancedMDRecordGUI(
1572  'sess',
1573  $this->object->getId()
1574  );
1575  $this->record_gui->setPropertyForm($this->form);
1576  $this->record_gui->parse();
1577  }
1578 
1579 
1580  // section
1581  $section = new ilFormSectionHeaderGUI();
1582  $section->setTitle($this->lng->txt('event_tutor_data'));
1583  $this->form->addItem($section);
1584 
1585  // name
1586  $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name');
1587  $tutor_name->setValue($this->object->getName());
1588  $tutor_name->setSize(20);
1589  $tutor_name->setMaxLength(70);
1590  $this->form->addItem($tutor_name);
1591 
1592  // email
1593  $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email');
1594  $tutor_email->setValue($this->object->getEmail());
1595  $tutor_email->setSize(20);
1596  $tutor_email->setMaxLength(70);
1597  $this->form->addItem($tutor_email);
1598 
1599  // phone
1600  $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone');
1601  $tutor_phone->setValue($this->object->getPhone());
1602  $tutor_phone->setSize(20);
1603  $tutor_phone->setMaxLength(70);
1604  $this->form->addItem($tutor_phone);
1605 
1606  $section = new ilFormSectionHeaderGUI();
1607  $section->setTitle($this->lng->txt('sess_section_reg'));
1608  $this->form->addItem($section);
1609 
1610  $reg_settings = new ilSessionMembershipRegistrationSettingsGUI(
1611  $this,
1612  $this->object,
1613  array(
1619  )
1620  );
1621  $reg_settings->addMembershipFormElements($this->form, '');
1622 
1623 
1624  $section = new ilFormSectionHeaderGUI();
1625  $section->setTitle($this->lng->txt('event_assign_files'));
1626  $this->form->addItem($section);
1627 
1628  $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
1629  $files->setFilenames(array(0 => ''));
1630  $this->form->addItem($files);
1631 
1632  $section = new ilFormSectionHeaderGUI();
1633  $section->setTitle($this->lng->txt('sess_setting_header_presentation'));
1634  $this->form->addItem($section);
1635 
1636  $object_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
1637 
1638  $features = new ilFormSectionHeaderGUI();
1639  $features->setTitle($this->lng->txt('obj_features'));
1640  $this->form->addItem($features);
1642  $this->object->getId(),
1643  $this->form,
1644  array(
1646  )
1647  );
1648 
1649  $gallery = new ilCheckboxInputGUI($this->lng->txt('sess_show_members'), 'show_members');
1650  $gallery->setChecked($this->object->getShowMembers());
1651  $gallery->setInfo($this->lng->txt('sess_show_participants_info'));
1652  $this->form->addItem($gallery);
1653 
1654 
1655  // Show mail to members type
1656  $mail_type = new ilRadioGroupInputGUI($this->lng->txt('sess_mail_type'), 'mail_type');
1657  $mail_type->setValue((string) $this->object->getMailToMembersType());
1658 
1659  $mail_tutors = new ilRadioOption(
1660  $this->lng->txt('sess_mail_admins_only'),
1662  $this->lng->txt('sess_mail_admins_only_info')
1663  );
1664  $mail_type->addOption($mail_tutors);
1665 
1666  $mail_all = new ilRadioOption(
1667  $this->lng->txt('sess_mail_all'),
1669  $this->lng->txt('sess_mail_all_info')
1670  );
1671  $mail_type->addOption($mail_all);
1672  $this->form->addItem($mail_type);
1673 
1674 
1675 
1676  switch ($a_mode) {
1677  case 'create':
1678  $this->form->setTitle($this->lng->txt('event_table_create'));
1679 
1680  $this->form->addCommandButton('save', $this->lng->txt('event_btn_add'));
1681  $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit'));
1682  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
1683 
1684  return true;
1685 
1686  case 'edit':
1687  $this->form->setTitle($this->lng->txt('event_table_update'));
1688 
1689  $this->form->addCommandButton('update', $this->lng->txt('save'));
1690  $this->form->addCommandButton('cancelEdit', $this->lng->txt('cancel'));
1691 
1692  return true;
1693  }
1694  return true;
1695  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setPropertyForm(ilPropertyFormGUI $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 file wizard property in a property form.
static initDomEvent(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI DomEvent used in Services/Calendar, Modules/Session, Modules/Test (Jan 2022) ...
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...
setRecurrence(int $a_type)
set type of recurrence public
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
array $details
Details for error message relating to last request processed.
Definition: System.php:109
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
ilPropertyFormGUI $form
initDidacticTemplate(ilPropertyFormGUI $form)
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
setRequired(bool $a_required)
form( $class_path, string $cmd)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This class represents a text area property in a property form.
$ilUser
Definition: imgupload.php:34
ilObjectService $object_service
ilEventRecurrence $rec
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ joinObject()

ilObjSessionGUI::joinObject ( )

Definition at line 380 of file class.ilObjSessionGUI.php.

References $ilUser, $user, ilEventParticipants\_isRegistered(), ilEventParticipants\_register(), ilEventParticipants\_unregister(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilSession\set().

380  : void
381  {
383 
384  $this->checkPermission('read');
385 
386  if ($ilUser->isAnonymous()) {
387  $this->ctrl->redirect($this, 'infoScreen');
388  }
389 
390  if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->object->getId())) {
391  ilSession::set("sess_hide_info", true);
392  ilEventParticipants::_unregister($ilUser->getId(), $this->object->getId());
393  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_unregistered'), true);
394  } else {
395  ilEventParticipants::_register($ilUser->getId(), $this->object->getId());
396  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_registered'), true);
397  }
398 
399  $this->ctrl->redirect($this, 'infoScreen');
400  }
static _register(int $a_usr_id, int $a_event_id)
static _isRegistered(int $a_usr_id, int $a_event_id)
static _unregister(int $a_usr_id, int $a_event_id)
$ilUser
Definition: imgupload.php:34
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ load()

ilObjSessionGUI::load ( )
protected

Definition at line 1697 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\form(), IL_CAL_UNIX, ILIAS\Repository\object(), ilMembershipRegistrationSettings\TYPE_DIRECT, and ilMembershipRegistrationSettings\TYPE_REQUEST.

Referenced by saveObject(), and updateObject().

1697  : void
1698  {
1699  $event = $this->form->getItemByPostVar('event');
1700  if ($event->getStart() && $event->getEnd()) {
1701  $this->object->getFirstAppointment()->setStartingTime($event->getStart()->get(IL_CAL_UNIX));
1702  $this->object->getFirstAppointment()->setEndingTime($event->getStart()->get(IL_CAL_UNIX));
1703  $this->object->getFirstAppointment()->setStart($event->getStart());
1704  $this->object->getFirstAppointment()->setEnd($event->getEnd());
1705  $this->object->getFirstAppointment()->toggleFulltime($event->getStart() instanceof ilDate);
1706  }
1707 
1708  $this->object->setTitle($this->form->getInput('title'));
1709  $this->object->setDescription($this->form->getInput('desc'));
1710  $this->object->setLocation($this->form->getInput('location'));
1711  $this->object->setName($this->form->getInput('tutor_name'));
1712  $this->object->setPhone($this->form->getInput('tutor_phone'));
1713  $this->object->setEmail($this->form->getInput('tutor_email'));
1714  $this->object->setDetails($this->form->getInput('details'));
1715 
1716  $this->object->setRegistrationNotificationEnabled((bool) $this->form->getInput('registration_notification'));
1717  $this->object->setRegistrationNotificationOption($this->form->getInput('notification_option'));
1718 
1719  $this->object->setRegistrationType((int) $this->form->getInput('registration_type'));
1720 
1721  switch ($this->object->getRegistrationType()) {
1723  $this->object->enableCannotParticipateOption((bool) $this->form->getInput('show_cannot_participate_direct'));
1724  break;
1726  $this->object->enableCannotParticipateOption((bool) $this->form->getInput('show_cannot_participate_request'));
1727  break;
1728  default:
1729  $this->object->enableCannotParticipateOption(false);
1730  break;
1731  }
1732 
1733  // $this->object->setRegistrationMinUsers((int) $this->form->getInput('registration_min_members'));
1734  $this->object->setRegistrationMaxUsers((int) $this->form->getInput('registration_max_members'));
1735  $this->object->enableRegistrationUserLimit((int) $this->form->getInput('registration_membership_limited'));
1736  $this->object->setShowMembers((bool) $this->form->getInput('show_members'));
1737  $this->object->setMailToMembersType((int) $this->form->getInput('mail_type'));
1738 
1739  switch ((int) $this->form->getInput('waiting_list')) {
1740  case 2:
1741  $this->object->enableRegistrationWaitingList(true);
1742  $this->object->setWaitingListAutoFill(true);
1743  break;
1744 
1745  case 1:
1746  $this->object->enableRegistrationWaitingList(true);
1747  $this->object->setWaitingListAutoFill(false);
1748  break;
1749 
1750  default:
1751  $this->object->enableRegistrationWaitingList(false);
1752  $this->object->setWaitingListAutoFill(false);
1753  break;
1754  }
1755  }
const IL_CAL_UNIX
form( $class_path, string $cmd)
ilAppEventHandler $event
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRecurrenceSettings()

ilObjSessionGUI::loadRecurrenceSettings ( )
protected

Definition at line 1757 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\form(), ilCalendarRecurrence\FREQ_DAILY, ilCalendarRecurrence\FREQ_MONTHLY, ilCalendarRecurrence\FREQ_WEEKLY, ilCalendarRecurrence\FREQ_YEARLY, and ilUtil\stripSlashes().

Referenced by saveObject().

1757  : void
1758  {
1759  $this->rec = new ilEventRecurrence();
1760 
1761  switch ($this->form->getInput('frequence')) {
1763  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1764  $this->rec->setInterval((int) $this->form->getInput('count_DAILY'));
1765  break;
1766 
1768  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1769  $this->rec->setInterval((int) $this->form->getInput('count_WEEKLY'));
1770  if (is_array($this->form->getInput('byday_WEEKLY'))) {
1771  $this->rec->setBYDAY(ilUtil::stripSlashes(implode(',', $this->form->getInput('byday_WEEKLY'))));
1772  }
1773  break;
1774 
1776  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1777  $this->rec->setInterval((int) $this->form->getInput('count_MONTHLY'));
1778  switch ((int) $this->form->getInput('subtype_MONTHLY')) {
1779  case 0:
1780  // nothing to do;
1781  break;
1782 
1783  case 1:
1784  switch ((int) $this->form->getInput('monthly_byday_day')) {
1785  case 8:
1786  // Weekday
1787  $this->rec->setBYSETPOS($this->form->getInput('monthly_byday_num'));
1788  $this->rec->setBYDAY('MO,TU,WE,TH,FR');
1789  break;
1790 
1791  case 9:
1792  // Day of month
1793  $this->rec->setBYMONTHDAY($this->form->getInput('monthly_byday_num'));
1794  break;
1795 
1796  default:
1797  $this->rec->setBYDAY(($this->form->getInput('monthly_byday_num') . $this->form->getInput('monthly_byday_day')));
1798  break;
1799  }
1800  break;
1801 
1802  case 2:
1803  $this->rec->setBYMONTHDAY($this->form->getInput('monthly_bymonthday'));
1804  break;
1805  }
1806  break;
1807 
1809  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1810  $this->rec->setInterval((int) $this->form->getInput('count_YEARLY'));
1811  switch ((int) $this->form->getInput('subtype_YEARLY')) {
1812  case 0:
1813  // nothing to do;
1814  break;
1815 
1816  case 1:
1817  $this->rec->setBYMONTH($this->form->getInput('yearly_bymonth_byday'));
1818  $this->rec->setBYDAY(($this->form->getInput('yearly_byday_num') . $this->form->getInput('yearly_byday')));
1819  break;
1820 
1821  case 2:
1822  $this->rec->setBYMONTH($this->form->getInput('yearly_bymonth_by_monthday'));
1823  $this->rec->setBYMONTHDAY($this->form->getInput('yearly_bymonthday'));
1824  break;
1825  }
1826  break;
1827  }
1828 
1829  // UNTIL
1830  switch ((int) $this->form->getInput('until_type')) {
1831  case 1:
1832  $this->rec->setFrequenceUntilDate(null);
1833  // nothing to do
1834  break;
1835 
1836  case 2:
1837  $this->rec->setFrequenceUntilDate(null);
1838  $this->rec->setFrequenceUntilCount((int) $this->form->getInput('count'));
1839  break;
1840 
1841  case 3:
1842  $frequence = $this->form->getItemByPostVar('frequence');
1843  $end = $frequence->getRecurrence()->getFrequenceUntilDate();
1844  $this->rec->setFrequenceUntilCount(0);
1845  $this->rec->setFrequenceUntilDate($end);
1846  break;
1847  }
1848  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ materialsObject()

ilObjSessionGUI::materialsObject ( )

Definition at line 1188 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$data, $objDefinition, $tree, getContainerRefId(), ilTree\getParentId(), ilObjectDefinition\getSideBlockTypes(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

1188  : void
1189  {
1190  $tree = $this->tree;
1192 
1193  $this->tabs_gui->activateTab('materials');
1194 
1195  // #11337 - support ANY parent container (crs, grp, fld)
1196  $parent_ref_id = $tree->getParentId($this->object->getRefId());
1197 
1198  $gui = new ilObjectAddNewItemGUI($parent_ref_id);
1199  $gui->setDisabledObjectTypes(
1200  array_merge(
1201  [
1202  'itgr', 'sess'
1203  ],
1205  )
1206  );
1207  $gui->setAfterCreationCallback($this->ref_id);
1208  $gui->render();
1209 
1210  $this->event_items = new ilEventItems($this->object->getId());
1211 
1212  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1213 
1214  $tbl->setDisableFilterHiding(true);
1215 
1216  $tbl->addMultiCommand('saveMaterials', $this->lng->txt('sess_assign'));
1217  $tbl->addMultiCommand("removeMaterials", $this->lng->txt("remove"));
1218 
1219  $tbl->setTitle($this->lng->txt("event_assign_materials_table"));
1220  $tbl->setDescription($this->lng->txt('event_assign_materials_info'));
1221 
1222  $tbl->setMaterialItems($this->event_items->getItems());
1223  $tbl->setContainerRefId($this->getContainerRefId());
1224  $data = $tbl->getDataFromDb();
1225  $tbl->setMaterials($data);
1226 
1227  $this->tpl->setContent($tbl->getHTML());
1228  }
getSideBlockTypes(bool $filter_repository_types=true)
getParentId(int $a_node_id)
get parent id of given node
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...
ilObjectDefinition $objDefinition
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ membersObject()

ilObjSessionGUI::membersObject ( )
protected

Definition at line 283 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$object, and ILIAS\Repository\ctrl().

283  : void
284  {
285  $this->ctrl->redirectByClass('ilSessionMembershipGUI', 'participants');
286  }
+ Here is the call graph for this function:

◆ modifyItemGUI()

ilObjSessionGUI::modifyItemGUI ( ilObjectListGUI  $a_item_list_gui,
array  $a_item_data,
bool  $a_show_path 
)

Definition at line 499 of file class.ilObjSessionGUI.php.

References $tree, ilObject\_lookupObjId(), ilObjCourseGUI\_modifyItemGUI(), ilObjectActivation\addListGUIActivationProperty(), ilTree\checkForParentType(), and ILIAS\Repository\object().

Referenced by showJoinRequestButton().

499  : void
500  {
501  $tree = $this->tree;
502 
503  // if folder is in a course, modify item list gui according to course requirements
504  if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs')) {
505  // #10611
506  ilObjectActivation::addListGUIActivationProperty($a_item_list_gui, $a_item_data);
507 
508  $course_obj_id = ilObject::_lookupObjId($course_ref_id);
510  $a_item_list_gui,
511  get_class($this),
512  $a_item_data,
513  $a_show_path,
514  $course_ref_id,
515  $course_obj_id,
516  $this->object->getRefId()
517  );
518  }
519  }
static _lookupObjId(int $ref_id)
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
static addListGUIActivationProperty(ilObjectListGUI $list_gui, array &$item)
Get timing details for list gui.
static _modifyItemGUI(ilObjectListGUI $a_item_list_gui, string $a_cmd_class, array $a_item_data, bool $a_abo_status, int $a_course_ref_id, int $a_course_obj_id, int $a_parent_ref_id=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ postUpdateMaterials()

ilObjSessionGUI::postUpdateMaterials ( )

redirect to list of materials without offset/page.

Definition at line 1275 of file class.ilObjSessionGUI.php.

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

Referenced by removeMaterialsObject(), and saveMaterialsObject().

1275  : void
1276  {
1277  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1278  $tbl->setOffset(0);
1279  $tbl->storeNavParameter();//remove offset and go to page 1
1280 
1281  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1282  $this->ctrl->redirect($this, 'materials');
1283  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilObjSessionGUI::prepareOutput ( bool  $show_subobjects = true)

Definition at line 298 of file class.ilObjSessionGUI.php.

References ilObjectGUI\getCreationMode(), and ILIAS\Repository\object().

Referenced by executeCommand().

298  : bool
299  {
300  parent::prepareOutput($show_subobjects);
301 
302  if (!$this->getCreationMode()) {
303  $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
304 
305  $this->tpl->setTitle(
306  $this->object->getFirstAppointment()->appointmentToString() . $title
307  );
308  }
309  return true;
310  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printAttendanceListObject()

ilObjSessionGUI::printAttendanceListObject ( )
protected

Definition at line 1329 of file class.ilObjSessionGUI.php.

References ilObjectGUI\checkPermission(), initAttendanceList(), and ILIAS\Repository\object().

1329  : void
1330  {
1331  $this->checkPermission('manage_members');
1332 
1333  $list = $this->initAttendanceList();
1334  $list->initFromForm();
1335  $list->setCallback(array($this, 'getAttendanceListUserData'));
1336 
1337  $this->event_part = new ilEventParticipants($this->object->getId());
1338  $list->getFullscreenHTML();
1339  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ readMemberData()

ilObjSessionGUI::readMemberData ( array  $a_usr_ids)

Used for waiting list.

Definition at line 2004 of file class.ilObjSessionGUI.php.

2004  : array
2005  {
2006  $tmp_data = [];
2007  foreach ($a_usr_ids as $usr_id) {
2008  $tmp_data[$usr_id] = [];
2009  }
2010  return $tmp_data;
2011  }

◆ redirectToParentContentPageObject()

ilObjSessionGUI::redirectToParentContentPageObject ( )
protected

Definition at line 1868 of file class.ilObjSessionGUI.php.

References $ctrl, $objDefinition, $tree, ilObject\_lookupType(), ilObjectDefinition\getClassName(), ilTree\getParentId(), ILIAS\Repository\object(), ilCtrl\redirectByClass(), and ilCtrl\setParameterByClass().

1868  : void
1869  {
1871  $tree = $this->tree;
1872  $ctrl = $this->ctrl;
1873 
1874  $parent_id = $tree->getParentId($this->object->getRefId());
1875 
1876  // #11650
1877  $parent_type = ilObject::_lookupType($parent_id, true);
1878 
1879  $parent_class = $objDefinition->getClassName($parent_type);
1880  $parent_class = 'ilObj' . $parent_class . 'GUI';
1881 
1882  $ctrl->setParameterByClass($parent_class, "ref_id", $parent_id);
1883  $ctrl->redirectByClass($parent_class, "view");
1884  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
getClassName(string $obj_name)
getParentId(int $a_node_id)
get parent id of given node
static _lookupType(int $id, bool $reference=false)
ilObjectDefinition $objDefinition
+ Here is the call graph for this function:

◆ refuseParticipationObject()

ilObjSessionGUI::refuseParticipationObject ( )
protected

Definition at line 530 of file class.ilObjSessionGUI.php.

References unregisterObject().

530  : void
531  {
532  $this->unregisterObject(true);
533  }
unregisterObject(bool $a_refuse_participation=false)
+ Here is the call graph for this function:

◆ registerObject()

ilObjSessionGUI::registerObject ( )

Definition at line 312 of file class.ilObjSessionGUI.php.

References $event, $ilUser, $user, ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilParticipants\getInstance(), ilObjectGUI\getRefId(), ilEventParticipants\getRegisteredParticipants(), ILIAS\Repository\lng(), ilMembershipRegistrationSettings\TYPE_DIRECT, ilMembershipRegistrationSettings\TYPE_NONE, ilMembershipRegistrationSettings\TYPE_REQUEST, and ilEventParticipants\updateExcusedForUser().

312  : void
313  {
315  $ilAppEventHandler = $this->event;
316 
317  $this->checkPermission('visible');
318 
319  $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
320 
321  $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
322  $event_part->updateExcusedForUser($ilUser->getId(), false);
323 
324  if (
325  $this->getCurrentObject()->isRegistrationUserLimitEnabled() &&
326  $this->getCurrentObject()->getRegistrationMaxUsers() &&
327  (count($event_part->getRegisteredParticipants()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
328  ) {
329  if (!$this->getCurrentObject()->isRegistrationWaitingListEnabled()) {
330  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('sess_reg_max_users_exceeded'), true);
331  $this->ctrl->redirect($this, 'infoScreen');
332  }
333  $wait = new ilSessionWaitingList($this->getCurrentObject()->getId());
334  $wait->addToList($ilUser->getId());
335  $this->ctrl->redirect($this, 'infoScreen');
336  }
337 
338 
339  switch ($this->getCurrentObject()->getRegistrationType()) {
341  $this->ctrl->redirect($this, 'info');
342  break;
343 
345  $part->register($ilUser->getId());
346  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_registered'), true);
347 
348  $ilAppEventHandler->raise(
349  "Modules/Session",
350  'enter',
351  array(
352  'obj_id' => $this->getCurrentObject()->getId(),
353  'ref_id' => $this->getCurrentObject()->getRefId(),
354  'usr_id' => $ilUser->getId()
355  )
356  );
357 
358  $this->ctrl->redirect($this, 'infoScreen');
359  break;
360 
362  $this->tpl->setOnScreenMessage('success', $this->lng->txt('sess_registered_confirm'), true);
363  $part->addSubscriber($ilUser->getId());
364 
365  $ilAppEventHandler->raise(
366  "Modules/Session",
367  'register',
368  array(
369  'obj_id' => $this->getCurrentObject()->getId(),
370  'ref_id' => $this->getCurrentObject()->getRefId(),
371  'usr_id' => $ilUser->getId()
372  )
373  );
374 
375  $this->ctrl->redirect($this, 'infoScreen');
376  break;
377  }
378  }
static getInstance(int $a_ref_id)
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...
ilEventParticipants $event_part
ilAppEventHandler $event
updateExcusedForUser(int $a_usr_id, bool $a_status)
$ilUser
Definition: imgupload.php:34
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ removeMaterialsObject()

ilObjSessionGUI::removeMaterialsObject ( )

Definition at line 1246 of file class.ilObjSessionGUI.php.

References $requested_items, ILIAS\Repository\object(), postUpdateMaterials(), and ilEventItems\removeItems().

1246  : void
1247  {
1248  $items_checked = $this->requested_items;
1249 
1250  $this->event_items = new ilEventItems($this->object->getId());
1251  $this->event_items->removeItems($items_checked);
1252 
1253  $this->postUpdateMaterials();
1254  }
removeItems(array $a_items)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
postUpdateMaterials()
redirect to list of materials without offset/page.
+ Here is the call graph for this function:

◆ resetFilter()

ilObjSessionGUI::resetFilter ( )

Definition at line 1238 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\ctrl().

1238  : void
1239  {
1240  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1241  $tbl->resetOffset(); // sets record offest to 0 (first page)
1242  $tbl->resetFilter(); // clears filter
1243  $this->ctrl->redirect($this, "materials");
1244  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ saveAndAssignMaterialsObject()

ilObjSessionGUI::saveAndAssignMaterialsObject ( )
protected

Definition at line 760 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\object(), and ilObjectGUI\saveObject().

760  : void
761  {
762  $this->saveObject(false);
763 
764  $this->ctrl->setParameter($this, 'ref_id', $this->object->getRefId());
765  $this->ctrl->setParameter($this, 'new_type', '');
766  $this->ctrl->redirect($this, 'materials');
767  }
+ Here is the call graph for this function:

◆ saveMaterialsObject()

ilObjSessionGUI::saveMaterialsObject ( )

Definition at line 1256 of file class.ilObjSessionGUI.php.

References $requested_items, ilEventItems\getItems(), ILIAS\Repository\object(), and postUpdateMaterials().

1256  : void
1257  {
1258  $this->event_items = new ilEventItems($this->object->getId());
1259  $db_items = $this->event_items->getItems();
1260 
1261  $list_items_checked = $this->requested_items;
1262  $list_items_checked = array_map('intval', $list_items_checked);
1263 
1264  $items_to_save = array_merge($db_items, $list_items_checked);
1265  $items_to_save = array_unique($items_to_save);
1266 
1267  $this->event_items->setItems($items_to_save);
1268  $this->event_items->update();
1269  $this->postUpdateMaterials();
1270  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
postUpdateMaterials()
redirect to list of materials without offset/page.
+ Here is the call graph for this function:

◆ saveObject()

ilObjSessionGUI::saveObject ( bool  $a_redirect_on_success = true)

Definition at line 769 of file class.ilObjSessionGUI.php.

References $form, $ilUser, $object_service, $user, ilObjectService\commonSettings(), ilObjectGUI\createObject(), createRecurringSessions(), ILIAS\Repository\ctrl(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ILIAS\Repository\form(), ilObjectGUI\getDidacticTemplateVar(), handleFileUpload(), ilAdvancedMDRecordGUI\importEditFormPostValues(), initForm(), ILIAS\Repository\lng(), load(), loadRecurrenceSettings(), ilLPObjSettings\LP_MODE_DEACTIVATED, ilGlobalTemplateInterface\MESSAGE_TYPE_FAILURE, ILIAS\Repository\object(), ilLPObjSettings\setMode(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

769  : void
770  {
773 
774  $this->object = new ilObjSession();
775 
776  $this->ctrl->saveParameter($this, "new_type");
777 
778  $this->initForm('create');
779  $this->ilErr->setMessage('');
780  if (!$this->form->checkInput()) {
781  $this->tpl->setOnScreenMessage(
783  $this->lng->txt('err_check_input')
784  );
785  $this->form->setValuesByPost();
786  $this->createObject();
787  return;
788  }
789 
790  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI && !$this->record_gui->importEditFormPostValues()
791  ) {
792  $this->ilErr->setMessage($this->lng->txt('err_check_input'));
793  }
794 
795  $this->load();
796  $this->loadRecurrenceSettings();
797 
798  $this->object->validate();
799  $this->object->getFirstAppointment()->validate();
800 
801  if (strlen($this->ilErr->getMessage())) {
802  $this->tpl->setOnScreenMessage('failure', $this->ilErr->getMessage());
803  $this->form->setValuesByPost();
804  $this->createObject();
805  }
806  // Create session
807  $this->object->create();
808  $this->object->createReference();
809  $this->object->putInTree($this->requested_ref_id);
810  $this->object->setPermissions($this->requested_ref_id);
811 
813  $this->object->getId(),
814  $this->form,
815  array(
817  )
818  );
819  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
820  $this->record_gui->writeEditForm($this->object->getId());
821  }
822 
823 
824  // apply didactic template?
825  $dtpl = $this->getDidacticTemplateVar("dtpl");
826  if ($dtpl) {
827  $this->object->applyDidacticTemplate($dtpl);
828  }
829 
830  // #14547 - active is default
831  if (!$this->form->getInput("lp_preset")) {
832  $lp_obj_settings = new ilLPObjSettings($this->object->getId());
834  $lp_obj_settings->update(false);
835  }
836 
837  // create appointment
838  $this->object->getFirstAppointment()->setSessionId($this->object->getId());
839  $this->object->getFirstAppointment()->create();
840 
841  $this->handleFileUpload();
842 
843  $object_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
844 
845  $this->createRecurringSessions((bool) $this->form->getInput("lp_preset"));
846 
847  if ($a_redirect_on_success) {
848  $this->tpl->setOnScreenMessage('info', $this->lng->txt('event_add_new_event'), true);
849  $this->ctrl->returnToParent($this);
850  }
851  }
importEditFormPostValues()
Load edit form values from post.
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
createObject()
create new object form
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
createRecurringSessions(bool $a_activate_lp=true)
ilPropertyFormGUI $form
form( $class_path, string $cmd)
initForm(string $a_mode)
$ilUser
Definition: imgupload.php:34
ilObjectService $object_service
+ Here is the call graph for this function:

◆ sendFileObject()

ilObjSessionGUI::sendFileObject ( )

Definition at line 741 of file class.ilObjSessionGUI.php.

References ilFileDelivery\deliverFileLegacy().

741  : bool
742  {
743  $file = new ilSessionFile($this->requested_file_id);
744 
745  ilFileDelivery::deliverFileLegacy($file->getAbsolutePath(), $file->getFileName(), $file->getFileType());
746  return true;
747  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
+ Here is the call graph for this function:

◆ showJoinRequestButton()

ilObjSessionGUI::showJoinRequestButton ( ?ilToolbarGUI  $ilToolbar = null)
protected

Definition at line 535 of file class.ilObjSessionGUI.php.

References $email, ilObjectGUI\$html, $ilUser, $lng, $location, $parts, $toolbar, $tree, $user, ilContainerSorting\_getInstance(), ilWaitingList\_isOnList(), ilEventParticipants\_isRegistered(), ilObject\_lookupObjId(), ilChangeEvent\_recordReadEvent(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilSessionObjectListGUIFactory\factory(), ilSession\get(), ILIAS\Survey\Mode\getId(), ilParticipants\getInstance(), ilObjectActivation\getItemsByEvent(), ilTree\getParentId(), ilObjectGUI\getRefId(), ilEventParticipants\getRegisteredParticipants(), ilEventParticipants\isExcused(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ilUtil\makeClickable(), ilAdvancedMDRecordGUI\MODE_INFO, modifyItemGUI(), ILIAS\Repository\object(), ilAdvancedMDRecordGUI\setInfoObject(), and ILIAS\Repository\ui().

Referenced by showJoinRequestButtonInCalendar().

535  : bool
536  {
538 
539  if (!$ilToolbar) {
540  $ilToolbar = $this->toolbar;
541  }
542 
543  if (!$this->getCurrentObject()->enabledRegistrationForUsers() || $ilUser->isAnonymous()) {
544  return false;
545  }
546 
547  $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
548 
549  $this->ctrl->setParameter($this, "ref_id", $this->getCurrentObject()->getRefId());
550 
551  $btn_excused = null;
552  if ($this->object->isCannotParticipateOptionEnabled()) {
553  $btn_excused = $this->ui->factory()->button()->standard(
554  $this->lng->txt('sess_bt_refuse'),
555  $this->ctrl->getLinkTarget($this, 'refuseParticipation')
556  );
557  }
558 
559 
560  if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->getCurrentObject()->getId())) {
561  if (!is_null($btn_excused)) {
562  $ilToolbar->addComponent($btn_excused);
563  }
564  return true;
565  } elseif ($part->isSubscriber($ilUser->getId())) {
566  if (!is_null($btn_excused)) {
567  $ilToolbar->addComponent($btn_excused);
568  }
569  return true;
570  } elseif (ilSessionWaitingList::_isOnList($ilUser->getId(), $this->getCurrentObject()->getId())) {
571  if (!is_null($btn_excused)) {
572  $ilToolbar->addComponent($btn_excused);
573  }
574  return true;
575  }
576 
577  $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
578 
579  if (
580  $this->getCurrentObject()->isRegistrationUserLimitEnabled() &&
581  $this->getCurrentObject()->getRegistrationMaxUsers() &&
582  (count($event_part->getRegisteredParticipants()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
583  ) {
584  if ($this->getCurrentObject()->isRegistrationWaitingListEnabled()) {
585  $this->tpl->setOnScreenMessage('info', $this->lng->txt('sess_reg_max_users_exceeded_wl'));
586  $btn_attend = $this->ui->factory()->button()->primary(
587  $this->lng->txt("mem_add_to_wl"),
588  $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register")
589  );
590  $ilToolbar->addComponent($btn_attend);
591  if (!$event_part->isExcused($ilUser->getId()) && !is_null($btn_excused)) {
592  $ilToolbar->addComponent($btn_excused);
593  }
594  } else {
595  $this->tpl->setOnScreenMessage('info', $this->lng->txt('sess_reg_max_users_exceeded'));
596  }
597  return true;
598  } else {
599  if (is_null(ilSession::get("sess_hide_info"))) {
600  $this->tpl->setOnScreenMessage('info', $this->lng->txt('sess_join_info'));
601  $btn_attend = $this->ui->factory()->button()->primary(
602  $this->lng->txt("join_session"),
603  $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register")
604  );
605  $ilToolbar->addComponent($btn_attend);
606  if (!$event_part->isExcused($ilUser->getId()) && !is_null($btn_excused)) {
607  $ilToolbar->addComponent($btn_excused);
608  }
609  return true;
610  }
611  }
612  return false;
613  }
static get(string $a_var)
static getInstance(int $a_ref_id)
static _isRegistered(int $a_usr_id, int $a_event_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilEventParticipants $event_part
$ilUser
Definition: imgupload.php:34
static _isOnList(int $a_usr_id, int $a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showJoinRequestButtonInCalendar()

ilObjSessionGUI::showJoinRequestButtonInCalendar ( ilToolbarGUI  $a_ilToolbar)

show join request This method is only needed to keep showJoinRequestButton method protected.

Definition at line 525 of file class.ilObjSessionGUI.php.

References showJoinRequestButton().

525  : bool
526  {
527  return $this->showJoinRequestButton($a_ilToolbar);
528  }
showJoinRequestButton(?ilToolbarGUI $ilToolbar=null)
+ Here is the call graph for this function:

◆ unregisterObject()

ilObjSessionGUI::unregisterObject ( bool  $a_refuse_participation = false)

Definition at line 402 of file class.ilObjSessionGUI.php.

References $access, $event, $ilUser, $tree, $user, ilRBACAccessHandler\checkAccessOfUser(), ilRBACAccessHandler\clear(), ILIAS\Repository\ctrl(), ilWaitingList\deleteUserEntry(), ILIAS\Survey\Mode\getId(), ilSessionParticipants\getInstance(), ilTree\getParentId(), ilObjectGUI\getRefId(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilObjectGUI\redirectToRefId(), ilRbacSystem\resetCaches(), and ilEventParticipants\updateExcusedForUser().

Referenced by refuseParticipationObject().

402  : void
403  {
405  $ilAppEventHandler = $this->event;
407  $tree = $this->tree;
408 
409  $part = ilSessionParticipants::getInstance($this->object->getRefId());
410  if ($part->isSubscriber($ilUser->getId())) {
411  $part->deleteSubscriber($ilUser->getId());
412  }
413 
414  $part->unregister($ilUser->getId());
415 
416  if ($a_refuse_participation) {
417  $event_part = new \ilEventParticipants($this->object->getId());
418  $event_part->updateExcusedForUser($ilUser->getId(), true);
419  }
420 
421  ilSessionWaitingList::deleteUserEntry($ilUser->getId(), $this->getCurrentObject()->getId());
422 
423  // check for visible permission of user
425  $access->clear();
426  $has_access = $access->checkAccessOfUser(
427  $ilUser->getId(),
428  'visible',
429  '',
430  $this->object->getRefId()
431  );
432  if (!$has_access) {
433  $parent = $tree->getParentId($this->object->getRefId());
434  $this->redirectToRefId($parent);
435  return;
436  }
437 
438  $ilAppEventHandler->raise(
439  "Modules/Session",
440  'unregister',
441  array(
442  'obj_id' => $this->getCurrentObject()->getId(),
443  'ref_id' => $this->getCurrentObject()->getRefId(),
444  'usr_id' => $ilUser->getId()
445  )
446  );
447  if ($a_refuse_participation) {
448  $this->tpl->setOnScreenMessage('info', $this->lng->txt('sess_participation_refused_info'), true);
449  } else {
450  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_unregistered'), true);
451  }
452  $this->ctrl->returnToParent($this);
453  }
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 sav...
static resetCaches()
Reset internal caches.
static getInstance(int $a_ref_id)
getParentId(int $a_node_id)
get parent id of given node
static deleteUserEntry(int $a_usr_id, int $a_obj_id)
ilEventParticipants $event_part
ilAppEventHandler $event
updateExcusedForUser(int $a_usr_id, bool $a_status)
$ilUser
Definition: imgupload.php:34
checkAccessOfUser(int $a_user_id, string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance) ...
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateObject()

ilObjSessionGUI::updateObject ( )

Definition at line 984 of file class.ilObjSessionGUI.php.

References $form, $object_service, ilObjectService\commonSettings(), ILIAS\Repository\ctrl(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, editObject(), ILIAS\Repository\form(), handleFileUpload(), ilAdvancedMDRecordGUI\importEditFormPostValues(), initForm(), ILIAS\Repository\int(), ILIAS\Repository\lng(), load(), ilDidacticTemplateObjSettings\lookupTemplateId(), ilGlobalTemplateInterface\MESSAGE_TYPE_FAILURE, ILIAS\Repository\object(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

984  : void
985  {
987 
988  $old_autofill = $this->object->hasWaitingListAutoFill();
989 
990  $this->initForm('edit');
991  $this->ilErr->setMessage('');
992  if (!$this->form->checkInput()) {
993  $this->tpl->setOnScreenMessage(
995  $this->lng->txt('err_check_input')
996  );
997  $this->form->setValuesByPost();
998  $this->editObject();
999  return;
1000  }
1001 
1002  //Mantis 21972: Choose didactic template on settings screen
1003  $old_type = ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
1004 
1005  $modified = false;
1006  $new_type_info = $this->form->getInput('didactic_type');
1007  if ($new_type_info) {
1008  $new_type = explode('_', $this->form->getInput('didactic_type'));
1009  $new_type = (int) $new_type[1];
1010 
1011  $modified = ($new_type !== $old_type);
1012  }
1013 
1014  if (
1015  $this->record_gui instanceof \ilAdvancedMDRecordGUI &&
1016  !$this->record_gui->importEditFormPostValues()
1017  ) {
1018  $this->tpl->setOnScreenMessage(
1020  $this->lng->txt('err_check_input')
1021  );
1022  $this->form->setValuesByPost();
1023  $this->editObject();
1024  }
1025 
1026  $this->load();
1027 
1028  $this->object->validate();
1029  $this->object->getFirstAppointment()->validate();
1030 
1031  if (strlen($this->ilErr->getMessage())) {
1032  $this->tpl->setOnScreenMessage('failure', $this->ilErr->getMessage());
1033  $this->editObject();
1034  }
1035  // Update event
1036  $this->object->update();
1037  $this->object->getFirstAppointment()->update();
1038 
1040  $this->object->getId(),
1041  $this->form,
1042  array(
1044  )
1045  );
1046  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
1047  $this->record_gui->writeEditForm();
1048  }
1049  $this->handleFileUpload();
1050 
1051  $object_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
1052 
1053  // if autofill has been activated trigger process
1054  if (!$old_autofill &&
1055  $this->object->hasWaitingListAutoFill()) {
1056  $this->object->handleAutoFill();
1057  }
1058 
1059  //Mantis 21972: Choose didactic template on settings screen
1060  if (!$modified) {
1061  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_updated'), true);
1062  $this->ctrl->redirect($this, 'edit');
1063  return;
1064  }
1065 
1066  if ($new_type == 0) {
1067  $new_type_txt = $this->lng->txt('il_sess_status_open');
1068  } else {
1069  $dtpl = new ilDidacticTemplateSetting($new_type);
1070  $new_type_txt = $dtpl->getPresentationTitle($this->lng->getLangKey());
1071  }
1072  $this->tabs_gui->activateTab('settings');
1073 
1074  $confirm = new ilConfirmationGUI();
1075  $confirm->setFormAction($this->ctrl->getFormAction($this));
1076  $confirm->setHeaderText($this->lng->txt('sess_warn_sess_type_changed'));
1077  $confirm->addItem(
1078  'sess_type',
1079  (string) $new_type,
1080  $this->lng->txt('sess_info_new_sess_type') . ': ' . $new_type_txt
1081  );
1082  $confirm->setConfirm($this->lng->txt('sess_change_type'), 'updateSessionType');
1083  $confirm->setCancel($this->lng->txt('cancel'), 'edit');
1084 
1085  $this->tpl->setContent($confirm->getHTML());
1086  }
importEditFormPostValues()
Load edit form values from post.
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
ilPropertyFormGUI $form
form( $class_path, string $cmd)
initForm(string $a_mode)
ilObjectService $object_service
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ updateSessionTypeObject()

ilObjSessionGUI::updateSessionTypeObject ( )

change session type

Definition at line 1091 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilDidacticTemplateUtils\switchTemplate().

1091  : void
1092  {
1094  $this->object->getRefId(),
1095  (int) $this->http->request()->getParsedBody()['sess_type']
1096  );
1097 
1098  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1099  $this->ctrl->redirect($this, 'edit');
1100  }
static switchTemplate(int $a_ref_id, int $a_new_tpl_id)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilObjSessionGUI::$access
protected

◆ $container_obj_id

int ilObjSessionGUI::$container_obj_id = 0
protected

Definition at line 56 of file class.ilObjSessionGUI.php.

◆ $container_ref_id

int ilObjSessionGUI::$container_ref_id = 0
protected

Definition at line 55 of file class.ilObjSessionGUI.php.

Referenced by getContainerRefId().

◆ $ctrl

ilCtrl ilObjSessionGUI::$ctrl

◆ $event

ilAppEventHandler ilObjSessionGUI::$event
protected

Definition at line 35 of file class.ilObjSessionGUI.php.

Referenced by registerObject(), and unregisterObject().

◆ $event_items

ilEventItems ilObjSessionGUI::$event_items = null
protected

Definition at line 61 of file class.ilObjSessionGUI.php.

◆ $event_part

ilEventParticipants ilObjSessionGUI::$event_part = null
protected

Definition at line 62 of file class.ilObjSessionGUI.php.

◆ $files

array ilObjSessionGUI::$files = []
protected

Definition at line 57 of file class.ilObjSessionGUI.php.

◆ $form

ilPropertyFormGUI ilObjSessionGUI::$form = null
protected

◆ $help

ilHelpGUI ilObjSessionGUI::$help
protected

Definition at line 37 of file class.ilObjSessionGUI.php.

Referenced by getTabs().

◆ $http

ILIAS HTTP Services ilObjSessionGUI::$http
protected

Definition at line 38 of file class.ilObjSessionGUI.php.

◆ $ilErr

ilErrorHandling ilObjSessionGUI::$ilErr
protected

Definition at line 48 of file class.ilObjSessionGUI.php.

◆ $lng

ilLanguage ilObjSessionGUI::$lng

Definition at line 41 of file class.ilObjSessionGUI.php.

Referenced by showJoinRequestButton().

◆ $locator

ilLocatorGUI ilObjSessionGUI::$locator
protected

Definition at line 52 of file class.ilObjSessionGUI.php.

Referenced by addLocatorItems().

◆ $objDefinition

ilObjectDefinition ilObjSessionGUI::$objDefinition

Definition at line 50 of file class.ilObjSessionGUI.php.

Referenced by materialsObject(), and redirectToParentContentPageObject().

◆ $object_service

ilObjectService ilObjSessionGUI::$object_service
protected

Definition at line 49 of file class.ilObjSessionGUI.php.

Referenced by initForm(), saveObject(), and updateObject().

◆ $rbacreview

ilRbacReview ilObjSessionGUI::$rbacreview
protected

Definition at line 53 of file class.ilObjSessionGUI.php.

Referenced by getDefaultMemberRole(), and getLocalRoles().

◆ $rec

ilEventRecurrence ilObjSessionGUI::$rec = null
protected

Definition at line 60 of file class.ilObjSessionGUI.php.

Referenced by createRecurringSessions().

◆ $record_gui

ilAdvancedMDRecordGUI ilObjSessionGUI::$record_gui = null
protected

Definition at line 59 of file class.ilObjSessionGUI.php.

◆ $refinery

ILIAS Refinery Factory ilObjSessionGUI::$refinery
protected

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

◆ $requested_file_id

int ilObjSessionGUI::$requested_file_id = 0
protected

Definition at line 65 of file class.ilObjSessionGUI.php.

◆ $requested_items

array ilObjSessionGUI::$requested_items = []
protected

Definition at line 69 of file class.ilObjSessionGUI.php.

Referenced by removeMaterialsObject(), and saveMaterialsObject().

◆ $requested_offset

int ilObjSessionGUI::$requested_offset = 0
protected

Definition at line 66 of file class.ilObjSessionGUI.php.

◆ $requested_ref_id

int ilObjSessionGUI::$requested_ref_id = 0
protected

Definition at line 63 of file class.ilObjSessionGUI.php.

Referenced by addLocatorItems().

◆ $requested_sort_by

string ilObjSessionGUI::$requested_sort_by = ""
protected

Definition at line 67 of file class.ilObjSessionGUI.php.

◆ $requested_sort_order

string ilObjSessionGUI::$requested_sort_order = ""
protected

Definition at line 68 of file class.ilObjSessionGUI.php.

◆ $requested_user_id

int ilObjSessionGUI::$requested_user_id = 0
protected

Definition at line 64 of file class.ilObjSessionGUI.php.

◆ $tabs_gui

ilTabsGUI ilObjSessionGUI::$tabs_gui
protected

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

Referenced by attendanceListObject(), and getTabs().

◆ $toolbar

ilToolbarGUI ilObjSessionGUI::$toolbar
protected

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

Referenced by showJoinRequestButton().

◆ $tpl

ilGlobalTemplateInterface ilObjSessionGUI::$tpl

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

Referenced by attendanceListObject().

◆ $tree

◆ $ui

ILIAS DI UIServices ilObjSessionGUI::$ui
protected

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

◆ $upload

ILIAS FileUpload FileUpload ilObjSessionGUI::$upload
protected

Definition at line 36 of file class.ilObjSessionGUI.php.

Referenced by handleFileUpload().

◆ $user


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