ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjSessionGUI Class Reference
+ Inheritance diagram for ilObjSessionGUI:
+ Collaboration diagram for ilObjSessionGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 
 executeCommand ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 registerObject ()
 
 joinObject ()
 
 unregisterObject (bool $a_refuse_participation=false)
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 modifyItemGUI (ilObjectListGUI $a_item_list_gui, array $a_item_data, bool $a_show_path)
 
 showJoinRequestButtonInCalendar (ilToolbarGUI $a_ilToolbar)
 show join request This method is only needed to keep showJoinRequestButton method protected. More...
 
 saveObject (bool $a_redirect_on_success=true)
 
 handleFileUpload ()
 
 editObject ()
 
 updateObject ()
 
 updateSessionTypeObject ()
 change session type More...
 
 materialsObject ()
 
 getCreatableObjectTypes ()
 
 applyFilter ()
 
 resetFilter ()
 
 removeMaterialsObject ()
 
 saveMaterialsObject ()
 
 postUpdateMaterials ()
 redirect to list of materials without offset/page. More...
 
 attendanceListObject ()
 
 getAttendanceListUserData (int $a_user_id, array $a_filters)
 
 eventsListObject ()
 
 afterSaveCallback (ilObject $a_obj)
 Custom callback after object is created (in parent container) More...
 
 readMemberData (array $a_usr_ids)
 Used for waiting list. More...
 
 getContainerRefId ()
 
 getDefaultMemberRole ()
 
 getLocalRoles ()
 
 createMailSignature ()
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Static Public Member Functions

static _goto (string $a_target)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

ilLanguage $lng
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilObjectDefinition $objDefinition
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Protected Member Functions

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

Protected Attributes

ILIAS DI UIServices $ui
 
ilAppEventHandler $event
 
ILIAS FileUpload FileUpload $upload
 
ilHelpGUI $help
 
ILIAS 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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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  }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ __showButton()

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

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

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

Referenced by eventsListObject().

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

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

◆ _goto()

static ilObjSessionGUI::_goto ( string  $a_target)
static

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

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

◆ addLocatorItems()

ilObjSessionGUI::addLocatorItems ( )
protected

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

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

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

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

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

◆ applyFilter()

ilObjSessionGUI::applyFilter ( )

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

References ILIAS\Repository\ctrl().

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

◆ attendanceListObject()

ilObjSessionGUI::attendanceListObject ( )

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

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

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

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

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

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

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

◆ createRecurringSessions()

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

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

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

Referenced by saveObject().

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

◆ editObject()

ilObjSessionGUI::editObject ( )

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

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

Referenced by updateObject().

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

◆ eventsListObject()

ilObjSessionGUI::eventsListObject ( )

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

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

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

◆ executeCommand()

ilObjSessionGUI::executeCommand ( )

Definition at line 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  }
Class ilObjectMetaDataGUI.
GUI class for the workflow of copying objects.
This class is used for integration of the booking manager as a service into other repository objects...
prepareOutput(bool $show_sub_objects=true)
$GLOBALS["DIC"]
Definition: wac.php:53
GUI class for membership features.
ilPropertyFormGUI $form
getParentId(int $a_node_id)
get parent id of given node
initForm(string $a_mode)
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
ilAccessHandler $access
+ Here is the call graph for this function:

◆ getAttendanceListUserData()

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

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

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

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

◆ getContainerRefId()

ilObjSessionGUI::getContainerRefId ( )

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

References $container_ref_id, and initContainer().

Referenced by materialsObject().

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

◆ getCreatableObjectTypes()

ilObjSessionGUI::getCreatableObjectTypes ( )

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

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

Referenced by materialsObject().

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

◆ getDefaultMemberRole()

ilObjSessionGUI::getDefaultMemberRole ( )

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

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

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

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

1977  : array
1978  {
1980 
1981  return $this->rbacreview->getRolesOfRoleFolder($this->object->getRefId(), false);
1982  }
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 1812 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().

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

◆ handleFileUpload()

ilObjSessionGUI::handleFileUpload ( )

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

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

◆ infoScreenObject()

ilObjSessionGUI::infoScreenObject ( )

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

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

References ILIAS\Repository\ctrl().

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

◆ initAttendanceList()

ilObjSessionGUI::initAttendanceList ( )
protected

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

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

Referenced by attendanceListObject(), and printAttendanceListObject().

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

◆ initContainer()

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

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

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

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

Referenced by executeCommand().

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

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

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

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

◆ joinObject()

ilObjSessionGUI::joinObject ( )

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

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

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

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

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

Referenced by saveObject().

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

◆ materialsObject()

ilObjSessionGUI::materialsObject ( )

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

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

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

◆ membersObject()

ilObjSessionGUI::membersObject ( )
protected

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

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

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

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

Referenced by showJoinRequestButton().

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

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

Referenced by removeMaterialsObject(), and saveMaterialsObject().

1202  : void
1203  {
1204  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1205  $tbl->setOffset(0);
1206  $tbl->storeNavParameter();//remove offset and go to page 1
1207 
1208  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1209  $this->ctrl->redirect($this, 'materials');
1210  }
+ 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 295 of file class.ilObjSessionGUI.php.

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

Referenced by executeCommand().

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

◆ printAttendanceListObject()

ilObjSessionGUI::printAttendanceListObject ( )
protected

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

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

1256  : void
1257  {
1258  $this->checkPermission('manage_members');
1259 
1260  $list = $this->initAttendanceList();
1261  $list->initFromForm();
1262  $list->setCallback(array($this, 'getAttendanceListUserData'));
1263 
1264  $this->event_part = new ilEventParticipants($this->object->getId());
1265  $list->getFullscreenHTML();
1266  }
class ilEventParticipants
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ readMemberData()

ilObjSessionGUI::readMemberData ( array  $a_usr_ids)

Used for waiting list.

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

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

◆ redirectToParentContentPageObject()

ilObjSessionGUI::redirectToParentContentPageObject ( )
protected

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

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

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

◆ refuseParticipationObject()

ilObjSessionGUI::refuseParticipationObject ( )
protected

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

References unregisterObject().

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

◆ registerObject()

ilObjSessionGUI::registerObject ( )

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

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

◆ removeMaterialsObject()

ilObjSessionGUI::removeMaterialsObject ( )

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

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

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

◆ resetFilter()

ilObjSessionGUI::resetFilter ( )

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

References ILIAS\Repository\ctrl().

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

◆ saveAndAssignMaterialsObject()

ilObjSessionGUI::saveAndAssignMaterialsObject ( )
protected

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

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

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

◆ saveMaterialsObject()

ilObjSessionGUI::saveMaterialsObject ( )

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

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

1183  : void
1184  {
1185  $this->event_items = new ilEventItems($this->object->getId());
1186  $db_items = $this->event_items->getItems();
1187 
1188  $list_items_checked = $this->requested_items;
1189  $list_items_checked = array_map('intval', $list_items_checked);
1190 
1191  $items_to_save = array_merge($db_items, $list_items_checked);
1192  $items_to_save = array_unique($items_to_save);
1193 
1194  $this->event_items->setItems($items_to_save);
1195  $this->event_items->update();
1196  $this->postUpdateMaterials();
1197  }
class ilEventItems
postUpdateMaterials()
redirect to list of materials without offset/page.
+ Here is the call graph for this function:

◆ saveObject()

ilObjSessionGUI::saveObject ( bool  $a_redirect_on_success = true)

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

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

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

◆ showJoinRequestButton()

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

Definition at line 533 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(), null, ILIAS\Repository\object(), ilAdvancedMDRecordGUI\setInfoObject(), and ILIAS\Repository\ui().

Referenced by showJoinRequestButtonInCalendar().

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

◆ showJoinRequestButtonInCalendar()

ilObjSessionGUI::showJoinRequestButtonInCalendar ( ilToolbarGUI  $a_ilToolbar)

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

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

References showJoinRequestButton().

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

◆ unregisterObject()

ilObjSessionGUI::unregisterObject ( bool  $a_refuse_participation = false)

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

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

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

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

◆ updateSessionTypeObject()

ilObjSessionGUI::updateSessionTypeObject ( )

change session type

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

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

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

Field Documentation

◆ $access

ilAccessHandler ilObjSessionGUI::$access
protected

◆ $container_obj_id

int ilObjSessionGUI::$container_obj_id = 0
protected

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

◆ $container_ref_id

int ilObjSessionGUI::$container_ref_id = 0
protected

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

Referenced by getContainerRefId().

◆ $ctrl

ilCtrl ilObjSessionGUI::$ctrl

◆ $event

ilAppEventHandler ilObjSessionGUI::$event
protected

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

Referenced by registerObject(), and unregisterObject().

◆ $event_items

ilEventItems ilObjSessionGUI::$event_items = null
protected

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