ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 
 applyFilter ()
 
 resetFilter ()
 
 removeMaterialsObject ()
 
 saveMaterialsObject ()
 
 postUpdateMaterials ()
 redirect to list of materials without offset/page. More...
 
 attendanceListObject ()
 
 getAttendanceListUserData (int $a_user_id, array $a_filters)
 
 eventsListObject ()
 
 afterSaveCallback (ilObject $a_obj)
 Custom callback after object is created (in parent container) More...
 
 readMemberData (array $a_usr_ids)
 Used for waiting list. More...
 
 getContainerRefId ()
 
 getDefaultMemberRole ()
 
 getLocalRoles ()
 
 createMailSignature ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] 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)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 
 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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 renderObject ()
 
 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...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 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...
 

Protected Attributes

ILIAS DI UIServices $ui
 
ilAppEventHandler $event
 
ILIAS FileUpload FileUpload $upload
 
ilHelpGUI $help
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ilErrorHandling $ilErr
 
ilObjectService $object_service
 
ilTabsGUI $tabs_gui
 
ilLocatorGUI $locator
 
ilRbacReview $rbacreview
 
int $container_ref_id = 0
 
int $container_obj_id = 0
 
ilPropertyFormGUI $form = null
 
ilAdvancedMDRecordGUI $record_gui = null
 
ilEventRecurrence $rec = null
 
ilEventItems $event_items = null
 
ilEventParticipants $event_part = null
 
int $requested_ref_id = 0
 
int $requested_user_id = 0
 
int $requested_file_id = 0
 
int $requested_offset = 0
 
string $requested_sort_by = ""
 
string $requested_sort_order = ""
 
array $requested_items = []
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
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 70 of file class.ilObjSessionGUI.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__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().

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

Member Function Documentation

◆ __showButton()

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

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

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

Referenced by eventsListObject().

1403  : void
1404  {
1405  $this->toolbar->addButton($text, $this->ctrl->getLinkTarget($this, $cmd), $target);
1406  }
+ 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 1780 of file class.ilObjSessionGUI.php.

1780  : int
1781  {
1782  return mktime($time['h'], $time['m'], 0, $date['m'], $date['d'], $date['y']);
1783  }

◆ _goto()

static ilObjSessionGUI::_goto ( string  $a_target)
static

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

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

◆ addLocatorItems()

ilObjSessionGUI::addLocatorItems ( )
protected

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

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

1785  : void
1786  {
1787  $ilLocator = $this->locator;
1788 
1789  if (!$this->getCreationMode()) {
1790  // see prepareOutput()
1791  $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
1792  $title = $this->object->getFirstAppointment()->appointmentToString() . $title;
1793 
1794  $ilLocator->addItem($title, $this->ctrl->getLinkTarget($this, "infoScreen"), "", $this->requested_ref_id);
1795  }
1796  }
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
+ Here is the call graph for this function:

◆ afterSaveCallback()

ilObjSessionGUI::afterSaveCallback ( ilObject  $a_obj)

Custom callback after object is created (in parent container)

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

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

1923  : void
1924  {
1925  // add new object to materials
1926  $event_items = new ilEventItems($this->object->getId());
1927  $event_items->addItem($a_obj->getRefId());
1928  $event_items->update();
1929  }
addItem(int $a_item_ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ applyFilter()

ilObjSessionGUI::applyFilter ( )

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

References ILIAS\Repository\ctrl().

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

◆ attendanceListObject()

ilObjSessionGUI::attendanceListObject ( )

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

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

1215  : void
1216  {
1217  $tpl = $this->tpl;
1218  $ilTabs = $this->tabs_gui;
1219 
1220  $this->checkPermission('manage_members');
1221  $ilTabs->setTabActive('event_edit_members');
1222 
1223  $list = $this->initAttendanceList();
1224  $form = $list->initForm('printAttendanceList');
1226  }
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 1951 of file class.ilObjSessionGUI.php.

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

1951  : void
1952  {
1953  $ilCtrl = $this->ctrl;
1954  $tree = $this->tree;
1955 
1956  $parent_id = $tree->getParentId($this->requested_ref_id);
1957 
1958  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent_id);
1959 
1960  $ilCtrl->redirectByClass("ilrepositorygui", "");
1961  }
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 1988 of file class.ilObjSessionGUI.php.

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

1988  : string
1989  {
1990  $link = chr(13) . chr(10) . chr(13) . chr(10);
1991  $link .= $this->lng->txt('sess_mail_permanent_link');
1992  $link .= chr(13) . chr(10) . chr(13) . chr(10);
1993  $link .= ilLink::_getLink($this->object->getRefId());
1994  return rawurlencode(base64_encode($link));
1995  }
+ Here is the call graph for this function:

◆ createRecurringSessions()

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

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

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

Referenced by saveObject().

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

◆ editObject()

ilObjSessionGUI::editObject ( )

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

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

Referenced by updateObject().

948  : void
949  {
950  $this->checkPermission('write');
951  $this->tabs_gui->setTabActive('settings');
952 
953  $this->initForm('edit');
954  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit.html', 'Modules/Session');
955  $this->tpl->setVariable('EVENT_EDIT_TABLE', $this->form->getHTML());
956  }
initForm(string $a_mode)
form( $class_path, string $cmd, string $submit_caption="")
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eventsListObject()

ilObjSessionGUI::eventsListObject ( )

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

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

1289  : void
1290  {
1291  $ilAccess = $this->access;
1292  $ilUser = $this->user;
1293  $tree = $this->tree;
1294 
1295  if (!$ilAccess->checkAccess('manage_members', '', $this->object->getRefId())) {
1296  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE);
1297  }
1298 
1299  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_list.html', 'Modules/Session');
1300  $this->__showButton($this->ctrl->getLinkTarget($this, 'exportCSV'), $this->lng->txt('event_csv_export'));
1301 
1302  $this->tpl->addBlockFile("EVENTS_TABLE", "events_table", "tpl.table.html");
1303  $this->tpl->addBlockFile('TBL_CONTENT', 'tbl_content', 'tpl.sess_list_row.html', 'Modules/Session');
1304 
1305  $members_obj = $this->initContainer(true);
1306  $members = $members_obj->getParticipants();
1307  $members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
1308 
1309  // Table
1310  $tbl = new ilTableGUI();
1311  $tbl->setTitle(
1312  $this->lng->txt("event_overview"),
1313  'standard/icon_usr.svg',
1314  $this->lng->txt('obj_usr')
1315  );
1316  $this->ctrl->setParameter($this, 'offset', $this->requested_offset);
1317 
1318  $course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1319  $events = [];
1320  foreach ($tree->getSubTree($tree->getNodeData($course_ref_id), false, ['sess']) as $event_id) {
1321  $tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
1322  if (!is_object($tmp_event) || $tmp_event->getType() != 'sess') {
1323  continue;
1324  }
1325  $events[] = $tmp_event;
1326  }
1327 
1328  $headerNames = [];
1329  $headerVars = [];
1330  $colWidth = [];
1331 
1332  $headerNames[] = $this->lng->txt('name');
1333  $headerVars[] = "name";
1334  $colWidth[] = '20%';
1335 
1336  for ($i = 1; $i <= count($events); $i++) {
1337  $headerNames[] = $i;
1338  $headerVars[] = "event_" . $i;
1339  $colWidth[] = 80 / count($events) . "%";
1340  }
1341 
1342  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1343  $tbl->setHeaderNames($headerNames);
1344  $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this));
1345  $tbl->setColumnWidth($colWidth);
1346 
1347  $tbl->setOrderColumn($this->requested_sort_by);
1348  $tbl->setOrderDirection($this->requested_sort_order);
1349  $tbl->setOffset($this->requested_offset);
1350  $tbl->setLimit((int) $ilUser->getPref("hits_per_page"));
1351  $tbl->setMaxCount(count($members));
1352  $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
1353 
1354  $sliced_users = array_slice($members, $this->requested_offset, ilSession::get("tbl_limit"));
1355  $tbl->disable('sort');
1356  $tbl->render();
1357 
1358  $counter = 0;
1359  foreach ($sliced_users as $user_id) {
1360  foreach ($events as $event_obj) {
1361  $this->tpl->setCurrentBlock("eventcols");
1362 
1363  $event_part = new ilEventParticipants($this->object->getId());
1364 
1365  {
1366  $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1367  ilUtil::getImagePath('standard/icon_ok.svg') :
1368  ilUtil::getImagePath('standard/icon_not_ok.svg'));
1369 
1370  $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
1371  $this->lng->txt('event_participated') :
1372  $this->lng->txt('event_not_participated'));
1373  }
1374 
1375  $this->tpl->parseCurrentBlock();
1376  }
1377 
1378  $this->tpl->setCurrentBlock("tbl_content");
1379  $name = ilObjUser::_lookupName($user_id);
1380  $this->tpl->setVariable("LASTNAME", $name['lastname']);
1381  $this->tpl->setVariable("FIRSTNAME", $name['firstname']);
1382  $this->tpl->setVariable("LOGIN", ilObjUser::_lookupLogin($user_id));
1383  $this->tpl->parseCurrentBlock();
1384  }
1385 
1386  $this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));
1387  $this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
1388  $this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
1389  $this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
1390  $this->tpl->setVariable("HEAD_TXT_DATE_TIME", $this->lng->txt("event_date_time"));
1391  $i = 1;
1392  foreach ($events as $event_obj) {
1393  $this->tpl->setCurrentBlock("legend_loop");
1394  $this->tpl->setVariable("LEGEND_DIGIT", $i++);
1395  $this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
1396  $this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1397  $this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1398  $this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1399  $this->tpl->parseCurrentBlock();
1400  }
1401  }
static get(string $a_var)
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
initContainer(bool $a_init_participants=false)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _lookupName(int $a_user_id)
lookup user name
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilEventParticipants $event_part
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),&#39;usr_data&#39;,&#39;lastname&#39;,&#39;usr_id&#39;) => sorts by lastname.
__showButton(string $cmd, string $text, string $target='')
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 159 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().

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

◆ getAttendanceListUserData()

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

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

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

1271  : ?array
1272  {
1273  $data = $this->event_part->getUser($a_user_id);
1274 
1275  if ($a_filters && $a_filters["registered"] && !$data["registered"]) {
1276  return null;
1277  }
1278 
1279  $data['registered'] = $data['registered'] ?
1280  $this->lng->txt('yes') :
1281  $this->lng->txt('no');
1282  $data['participated'] = $data['participated'] ?
1283  $this->lng->txt('yes') :
1284  $this->lng->txt('no');
1285 
1286  return $data;
1287  }
+ Here is the call graph for this function:

◆ getContainerRefId()

ilObjSessionGUI::getContainerRefId ( )

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

References $container_ref_id, and initContainer().

Referenced by materialsObject().

1943  : int
1944  {
1945  if (!$this->container_ref_id) {
1946  $this->initContainer();
1947  }
1948  return $this->container_ref_id;
1949  }
initContainer(bool $a_init_participants=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultMemberRole()

ilObjSessionGUI::getDefaultMemberRole ( )

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

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

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

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

1981  : array
1982  {
1984 
1985  return $this->rbacreview->getRolesOfRoleFolder($this->object->getRefId(), false);
1986  }
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 1816 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().

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

◆ handleFileUpload()

ilObjSessionGUI::handleFileUpload ( )

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

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

◆ infoScreenObject()

ilObjSessionGUI::infoScreenObject ( )

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

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

References ILIAS\Repository\ctrl().

Referenced by renderObject().

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

◆ initAttendanceList()

ilObjSessionGUI::initAttendanceList ( )
protected

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

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

Referenced by attendanceListObject(), and printAttendanceListObject().

1229  {
1230  $members_obj = $this->initContainer(true);
1231 
1232  $list = new ilAttendanceList(
1233  $this,
1234  $this->object,
1235  $members_obj
1236  );
1237  $list->setId('sessattlst');
1238 
1239  $event_app = $this->object->getFirstAppointment();
1241  $desc = ilDatePresentation::formatPeriod($event_app->getStart(), $event_app->getEnd());
1243  $desc .= " " . $this->object->getTitle();
1244  $list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
1245 
1246  $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
1247  $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
1248  if ($this->object->enabledRegistration()) {
1249  $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
1250  }
1251  $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1252  $list->addBlank($this->lng->txt('sess_signature'));
1253 
1254  $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1255 
1256  return $list;
1257  }
initContainer(bool $a_init_participants=false)
Base class for attendance lists.
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
static setUseRelativeDates(bool $a_status)
set use relative dates
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initContainer()

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

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

1082  {
1083  $tree = $this->tree;
1084 
1085  $is_course = $is_group = false;
1086 
1087  // #13178
1088  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
1089  if ($this->container_ref_id) {
1090  $is_group = true;
1091  }
1092  if (!$this->container_ref_id) {
1093  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1094  if ($this->container_ref_id) {
1095  $is_course = true;
1096  }
1097  }
1098  if (!$this->container_ref_id) {
1099  $this->tpl->setOnScreenMessage('failure', 'No container object found. Aborting');
1100  return true;
1101  }
1102  $this->container_obj_id = ilObject::_lookupObjId($this->container_ref_id);
1103 
1104  if ($a_init_participants && $this->container_obj_id) {
1105  if ($is_course) {
1106  return ilCourseParticipants::_getInstanceByObjId($this->container_obj_id);
1107  } elseif ($is_group) {
1108  return ilGroupParticipants::_getInstanceByObjId($this->container_obj_id);
1109  }
1110  }
1111 
1112  return false;
1113  }
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 741 of file class.ilObjSessionGUI.php.

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

Referenced by executeCommand().

742  {
743  if (!is_object($this->object)) {
744  $this->object = new ilObjSession();
745  }
746  if (!$this->form instanceof ilPropertyFormGUI) {
747  $this->initForm('create');
748  }
749  return $this->form;
750  }
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 1408 of file class.ilObjSessionGUI.php.

References ILIAS\LTI\ToolProvider\$details, $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().

1408  : bool
1409  {
1410  if ($this->form instanceof ilPropertyFormGUI) {
1411  return true;
1412  }
1413  $ilUser = $this->user;
1415  $this->lng->loadLanguageModule('dateplaner');
1416 
1418 
1419  $this->form = new ilPropertyFormGUI();
1420  $this->form->setMultipart(true);
1421  $this->form->setTableWidth('600px');
1422  $this->form->setFormAction($this->ctrl->getFormAction($this));
1423  $this->form->setMultipart(true);
1424 
1425  $this->form = $this->initDidacticTemplate($this->form);
1426 
1427  $this->lng->loadLanguageModule('dateplaner');
1428  $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
1429  $dur->setRequired(true);
1430  $dur->enableToggleFullTime(
1431  $this->lng->txt('event_fulltime_info'),
1432  $this->object->getFirstAppointment()->enabledFulltime()
1433  );
1434  $dur->setShowTime(true);
1435  $dur->setStart($this->object->getFirstAppointment()->getStart());
1436  $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1437 
1438  $this->form->addItem($dur);
1439 
1440 
1441  // Recurrence
1442  if ($a_mode == 'create') {
1443  if (!is_object($this->rec)) {
1444  $this->rec = new ilEventRecurrence();
1445  }
1446  $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
1447  $rec->allowUnlimitedRecurrences(false);
1448  $rec->setRecurrence($this->rec);
1449  $this->form->addItem($rec);
1450 
1451  // #14547
1452  $lp = new ilCheckboxInputGUI($this->lng->txt("sess_lp_preset"), "lp_preset");
1453  $lp->setInfo($this->lng->txt("sess_lp_preset_info"));
1454  $lp->setChecked(true);
1455  $this->form->addItem($lp);
1456  }
1457 
1458  $section = new ilFormSectionHeaderGUI();
1459  $section->setTitle($this->lng->txt('event_section_information'));
1460  $this->form->addItem($section);
1461 
1462  // title
1463  $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title');
1464  $title->setRequired(true);
1465  $title->setValue($this->object->getTitle());
1466  $title->setSize(50);
1467  $title->setMaxLength(70);
1468  $this->form->addItem($title);
1469 
1470  // desc
1471  $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc');
1472  $desc->setValue($this->object->getLongDescription());
1473  $desc->setRows(4);
1474  $desc->setCols(50);
1475  $this->form->addItem($desc);
1476 
1477  // location
1478  $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location');
1479  $desc->setValue($this->object->getLocation());
1480  $desc->setRows(4);
1481  $desc->setCols(50);
1482  $this->form->addItem($desc);
1483 
1484  // workflow
1485  $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details');
1486  $details->setValue($this->object->getDetails());
1487  $details->setCols(50);
1488  $details->setRows(4);
1489  $this->form->addItem($details);
1490 
1491  if ($a_mode == 'create') {
1492  $this->record_gui = new ilAdvancedMDRecordGUI(
1494  'sess'
1495  );
1496  $this->record_gui->setRefId($this->requested_ref_id);
1497  $this->record_gui->setPropertyForm($this->form);
1498  $this->record_gui->parse();
1499  } elseif ($this->checkPermissionBool('edit_metadata')) {
1500  $this->record_gui = new ilAdvancedMDRecordGUI(
1502  'sess',
1503  $this->object->getId()
1504  );
1505  $this->record_gui->setPropertyForm($this->form);
1506  $this->record_gui->parse();
1507  }
1508 
1509 
1510  // section
1511  $section = new ilFormSectionHeaderGUI();
1512  $section->setTitle($this->lng->txt('event_tutor_data'));
1513  $this->form->addItem($section);
1514 
1515  // name
1516  $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name');
1517  $tutor_name->setValue($this->object->getName());
1518  $tutor_name->setSize(20);
1519  $tutor_name->setMaxLength(70);
1520  $this->form->addItem($tutor_name);
1521 
1522  // email
1523  $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email');
1524  $tutor_email->setValue($this->object->getEmail());
1525  $tutor_email->setSize(20);
1526  $tutor_email->setMaxLength(70);
1527  $this->form->addItem($tutor_email);
1528 
1529  // phone
1530  $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone');
1531  $tutor_phone->setValue($this->object->getPhone());
1532  $tutor_phone->setSize(20);
1533  $tutor_phone->setMaxLength(70);
1534  $this->form->addItem($tutor_phone);
1535 
1536  $section = new ilFormSectionHeaderGUI();
1537  $section->setTitle($this->lng->txt('sess_section_reg'));
1538  $this->form->addItem($section);
1539 
1540  $reg_settings = new ilSessionMembershipRegistrationSettingsGUI(
1541  $this,
1542  $this->object,
1543  array(
1549  )
1550  );
1551  $reg_settings->addMembershipFormElements($this->form, '');
1552 
1553 
1554  $section = new ilFormSectionHeaderGUI();
1555  $section->setTitle($this->lng->txt('event_assign_files'));
1556  $this->form->addItem($section);
1557 
1558  $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
1559  $files->setFilenames(array(0 => ''));
1560  $this->form->addItem($files);
1561 
1562  $section = new ilFormSectionHeaderGUI();
1563  $section->setTitle($this->lng->txt('sess_setting_header_presentation'));
1564  $this->form->addItem($section);
1565 
1566  $object_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
1567 
1568  $features = new ilFormSectionHeaderGUI();
1569  $features->setTitle($this->lng->txt('obj_features'));
1570  $this->form->addItem($features);
1572  $this->object->getId(),
1573  $this->form,
1574  array(
1576  )
1577  );
1578 
1579  $gallery = new ilCheckboxInputGUI($this->lng->txt('sess_show_members'), 'show_members');
1580  $gallery->setChecked($this->object->getShowMembers());
1581  $gallery->setInfo($this->lng->txt('sess_show_participants_info'));
1582  $this->form->addItem($gallery);
1583 
1584 
1585  // Show mail to members type
1586  $mail_type = new ilRadioGroupInputGUI($this->lng->txt('sess_mail_type'), 'mail_type');
1587  $mail_type->setValue((string) $this->object->getMailToMembersType());
1588 
1589  $mail_tutors = new ilRadioOption(
1590  $this->lng->txt('sess_mail_admins_only'),
1592  $this->lng->txt('sess_mail_admins_only_info')
1593  );
1594  $mail_type->addOption($mail_tutors);
1595 
1596  $mail_all = new ilRadioOption(
1597  $this->lng->txt('sess_mail_all'),
1599  $this->lng->txt('sess_mail_all_info')
1600  );
1601  $mail_type->addOption($mail_all);
1602  $this->form->addItem($mail_type);
1603 
1604 
1605 
1606  switch ($a_mode) {
1607  case 'create':
1608  $this->form->setTitle($this->lng->txt('event_table_create'));
1609 
1610  $this->form->addCommandButton('save', $this->lng->txt('event_btn_add'));
1611  $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit'));
1612  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
1613 
1614  return true;
1615 
1616  case 'edit':
1617  $this->form->setTitle($this->lng->txt('event_table_update'));
1618 
1619  $this->form->addCommandButton('update', $this->lng->txt('save'));
1620  $this->form->addCommandButton('cancelEdit', $this->lng->txt('cancel'));
1621 
1622  return true;
1623  }
1624  return true;
1625  }
setFilenames(array $a_filenames)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setPropertyForm(ilPropertyFormGUI $form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a file wizard property in a property form.
static initDomEvent(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI DomEvent used in Services/Calendar, Modules/Session, Modules/Test (Jan 2022) ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRecurrence(int $a_type)
set type of recurrence public
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
array $details
Details for error message relating to last request processed.
Definition: System.php:109
This 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 382 of file class.ilObjSessionGUI.php.

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

382  : void
383  {
384  $ilUser = $this->user;
385 
386  $this->checkPermission('read');
387 
388  if ($ilUser->isAnonymous()) {
389  $this->ctrl->redirect($this, 'infoScreen');
390  }
391 
392  if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->object->getId())) {
393  ilSession::set("sess_hide_info", true);
394  ilEventParticipants::_unregister($ilUser->getId(), $this->object->getId());
395  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_unregistered'), true);
396  } else {
397  ilEventParticipants::_register($ilUser->getId(), $this->object->getId());
398  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_registered'), true);
399  }
400 
401  $this->ctrl->redirect($this, 'infoScreen');
402  }
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 1627 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().

1627  : void
1628  {
1629  $event = $this->form->getItemByPostVar('event');
1630  if ($event->getStart() && $event->getEnd()) {
1631  $this->object->getFirstAppointment()->setStartingTime($event->getStart()->get(IL_CAL_UNIX));
1632  $this->object->getFirstAppointment()->setEndingTime($event->getStart()->get(IL_CAL_UNIX));
1633  $this->object->getFirstAppointment()->setStart($event->getStart());
1634  $this->object->getFirstAppointment()->setEnd($event->getEnd());
1635  $this->object->getFirstAppointment()->toggleFulltime($event->getStart() instanceof ilDate);
1636  }
1637 
1638  $this->object->setTitle($this->form->getInput('title'));
1639  $this->object->setDescription($this->form->getInput('desc'));
1640  $this->object->setLocation($this->form->getInput('location'));
1641  $this->object->setName($this->form->getInput('tutor_name'));
1642  $this->object->setPhone($this->form->getInput('tutor_phone'));
1643  $this->object->setEmail($this->form->getInput('tutor_email'));
1644  $this->object->setDetails($this->form->getInput('details'));
1645 
1646  $this->object->setRegistrationNotificationEnabled((bool) $this->form->getInput('registration_notification'));
1647  $this->object->setRegistrationNotificationOption($this->form->getInput('notification_option'));
1648 
1649  $this->object->setRegistrationType((int) $this->form->getInput('registration_type'));
1650 
1651  switch ($this->object->getRegistrationType()) {
1653  $this->object->enableCannotParticipateOption((bool) $this->form->getInput('show_cannot_participate_direct'));
1654  break;
1656  $this->object->enableCannotParticipateOption((bool) $this->form->getInput('show_cannot_participate_request'));
1657  break;
1658  default:
1659  $this->object->enableCannotParticipateOption(false);
1660  break;
1661  }
1662 
1663  // $this->object->setRegistrationMinUsers((int) $this->form->getInput('registration_min_members'));
1664  $this->object->setRegistrationMaxUsers((int) $this->form->getInput('registration_max_members'));
1665  $this->object->enableRegistrationUserLimit((int) $this->form->getInput('registration_membership_limited'));
1666  $this->object->setShowMembers((bool) $this->form->getInput('show_members'));
1667  $this->object->setMailToMembersType((int) $this->form->getInput('mail_type'));
1668 
1669  switch ((int) $this->form->getInput('waiting_list')) {
1670  case 2:
1671  $this->object->enableRegistrationWaitingList(true);
1672  $this->object->setWaitingListAutoFill(true);
1673  break;
1674 
1675  case 1:
1676  $this->object->enableRegistrationWaitingList(true);
1677  $this->object->setWaitingListAutoFill(false);
1678  break;
1679 
1680  default:
1681  $this->object->enableRegistrationWaitingList(false);
1682  $this->object->setWaitingListAutoFill(false);
1683  break;
1684  }
1685  }
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 1687 of file class.ilObjSessionGUI.php.

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

Referenced by saveObject().

1687  : void
1688  {
1689  $this->rec = new ilEventRecurrence();
1690 
1691  switch ($this->form->getInput('frequence')) {
1693  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1694  $this->rec->setInterval((int) $this->form->getInput('count_DAILY'));
1695  break;
1696 
1698  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1699  $this->rec->setInterval((int) $this->form->getInput('count_WEEKLY'));
1700  if (is_array($this->form->getInput('byday_WEEKLY'))) {
1701  $this->rec->setBYDAY(ilUtil::stripSlashes(implode(',', $this->form->getInput('byday_WEEKLY'))));
1702  }
1703  break;
1704 
1706  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1707  $this->rec->setInterval((int) $this->form->getInput('count_MONTHLY'));
1708  switch ((int) $this->form->getInput('subtype_MONTHLY')) {
1709  case 0:
1710  // nothing to do;
1711  break;
1712 
1713  case 1:
1714  switch ((int) $this->form->getInput('monthly_byday_day')) {
1715  case 8:
1716  // Weekday
1717  $this->rec->setBYSETPOS($this->form->getInput('monthly_byday_num'));
1718  $this->rec->setBYDAY('MO,TU,WE,TH,FR');
1719  break;
1720 
1721  case 9:
1722  // Day of month
1723  $this->rec->setBYMONTHDAY($this->form->getInput('monthly_byday_num'));
1724  break;
1725 
1726  default:
1727  $this->rec->setBYDAY(($this->form->getInput('monthly_byday_num') . $this->form->getInput('monthly_byday_day')));
1728  break;
1729  }
1730  break;
1731 
1732  case 2:
1733  $this->rec->setBYMONTHDAY($this->form->getInput('monthly_bymonthday'));
1734  break;
1735  }
1736  break;
1737 
1739  $this->rec->setFrequenceType($this->form->getInput('frequence'));
1740  $this->rec->setInterval((int) $this->form->getInput('count_YEARLY'));
1741  switch ((int) $this->form->getInput('subtype_YEARLY')) {
1742  case 0:
1743  // nothing to do;
1744  break;
1745 
1746  case 1:
1747  $this->rec->setBYMONTH($this->form->getInput('yearly_bymonth_byday'));
1748  $this->rec->setBYDAY(($this->form->getInput('yearly_byday_num') . $this->form->getInput('yearly_byday')));
1749  break;
1750 
1751  case 2:
1752  $this->rec->setBYMONTH($this->form->getInput('yearly_bymonth_by_monthday'));
1753  $this->rec->setBYMONTHDAY($this->form->getInput('yearly_bymonthday'));
1754  break;
1755  }
1756  break;
1757  }
1758 
1759  // UNTIL
1760  switch ((int) $this->form->getInput('until_type')) {
1761  case 1:
1762  $this->rec->setFrequenceUntilDate(null);
1763  // nothing to do
1764  break;
1765 
1766  case 2:
1767  $this->rec->setFrequenceUntilDate(null);
1768  $this->rec->setFrequenceUntilCount((int) $this->form->getInput('count'));
1769  break;
1770 
1771  case 3:
1772  $frequence = $this->form->getItemByPostVar('frequence');
1773  $end = $frequence->getRecurrence()->getFrequenceUntilDate();
1774  $this->rec->setFrequenceUntilCount(0);
1775  $this->rec->setFrequenceUntilDate($end);
1776  break;
1777  }
1778  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd, 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 1115 of file class.ilObjSessionGUI.php.

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

1115  : void
1116  {
1117  $this->checkPermission('manage_materials');
1118  $tree = $this->tree;
1120 
1121  $this->tabs_gui->activateTab('materials');
1122 
1123  // #11337 - support ANY parent container (crs, grp, fld)
1124  $parent_ref_id = $tree->getParentId($this->object->getRefId());
1125 
1126  $gui = new ilObjectAddNewItemGUI($parent_ref_id);
1127  $gui->setDisabledObjectTypes(
1128  array_merge(
1129  [
1130  'itgr', 'sess'
1131  ],
1133  )
1134  );
1135  $gui->setAfterCreationCallback($this->ref_id);
1136  $gui->render();
1137 
1138  $this->event_items = new ilEventItems($this->object->getId());
1139 
1140  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1141 
1142  $tbl->setDisableFilterHiding(true);
1143 
1144  $tbl->addMultiCommand('saveMaterials', $this->lng->txt('sess_assign'));
1145  $tbl->addMultiCommand("removeMaterials", $this->lng->txt("remove"));
1146 
1147  $tbl->setTitle($this->lng->txt("event_assign_materials_table"));
1148  $tbl->setDescription($this->lng->txt('event_assign_materials_info'));
1149 
1150  $tbl->setMaterialItems($this->event_items->getItems());
1151  $tbl->setContainerRefId($this->getContainerRefId());
1152  $data = $tbl->getDataFromDb();
1153  $tbl->setMaterials($data);
1154 
1155  $this->tpl->setContent($tbl->getHTML());
1156  }
getSideBlockTypes(bool $filter_repository_types=true)
getParentId(int $a_node_id)
get parent id of given node
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjectDefinition $objDefinition
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ membersObject()

ilObjSessionGUI::membersObject ( )
protected

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

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

285  : void
286  {
287  $this->ctrl->redirectByClass('ilSessionMembershipGUI', 'participants');
288  }
+ 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 501 of file class.ilObjSessionGUI.php.

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

Referenced by showJoinRequestButton().

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

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

Referenced by removeMaterialsObject(), and saveMaterialsObject().

1205  : void
1206  {
1207  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1208  $tbl->setOffset(0);
1209  $tbl->storeNavParameter();//remove offset and go to page 1
1210 
1211  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1212  $this->ctrl->redirect($this, 'materials');
1213  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilObjSessionGUI::prepareOutput ( bool  $show_sub_objects = true)

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

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

Referenced by executeCommand().

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

◆ printAttendanceListObject()

ilObjSessionGUI::printAttendanceListObject ( )
protected

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

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

1259  : void
1260  {
1261  $this->checkPermission('manage_members');
1262 
1263  $list = $this->initAttendanceList();
1264  $list->initFromForm();
1265  $list->setCallback(array($this, 'getAttendanceListUserData'));
1266 
1267  $this->event_part = new ilEventParticipants($this->object->getId());
1268  $list->getFullscreenHTML();
1269  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ readMemberData()

ilObjSessionGUI::readMemberData ( array  $a_usr_ids)

Used for waiting list.

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

1934  : array
1935  {
1936  $tmp_data = [];
1937  foreach ($a_usr_ids as $usr_id) {
1938  $tmp_data[$usr_id] = [];
1939  }
1940  return $tmp_data;
1941  }

◆ redirectToParentContentPageObject()

ilObjSessionGUI::redirectToParentContentPageObject ( )
protected

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

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

1798  : void
1799  {
1801  $tree = $this->tree;
1802  $ctrl = $this->ctrl;
1803 
1804  $parent_id = $tree->getParentId($this->object->getRefId());
1805 
1806  // #11650
1807  $parent_type = ilObject::_lookupType($parent_id, true);
1808 
1809  $parent_class = $objDefinition->getClassName($parent_type);
1810  $parent_class = 'ilObj' . $parent_class . 'GUI';
1811 
1812  $ctrl->setParameterByClass($parent_class, "ref_id", $parent_id);
1813  $ctrl->redirectByClass($parent_class, "view");
1814  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
getClassName(string $obj_name)
getParentId(int $a_node_id)
get parent id of given node
static _lookupType(int $id, bool $reference=false)
ilObjectDefinition $objDefinition
+ Here is the call graph for this function:

◆ refuseParticipationObject()

ilObjSessionGUI::refuseParticipationObject ( )
protected

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

References unregisterObject().

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

◆ registerObject()

ilObjSessionGUI::registerObject ( )

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

314  : void
315  {
316  $ilUser = $this->user;
317  $ilAppEventHandler = $this->event;
318 
319  $this->checkPermission('visible');
320 
321  $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
322 
323  $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
324  $event_part->updateExcusedForUser($ilUser->getId(), false);
325 
326  if (
327  $this->getCurrentObject()->isRegistrationUserLimitEnabled() &&
328  $this->getCurrentObject()->getRegistrationMaxUsers() &&
329  (count($event_part->getRegisteredParticipants()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
330  ) {
331  if (!$this->getCurrentObject()->isRegistrationWaitingListEnabled()) {
332  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('sess_reg_max_users_exceeded'), true);
333  $this->ctrl->redirect($this, 'infoScreen');
334  }
335  $wait = new ilSessionWaitingList($this->getCurrentObject()->getId());
336  $wait->addToList($ilUser->getId());
337  $this->ctrl->redirect($this, 'infoScreen');
338  }
339 
340 
341  switch ($this->getCurrentObject()->getRegistrationType()) {
343  $this->ctrl->redirect($this, 'info');
344  break;
345 
347  $part->register($ilUser->getId());
348  $this->tpl->setOnScreenMessage('success', $this->lng->txt('event_registered'), true);
349 
350  $ilAppEventHandler->raise(
351  "Modules/Session",
352  'enter',
353  array(
354  'obj_id' => $this->getCurrentObject()->getId(),
355  'ref_id' => $this->getCurrentObject()->getRefId(),
356  'usr_id' => $ilUser->getId()
357  )
358  );
359 
360  $this->ctrl->redirect($this, 'infoScreen');
361  break;
362 
364  $this->tpl->setOnScreenMessage('success', $this->lng->txt('sess_registered_confirm'), true);
365  $part->addSubscriber($ilUser->getId());
366 
367  $ilAppEventHandler->raise(
368  "Modules/Session",
369  'register',
370  array(
371  'obj_id' => $this->getCurrentObject()->getId(),
372  'ref_id' => $this->getCurrentObject()->getRefId(),
373  'usr_id' => $ilUser->getId()
374  )
375  );
376 
377  $this->ctrl->redirect($this, 'infoScreen');
378  break;
379  }
380  }
static getInstance(int $a_ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilEventParticipants $event_part
ilAppEventHandler $event
updateExcusedForUser(int $a_usr_id, bool $a_status)
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 1174 of file class.ilObjSessionGUI.php.

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

1174  : void
1175  {
1176  $this->checkPermission('manage_materials');
1177  $items_checked = $this->requested_items;
1178 
1179  $this->event_items = new ilEventItems($this->object->getId());
1180  $this->event_items->removeItems($items_checked);
1181 
1182  $this->postUpdateMaterials();
1183  }
removeItems(array $a_items)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
postUpdateMaterials()
redirect to list of materials without offset/page.
+ Here is the call graph for this function:

◆ renderObject()

ilObjSessionGUI::renderObject ( )
protected

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

References infoScreenObject().

280  : void
281  {
282  $this->infoScreenObject();
283  }
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
+ Here is the call graph for this function:

◆ resetFilter()

ilObjSessionGUI::resetFilter ( )

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

References ILIAS\Repository\ctrl().

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

◆ saveAndAssignMaterialsObject()

ilObjSessionGUI::saveAndAssignMaterialsObject ( )
protected

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

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

752  : void
753  {
754  $this->checkPermission('manage_materials');
755  $this->saveObject(false);
756 
757  $this->ctrl->setParameter($this, 'ref_id', $this->object->getRefId());
758  $this->ctrl->setParameter($this, 'new_type', '');
759  $this->ctrl->redirect($this, 'materials');
760  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ saveMaterialsObject()

ilObjSessionGUI::saveMaterialsObject ( )

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

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

1185  : void
1186  {
1187  $this->checkPermission('manage_materials');
1188  $this->event_items = new ilEventItems($this->object->getId());
1189  $db_items = $this->event_items->getItems();
1190 
1191  $list_items_checked = $this->requested_items;
1192  $list_items_checked = array_map('intval', $list_items_checked);
1193 
1194  $items_to_save = array_merge($db_items, $list_items_checked);
1195  $items_to_save = array_unique($items_to_save);
1196 
1197  $this->event_items->setItems($items_to_save);
1198  $this->event_items->update();
1199  $this->postUpdateMaterials();
1200  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
postUpdateMaterials()
redirect to list of materials without offset/page.
+ Here is the call graph for this function:

◆ saveObject()

ilObjSessionGUI::saveObject ( bool  $a_redirect_on_success = true)

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

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

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

◆ showJoinRequestButton()

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

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

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

Referenced by showJoinRequestButtonInCalendar().

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

References showJoinRequestButton().

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

◆ unregisterObject()

ilObjSessionGUI::unregisterObject ( bool  $a_refuse_participation = false)

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

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

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

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

◆ updateSessionTypeObject()

ilObjSessionGUI::updateSessionTypeObject ( )

change session type

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

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

1066  : void
1067  {
1068  $this->checkPermission('write');
1070  $this->object->getRefId(),
1071  (int) $this->http->request()->getParsedBody()['sess_type']
1072  );
1073 
1074  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1075  $this->ctrl->redirect($this, 'edit');
1076  }
static switchTemplate(int $a_ref_id, int $a_new_tpl_id)
static http()
Fetches the global http state from ILIAS.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilObjSessionGUI::$access
protected

◆ $container_obj_id

int ilObjSessionGUI::$container_obj_id = 0
protected

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

◆ $container_ref_id

int ilObjSessionGUI::$container_ref_id = 0
protected

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

Referenced by getContainerRefId().

◆ $ctrl

ilCtrl ilObjSessionGUI::$ctrl

◆ $event

ilAppEventHandler ilObjSessionGUI::$event
protected

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

Referenced by registerObject(), and unregisterObject().

◆ $event_items

ilEventItems ilObjSessionGUI::$event_items = null
protected

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

◆ $event_part

ilEventParticipants ilObjSessionGUI::$event_part = null
protected

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

◆ $form

ilPropertyFormGUI ilObjSessionGUI::$form = null
protected

◆ $help

ilHelpGUI ilObjSessionGUI::$help
protected

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

Referenced by getTabs().

◆ $http

ILIAS HTTP Services ilObjSessionGUI::$http
protected

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

◆ $ilErr

ilErrorHandling ilObjSessionGUI::$ilErr
protected

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

◆ $lng

ilLanguage ilObjSessionGUI::$lng

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

Referenced by showJoinRequestButton().

◆ $locator

ilLocatorGUI ilObjSessionGUI::$locator
protected

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

Referenced by addLocatorItems().

◆ $objDefinition

ilObjectDefinition ilObjSessionGUI::$objDefinition

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

Referenced by materialsObject(), and redirectToParentContentPageObject().

◆ $object_service

ilObjectService ilObjSessionGUI::$object_service
protected

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

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

◆ $rbacreview

ilRbacReview ilObjSessionGUI::$rbacreview
protected

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

Referenced by getDefaultMemberRole(), and getLocalRoles().

◆ $rec

ilEventRecurrence ilObjSessionGUI::$rec = null
protected

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

Referenced by createRecurringSessions().

◆ $record_gui

ilAdvancedMDRecordGUI ilObjSessionGUI::$record_gui = null
protected

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

◆ $refinery

ILIAS Refinery Factory ilObjSessionGUI::$refinery
protected

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

◆ $requested_file_id

int ilObjSessionGUI::$requested_file_id = 0
protected

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

◆ $requested_items

array ilObjSessionGUI::$requested_items = []
protected

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

Referenced by removeMaterialsObject(), and saveMaterialsObject().

◆ $requested_offset

int ilObjSessionGUI::$requested_offset = 0
protected

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

◆ $requested_ref_id

int ilObjSessionGUI::$requested_ref_id = 0
protected

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

Referenced by addLocatorItems().

◆ $requested_sort_by

string ilObjSessionGUI::$requested_sort_by = ""
protected

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

◆ $requested_sort_order

string ilObjSessionGUI::$requested_sort_order = ""
protected

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

◆ $requested_user_id

int ilObjSessionGUI::$requested_user_id = 0
protected

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

◆ $tabs_gui

ilTabsGUI ilObjSessionGUI::$tabs_gui
protected

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

Referenced by attendanceListObject(), and getTabs().

◆ $toolbar

ilToolbarGUI ilObjSessionGUI::$toolbar
protected

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

Referenced by showJoinRequestButton().

◆ $tpl

ilGlobalTemplateInterface ilObjSessionGUI::$tpl

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

Referenced by attendanceListObject().

◆ $tree

◆ $ui

ILIAS DI UIServices ilObjSessionGUI::$ui
protected

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

◆ $upload

ILIAS FileUpload FileUpload ilObjSessionGUI::$upload
protected

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

Referenced by handleFileUpload().

◆ $user


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