ILIAS  release_8 Revision v8.23
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 1483 of file class.ilObjSessionGUI.php.

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

Referenced by eventsListObject().

1483  : void
1484  {
1485  $this->toolbar->addButton($text, $this->ctrl->getLinkTarget($this, $cmd), $target);
1486  }
+ 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 1860 of file class.ilObjSessionGUI.php.

1860  : int
1861  {
1862  return mktime($time['h'], $time['m'], 0, $date['m'], $date['d'], $date['y']);
1863  }

◆ _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 1865 of file class.ilObjSessionGUI.php.

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

1865  : void
1866  {
1867  $ilLocator = $this->locator;
1868 
1869  if (!$this->getCreationMode()) {
1870  // see prepareOutput()
1871  $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
1872  $title = $this->object->getFirstAppointment()->appointmentToString() . $title;
1873 
1874  $ilLocator->addItem($title, $this->ctrl->getLinkTarget($this, "infoScreen"), "", $this->requested_ref_id);
1875  }
1876  }
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 2003 of file class.ilObjSessionGUI.php.

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

2003  : void
2004  {
2005  // add new object to materials
2006  $event_items = new ilEventItems($this->object->getId());
2007  $event_items->addItem($a_obj->getRefId());
2008  $event_items->update();
2009  }
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 1238 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\ctrl().

1238  : void
1239  {
1240  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1241  $tbl->writeFilterToSession(); // writes filter to session
1242  $tbl->resetOffset(); // sets record offest to 0 (first page)
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:

◆ attendanceListObject()

ilObjSessionGUI::attendanceListObject ( )

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

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

1295  : void
1296  {
1297  $tpl = $this->tpl;
1298  $ilTabs = $this->tabs_gui;
1299 
1300  $this->checkPermission('manage_members');
1301  $ilTabs->setTabActive('event_edit_members');
1302 
1303  $list = $this->initAttendanceList();
1304  $form = $list->initForm('printAttendanceList');
1306  }
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 2031 of file class.ilObjSessionGUI.php.

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

2031  : void
2032  {
2033  $ilCtrl = $this->ctrl;
2034  $tree = $this->tree;
2035 
2036  $parent_id = $tree->getParentId($this->requested_ref_id);
2037 
2038  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent_id);
2039 
2040  $ilCtrl->redirectByClass("ilrepositorygui", "");
2041  }
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 1107 of file class.ilObjSessionGUI.php.

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

1107  : bool
1108  {
1109  $this->checkPermission('write');
1110  $this->tabs_gui->setTabActive('settings');
1111 
1112  if (!count($this->requested_file_id)) {
1113  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1114  $this->editObject();
1115  return false;
1116  }
1117 
1118  $c_gui = new ilConfirmationGUI();
1119 
1120  // set confirm/cancel commands
1121  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteFiles"));
1122  $c_gui->setHeaderText($this->lng->txt("info_delete_sure"));
1123  $c_gui->setCancel($this->lng->txt("cancel"), "edit");
1124  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteFiles");
1125 
1126  // add items to delete
1127  foreach ($this->requested_file_id as $file_id) {
1128  $file = new ilSessionFile($file_id);
1129  if ($file->getSessionId() != $this->object->getEventId()) {
1130  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1131  $this->editObject();
1132  return false;
1133  }
1134  $c_gui->addItem("file_id[]", $file_id, $file->getFileName());
1135  }
1136 
1137  $this->tpl->setContent($c_gui->getHTML());
1138  return true;
1139  }
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)
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 2068 of file class.ilObjSessionGUI.php.

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

2068  : string
2069  {
2070  $link = chr(13) . chr(10) . chr(13) . chr(10);
2071  $link .= $this->lng->txt('sess_mail_permanent_link');
2072  $link .= chr(13) . chr(10) . chr(13) . chr(10);
2073  $link .= ilLink::_getLink($this->object->getRefId());
2074  return rawurlencode(base64_encode($link));
2075  }
+ Here is the call graph for this function:

◆ createRecurringSessions()

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

Definition at line 898 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().

898  : bool
899  {
900  $tree = $this->tree;
901 
902  if (!$this->rec->getFrequenceType()) {
903  return true;
904  }
905  $calc = new ilCalendarRecurrenceCalculator($this->object->getFirstAppointment(), $this->rec);
906 
907  $period_start = clone $this->object->getFirstAppointment()->getStart();
908 
909 
910  $period_end = clone $this->object->getFirstAppointment()->getStart();
911  $period_end->increment(IL_CAL_YEAR, 5);
912  $date_list = $calc->calculateDateList($period_start, $period_end);
913 
914  $period_diff = $this->object->getFirstAppointment()->getEnd()->get(IL_CAL_UNIX) -
915  $this->object->getFirstAppointment()->getStart()->get(IL_CAL_UNIX);
916  $parent_id = $tree->getParentId($this->object->getRefId());
917 
918  $evi = new ilEventItems($this->object->getId());
919  $eitems = $evi->getItems();
920 
921  $counter = 0;
922  foreach ($date_list->get() as $date) {
923  if (!$counter++) {
924  continue;
925  }
926 
927  $new_obj = $this->object->cloneObject($parent_id);
928 
929  // apply didactic template?
930  $dtpl = $this->getDidacticTemplateVar("dtpl");
931  if ($dtpl) {
932  $new_obj->applyDidacticTemplate($dtpl);
933  }
934 
935  $new_obj->read();
936  $new_obj->getFirstAppointment()->setStartingTime($date->get(IL_CAL_UNIX));
937  $new_obj->getFirstAppointment()->setEndingTime($date->get(IL_CAL_UNIX) + $period_diff);
938  $new_obj->getFirstAppointment()->update();
939  $new_obj->update(true);
940 
941  // #14547 - active is default
942  if (!$a_activate_lp) {
943  $lp_obj_settings = new ilLPObjSettings($new_obj->getId());
945  $lp_obj_settings->update(false);
946  }
947 
948  $new_evi = new ilEventItems($new_obj->getId());
949  $new_evi->setItems($eitems);
950  $new_evi->update();
951  }
952 
953  return true;
954  }
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 1141 of file class.ilObjSessionGUI.php.

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

1141  : bool
1142  {
1143  $this->checkPermission('write');
1144  if (!count($this->requested_file_id)) {
1145  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1146  $this->editObject();
1147  return false;
1148  }
1149  foreach ($this->requested_file_id as $id) {
1150  $file = new ilSessionFile($id);
1151  $file->delete();
1152  }
1153  $this->object->initFiles();
1154  $this->editObject();
1155  return true;
1156  }
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:

◆ editObject()

ilObjSessionGUI::editObject ( )

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

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

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

956  : void
957  {
958  $this->checkPermission('write');
959  $this->tabs_gui->setTabActive('settings');
960 
961  $this->initForm('edit');
962  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit.html', 'Modules/Session');
963  $this->tpl->setVariable('EVENT_EDIT_TABLE', $this->form->getHTML());
964 
965  if (!count($this->object->getFiles())) {
966  return;
967  }
968  $rows = [];
969  foreach ($this->object->getFiles() as $file) {
970  $table_data['id'] = $file->getFileId();
971  $table_data['filename'] = $file->getFileName();
972  $table_data['filetype'] = $file->getFileType();
973  $table_data['filesize'] = $file->getFileSize();
974 
975  $rows[] = $table_data;
976  }
977 
978  $table_gui = new ilSessionFileTableGUI($this, "edit");
979  $table_gui->setTitle($this->lng->txt("event_files"));
980  $table_gui->setData($rows);
981  $table_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
982  $table_gui->addMultiCommand("confirmDeleteFiles", $this->lng->txt("delete"));
983  $table_gui->setSelectAllCheckbox("file_id");
984  $this->tpl->setVariable('EVENT_FILE_TABLE', $table_gui->getHTML());
985  }
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
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eventsListObject()

ilObjSessionGUI::eventsListObject ( )

Definition at line 1369 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().

1369  : void
1370  {
1371  $ilAccess = $this->access;
1372  $ilUser = $this->user;
1373  $tree = $this->tree;
1374 
1375  if (!$ilAccess->checkAccess('manage_members', '', $this->object->getRefId())) {
1376  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE);
1377  }
1378 
1379  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_list.html', 'Modules/Session');
1380  $this->__showButton($this->ctrl->getLinkTarget($this, 'exportCSV'), $this->lng->txt('event_csv_export'));
1381 
1382  $this->tpl->addBlockFile("EVENTS_TABLE", "events_table", "tpl.table.html");
1383  $this->tpl->addBlockFile('TBL_CONTENT', 'tbl_content', 'tpl.sess_list_row.html', 'Modules/Session');
1384 
1385  $members_obj = $this->initContainer(true);
1386  $members = $members_obj->getParticipants();
1387  $members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
1388 
1389  // Table
1390  $tbl = new ilTableGUI();
1391  $tbl->setTitle(
1392  $this->lng->txt("event_overview"),
1393  'icon_usr.svg',
1394  $this->lng->txt('obj_usr')
1395  );
1396  $this->ctrl->setParameter($this, 'offset', $this->requested_offset);
1397 
1398  $course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1399  $events = [];
1400  foreach ($tree->getSubTree($tree->getNodeData($course_ref_id), false, ['sess']) as $event_id) {
1401  $tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
1402  if (!is_object($tmp_event) || $tmp_event->getType() != 'sess') {
1403  continue;
1404  }
1405  $events[] = $tmp_event;
1406  }
1407 
1408  $headerNames = [];
1409  $headerVars = [];
1410  $colWidth = [];
1411 
1412  $headerNames[] = $this->lng->txt('name');
1413  $headerVars[] = "name";
1414  $colWidth[] = '20%';
1415 
1416  for ($i = 1; $i <= count($events); $i++) {
1417  $headerNames[] = $i;
1418  $headerVars[] = "event_" . $i;
1419  $colWidth[] = 80 / count($events) . "%";
1420  }
1421 
1422  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1423  $tbl->setHeaderNames($headerNames);
1424  $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this));
1425  $tbl->setColumnWidth($colWidth);
1426 
1427  $tbl->setOrderColumn($this->requested_sort_by);
1428  $tbl->setOrderDirection($this->requested_sort_order);
1429  $tbl->setOffset($this->requested_offset);
1430  $tbl->setLimit((int) $ilUser->getPref("hits_per_page"));
1431  $tbl->setMaxCount(count($members));
1432  $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
1433 
1434  $sliced_users = array_slice($members, $this->requested_offset, ilSession::get("tbl_limit"));
1435  $tbl->disable('sort');
1436  $tbl->render();
1437 
1438  $counter = 0;
1439  foreach ($sliced_users as $user_id) {
1440  foreach ($events as $event_obj) {
1441  $this->tpl->setCurrentBlock("eventcols");
1442 
1443  $event_part = new ilEventParticipants($this->object->getId());
1444 
1445  {
1446  $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1447  ilUtil::getImagePath('icon_ok.svg') :
1448  ilUtil::getImagePath('icon_not_ok.svg'));
1449 
1450  $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
1451  $this->lng->txt('event_participated') :
1452  $this->lng->txt('event_not_participated'));
1453  }
1454 
1455  $this->tpl->parseCurrentBlock();
1456  }
1457 
1458  $this->tpl->setCurrentBlock("tbl_content");
1459  $name = ilObjUser::_lookupName($user_id);
1460  $this->tpl->setVariable("LASTNAME", $name['lastname']);
1461  $this->tpl->setVariable("FIRSTNAME", $name['firstname']);
1462  $this->tpl->setVariable("LOGIN", ilObjUser::_lookupLogin($user_id));
1463  $this->tpl->parseCurrentBlock();
1464  }
1465 
1466  $this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));
1467  $this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
1468  $this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
1469  $this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
1470  $this->tpl->setVariable("HEAD_TXT_DATE_TIME", $this->lng->txt("event_date_time"));
1471  $i = 1;
1472  foreach ($events as $event_obj) {
1473  $this->tpl->setCurrentBlock("legend_loop");
1474  $this->tpl->setVariable("LEGEND_DIGIT", $i++);
1475  $this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
1476  $this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1477  $this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1478  $this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1479  $this->tpl->parseCurrentBlock();
1480  }
1481  }
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 1351 of file class.ilObjSessionGUI.php.

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

1351  : ?array
1352  {
1353  $data = $this->event_part->getUser($a_user_id);
1354 
1355  if ($a_filters && $a_filters["registered"] && !$data["registered"]) {
1356  return null;
1357  }
1358 
1359  $data['registered'] = $data['registered'] ?
1360  $this->lng->txt('yes') :
1361  $this->lng->txt('no');
1362  $data['participated'] = $data['participated'] ?
1363  $this->lng->txt('yes') :
1364  $this->lng->txt('no');
1365 
1366  return $data;
1367  }
+ Here is the call graph for this function:

◆ getContainerRefId()

ilObjSessionGUI::getContainerRefId ( )

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

References $container_ref_id, and initContainer().

Referenced by materialsObject().

2023  : int
2024  {
2025  if (!$this->container_ref_id) {
2026  $this->initContainer();
2027  }
2028  return $this->container_ref_id;
2029  }
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 2043 of file class.ilObjSessionGUI.php.

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

2043  : int
2044  {
2046 
2047  $local_roles = $rbac_review->getRolesOfRoleFolder($this->object->getRefId(), false);
2048 
2049  foreach ($local_roles as $role_id) {
2050  $title = ilObject::_lookupTitle($role_id);
2051  if (substr($title, 0, 19) == 'il_sess_participant') {
2052  return $role_id;
2053  }
2054  }
2055  return 0;
2056  }
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 2061 of file class.ilObjSessionGUI.php.

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

2061  : array
2062  {
2064 
2065  return $this->rbacreview->getRolesOfRoleFolder($this->object->getRefId(), false);
2066  }
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 1896 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().

1896  : void
1897  {
1898  $ilAccess = $this->access;
1899  $ilTabs = $this->tabs_gui;
1900  $tree = $this->tree;
1901  $ilCtrl = $this->ctrl;
1902  $ilHelp = $this->help;
1903  $ilUser = $this->user;
1904 
1905  $ilHelp->setScreenIdComponent("sess");
1906 
1907  $parent_id = $tree->getParentId($this->object->getRefId());
1908 
1909  // #11650
1910  $parent_type = ilObject::_lookupType($parent_id, true);
1911 
1912  $this->tabs_gui->setBackTarget(
1913  $this->lng->txt('back_to_' . $parent_type . '_content'),
1914  $ilCtrl->getLinkTarget($this, "redirectToParentContentPage")
1915  );
1916 
1917  $this->tabs_gui->addTarget(
1918  'info_short',
1919  $this->ctrl->getLinkTarget($this, 'infoScreen')
1920  );
1921 
1922  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1923  $this->tabs_gui->addTarget(
1924  'settings',
1925  $this->ctrl->getLinkTarget($this, 'edit')
1926  );
1927  }
1928  if ($ilAccess->checkAccess('manage_materials', '', $this->object->getRefId())) {
1929  $this->tabs_gui->addTab(
1930  'materials',
1931  $this->lng->txt('crs_materials'),
1932  $this->ctrl->getLinkTarget($this, 'materials')
1933  );
1934  }
1935 
1936  // booking
1937  $parent_id = $tree->getParentId($this->requested_ref_id);
1938 
1939  if ($ilAccess->checkAccess('write', '', $this->ref_id) && ilContainer::_lookupContainerSetting(
1940  ilObject::_lookupObjId($parent_id),
1942  )) {
1943  $this->tabs_gui->addTarget(
1944  "obj_tool_setting_booking",
1945  $this->ctrl->getLinkTargetByClass(array("ilbookinggatewaygui"), "")
1946  );
1947  }
1948 
1949  // member tab
1950  $is_participant = $this->object->getMembersObject()->isAssigned($ilUser->getId());
1951  $membership_gui = new ilSessionMembershipGUI($this, $this->object);
1952  $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
1953 
1954 
1955  // learning progress
1956  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1957  $this->tabs_gui->addTarget(
1958  'learning_progress',
1959  $this->ctrl->getLinkTargetByClass(array('ilobjsessiongui','illearningprogressgui'), ''),
1960  '',
1961  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
1962  );
1963  }
1964 
1965  // meta data
1966  if ($ilAccess->checkAccess('edit_metadata', '', $this->ref_id)) {
1967  $mdgui = new ilObjectMetaDataGUI($this->object);
1968  $mdtab = $mdgui->getTab();
1969  if ($mdtab) {
1970  $this->tabs_gui->addTab(
1971  "metadata",
1972  $this->lng->txt('meta_data'),
1973  $mdtab
1974  );
1975  }
1976  }
1977 
1978  // export
1979  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1980  $this->tabs_gui->addTarget(
1981  "export",
1982  $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1983  "",
1984  "ilexportgui"
1985  );
1986  }
1987 
1988 
1989  // edit permissions
1990  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
1991  $this->tabs_gui->addTarget(
1992  "perm_settings",
1993  $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"),
1994  array("perm","info","owner"),
1995  'ilpermissiongui'
1996  );
1997  }
1998  }
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 855 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().

855  : void
856  {
857  $tree = $this->tree;
858 
859  $ev = new ilEventItems($this->object->getId());
860  $items = $ev->getItems();
861 
862  $counter = 0;
863  while (true) {
864  if (!isset($_FILES['files']['name'][$counter])) {
865  break;
866  }
867  if (!strlen($_FILES['files']['name'][$counter])) {
868  $counter++;
869  continue;
870  }
871 
872  $file = new ilObjFile();
873  $file->setTitle(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
874  $file->setDescription('');
875  $file->setFileName(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
876  $file->create();
877  $new_ref_id = $file->createReference();
878  $file->putInTree($tree->getParentId($this->object->getRefId()));
879  $file->setPermissions($tree->getParentId($this->object->getRefId()));
880 
882  if (!$upload->hasBeenProcessed()) {
883  $upload->process();
884  }
885  $file->getUploadFile(
886  $_FILES['files']['tmp_name'][$counter],
887  $_FILES['files']['name'][$counter]
888  );
889 
890  $items[] = $new_ref_id;
891  $counter++;
892  }
893 
894  $ev->setItems($items);
895  $ev->update();
896  }
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 1308 of file class.ilObjSessionGUI.php.

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

Referenced by attendanceListObject(), and printAttendanceListObject().

1309  {
1310  $members_obj = $this->initContainer(true);
1311 
1312  $list = new ilAttendanceList(
1313  $this,
1314  $this->object,
1315  $members_obj
1316  );
1317  $list->setId('sessattlst');
1318 
1319  $event_app = $this->object->getFirstAppointment();
1321  $desc = ilDatePresentation::formatPeriod($event_app->getStart(), $event_app->getEnd());
1323  $desc .= " " . $this->object->getTitle();
1324  $list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
1325 
1326  $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
1327  $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
1328  if ($this->object->enabledRegistration()) {
1329  $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
1330  }
1331  $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1332  $list->addBlank($this->lng->txt('sess_signature'));
1333 
1334  $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1335 
1336  return $list;
1337  }
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 1161 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().

1162  {
1163  $tree = $this->tree;
1164 
1165  $is_course = $is_group = false;
1166 
1167  // #13178
1168  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
1169  if ($this->container_ref_id) {
1170  $is_group = true;
1171  }
1172  if (!$this->container_ref_id) {
1173  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1174  if ($this->container_ref_id) {
1175  $is_course = true;
1176  }
1177  }
1178  if (!$this->container_ref_id) {
1179  $this->tpl->setOnScreenMessage('failure', 'No container object found. Aborting');
1180  return true;
1181  }
1182  $this->container_obj_id = ilObject::_lookupObjId($this->container_ref_id);
1183 
1184  if ($a_init_participants && $this->container_obj_id) {
1185  if ($is_course) {
1186  return ilCourseParticipants::_getInstanceByObjId($this->container_obj_id);
1187  } elseif ($is_group) {
1188  return ilGroupParticipants::_getInstanceByObjId($this->container_obj_id);
1189  }
1190  }
1191 
1192  return false;
1193  }
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 1488 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().

1488  : bool
1489  {
1490  if ($this->form instanceof ilPropertyFormGUI) {
1491  return true;
1492  }
1493  $ilUser = $this->user;
1495  $this->lng->loadLanguageModule('dateplaner');
1496 
1498 
1499  $this->form = new ilPropertyFormGUI();
1500  $this->form->setMultipart(true);
1501  $this->form->setTableWidth('600px');
1502  $this->form->setFormAction($this->ctrl->getFormAction($this));
1503  $this->form->setMultipart(true);
1504 
1505  $this->form = $this->initDidacticTemplate($this->form);
1506 
1507  $this->lng->loadLanguageModule('dateplaner');
1508  $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
1509  $dur->setRequired(true);
1510  $dur->enableToggleFullTime(
1511  $this->lng->txt('event_fulltime_info'),
1512  $this->object->getFirstAppointment()->enabledFulltime()
1513  );
1514  $dur->setShowTime(true);
1515  $dur->setStart($this->object->getFirstAppointment()->getStart());
1516  $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1517 
1518  $this->form->addItem($dur);
1519 
1520 
1521  // Recurrence
1522  if ($a_mode == 'create') {
1523  if (!is_object($this->rec)) {
1524  $this->rec = new ilEventRecurrence();
1525  }
1526  $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
1527  $rec->allowUnlimitedRecurrences(false);
1528  $rec->setRecurrence($this->rec);
1529  $this->form->addItem($rec);
1530 
1531  // #14547
1532  $lp = new ilCheckboxInputGUI($this->lng->txt("sess_lp_preset"), "lp_preset");
1533  $lp->setInfo($this->lng->txt("sess_lp_preset_info"));
1534  $lp->setChecked(true);
1535  $this->form->addItem($lp);
1536  }
1537 
1538  $section = new ilFormSectionHeaderGUI();
1539  $section->setTitle($this->lng->txt('event_section_information'));
1540  $this->form->addItem($section);
1541 
1542  // title
1543  $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title');
1544  $title->setRequired(true);
1545  $title->setValue($this->object->getTitle());
1546  $title->setSize(50);
1547  $title->setMaxLength(70);
1548  $this->form->addItem($title);
1549 
1550  // desc
1551  $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc');
1552  $desc->setValue($this->object->getLongDescription());
1553  $desc->setRows(4);
1554  $desc->setCols(50);
1555  $this->form->addItem($desc);
1556 
1557  // location
1558  $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location');
1559  $desc->setValue($this->object->getLocation());
1560  $desc->setRows(4);
1561  $desc->setCols(50);
1562  $this->form->addItem($desc);
1563 
1564  // workflow
1565  $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details');
1566  $details->setValue($this->object->getDetails());
1567  $details->setCols(50);
1568  $details->setRows(4);
1569  $this->form->addItem($details);
1570 
1571  if ($a_mode == 'create') {
1572  $this->record_gui = new ilAdvancedMDRecordGUI(
1574  'sess'
1575  );
1576  $this->record_gui->setRefId($this->requested_ref_id);
1577  $this->record_gui->setPropertyForm($this->form);
1578  $this->record_gui->parse();
1579  } elseif ($this->checkPermissionBool('edit_metadata')) {
1580  $this->record_gui = new ilAdvancedMDRecordGUI(
1582  'sess',
1583  $this->object->getId()
1584  );
1585  $this->record_gui->setPropertyForm($this->form);
1586  $this->record_gui->parse();
1587  }
1588 
1589 
1590  // section
1591  $section = new ilFormSectionHeaderGUI();
1592  $section->setTitle($this->lng->txt('event_tutor_data'));
1593  $this->form->addItem($section);
1594 
1595  // name
1596  $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name');
1597  $tutor_name->setValue($this->object->getName());
1598  $tutor_name->setSize(20);
1599  $tutor_name->setMaxLength(70);
1600  $this->form->addItem($tutor_name);
1601 
1602  // email
1603  $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email');
1604  $tutor_email->setValue($this->object->getEmail());
1605  $tutor_email->setSize(20);
1606  $tutor_email->setMaxLength(70);
1607  $this->form->addItem($tutor_email);
1608 
1609  // phone
1610  $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone');
1611  $tutor_phone->setValue($this->object->getPhone());
1612  $tutor_phone->setSize(20);
1613  $tutor_phone->setMaxLength(70);
1614  $this->form->addItem($tutor_phone);
1615 
1616  $section = new ilFormSectionHeaderGUI();
1617  $section->setTitle($this->lng->txt('sess_section_reg'));
1618  $this->form->addItem($section);
1619 
1620  $reg_settings = new ilSessionMembershipRegistrationSettingsGUI(
1621  $this,
1622  $this->object,
1623  array(
1629  )
1630  );
1631  $reg_settings->addMembershipFormElements($this->form, '');
1632 
1633 
1634  $section = new ilFormSectionHeaderGUI();
1635  $section->setTitle($this->lng->txt('event_assign_files'));
1636  $this->form->addItem($section);
1637 
1638  $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
1639  $files->setFilenames(array(0 => ''));
1640  $this->form->addItem($files);
1641 
1642  $section = new ilFormSectionHeaderGUI();
1643  $section->setTitle($this->lng->txt('sess_setting_header_presentation'));
1644  $this->form->addItem($section);
1645 
1646  $object_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
1647 
1648  $features = new ilFormSectionHeaderGUI();
1649  $features->setTitle($this->lng->txt('obj_features'));
1650  $this->form->addItem($features);
1652  $this->object->getId(),
1653  $this->form,
1654  array(
1656  )
1657  );
1658 
1659  $gallery = new ilCheckboxInputGUI($this->lng->txt('sess_show_members'), 'show_members');
1660  $gallery->setChecked($this->object->getShowMembers());
1661  $gallery->setInfo($this->lng->txt('sess_show_participants_info'));
1662  $this->form->addItem($gallery);
1663 
1664 
1665  // Show mail to members type
1666  $mail_type = new ilRadioGroupInputGUI($this->lng->txt('sess_mail_type'), 'mail_type');
1667  $mail_type->setValue((string) $this->object->getMailToMembersType());
1668 
1669  $mail_tutors = new ilRadioOption(
1670  $this->lng->txt('sess_mail_admins_only'),
1672  $this->lng->txt('sess_mail_admins_only_info')
1673  );
1674  $mail_type->addOption($mail_tutors);
1675 
1676  $mail_all = new ilRadioOption(
1677  $this->lng->txt('sess_mail_all'),
1679  $this->lng->txt('sess_mail_all_info')
1680  );
1681  $mail_type->addOption($mail_all);
1682  $this->form->addItem($mail_type);
1683 
1684 
1685 
1686  switch ($a_mode) {
1687  case 'create':
1688  $this->form->setTitle($this->lng->txt('event_table_create'));
1689 
1690  $this->form->addCommandButton('save', $this->lng->txt('event_btn_add'));
1691  $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit'));
1692  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
1693 
1694  return true;
1695 
1696  case 'edit':
1697  $this->form->setTitle($this->lng->txt('event_table_update'));
1698 
1699  $this->form->addCommandButton('update', $this->lng->txt('save'));
1700  $this->form->addCommandButton('cancelEdit', $this->lng->txt('cancel'));
1701 
1702  return true;
1703  }
1704  return true;
1705  }
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 1707 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().

1707  : void
1708  {
1709  $event = $this->form->getItemByPostVar('event');
1710  if ($event->getStart() && $event->getEnd()) {
1711  $this->object->getFirstAppointment()->setStartingTime($event->getStart()->get(IL_CAL_UNIX));
1712  $this->object->getFirstAppointment()->setEndingTime($event->getStart()->get(IL_CAL_UNIX));
1713  $this->object->getFirstAppointment()->setStart($event->getStart());
1714  $this->object->getFirstAppointment()->setEnd($event->getEnd());
1715  $this->object->getFirstAppointment()->toggleFulltime($event->getStart() instanceof ilDate);
1716  }
1717 
1718  $this->object->setTitle($this->form->getInput('title'));
1719  $this->object->setDescription($this->form->getInput('desc'));
1720  $this->object->setLocation($this->form->getInput('location'));
1721  $this->object->setName($this->form->getInput('tutor_name'));
1722  $this->object->setPhone($this->form->getInput('tutor_phone'));
1723  $this->object->setEmail($this->form->getInput('tutor_email'));
1724  $this->object->setDetails($this->form->getInput('details'));
1725 
1726  $this->object->setRegistrationNotificationEnabled((bool) $this->form->getInput('registration_notification'));
1727  $this->object->setRegistrationNotificationOption($this->form->getInput('notification_option'));
1728 
1729  $this->object->setRegistrationType((int) $this->form->getInput('registration_type'));
1730 
1731  switch ($this->object->getRegistrationType()) {
1733  $this->object->enableCannotParticipateOption((bool) $this->form->getInput('show_cannot_participate_direct'));
1734  break;
1736  $this->object->enableCannotParticipateOption((bool) $this->form->getInput('show_cannot_participate_request'));
1737  break;
1738  default:
1739  $this->object->enableCannotParticipateOption(false);
1740  break;
1741  }
1742 
1743  // $this->object->setRegistrationMinUsers((int) $this->form->getInput('registration_min_members'));
1744  $this->object->setRegistrationMaxUsers((int) $this->form->getInput('registration_max_members'));
1745  $this->object->enableRegistrationUserLimit((int) $this->form->getInput('registration_membership_limited'));
1746  $this->object->setShowMembers((bool) $this->form->getInput('show_members'));
1747  $this->object->setMailToMembersType((int) $this->form->getInput('mail_type'));
1748 
1749  switch ((int) $this->form->getInput('waiting_list')) {
1750  case 2:
1751  $this->object->enableRegistrationWaitingList(true);
1752  $this->object->setWaitingListAutoFill(true);
1753  break;
1754 
1755  case 1:
1756  $this->object->enableRegistrationWaitingList(true);
1757  $this->object->setWaitingListAutoFill(false);
1758  break;
1759 
1760  default:
1761  $this->object->enableRegistrationWaitingList(false);
1762  $this->object->setWaitingListAutoFill(false);
1763  break;
1764  }
1765  }
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 1767 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().

1767  : void
1768  {
1769  $this->rec = new ilEventRecurrence();
1770 
1771  switch ($this->form->getInput('frequence')) {
1773  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1774  $this->rec->setInterval((int) $this->form->getInput('count_DAILY'));
1775  break;
1776 
1778  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1779  $this->rec->setInterval((int) $this->form->getInput('count_WEEKLY'));
1780  if (is_array($this->form->getInput('byday_WEEKLY'))) {
1781  $this->rec->setBYDAY(ilUtil::stripSlashes(implode(',', $this->form->getInput('byday_WEEKLY'))));
1782  }
1783  break;
1784 
1786  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1787  $this->rec->setInterval((int) $this->form->getInput('count_MONTHLY'));
1788  switch ((int) $this->form->getInput('subtype_MONTHLY')) {
1789  case 0:
1790  // nothing to do;
1791  break;
1792 
1793  case 1:
1794  switch ((int) $this->form->getInput('monthly_byday_day')) {
1795  case 8:
1796  // Weekday
1797  $this->rec->setBYSETPOS($this->form->getInput('monthly_byday_num'));
1798  $this->rec->setBYDAY('MO,TU,WE,TH,FR');
1799  break;
1800 
1801  case 9:
1802  // Day of month
1803  $this->rec->setBYMONTHDAY($this->form->getInput('monthly_byday_num'));
1804  break;
1805 
1806  default:
1807  $this->rec->setBYDAY(($this->form->getInput('monthly_byday_num') . $this->form->getInput('monthly_byday_day')));
1808  break;
1809  }
1810  break;
1811 
1812  case 2:
1813  $this->rec->setBYMONTHDAY($this->form->getInput('monthly_bymonthday'));
1814  break;
1815  }
1816  break;
1817 
1819  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1820  $this->rec->setInterval((int) $this->form->getInput('count_YEARLY'));
1821  switch ((int) $this->form->getInput('subtype_YEARLY')) {
1822  case 0:
1823  // nothing to do;
1824  break;
1825 
1826  case 1:
1827  $this->rec->setBYMONTH($this->form->getInput('yearly_bymonth_byday'));
1828  $this->rec->setBYDAY(($this->form->getInput('yearly_byday_num') . $this->form->getInput('yearly_byday')));
1829  break;
1830 
1831  case 2:
1832  $this->rec->setBYMONTH($this->form->getInput('yearly_bymonth_by_monthday'));
1833  $this->rec->setBYMONTHDAY($this->form->getInput('yearly_bymonthday'));
1834  break;
1835  }
1836  break;
1837  }
1838 
1839  // UNTIL
1840  switch ((int) $this->form->getInput('until_type')) {
1841  case 1:
1842  $this->rec->setFrequenceUntilDate(null);
1843  // nothing to do
1844  break;
1845 
1846  case 2:
1847  $this->rec->setFrequenceUntilDate(null);
1848  $this->rec->setFrequenceUntilCount((int) $this->form->getInput('count'));
1849  break;
1850 
1851  case 3:
1852  $frequence = $this->form->getItemByPostVar('frequence');
1853  $end = $frequence->getRecurrence()->getFrequenceUntilDate();
1854  $this->rec->setFrequenceUntilCount(0);
1855  $this->rec->setFrequenceUntilDate($end);
1856  break;
1857  }
1858  }
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 1195 of file class.ilObjSessionGUI.php.

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

1195  : void
1196  {
1197  $this->checkPermission('manage_materials');
1198  $tree = $this->tree;
1200 
1201  $this->tabs_gui->activateTab('materials');
1202 
1203  // #11337 - support ANY parent container (crs, grp, fld)
1204  $parent_ref_id = $tree->getParentId($this->object->getRefId());
1205 
1206  $gui = new ilObjectAddNewItemGUI($parent_ref_id);
1207  $gui->setDisabledObjectTypes(
1208  array_merge(
1209  [
1210  'itgr', 'sess'
1211  ],
1213  )
1214  );
1215  $gui->setAfterCreationCallback($this->ref_id);
1216  $gui->render();
1217 
1218  $this->event_items = new ilEventItems($this->object->getId());
1219 
1220  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1221 
1222  $tbl->setDisableFilterHiding(true);
1223 
1224  $tbl->addMultiCommand('saveMaterials', $this->lng->txt('sess_assign'));
1225  $tbl->addMultiCommand("removeMaterials", $this->lng->txt("remove"));
1226 
1227  $tbl->setTitle($this->lng->txt("event_assign_materials_table"));
1228  $tbl->setDescription($this->lng->txt('event_assign_materials_info'));
1229 
1230  $tbl->setMaterialItems($this->event_items->getItems());
1231  $tbl->setContainerRefId($this->getContainerRefId());
1232  $data = $tbl->getDataFromDb();
1233  $tbl->setMaterials($data);
1234 
1235  $this->tpl->setContent($tbl->getHTML());
1236  }
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
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
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 1285 of file class.ilObjSessionGUI.php.

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

Referenced by removeMaterialsObject(), and saveMaterialsObject().

1285  : void
1286  {
1287  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1288  $tbl->setOffset(0);
1289  $tbl->storeNavParameter();//remove offset and go to page 1
1290 
1291  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1292  $this->ctrl->redirect($this, 'materials');
1293  }
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 1339 of file class.ilObjSessionGUI.php.

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

1339  : void
1340  {
1341  $this->checkPermission('manage_members');
1342 
1343  $list = $this->initAttendanceList();
1344  $list->initFromForm();
1345  $list->setCallback(array($this, 'getAttendanceListUserData'));
1346 
1347  $this->event_part = new ilEventParticipants($this->object->getId());
1348  $list->getFullscreenHTML();
1349  }
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 2014 of file class.ilObjSessionGUI.php.

2014  : array
2015  {
2016  $tmp_data = [];
2017  foreach ($a_usr_ids as $usr_id) {
2018  $tmp_data[$usr_id] = [];
2019  }
2020  return $tmp_data;
2021  }

◆ redirectToParentContentPageObject()

ilObjSessionGUI::redirectToParentContentPageObject ( )
protected

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

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

1878  : void
1879  {
1881  $tree = $this->tree;
1882  $ctrl = $this->ctrl;
1883 
1884  $parent_id = $tree->getParentId($this->object->getRefId());
1885 
1886  // #11650
1887  $parent_type = ilObject::_lookupType($parent_id, true);
1888 
1889  $parent_class = $objDefinition->getClassName($parent_type);
1890  $parent_class = 'ilObj' . $parent_class . 'GUI';
1891 
1892  $ctrl->setParameterByClass($parent_class, "ref_id", $parent_id);
1893  $ctrl->redirectByClass($parent_class, "view");
1894  }
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 1254 of file class.ilObjSessionGUI.php.

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

1254  : void
1255  {
1256  $this->checkPermission('manage_materials');
1257  $items_checked = $this->requested_items;
1258 
1259  $this->event_items = new ilEventItems($this->object->getId());
1260  $this->event_items->removeItems($items_checked);
1261 
1262  $this->postUpdateMaterials();
1263  }
removeItems(array $a_items)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
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 1246 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\ctrl().

1246  : void
1247  {
1248  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1249  $tbl->resetOffset(); // sets record offest to 0 (first page)
1250  $tbl->resetFilter(); // clears filter
1251  $this->ctrl->redirect($this, "materials");
1252  }
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 ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\object(), and ilObjectGUI\saveObject().

760  : void
761  {
762  $this->checkPermission('manage_materials');
763  $this->saveObject(false);
764 
765  $this->ctrl->setParameter($this, 'ref_id', $this->object->getRefId());
766  $this->ctrl->setParameter($this, 'new_type', '');
767  $this->ctrl->redirect($this, 'materials');
768  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ saveMaterialsObject()

ilObjSessionGUI::saveMaterialsObject ( )

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

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

1265  : void
1266  {
1267  $this->checkPermission('manage_materials');
1268  $this->event_items = new ilEventItems($this->object->getId());
1269  $db_items = $this->event_items->getItems();
1270 
1271  $list_items_checked = $this->requested_items;
1272  $list_items_checked = array_map('intval', $list_items_checked);
1273 
1274  $items_to_save = array_merge($db_items, $list_items_checked);
1275  $items_to_save = array_unique($items_to_save);
1276 
1277  $this->event_items->setItems($items_to_save);
1278  $this->event_items->update();
1279  $this->postUpdateMaterials();
1280  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
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 770 of file class.ilObjSessionGUI.php.

References $form, $ilUser, $object_service, $user, ilObjectGUI\checkPermission(), 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().

770  : void
771  {
772  $this->checkPermission('write');
775 
776  $this->object = new ilObjSession();
777 
778  $this->ctrl->saveParameter($this, "new_type");
779 
780  $this->initForm('create');
781  $this->ilErr->setMessage('');
782  if (!$this->form->checkInput()) {
783  $this->tpl->setOnScreenMessage(
785  $this->lng->txt('err_check_input')
786  );
787  $this->form->setValuesByPost();
788  $this->createObject();
789  return;
790  }
791 
792  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI && !$this->record_gui->importEditFormPostValues()
793  ) {
794  $this->ilErr->setMessage($this->lng->txt('err_check_input'));
795  }
796 
797  $this->load();
798  $this->loadRecurrenceSettings();
799 
800  $this->object->validate();
801  $this->object->getFirstAppointment()->validate();
802 
803  if (strlen($this->ilErr->getMessage())) {
804  $this->tpl->setOnScreenMessage('failure', $this->ilErr->getMessage());
805  $this->form->setValuesByPost();
806  $this->createObject();
807  }
808  // Create session
809  $this->object->create();
810  $this->object->createReference();
811  $this->object->putInTree($this->requested_ref_id);
812  $this->object->setPermissions($this->requested_ref_id);
813 
815  $this->object->getId(),
816  $this->form,
817  array(
819  )
820  );
821  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
822  $this->record_gui->writeEditForm($this->object->getId());
823  }
824 
825 
826  // apply didactic template?
827  $dtpl = $this->getDidacticTemplateVar("dtpl");
828  if ($dtpl) {
829  $this->object->applyDidacticTemplate($dtpl);
830  }
831 
832  // #14547 - active is default
833  if (!$this->form->getInput("lp_preset")) {
834  $lp_obj_settings = new ilLPObjSettings($this->object->getId());
836  $lp_obj_settings->update(false);
837  }
838 
839  // create appointment
840  $this->object->getFirstAppointment()->setSessionId($this->object->getId());
841  $this->object->getFirstAppointment()->create();
842 
843  $this->handleFileUpload();
844 
845  $object_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
846 
847  $this->createRecurringSessions((bool) $this->form->getInput("lp_preset"));
848 
849  if ($a_redirect_on_success) {
850  $this->tpl->setOnScreenMessage('info', $this->lng->txt('event_add_new_event'), true);
851  $this->ctrl->returnToParent($this);
852  }
853  }
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
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ 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 987 of file class.ilObjSessionGUI.php.

References $form, $object_service, ilObjectGUI\checkPermission(), 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().

987  : void
988  {
989  $this->checkPermission('write');
991 
992  $old_autofill = $this->object->hasWaitingListAutoFill();
993 
994  $this->initForm('edit');
995  $this->ilErr->setMessage('');
996  if (!$this->form->checkInput()) {
997  $this->tpl->setOnScreenMessage(
999  $this->lng->txt('err_check_input')
1000  );
1001  $this->form->setValuesByPost();
1002  $this->editObject();
1003  return;
1004  }
1005 
1006  //Mantis 21972: Choose didactic template on settings screen
1007  $old_type = ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
1008 
1009  $modified = false;
1010  $new_type_info = $this->form->getInput('didactic_type');
1011  if ($new_type_info) {
1012  $new_type = explode('_', $this->form->getInput('didactic_type'));
1013  $new_type = (int) $new_type[1];
1014 
1015  $modified = ($new_type !== $old_type);
1016  }
1017 
1018  if (
1019  $this->record_gui instanceof \ilAdvancedMDRecordGUI &&
1020  !$this->record_gui->importEditFormPostValues()
1021  ) {
1022  $this->tpl->setOnScreenMessage(
1024  $this->lng->txt('err_check_input')
1025  );
1026  $this->form->setValuesByPost();
1027  $this->editObject();
1028  }
1029 
1030  $this->load();
1031 
1032  $this->object->validate();
1033  $this->object->getFirstAppointment()->validate();
1034 
1035  if (strlen($this->ilErr->getMessage())) {
1036  $this->tpl->setOnScreenMessage('failure', $this->ilErr->getMessage());
1037  $this->editObject();
1038  }
1039  // Update event
1040  $this->object->update();
1041  $this->object->getFirstAppointment()->update();
1042 
1044  $this->object->getId(),
1045  $this->form,
1046  array(
1048  )
1049  );
1050  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
1051  $this->record_gui->writeEditForm();
1052  }
1053  $this->handleFileUpload();
1054 
1055  $object_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
1056 
1057  // if autofill has been activated trigger process
1058  if (!$old_autofill &&
1059  $this->object->hasWaitingListAutoFill()) {
1060  $this->object->handleAutoFill();
1061  }
1062 
1063  //Mantis 21972: Choose didactic template on settings screen
1064  if (!$modified) {
1065  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_updated'), true);
1066  $this->ctrl->redirect($this, 'edit');
1067  return;
1068  }
1069 
1070  if ($new_type == 0) {
1071  $new_type_txt = $this->lng->txt('il_sess_status_open');
1072  } else {
1073  $dtpl = new ilDidacticTemplateSetting($new_type);
1074  $new_type_txt = $dtpl->getPresentationTitle($this->lng->getLangKey());
1075  }
1076  $this->tabs_gui->activateTab('settings');
1077 
1078  $confirm = new ilConfirmationGUI();
1079  $confirm->setFormAction($this->ctrl->getFormAction($this));
1080  $confirm->setHeaderText($this->lng->txt('sess_warn_sess_type_changed'));
1081  $confirm->addItem(
1082  'sess_type',
1083  (string) $new_type,
1084  $this->lng->txt('sess_info_new_sess_type') . ': ' . $new_type_txt
1085  );
1086  $confirm->setConfirm($this->lng->txt('sess_change_type'), 'updateSessionType');
1087  $confirm->setCancel($this->lng->txt('cancel'), 'edit');
1088 
1089  $this->tpl->setContent($confirm->getHTML());
1090  }
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
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
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 1095 of file class.ilObjSessionGUI.php.

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

1095  : void
1096  {
1097  $this->checkPermission('write');
1099  $this->object->getRefId(),
1100  (int) $this->http->request()->getParsedBody()['sess_type']
1101  );
1102 
1103  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1104  $this->ctrl->redirect($this, 'edit');
1105  }
static switchTemplate(int $a_ref_id, int $a_new_tpl_id)
static http()
Fetches the global http state from ILIAS.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ 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: