ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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_sub_objects=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...
 
 saveObject (bool $a_redirect_on_success=true)
 
 handleFileUpload ()
 
 editObject ()
 
 updateObject ()
 
 updateSessionTypeObject ()
 change session type More...
 
 materialsObject ()
 
 getCreatableObjectTypes ()
 
 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
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 
 removeFromDeskObject ()
 

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 ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Protected Member Functions

 membersObject ()
 
 refuseParticipationObject ()
 
 showJoinRequestButton (?ilToolbarGUI $ilToolbar=null)
 
 initCreateForm ($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 ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

ILIAS DI UIServices $ui
 
ilAppEventHandler $event
 
ILIAS FileUpload FileUpload $upload
 
ilHelpGUI $help
 
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
 
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
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

Referenced by eventsListObject().

1397  : void
1398  {
1399  $this->toolbar->addButton($text, $this->ctrl->getLinkTarget($this, $cmd), $target);
1400  }
+ 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 1774 of file class.ilObjSessionGUI.php.

1774  : int
1775  {
1776  return mktime($time['h'], $time['m'], 0, $date['m'], $date['d'], $date['y']);
1777  }

◆ _goto()

static ilObjSessionGUI::_goto ( string  $a_target)
static

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

450  : void
451  {
452  global $DIC;
453  $main_tpl = $DIC->ui()->mainTemplate();
454 
455  $ilAccess = $DIC->access();
456  $lng = $DIC->language();
457 
458  $ilCtrl = $DIC->ctrl();
459  $parts = explode('_', $a_target);
460  $a_target = (int) $parts[0];
461 
462  if ($ilAccess->checkAccess('write', '', $a_target)) {
463  if (isset($parts[1]) && 'part' === $parts[1]) {
464  $ilCtrl->setTargetScript('ilias.php');
465  $ilCtrl->setParameterByClass('ilSessionMembershipGUI', 'ref_id', $a_target);
466  $ilCtrl->setTargetScript('ilias.php');
467  $ilCtrl->redirectByClass(array('ilRepositoryGUI', __CLASS__, 'ilSessionMembershipGUI'));
468  }
469  }
470 
471  if ($ilAccess->checkAccess('visible', "", $a_target)) {
472  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
473  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
474  $main_tpl->setOnScreenMessage('failure', sprintf(
475  $lng->txt("msg_no_perm_read_item"),
477  ), true);
479  }
480  }
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:61
static _gotoRepositoryNode(int $ref_id, string $cmd="")
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:26
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSessionGUI::addLocatorItems ( )
protected

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

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

1779  : void
1780  {
1781  $ilLocator = $this->locator;
1782 
1783  if (!$this->getCreationMode()) {
1784  // see prepareOutput()
1785  $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
1786  $title = $this->object->getFirstAppointment()->appointmentToString() . $title;
1787 
1788  $ilLocator->addItem($title, $this->ctrl->getLinkTarget($this, "infoScreen"), "", $this->requested_ref_id);
1789  }
1790  }
+ 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 1917 of file class.ilObjSessionGUI.php.

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

1917  : void
1918  {
1919  // add new object to materials
1920  $event_items = new ilEventItems($this->object->getId());
1921  $event_items->addItem($a_obj->getRefId());
1922  $event_items->update();
1923  }
addItem(int $a_item_ref_id)
class ilEventItems
+ Here is the call graph for this function:

◆ applyFilter()

ilObjSessionGUI::applyFilter ( )

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

References ILIAS\Repository\ctrl().

1155  : void
1156  {
1157  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1158  $tbl->writeFilterToSession(); // writes filter to session
1159  $tbl->resetOffset(); // sets record offest to 0 (first page)
1160  $this->ctrl->redirect($this, "materials");
1161  }
+ Here is the call graph for this function:

◆ attendanceListObject()

ilObjSessionGUI::attendanceListObject ( )

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

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

1210  : void
1211  {
1212  $tpl = $this->tpl;
1213  $ilTabs = $this->tabs_gui;
1214 
1215  $this->checkPermission('manage_members');
1216  $ilTabs->setTabActive('event_edit_members');
1217 
1218  $list = $this->initAttendanceList();
1219  $form = $list->initForm('printAttendanceList');
1221  }
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 1945 of file class.ilObjSessionGUI.php.

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

1945  : void
1946  {
1947  $ilCtrl = $this->ctrl;
1948  $tree = $this->tree;
1949 
1950  $parent_id = $tree->getParentId($this->requested_ref_id);
1951 
1952  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent_id);
1953 
1954  $ilCtrl->redirectByClass("ilrepositorygui", "");
1955  }
getParentId(int $a_node_id)
get parent id of given node
+ Here is the call graph for this function:

◆ createMailSignature()

ilObjSessionGUI::createMailSignature ( )

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

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

1982  : string
1983  {
1984  $link = chr(13) . chr(10) . chr(13) . chr(10);
1985  $link .= $this->lng->txt('sess_mail_permanent_link');
1986  $link .= chr(13) . chr(10) . chr(13) . chr(10);
1987  $link .= ilLink::_getLink($this->object->getRefId());
1988  return rawurlencode(base64_encode($link));
1989  }
+ Here is the call graph for this function:

◆ createRecurringSessions()

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

Definition at line 882 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(), and ilEventItems\setItems().

Referenced by saveObject().

882  : bool
883  {
884  $tree = $this->tree;
885 
886  if (!$this->rec->getFrequenceType()) {
887  return true;
888  }
889  $calc = new ilCalendarRecurrenceCalculator($this->object->getFirstAppointment(), $this->rec);
890 
891  $period_start = clone $this->object->getFirstAppointment()->getStart();
892 
893 
894  $period_end = clone $this->object->getFirstAppointment()->getStart();
895  $period_end->increment(IL_CAL_YEAR, 5);
896  $date_list = $calc->calculateDateList($period_start, $period_end);
897 
898  $period_diff = $this->object->getFirstAppointment()->getEnd()->get(IL_CAL_UNIX) -
899  $this->object->getFirstAppointment()->getStart()->get(IL_CAL_UNIX);
900  $parent_id = $tree->getParentId($this->object->getRefId());
901 
902  $evi = new ilEventItems($this->object->getId());
903  $eitems = $evi->getItems();
904 
905  $counter = 0;
906  foreach ($date_list->get() as $date) {
907  if (!$counter++) {
908  continue;
909  }
910 
911  $new_obj = $this->object->cloneObject($parent_id);
912 
913  // apply didactic template?
914  $dtpl = $this->getDidacticTemplateVar("dtpl");
915  if ($dtpl) {
916  $new_obj->applyDidacticTemplate($dtpl);
917  }
918 
919  $new_obj->read();
920  $new_obj->getFirstAppointment()->setStartingTime($date->get(IL_CAL_UNIX));
921  $new_obj->getFirstAppointment()->setEndingTime($date->get(IL_CAL_UNIX) + $period_diff);
922  $new_obj->getFirstAppointment()->update();
923  $new_obj->update();
924 
925  // #14547 - active is default
926  if (!$a_activate_lp) {
927  $lp_obj_settings = new ilLPObjSettings($new_obj->getId());
928  $lp_obj_settings->setMode(ilLPObjSettings::LP_MODE_DEACTIVATED);
929  $lp_obj_settings->update(false);
930  }
931 
932  $new_evi = new ilEventItems($new_obj->getId());
933  $new_evi->setItems($eitems);
934  $new_evi->update();
935  }
936 
937  return true;
938  }
setItems(array $a_items)
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
const IL_CAL_UNIX
Calculates an ilDateList for a given calendar entry and recurrence rule.
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
class ilEventItems
const IL_CAL_YEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editObject()

ilObjSessionGUI::editObject ( )

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

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

Referenced by updateObject().

940  : void
941  {
942  $this->tabs_gui->setTabActive('settings');
943 
944  $this->initForm('edit');
945  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit.html', 'components/ILIAS/Session');
946  $this->tpl->setVariable('EVENT_EDIT_TABLE', $this->form->getHTML());
947  }
initForm(string $a_mode)
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eventsListObject()

ilObjSessionGUI::eventsListObject ( )

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

References $access, $tree, $user, $user_id, __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().

1284  : void
1285  {
1286  $ilAccess = $this->access;
1287  $ilUser = $this->user;
1288  $tree = $this->tree;
1289 
1290  if (!$ilAccess->checkAccess('manage_members', '', $this->object->getRefId())) {
1291  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE);
1292  }
1293 
1294  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_list.html', 'components/ILIAS/Session');
1295  $this->__showButton($this->ctrl->getLinkTarget($this, 'exportCSV'), $this->lng->txt('event_csv_export'));
1296 
1297  $this->tpl->addBlockFile("EVENTS_TABLE", "events_table", "tpl.table.html");
1298  $this->tpl->addBlockFile('TBL_CONTENT', 'tbl_content', 'tpl.sess_list_row.html', 'components/ILIAS/Session');
1299 
1300  $members_obj = $this->initContainer(true);
1301  $members = $members_obj->getParticipants();
1302  $members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
1303 
1304  // Table
1305  $tbl = new ilTableGUI();
1306  $tbl->setTitle(
1307  $this->lng->txt("event_overview"),
1308  'standard/icon_usr.svg',
1309  $this->lng->txt('obj_usr')
1310  );
1311  $this->ctrl->setParameter($this, 'offset', $this->requested_offset);
1312 
1313  $course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1314  $events = [];
1315  foreach ($tree->getSubTree($tree->getNodeData($course_ref_id), false, ['sess']) as $event_id) {
1316  $tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
1317  if (!is_object($tmp_event) || $tmp_event->getType() != 'sess') {
1318  continue;
1319  }
1320  $events[] = $tmp_event;
1321  }
1322 
1323  $headerNames = [];
1324  $headerVars = [];
1325  $colWidth = [];
1326 
1327  $headerNames[] = $this->lng->txt('name');
1328  $headerVars[] = "name";
1329  $colWidth[] = '20%';
1330 
1331  for ($i = 1; $i <= count($events); $i++) {
1332  $headerNames[] = $i;
1333  $headerVars[] = "event_" . $i;
1334  $colWidth[] = 80 / count($events) . "%";
1335  }
1336 
1337  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1338  $tbl->setHeaderNames($headerNames);
1339  $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this));
1340  $tbl->setColumnWidth($colWidth);
1341 
1342  $tbl->setOrderColumn($this->requested_sort_by);
1343  $tbl->setOrderDirection($this->requested_sort_order);
1344  $tbl->setOffset($this->requested_offset);
1345  $tbl->setMaxCount(count($members));
1346  $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
1347 
1348  $sliced_users = array_slice($members, $this->requested_offset, ilSession::get("tbl_limit"));
1349  $tbl->disable('sort');
1350  $tbl->render();
1351 
1352  $counter = 0;
1353  foreach ($sliced_users as $user_id) {
1354  foreach ($events as $event_obj) {
1355  $this->tpl->setCurrentBlock("eventcols");
1356 
1357  $event_part = new ilEventParticipants($this->object->getId());
1358 
1359  {
1360  $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1361  ilUtil::getImagePath('standard/icon_ok.svg') :
1362  ilUtil::getImagePath('standard/icon_not_ok.svg'));
1363 
1364  $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
1365  $this->lng->txt('event_participated') :
1366  $this->lng->txt('event_not_participated'));
1367  }
1368 
1369  $this->tpl->parseCurrentBlock();
1370  }
1371 
1372  $this->tpl->setCurrentBlock("tbl_content");
1373  $name = ilObjUser::_lookupName($user_id);
1374  $this->tpl->setVariable("LASTNAME", $name['lastname']);
1375  $this->tpl->setVariable("FIRSTNAME", $name['firstname']);
1376  $this->tpl->setVariable("LOGIN", ilObjUser::_lookupLogin($user_id));
1377  $this->tpl->parseCurrentBlock();
1378  }
1379 
1380  $this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));
1381  $this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
1382  $this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
1383  $this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
1384  $this->tpl->setVariable("HEAD_TXT_DATE_TIME", $this->lng->txt("event_date_time"));
1385  $i = 1;
1386  foreach ($events as $event_obj) {
1387  $this->tpl->setCurrentBlock("legend_loop");
1388  $this->tpl->setVariable("LEGEND_DIGIT", $i++);
1389  $this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
1390  $this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1391  $this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1392  $this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1393  $this->tpl->parseCurrentBlock();
1394  }
1395  }
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 _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...
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
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
class ilEventParticipants
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='')
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
ilAccessHandler $access
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSessionGUI::executeCommand ( )

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

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

157  : void
158  {
159  $ilUser = $this->user;
160  $ilCtrl = $this->ctrl;
161  $ilAccess = $this->access;
162 
163  $next_class = $this->ctrl->getNextClass($this);
164  $cmd = $this->ctrl->getCmd();
165 
166  if (
167  !$this->getCreationMode() &&
168  $ilAccess->checkAccess('read', '', $this->requested_ref_id)
169  ) {
170  $GLOBALS['DIC']['ilNavigationHistory']->addItem(
171  $this->requested_ref_id,
172  ilLink::_getLink($this->requested_ref_id, 'sess'),
173  'sess',
174  $this->object->getPresentationTitle()
175  );
176  }
177 
178  $this->prepareOutput();
179  switch ($next_class) {
180  case 'ilsessionmembershipgui':
181  $this->tabs_gui->activateTab('members');
182  $mem_gui = new ilSessionMembershipGUI($this, $this->object);
183  $this->ctrl->forwardCommand($mem_gui);
184  break;
185 
186  case "ilinfoscreengui":
187  $this->checkPermission("visible");
188  $this->infoScreen(); // forwards command
189  break;
190 
191  case 'ilobjectmetadatagui':
192  $this->checkPermission('edit_metadata');
193  $this->tabs_gui->activateTab('metadata');
194  $md_gui = new ilObjectMetaDataGUI($this->object);
195  $this->ctrl->forwardCommand($md_gui);
196  break;
197 
198  case 'ilpermissiongui':
199  $this->tabs_gui->setTabActive('perm_settings');
200  $perm_gui = new ilPermissionGUI($this);
201  $ret = $this->ctrl->forwardCommand($perm_gui);
202  break;
203 
204  case 'ilobjectcopygui':
205  $cp = new ilObjectCopyGUI($this);
206  $cp->setType('sess');
207  $this->ctrl->forwardCommand($cp);
208  break;
209 
210  case "ilexportgui":
211  $this->tabs_gui->setTabActive("export");
212  $exp_gui = new ilExportGUI($this);
213  $exp_gui->addFormat("xml");
214  $ret = $this->ctrl->forwardCommand($exp_gui);
215  break;
216 
217  case "ilcommonactiondispatchergui":
219  $this->ctrl->forwardCommand($gui);
220  break;
221 
222  case 'ilmembershipgui':
223  $this->ctrl->setReturn($this, 'members');
224  $mem = new ilMembershipMailGUI($this);
225  $this->ctrl->forwardCommand($mem);
226  break;
227 
228  case "illearningprogressgui":
229  $new_gui = new ilLearningProgressGUI(
231  $this->object->getRefId(),
232  $this->requested_user_id ?: $ilUser->getId()
233  );
234  $this->ctrl->forwardCommand($new_gui);
235  $this->tabs_gui->setTabActive('learning_progress');
236  break;
237 
238  case "ilpropertyformgui":
239  // only case is currently adv metadata internal link in info settings, see #24497
240  if (!is_object($this->object)) {
241  $form = $this->initCreateForm("sess");
242  } else {
243  $form = $this->initForm("edit");
244  if ($form === true) {
245  $form = $this->form;
246  }
247  }
248  $ilCtrl->forwardCommand($form);
249  break;
250 
251  case "ilbookinggatewaygui":
252  $tree = $this->tree;
253  $parent_id = $tree->getParentId($this->requested_ref_id);
254 
255  $this->tabs_gui->activateTab('obj_tool_setting_booking');
256  $gui = new ilBookingGatewayGUI($this, $parent_id);
257  $this->ctrl->forwardCommand($gui);
258  break;
259 
260  default:
261  if ($cmd == "applyFilter") {
262  $this->$cmd();
263  } elseif ($cmd == "resetFilter") {
264  $this->$cmd();
265  }
266  if (!$cmd) {
267  $cmd = "infoScreen";
268  }
269  $cmd .= "Object";
270  $this->$cmd();
271 
272  break;
273  }
274 
275  $this->addHeaderAction();
276  }
Class ilObjectMetaDataGUI.
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...
prepareOutput(bool $show_sub_objects=true)
$GLOBALS["DIC"]
Definition: wac.php:53
GUI class for membership features.
ilPropertyFormGUI $form
getParentId(int $a_node_id)
get parent id of given node
initForm(string $a_mode)
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
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 1266 of file class.ilObjSessionGUI.php.

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

1266  : ?array
1267  {
1268  $data = $this->event_part->getUser($a_user_id);
1269 
1270  if ($a_filters && $a_filters["registered"] && !$data["registered"]) {
1271  return null;
1272  }
1273 
1274  $data['registered'] = $data['registered'] ?
1275  $this->lng->txt('yes') :
1276  $this->lng->txt('no');
1277  $data['participated'] = $data['participated'] ?
1278  $this->lng->txt('yes') :
1279  $this->lng->txt('no');
1280 
1281  return $data;
1282  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getContainerRefId()

ilObjSessionGUI::getContainerRefId ( )

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

References $container_ref_id, and initContainer().

Referenced by materialsObject().

1937  : int
1938  {
1939  if (!$this->container_ref_id) {
1940  $this->initContainer();
1941  }
1942  return $this->container_ref_id;
1943  }
initContainer(bool $a_init_participants=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCreatableObjectTypes()

ilObjSessionGUI::getCreatableObjectTypes ( )

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

References ilObject\_lookupType(), and ILIAS\Repository\object().

Referenced by materialsObject().

1142  : array
1143  {
1144  $parent_ref_id = $this->tree->getParentId($this->object->getRefId());
1145  $parent_type = ilObject::_lookupType($parent_ref_id, true);
1146  $parent_gui_class = 'ilObj' . $this->obj_definition->getClassName($parent_type) . 'GUI';
1147  $parent_gui = new $parent_gui_class('', $parent_ref_id, true, false);
1148  $types = $parent_gui->getCreatableObjectTypes();
1149  foreach (array_merge(['itgr', 'sess' ], $this->objDefinition->getSideBlockTypes()) as $type_to_remove) {
1150  unset($types[$type_to_remove]);
1151  }
1152  return $types;
1153  }
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultMemberRole()

ilObjSessionGUI::getDefaultMemberRole ( )

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

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

1957  : int
1958  {
1960 
1961  $local_roles = $rbac_review->getRolesOfRoleFolder($this->object->getRefId(), false);
1962 
1963  foreach ($local_roles as $role_id) {
1964  $title = ilObject::_lookupTitle($role_id);
1965  if (substr($title, 0, 19) == 'il_sess_participant') {
1966  return $role_id;
1967  }
1968  }
1969  return 0;
1970  }
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 1975 of file class.ilObjSessionGUI.php.

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

1975  : array
1976  {
1978 
1979  return $this->rbacreview->getRolesOfRoleFolder($this->object->getRefId(), false);
1980  }
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 1810 of file class.ilObjSessionGUI.php.

References $access, $ctrl, $help, $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().

1810  : void
1811  {
1812  $ilAccess = $this->access;
1813  $ilTabs = $this->tabs_gui;
1814  $tree = $this->tree;
1815  $ilCtrl = $this->ctrl;
1816  $ilHelp = $this->help;
1817  $ilUser = $this->user;
1818 
1819  $ilHelp->setScreenIdComponent("sess");
1820 
1821  $parent_id = $tree->getParentId($this->object->getRefId());
1822 
1823  // #11650
1824  $parent_type = ilObject::_lookupType($parent_id, true);
1825 
1826  $this->tabs_gui->setBackTarget(
1827  $this->lng->txt('back_to_' . $parent_type . '_content'),
1828  $ilCtrl->getLinkTarget($this, "redirectToParentContentPage")
1829  );
1830 
1831  $this->tabs_gui->addTarget(
1832  'info_short',
1833  $this->ctrl->getLinkTarget($this, 'infoScreen')
1834  );
1835 
1836  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1837  $this->tabs_gui->addTarget(
1838  'settings',
1839  $this->ctrl->getLinkTarget($this, 'edit')
1840  );
1841  }
1842  if ($ilAccess->checkAccess('manage_materials', '', $this->object->getRefId())) {
1843  $this->tabs_gui->addTab(
1844  'materials',
1845  $this->lng->txt('crs_materials'),
1846  $this->ctrl->getLinkTarget($this, 'materials')
1847  );
1848  }
1849 
1850  // booking
1851  $parent_id = $tree->getParentId($this->requested_ref_id);
1852 
1853  if ($ilAccess->checkAccess('write', '', $this->ref_id) && ilContainer::_lookupContainerSetting(
1854  ilObject::_lookupObjId($parent_id),
1856  )) {
1857  $this->tabs_gui->addTarget(
1858  "obj_tool_setting_booking",
1859  $this->ctrl->getLinkTargetByClass(array("ilbookinggatewaygui"), "")
1860  );
1861  }
1862 
1863  // member tab
1864  $is_participant = $this->object->getMembersObject()->isAssigned($ilUser->getId());
1865  $membership_gui = new ilSessionMembershipGUI($this, $this->object);
1866  $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
1867 
1868 
1869  // learning progress
1870  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1871  $this->tabs_gui->addTarget(
1872  'learning_progress',
1873  $this->ctrl->getLinkTargetByClass(array('ilobjsessiongui','illearningprogressgui'), ''),
1874  '',
1875  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
1876  );
1877  }
1878 
1879  // meta data
1880  if ($ilAccess->checkAccess('edit_metadata', '', $this->ref_id)) {
1881  $mdgui = new ilObjectMetaDataGUI($this->object);
1882  $mdtab = $mdgui->getTab();
1883  if ($mdtab) {
1884  $this->tabs_gui->addTab(
1885  "metadata",
1886  $this->lng->txt('meta_data'),
1887  $mdtab
1888  );
1889  }
1890  }
1891 
1892  // export
1893  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1894  $this->tabs_gui->addTarget(
1895  "export",
1896  $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1897  "",
1898  "ilexportgui"
1899  );
1900  }
1901 
1902 
1903  // edit permissions
1904  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
1905  $this->tabs_gui->addTarget(
1906  "perm_settings",
1907  $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"),
1908  array("perm","info","owner"),
1909  'ilpermissiongui'
1910  );
1911  }
1912  }
Class ilObjectMetaDataGUI.
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
static _lookupObjId(int $ref_id)
GUI class for membership features.
getParentId(int $a_node_id)
get parent id of given node
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static _lookupType(int $id, bool $reference=false)
ilAccessHandler $access
+ Here is the call graph for this function:

◆ handleFileUpload()

ilObjSessionGUI::handleFileUpload ( )

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

839  : void
840  {
841  $tree = $this->tree;
842 
843  $ev = new ilEventItems($this->object->getId());
844  $items = $ev->getItems();
845 
846  $counter = 0;
847  while (true) {
848  if (!isset($_FILES['files']['name'][$counter])) {
849  break;
850  }
851  if (!strlen($_FILES['files']['name'][$counter])) {
852  $counter++;
853  continue;
854  }
855 
856  $file = new ilObjFile();
857  $file->setTitle(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
858  $file->setDescription('');
859  $file->setFileName(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
860  $file->create();
861  $new_ref_id = $file->createReference();
862  $file->putInTree($tree->getParentId($this->object->getRefId()));
863  $file->setPermissions($tree->getParentId($this->object->getRefId()));
864 
866  if (!$upload->hasBeenProcessed()) {
867  $upload->process();
868  }
869  $file->getUploadFile(
870  $_FILES['files']['tmp_name'][$counter],
871  $_FILES['files']['name'][$counter]
872  );
873 
874  $items[] = $new_ref_id;
875  $counter++;
876  }
877 
878  $ev->setItems($items);
879  $ev->update();
880  }
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
class ilEventItems
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 487 of file class.ilObjSessionGUI.php.

References ILIAS\Repository\ctrl().

487  : void
488  {
489  $this->ctrl->redirectByClass(
490  [self::class, ilInfoScreenGUI::class],
491  'showSummary'
492  );
493  }
+ Here is the call graph for this function:

◆ initAttendanceList()

ilObjSessionGUI::initAttendanceList ( )
protected

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

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

Referenced by attendanceListObject(), and printAttendanceListObject().

1224  {
1225  $members_obj = $this->initContainer(true);
1226 
1227  $list = new ilAttendanceList(
1228  $this,
1229  $this->object,
1230  $members_obj
1231  );
1232  $list->setId('sessattlst');
1233 
1234  $event_app = $this->object->getFirstAppointment();
1236  $desc = ilDatePresentation::formatPeriod($event_app->getStart(), $event_app->getEnd());
1238  $desc .= " " . $this->object->getTitle();
1239  $list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
1240 
1241  $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
1242  $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
1243  if ($this->object->enabledRegistration()) {
1244  $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
1245  }
1246  $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1247  $list->addBlank($this->lng->txt('sess_signature'));
1248 
1249  $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1250 
1251  return $list;
1252  }
static array static setUseRelativeDates(bool $a_status)
set use relative dates
initContainer(bool $a_init_participants=false)
Base class for attendance lists.
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
+ 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 1070 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().

1071  {
1072  $tree = $this->tree;
1073 
1074  $is_course = $is_group = false;
1075 
1076  // #13178
1077  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
1078  if ($this->container_ref_id) {
1079  $is_group = true;
1080  }
1081  if (!$this->container_ref_id) {
1082  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1083  if ($this->container_ref_id) {
1084  $is_course = true;
1085  }
1086  }
1087  if (!$this->container_ref_id) {
1088  $this->tpl->setOnScreenMessage('failure', 'No container object found. Aborting');
1089  return true;
1090  }
1091  $this->container_obj_id = ilObject::_lookupObjId($this->container_ref_id);
1092 
1093  if ($a_init_participants && $this->container_obj_id) {
1094  if ($is_course) {
1095  return ilCourseParticipants::_getInstanceByObjId($this->container_obj_id);
1096  } elseif ($is_group) {
1097  return ilGroupParticipants::_getInstanceByObjId($this->container_obj_id);
1098  }
1099  }
1100 
1101  return false;
1102  }
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 (   $new_type)
protected

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

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

Referenced by executeCommand().

736  {
737  if (!is_object($this->object)) {
738  $this->object = new ilObjSession();
739  }
740  if (!$this->form instanceof ilPropertyFormGUI) {
741  $this->initForm('create');
742  }
743  return $this->form;
744  }
ilPropertyFormGUI $form
initForm(string $a_mode)
form( $class_path, string $cmd, string $submit_caption="")
+ 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 1402 of file class.ilObjSessionGUI.php.

References $form, $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, ilFileWizardInputGUI\setFilenames(), ilAdvancedMDRecordGUI\setPropertyForm(), ilCalendarRecurrence\setRecurrence(), 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().

1402  : bool
1403  {
1404  if ($this->form instanceof ilPropertyFormGUI) {
1405  return true;
1406  }
1407  $ilUser = $this->user;
1409  $this->lng->loadLanguageModule('dateplaner');
1410 
1412 
1413  $this->form = new ilPropertyFormGUI();
1414  $this->form->setMultipart(true);
1415  $this->form->setTableWidth('600px');
1416  $this->form->setFormAction($this->ctrl->getFormAction($this));
1417  $this->form->setMultipart(true);
1418 
1419  $this->form = $this->initDidacticTemplate($this->form);
1420 
1421  $this->lng->loadLanguageModule('dateplaner');
1422  $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
1423  $dur->setRequired(true);
1424  $dur->enableToggleFullTime(
1425  $this->lng->txt('event_fulltime_info'),
1426  $this->object->getFirstAppointment()->enabledFulltime()
1427  );
1428  $dur->setShowTime(true);
1429  $dur->setStart($this->object->getFirstAppointment()->getStart());
1430  $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1431 
1432  $this->form->addItem($dur);
1433 
1434 
1435  // Recurrence
1436  if ($a_mode == 'create') {
1437  if (!is_object($this->rec)) {
1438  $this->rec = new ilEventRecurrence();
1439  }
1440  $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
1441  $rec->allowUnlimitedRecurrences(false);
1442  $rec->setRecurrence($this->rec);
1443  $this->form->addItem($rec);
1444 
1445  // #14547
1446  $lp = new ilCheckboxInputGUI($this->lng->txt("sess_lp_preset"), "lp_preset");
1447  $lp->setInfo($this->lng->txt("sess_lp_preset_info"));
1448  $lp->setChecked(true);
1449  $this->form->addItem($lp);
1450  }
1451 
1452  $section = new ilFormSectionHeaderGUI();
1453  $section->setTitle($this->lng->txt('event_section_information'));
1454  $this->form->addItem($section);
1455 
1456  // title
1457  $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title');
1458  $title->setRequired(true);
1459  $title->setValue($this->object->getTitle());
1460  $title->setSize(50);
1461  $title->setMaxLength(70);
1462  $this->form->addItem($title);
1463 
1464  // desc
1465  $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc');
1466  $desc->setValue($this->object->getLongDescription());
1467  $desc->setRows(4);
1468  $desc->setCols(50);
1469  $this->form->addItem($desc);
1470 
1471  // location
1472  $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location');
1473  $desc->setValue($this->object->getLocation());
1474  $desc->setRows(4);
1475  $desc->setCols(50);
1476  $this->form->addItem($desc);
1477 
1478  // workflow
1479  $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details');
1480  $details->setValue($this->object->getDetails());
1481  $details->setCols(50);
1482  $details->setRows(4);
1483  $this->form->addItem($details);
1484 
1485  if ($a_mode == 'create') {
1486  $this->record_gui = new ilAdvancedMDRecordGUI(
1488  'sess'
1489  );
1490  $this->record_gui->setRefId($this->requested_ref_id);
1491  $this->record_gui->setPropertyForm($this->form);
1492  $this->record_gui->parse();
1493  } elseif ($this->checkPermissionBool('edit_metadata')) {
1494  $this->record_gui = new ilAdvancedMDRecordGUI(
1496  'sess',
1497  $this->object->getId()
1498  );
1499  $this->record_gui->setPropertyForm($this->form);
1500  $this->record_gui->parse();
1501  }
1502 
1503 
1504  // section
1505  $section = new ilFormSectionHeaderGUI();
1506  $section->setTitle($this->lng->txt('event_tutor_data'));
1507  $this->form->addItem($section);
1508 
1509  // name
1510  $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name');
1511  $tutor_name->setValue($this->object->getName());
1512  $tutor_name->setSize(20);
1513  $tutor_name->setMaxLength(70);
1514  $this->form->addItem($tutor_name);
1515 
1516  // email
1517  $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email');
1518  $tutor_email->setValue($this->object->getEmail());
1519  $tutor_email->setSize(20);
1520  $tutor_email->setMaxLength(70);
1521  $this->form->addItem($tutor_email);
1522 
1523  // phone
1524  $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone');
1525  $tutor_phone->setValue($this->object->getPhone());
1526  $tutor_phone->setSize(20);
1527  $tutor_phone->setMaxLength(70);
1528  $this->form->addItem($tutor_phone);
1529 
1530  $section = new ilFormSectionHeaderGUI();
1531  $section->setTitle($this->lng->txt('sess_section_reg'));
1532  $this->form->addItem($section);
1533 
1534  $reg_settings = new ilSessionMembershipRegistrationSettingsGUI(
1535  $this,
1536  $this->object,
1537  array(
1543  )
1544  );
1545  $reg_settings->addMembershipFormElements($this->form, '');
1546 
1547 
1548  $section = new ilFormSectionHeaderGUI();
1549  $section->setTitle($this->lng->txt('event_assign_files'));
1550  $this->form->addItem($section);
1551 
1552  $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
1553  $files->setFilenames(array(0 => ''));
1554  $this->form->addItem($files);
1555 
1556  $section = new ilFormSectionHeaderGUI();
1557  $section->setTitle($this->lng->txt('sess_setting_header_presentation'));
1558  $this->form->addItem($section);
1559 
1560  $object_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
1561 
1562  $features = new ilFormSectionHeaderGUI();
1563  $features->setTitle($this->lng->txt('obj_features'));
1564  $this->form->addItem($features);
1566  $this->object->getId(),
1567  $this->form,
1568  array(
1570  )
1571  );
1572 
1573  $gallery = new ilCheckboxInputGUI($this->lng->txt('sess_show_members'), 'show_members');
1574  $gallery->setChecked($this->object->getShowMembers());
1575  $gallery->setInfo($this->lng->txt('sess_show_participants_info'));
1576  $this->form->addItem($gallery);
1577 
1578 
1579  // Show mail to members type
1580  $mail_type = new ilRadioGroupInputGUI($this->lng->txt('sess_mail_type'), 'mail_type');
1581  $mail_type->setValue((string) $this->object->getMailToMembersType());
1582 
1583  $mail_tutors = new ilRadioOption(
1584  $this->lng->txt('sess_mail_admins_only'),
1586  $this->lng->txt('sess_mail_admins_only_info')
1587  );
1588  $mail_type->addOption($mail_tutors);
1589 
1590  $mail_all = new ilRadioOption(
1591  $this->lng->txt('sess_mail_all'),
1593  $this->lng->txt('sess_mail_all_info')
1594  );
1595  $mail_type->addOption($mail_all);
1596  $this->form->addItem($mail_type);
1597 
1598 
1599 
1600  switch ($a_mode) {
1601  case 'create':
1602  $this->form->setTitle($this->lng->txt('event_table_create'));
1603 
1604  $this->form->addCommandButton('save', $this->lng->txt('event_btn_add'));
1605  $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit'));
1606  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
1607 
1608  return true;
1609 
1610  case 'edit':
1611  $this->form->setTitle($this->lng->txt('event_table_update'));
1612 
1613  $this->form->addCommandButton('update', $this->lng->txt('save'));
1614  $this->form->addCommandButton('cancelEdit', $this->lng->txt('cancel'));
1615 
1616  return true;
1617  }
1618  return true;
1619  }
setFilenames(array $a_filenames)
This class represents an option in a radio group.
setPropertyForm(ilPropertyFormGUI $form)
This class represents an input GUI for recurring events/appointments (course events or calendar appoi...
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) ...
setRecurrence(int $a_type)
set type of recurrence public
This class represents a property in a property form.
ilPropertyFormGUI $form
initDidacticTemplate(ilPropertyFormGUI $form)
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
form( $class_path, string $cmd, string $submit_caption="")
This class represents a text area property in a property form.
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 375 of file class.ilObjSessionGUI.php.

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

375  : void
376  {
377  $ilUser = $this->user;
378 
379  $this->checkPermission('read');
380 
381  if ($ilUser->isAnonymous()) {
382  $this->ctrl->redirect($this, 'infoScreen');
383  }
384 
385  if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->object->getId())) {
386  ilSession::set("sess_hide_info", true);
387  ilEventParticipants::_unregister($ilUser->getId(), $this->object->getId());
388  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_unregistered'), true);
389  } else {
390  ilEventParticipants::_register($ilUser->getId(), $this->object->getId());
391  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_registered'), true);
392  }
393 
394  $this->ctrl->redirect($this, 'infoScreen');
395  }
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)
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 1621 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().

1621  : void
1622  {
1623  $event = $this->form->getItemByPostVar('event');
1624  if ($event->getStart() && $event->getEnd()) {
1625  $this->object->getFirstAppointment()->setStartingTime($event->getStart()->get(IL_CAL_UNIX));
1626  $this->object->getFirstAppointment()->setEndingTime($event->getStart()->get(IL_CAL_UNIX));
1627  $this->object->getFirstAppointment()->setStart($event->getStart());
1628  $this->object->getFirstAppointment()->setEnd($event->getEnd());
1629  $this->object->getFirstAppointment()->toggleFulltime($event->getStart() instanceof ilDate);
1630  }
1631 
1632  $this->object->setTitle($this->form->getInput('title'));
1633  $this->object->setDescription($this->form->getInput('desc'));
1634  $this->object->setLocation($this->form->getInput('location'));
1635  $this->object->setName($this->form->getInput('tutor_name'));
1636  $this->object->setPhone($this->form->getInput('tutor_phone'));
1637  $this->object->setEmail($this->form->getInput('tutor_email'));
1638  $this->object->setDetails($this->form->getInput('details'));
1639 
1640  $this->object->setRegistrationNotificationEnabled((bool) $this->form->getInput('registration_notification'));
1641  $this->object->setRegistrationNotificationOption($this->form->getInput('notification_option'));
1642 
1643  $this->object->setRegistrationType((int) $this->form->getInput('registration_type'));
1644 
1645  switch ($this->object->getRegistrationType()) {
1647  $this->object->enableCannotParticipateOption((bool) $this->form->getInput('show_cannot_participate_direct'));
1648  break;
1650  $this->object->enableCannotParticipateOption((bool) $this->form->getInput('show_cannot_participate_request'));
1651  break;
1652  default:
1653  $this->object->enableCannotParticipateOption(false);
1654  break;
1655  }
1656 
1657  // $this->object->setRegistrationMinUsers((int) $this->form->getInput('registration_min_members'));
1658  $this->object->setRegistrationMaxUsers((int) $this->form->getInput('registration_max_members'));
1659  $this->object->enableRegistrationUserLimit((int) $this->form->getInput('registration_membership_limited'));
1660  $this->object->setShowMembers((bool) $this->form->getInput('show_members'));
1661  $this->object->setMailToMembersType((int) $this->form->getInput('mail_type'));
1662 
1663  switch ((int) $this->form->getInput('waiting_list')) {
1664  case 2:
1665  $this->object->enableRegistrationWaitingList(true);
1666  $this->object->setWaitingListAutoFill(true);
1667  break;
1668 
1669  case 1:
1670  $this->object->enableRegistrationWaitingList(true);
1671  $this->object->setWaitingListAutoFill(false);
1672  break;
1673 
1674  default:
1675  $this->object->enableRegistrationWaitingList(false);
1676  $this->object->setWaitingListAutoFill(false);
1677  break;
1678  }
1679  }
const IL_CAL_UNIX
ilAppEventHandler $event
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRecurrenceSettings()

ilObjSessionGUI::loadRecurrenceSettings ( )
protected

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

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

Referenced by saveObject().

1681  : void
1682  {
1683  $this->rec = new ilEventRecurrence();
1684 
1685  switch ($this->form->getInput('frequence')) {
1687  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1688  $this->rec->setInterval((int) $this->form->getInput('count_DAILY'));
1689  break;
1690 
1692  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1693  $this->rec->setInterval((int) $this->form->getInput('count_WEEKLY'));
1694  if (is_array($this->form->getInput('byday_WEEKLY'))) {
1695  $this->rec->setBYDAY(ilUtil::stripSlashes(implode(',', $this->form->getInput('byday_WEEKLY'))));
1696  }
1697  break;
1698 
1700  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1701  $this->rec->setInterval((int) $this->form->getInput('count_MONTHLY'));
1702  switch ((int) $this->form->getInput('subtype_MONTHLY')) {
1703  case 0:
1704  // nothing to do;
1705  break;
1706 
1707  case 1:
1708  switch ((int) $this->form->getInput('monthly_byday_day')) {
1709  case 8:
1710  // Weekday
1711  $this->rec->setBYSETPOS($this->form->getInput('monthly_byday_num'));
1712  $this->rec->setBYDAY('MO,TU,WE,TH,FR');
1713  break;
1714 
1715  case 9:
1716  // Day of month
1717  $this->rec->setBYMONTHDAY($this->form->getInput('monthly_byday_num'));
1718  break;
1719 
1720  default:
1721  $this->rec->setBYDAY(($this->form->getInput('monthly_byday_num') . $this->form->getInput('monthly_byday_day')));
1722  break;
1723  }
1724  break;
1725 
1726  case 2:
1727  $this->rec->setBYMONTHDAY($this->form->getInput('monthly_bymonthday'));
1728  break;
1729  }
1730  break;
1731 
1733  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1734  $this->rec->setInterval((int) $this->form->getInput('count_YEARLY'));
1735  switch ((int) $this->form->getInput('subtype_YEARLY')) {
1736  case 0:
1737  // nothing to do;
1738  break;
1739 
1740  case 1:
1741  $this->rec->setBYMONTH($this->form->getInput('yearly_bymonth_byday'));
1742  $this->rec->setBYDAY(($this->form->getInput('yearly_byday_num') . $this->form->getInput('yearly_byday')));
1743  break;
1744 
1745  case 2:
1746  $this->rec->setBYMONTH($this->form->getInput('yearly_bymonth_by_monthday'));
1747  $this->rec->setBYMONTHDAY($this->form->getInput('yearly_bymonthday'));
1748  break;
1749  }
1750  break;
1751  }
1752 
1753  // UNTIL
1754  switch ((int) $this->form->getInput('until_type')) {
1755  case 1:
1756  $this->rec->setFrequenceUntilDate(null);
1757  // nothing to do
1758  break;
1759 
1760  case 2:
1761  $this->rec->setFrequenceUntilDate(null);
1762  $this->rec->setFrequenceUntilCount((int) $this->form->getInput('count'));
1763  break;
1764 
1765  case 3:
1766  $frequence = $this->form->getItemByPostVar('frequence');
1767  $end = $frequence->getRecurrence()->getFrequenceUntilDate();
1768  $this->rec->setFrequenceUntilCount(0);
1769  $this->rec->setFrequenceUntilDate($end);
1770  break;
1771  }
1772  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ materialsObject()

ilObjSessionGUI::materialsObject ( )

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

References ilObjectGUI\$data, ilObject\_lookupType(), ilObjectGUI\buildAddNewItemElements(), ILIAS\Repository\ctrl(), getContainerRefId(), getCreatableObjectTypes(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

1104  : void
1105  {
1106  $this->tabs_gui->activateTab('materials');
1107 
1108  $parent_ref_id = $this->tree->getParentId($this->object->getRefId());
1109  $parent_type = ilObject::_lookupType($parent_ref_id, true);
1110  $parent_gui_class = 'ilObj' . $this->obj_definition->getClassName($parent_type) . 'GUI';
1111  $this->ctrl->setParameterByClass($parent_gui_class, 'ref_id', $parent_ref_id);
1113  $this->buildAddNewItemElements(
1114  $this->getCreatableObjectTypes(),
1115  $parent_gui_class,
1116  $this->object->getRefId()
1117  )
1118  );
1119  $gui->render();
1120  $this->ctrl->clearParameterByClass($parent_gui_class, 'ref_id');
1121 
1122  $this->event_items = new ilEventItems($this->object->getId());
1123 
1124  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1125 
1126  $tbl->setDisableFilterHiding(true);
1127 
1128  $tbl->addMultiCommand('saveMaterials', $this->lng->txt('sess_assign'));
1129  $tbl->addMultiCommand("removeMaterials", $this->lng->txt("remove"));
1130 
1131  $tbl->setTitle($this->lng->txt("event_assign_materials_table"));
1132  $tbl->setDescription($this->lng->txt('event_assign_materials_info'));
1133 
1134  $tbl->setMaterialItems($this->event_items->getItems());
1135  $tbl->setContainerRefId($this->getContainerRefId());
1136  $data = $tbl->getDataFromDb();
1137  $tbl->setMaterials($data);
1138 
1139  $this->tpl->setContent($tbl->getHTML());
1140  }
buildAddNewItemElements(array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
Render add new item selector.
static _lookupType(int $id, bool $reference=false)
class ilEventItems
+ Here is the call graph for this function:

◆ membersObject()

ilObjSessionGUI::membersObject ( )
protected

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

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

278  : void
279  {
280  $this->ctrl->redirectByClass('ilSessionMembershipGUI', 'participants');
281  }
+ 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 495 of file class.ilObjSessionGUI.php.

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

Referenced by showJoinRequestButton().

495  : void
496  {
497  $tree = $this->tree;
498 
499  // if folder is in a course, modify item list gui according to course requirements
500  if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs')) {
501  // #10611
502  ilObjectActivation::addListGUIActivationProperty($a_item_list_gui, $a_item_data);
503 
504  $course_obj_id = ilObject::_lookupObjId($course_ref_id);
506  $a_item_list_gui,
507  get_class($this),
508  $a_item_data,
509  $a_show_path,
510  $course_ref_id,
511  $course_obj_id,
512  $this->object->getRefId()
513  );
514  }
515  }
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 1200 of file class.ilObjSessionGUI.php.

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

Referenced by removeMaterialsObject(), and saveMaterialsObject().

1200  : void
1201  {
1202  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1203  $tbl->setOffset(0);
1204  $tbl->storeNavParameter();//remove offset and go to page 1
1205 
1206  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1207  $this->ctrl->redirect($this, 'materials');
1208  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilObjSessionGUI::prepareOutput ( bool  $show_sub_objects = true)

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

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

Referenced by executeCommand().

293  : bool
294  {
295  parent::prepareOutput($show_sub_objects);
296 
297  if (!$this->getCreationMode()) {
298  $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
299 
300  $this->tpl->setTitle(
301  $this->object->getFirstAppointment()->appointmentToString() . $title
302  );
303  }
304  return true;
305  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printAttendanceListObject()

ilObjSessionGUI::printAttendanceListObject ( )
protected

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

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

1254  : void
1255  {
1256  $this->checkPermission('manage_members');
1257 
1258  $list = $this->initAttendanceList();
1259  $list->initFromForm();
1260  $list->setCallback(array($this, 'getAttendanceListUserData'));
1261 
1262  $this->event_part = new ilEventParticipants($this->object->getId());
1263  $list->getFullscreenHTML();
1264  }
class ilEventParticipants
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 1928 of file class.ilObjSessionGUI.php.

1928  : array
1929  {
1930  $tmp_data = [];
1931  foreach ($a_usr_ids as $usr_id) {
1932  $tmp_data[$usr_id] = [];
1933  }
1934  return $tmp_data;
1935  }

◆ redirectToParentContentPageObject()

ilObjSessionGUI::redirectToParentContentPageObject ( )
protected

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

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

1792  : void
1793  {
1795  $tree = $this->tree;
1796  $ctrl = $this->ctrl;
1797 
1798  $parent_id = $tree->getParentId($this->object->getRefId());
1799 
1800  // #11650
1801  $parent_type = ilObject::_lookupType($parent_id, true);
1802 
1803  $parent_class = $objDefinition->getClassName($parent_type);
1804  $parent_class = 'ilObj' . $parent_class . 'GUI';
1805 
1806  $ctrl->setParameterByClass($parent_class, "ref_id", $parent_id);
1807  $ctrl->redirectByClass($parent_class, "view");
1808  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
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 526 of file class.ilObjSessionGUI.php.

References unregisterObject().

526  : void
527  {
528  $this->unregisterObject(true);
529  }
unregisterObject(bool $a_refuse_participation=false)
+ Here is the call graph for this function:

◆ registerObject()

ilObjSessionGUI::registerObject ( )

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

References $event, $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().

307  : void
308  {
309  $ilUser = $this->user;
310  $ilAppEventHandler = $this->event;
311 
312  $this->checkPermission('visible');
313 
314  $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
315 
316  $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
317  $event_part->updateExcusedForUser($ilUser->getId(), false);
318 
319  if (
320  $this->getCurrentObject()->isRegistrationUserLimitEnabled() &&
321  $this->getCurrentObject()->getRegistrationMaxUsers() &&
322  (count($event_part->getRegisteredParticipants()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
323  ) {
324  if (!$this->getCurrentObject()->isRegistrationWaitingListEnabled()) {
325  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('sess_reg_max_users_exceeded'), true);
326  $this->ctrl->redirect($this, 'infoScreen');
327  }
328  $wait = new ilSessionWaitingList($this->getCurrentObject()->getId());
329  $wait->addToList($ilUser->getId());
330  $this->ctrl->redirect($this, 'infoScreen');
331  }
332 
333 
334  switch ($this->getCurrentObject()->getRegistrationType()) {
336  $this->ctrl->redirect($this, 'info');
337  break;
338 
340  $part->register($ilUser->getId());
341  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_registered'), true);
342 
343  $ilAppEventHandler->raise(
344  "components/ILIAS/Session",
345  'enter',
346  array(
347  'obj_id' => $this->getCurrentObject()->getId(),
348  'ref_id' => $this->getCurrentObject()->getRefId(),
349  'usr_id' => $ilUser->getId()
350  )
351  );
352 
353  $this->ctrl->redirect($this, 'infoScreen');
354  break;
355 
357  $this->tpl->setOnScreenMessage('success', $this->lng->txt('sess_registered_confirm'), true);
358  $part->addSubscriber($ilUser->getId());
359 
360  $ilAppEventHandler->raise(
361  "components/ILIAS/Session",
362  'register',
363  array(
364  'obj_id' => $this->getCurrentObject()->getId(),
365  'ref_id' => $this->getCurrentObject()->getRefId(),
366  'usr_id' => $ilUser->getId()
367  )
368  );
369 
370  $this->ctrl->redirect($this, 'infoScreen');
371  break;
372  }
373  }
static getInstance(int $a_ref_id)
class ilEventParticipants
ilEventParticipants $event_part
ilAppEventHandler $event
updateExcusedForUser(int $a_usr_id, bool $a_status)
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 1171 of file class.ilObjSessionGUI.php.

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

1171  : void
1172  {
1173  $items_checked = $this->requested_items;
1174 
1175  $this->event_items = new ilEventItems($this->object->getId());
1176  $this->event_items->removeItems($items_checked);
1177 
1178  $this->postUpdateMaterials();
1179  }
removeItems(array $a_items)
class ilEventItems
postUpdateMaterials()
redirect to list of materials without offset/page.
+ Here is the call graph for this function:

◆ resetFilter()

ilObjSessionGUI::resetFilter ( )

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

References ILIAS\Repository\ctrl().

1163  : void
1164  {
1165  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1166  $tbl->resetOffset(); // sets record offest to 0 (first page)
1167  $tbl->resetFilter(); // clears filter
1168  $this->ctrl->redirect($this, "materials");
1169  }
+ Here is the call graph for this function:

◆ saveAndAssignMaterialsObject()

ilObjSessionGUI::saveAndAssignMaterialsObject ( )
protected

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

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

746  : void
747  {
748  $this->saveObject(false);
749 
750  $this->ctrl->setParameter($this, 'ref_id', $this->object->getRefId());
751  $this->ctrl->setParameter($this, 'new_type', '');
752  $this->ctrl->redirect($this, 'materials');
753  }
+ Here is the call graph for this function:

◆ saveMaterialsObject()

ilObjSessionGUI::saveMaterialsObject ( )

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

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

1181  : void
1182  {
1183  $this->event_items = new ilEventItems($this->object->getId());
1184  $db_items = $this->event_items->getItems();
1185 
1186  $list_items_checked = $this->requested_items;
1187  $list_items_checked = array_map('intval', $list_items_checked);
1188 
1189  $items_to_save = array_merge($db_items, $list_items_checked);
1190  $items_to_save = array_unique($items_to_save);
1191 
1192  $this->event_items->setItems($items_to_save);
1193  $this->event_items->update();
1194  $this->postUpdateMaterials();
1195  }
class ilEventItems
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 755 of file class.ilObjSessionGUI.php.

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

755  : void
756  {
757  $ilUser = $this->user;
759 
760  $this->object = new ilObjSession();
761 
762  $this->ctrl->saveParameter($this, "new_type");
763 
764  $this->initForm('create');
765  $this->ilErr->setMessage('');
766  if (!$this->form->checkInput()) {
767  $this->tpl->setOnScreenMessage(
769  $this->lng->txt('err_check_input')
770  );
771  $this->form->setValuesByPost();
772  $this->createObject();
773  return;
774  }
775 
776  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI && !$this->record_gui->importEditFormPostValues()
777  ) {
778  $this->ilErr->setMessage($this->lng->txt('err_check_input'));
779  }
780 
781  $this->load();
782  $this->loadRecurrenceSettings();
783 
784  $this->object->validate();
785  $this->object->getFirstAppointment()->validate();
786 
787  if (strlen($this->ilErr->getMessage())) {
788  $this->tpl->setOnScreenMessage('failure', $this->ilErr->getMessage());
789  $this->form->setValuesByPost();
790  $this->createObject();
791  }
792  // Create session
793  $this->object->create();
794  $this->object->createReference();
795  $this->object->putInTree($this->requested_ref_id);
796  $this->object->setPermissions($this->requested_ref_id);
797 
799  $this->object->getId(),
800  $this->form,
801  array(
803  )
804  );
805  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
806  $this->record_gui->writeEditForm($this->object->getId());
807  }
808 
809 
810  // apply didactic template?
811  $dtpl = $this->getDidacticTemplateVar("dtpl");
812  if ($dtpl) {
813  $this->object->applyDidacticTemplate($dtpl);
814  }
815 
816  // #14547 - active is default
817  if (!$this->form->getInput("lp_preset")) {
818  $lp_obj_settings = new ilLPObjSettings($this->object->getId());
819  $lp_obj_settings->setMode(ilLPObjSettings::LP_MODE_DEACTIVATED);
820  $lp_obj_settings->update(false);
821  }
822 
823  // create appointment
824  $this->object->getFirstAppointment()->setSessionId($this->object->getId());
825  $this->object->getFirstAppointment()->create();
826 
827  $this->handleFileUpload();
828 
829  $object_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
830 
831  $this->createRecurringSessions((bool) $this->form->getInput("lp_preset"));
832 
833  if ($a_redirect_on_success) {
834  $this->tpl->setOnScreenMessage('info', $this->lng->txt('event_add_new_event'), true);
835  $this->ctrl->returnToParent($this);
836  }
837  }
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
initForm(string $a_mode)
form( $class_path, string $cmd, string $submit_caption="")
ilObjectService $object_service
+ Here is the call graph for this function:

◆ showJoinRequestButton()

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

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

References ilObjectGUI\$html, $info, $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(), null, ILIAS\Repository\object(), ilAdvancedMDRecordGUI\setInfoObject(), and ILIAS\Repository\ui().

Referenced by showJoinRequestButtonInCalendar().

531  : bool
532  {
533  $ilUser = $this->user;
534 
535  if (!$ilToolbar) {
536  $ilToolbar = $this->toolbar;
537  }
538 
539  if (!$this->getCurrentObject()->enabledRegistrationForUsers() || $ilUser->isAnonymous()) {
540  return false;
541  }
542 
543  $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
544 
545  $this->ctrl->setParameter($this, "ref_id", $this->getCurrentObject()->getRefId());
546 
547  $btn_excused = null;
548  if ($this->object->isCannotParticipateOptionEnabled()) {
549  $btn_excused = $this->ui->factory()->button()->standard(
550  $this->lng->txt('sess_bt_refuse'),
551  $this->ctrl->getLinkTarget($this, 'refuseParticipation')
552  );
553  }
554 
555 
556  if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->getCurrentObject()->getId())) {
557  if (!is_null($btn_excused)) {
558  $ilToolbar->addComponent($btn_excused);
559  }
560  return true;
561  } elseif ($part->isSubscriber($ilUser->getId())) {
562  if (!is_null($btn_excused)) {
563  $ilToolbar->addComponent($btn_excused);
564  }
565  return true;
566  } elseif (ilSessionWaitingList::_isOnList($ilUser->getId(), $this->getCurrentObject()->getId())) {
567  if (!is_null($btn_excused)) {
568  $ilToolbar->addComponent($btn_excused);
569  }
570  return true;
571  }
572 
573  $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
574 
575  if (
576  $this->getCurrentObject()->isRegistrationUserLimitEnabled() &&
577  $this->getCurrentObject()->getRegistrationMaxUsers() &&
578  (count($event_part->getRegisteredParticipants()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
579  ) {
580  if ($this->getCurrentObject()->isRegistrationWaitingListEnabled()) {
581  $this->tpl->setOnScreenMessage('info', $this->lng->txt('sess_reg_max_users_exceeded_wl'));
582  $btn_attend = $this->ui->factory()->button()->primary(
583  $this->lng->txt("mem_add_to_wl"),
584  $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register")
585  );
586  $ilToolbar->addComponent($btn_attend);
587  if (!$event_part->isExcused($ilUser->getId()) && !is_null($btn_excused)) {
588  $ilToolbar->addComponent($btn_excused);
589  }
590  } else {
591  $this->tpl->setOnScreenMessage('info', $this->lng->txt('sess_reg_max_users_exceeded'));
592  }
593  return true;
594  } elseif (is_null(ilSession::get("sess_hide_info"))) {
595  $this->tpl->setOnScreenMessage('info', $this->lng->txt('sess_join_info'));
596  $btn_attend = $this->ui->factory()->button()->primary(
597  $this->lng->txt("join_session"),
598  $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register")
599  );
600  $ilToolbar->addComponent($btn_attend);
601  if (!$event_part->isExcused($ilUser->getId()) && !is_null($btn_excused)) {
602  $ilToolbar->addComponent($btn_excused);
603  }
604  return true;
605  }
606  return false;
607  }
static get(string $a_var)
static getInstance(int $a_ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _isRegistered(int $a_usr_id, int $a_event_id)
class ilEventParticipants
ilEventParticipants $event_part
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 521 of file class.ilObjSessionGUI.php.

References showJoinRequestButton().

521  : bool
522  {
523  return $this->showJoinRequestButton($a_ilToolbar);
524  }
showJoinRequestButton(?ilToolbarGUI $ilToolbar=null)
+ Here is the call graph for this function:

◆ unregisterObject()

ilObjSessionGUI::unregisterObject ( bool  $a_refuse_participation = false)

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

References $access, $event, $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().

397  : void
398  {
399  $ilUser = $this->user;
400  $ilAppEventHandler = $this->event;
402  $tree = $this->tree;
403 
404  $part = ilSessionParticipants::getInstance($this->object->getRefId());
405  if ($part->isSubscriber($ilUser->getId())) {
406  $part->deleteSubscriber($ilUser->getId());
407  }
408 
409  $part->unregister($ilUser->getId());
410 
411  if ($a_refuse_participation) {
412  $event_part = new \ilEventParticipants($this->object->getId());
413  $event_part->updateExcusedForUser($ilUser->getId(), true);
414  }
415 
416  ilSessionWaitingList::deleteUserEntry($ilUser->getId(), $this->getCurrentObject()->getId());
417 
418  // check for visible permission of user
420  $access->clear();
421  $has_access = $access->checkAccessOfUser(
422  $ilUser->getId(),
423  'visible',
424  '',
425  $this->object->getRefId()
426  );
427  if (!$has_access) {
428  $parent = $tree->getParentId($this->object->getRefId());
429  $this->redirectToRefId($parent);
430  return;
431  }
432 
433  $ilAppEventHandler->raise(
434  "components/ILIAS/Session",
435  'unregister',
436  array(
437  'obj_id' => $this->getCurrentObject()->getId(),
438  'ref_id' => $this->getCurrentObject()->getRefId(),
439  'usr_id' => $ilUser->getId()
440  )
441  );
442  if ($a_refuse_participation) {
443  $this->tpl->setOnScreenMessage('info', $this->lng->txt('sess_participation_refused_info'), true);
444  } else {
445  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_unregistered'), true);
446  }
447  $this->ctrl->returnToParent($this);
448  }
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)
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 949 of file class.ilObjSessionGUI.php.

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

949  : void
950  {
952 
953  $old_autofill = $this->object->hasWaitingListAutoFill();
954 
955  $this->initForm('edit');
956  $this->ilErr->setMessage('');
957  if (!$this->form->checkInput()) {
958  $this->tpl->setOnScreenMessage(
960  $this->lng->txt('err_check_input')
961  );
962  $this->form->setValuesByPost();
963  $this->editObject();
964  return;
965  }
966 
967  //Mantis 21972: Choose didactic template on settings screen
968  $old_type = ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
969 
970  $modified = false;
971  $new_type_info = $this->form->getInput('didactic_type');
972  if ($new_type_info) {
973  $new_type = explode('_', $this->form->getInput('didactic_type'));
974  $new_type = (int) $new_type[1];
975 
976  $modified = ($new_type !== $old_type);
977  }
978 
979  if (
980  $this->record_gui instanceof \ilAdvancedMDRecordGUI &&
981  !$this->record_gui->importEditFormPostValues()
982  ) {
983  $this->tpl->setOnScreenMessage(
985  $this->lng->txt('err_check_input')
986  );
987  $this->form->setValuesByPost();
988  $this->editObject();
989  }
990 
991  $this->load();
992 
993  $this->object->validate();
994  $this->object->getFirstAppointment()->validate();
995 
996  if (strlen($this->ilErr->getMessage())) {
997  $this->tpl->setOnScreenMessage('failure', $this->ilErr->getMessage());
998  $this->editObject();
999  }
1000  // Update event
1001  $this->object->update();
1002  $this->object->getFirstAppointment()->update();
1003 
1005  $this->object->getId(),
1006  $this->form,
1007  array(
1009  )
1010  );
1011  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
1012  $this->record_gui->writeEditForm();
1013  }
1014  $this->handleFileUpload();
1015 
1016  $object_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
1017 
1018  // if autofill has been activated trigger process
1019  if (!$old_autofill &&
1020  $this->object->hasWaitingListAutoFill()) {
1021  $this->object->handleAutoFill();
1022  }
1023 
1024  //Mantis 21972: Choose didactic template on settings screen
1025  if (!$modified) {
1026  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_updated'), true);
1027  $this->ctrl->redirect($this, 'edit');
1028  return;
1029  }
1030 
1031  if ($new_type == 0) {
1032  $new_type_txt = $this->lng->txt('il_sess_status_open');
1033  } else {
1034  $dtpl = new ilDidacticTemplateSetting($new_type);
1035  $new_type_txt = $dtpl->getPresentationTitle($this->lng->getLangKey());
1036  }
1037  $this->tabs_gui->activateTab('settings');
1038 
1039  $confirm = new ilConfirmationGUI();
1040  $confirm->setFormAction($this->ctrl->getFormAction($this));
1041  $confirm->setHeaderText($this->lng->txt('sess_warn_sess_type_changed'));
1042  $confirm->addItem(
1043  'sess_type',
1044  (string) $new_type,
1045  $this->lng->txt('sess_info_new_sess_type') . ': ' . $new_type_txt
1046  );
1047  $confirm->setConfirm($this->lng->txt('sess_change_type'), 'updateSessionType');
1048  $confirm->setCancel($this->lng->txt('cancel'), 'edit');
1049 
1050  $this->tpl->setContent($confirm->getHTML());
1051  }
importEditFormPostValues()
Load edit form values from post.
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
ilPropertyFormGUI $form
initForm(string $a_mode)
form( $class_path, string $cmd, string $submit_caption="")
ilObjectService $object_service
+ Here is the call graph for this function:

◆ updateSessionTypeObject()

ilObjSessionGUI::updateSessionTypeObject ( )

change session type

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

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

1056  : void
1057  {
1059  $this->object->getRefId(),
1060  (int) $this->http->request()->getParsedBody()['sess_type']
1061  );
1062 
1063  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1064  $this->ctrl->redirect($this, 'edit');
1065  }
static switchTemplate(int $a_ref_id, int $a_new_tpl_id)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilObjSessionGUI::$access
protected

◆ $container_obj_id

int ilObjSessionGUI::$container_obj_id = 0
protected

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

◆ $container_ref_id

int ilObjSessionGUI::$container_ref_id = 0
protected

Definition at line 54 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 59 of file class.ilObjSessionGUI.php.

◆ $event_part

ilEventParticipants ilObjSessionGUI::$event_part = null
protected

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

◆ $ilErr

ilErrorHandling ilObjSessionGUI::$ilErr
protected

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

◆ $lng

ilLanguage ilObjSessionGUI::$lng

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

Referenced by showJoinRequestButton().

◆ $locator

ilLocatorGUI ilObjSessionGUI::$locator
protected

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

Referenced by addLocatorItems().

◆ $objDefinition

ilObjectDefinition ilObjSessionGUI::$objDefinition

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

Referenced by redirectToParentContentPageObject().

◆ $object_service

ilObjectService ilObjSessionGUI::$object_service
protected

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

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

◆ $rbacreview

ilRbacReview ilObjSessionGUI::$rbacreview
protected

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

Referenced by getDefaultMemberRole(), and getLocalRoles().

◆ $rec

ilEventRecurrence ilObjSessionGUI::$rec = null
protected

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

Referenced by createRecurringSessions().

◆ $record_gui

ilAdvancedMDRecordGUI ilObjSessionGUI::$record_gui = null
protected

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

◆ $refinery

ILIAS Refinery Factory ilObjSessionGUI::$refinery
protected

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

◆ $requested_file_id

int ilObjSessionGUI::$requested_file_id = 0
protected

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

◆ $requested_items

array ilObjSessionGUI::$requested_items = []
protected

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

Referenced by removeMaterialsObject(), and saveMaterialsObject().

◆ $requested_offset

int ilObjSessionGUI::$requested_offset = 0
protected

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

◆ $requested_ref_id

int ilObjSessionGUI::$requested_ref_id = 0
protected

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

Referenced by addLocatorItems().

◆ $requested_sort_by

string ilObjSessionGUI::$requested_sort_by = ""
protected

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

◆ $requested_sort_order

string ilObjSessionGUI::$requested_sort_order = ""
protected

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

◆ $requested_user_id

int ilObjSessionGUI::$requested_user_id = 0
protected

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

◆ $tabs_gui

ilTabsGUI ilObjSessionGUI::$tabs_gui
protected

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

Referenced by attendanceListObject(), and getTabs().

◆ $toolbar

ilToolbarGUI ilObjSessionGUI::$toolbar
protected

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

Referenced by showJoinRequestButton().

◆ $tpl

ilGlobalTemplateInterface ilObjSessionGUI::$tpl

Definition at line 42 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: