ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 getCurrentObject ()
 Get session object. More...
 
 prepareOutput ($a_show_subobjects=true)
 
 registerObject ()
 register to session More...
 
 joinObject ()
 Called from info screen. More...
 
 unregisterObject ($a_refuse_participation=false)
 unregister from session More...
 
 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 ($a_item_list_gui, $a_item_data, $a_show_path)
 Modify Item ListGUI for presentation in container @global type $tree. More...
 
 showJoinRequestButtonInCalendar (ilToolbarGUI $a_ilToolbar)
 
 infoScreen ()
 info screen More...
 
 sendFileObject ()
 send file More...
 
 saveAndAssignMaterialsObject ()
 Save and assign sessoin materials. More...
 
 saveObject ($a_redirect_on_success=true)
 save object More...
 
 handleFileUpload ()
 
 editObject ()
 edit object More...
 
 updateObject ()
 update object More...
 
 updateSessionTypeObject ()
 change session type More...
 
 confirmDeleteFilesObject ()
 confirm delete files More...
 
 deleteFilesObject ()
 delete files More...
 
 materialsObject ()
 show material assignment More...
 
 applyFilter ()
 Apply filter. More...
 
 resetFilter ()
 Reset filter. More...
 
 removeMaterialsObject ()
 Remove materials from the current object. More...
 
 saveMaterialsObject ()
 save material assignment More...
 
 postUpdateMaterials ()
 redirect to list of materials without offset/page. More...
 
 attendanceListObject ()
 show attendance list selection More...
 
 getAttendanceListUserData ($a_user_id, $a_filters)
 Get user data for attendance list. More...
 
 eventsListObject ()
 list sessions of all user More...
 
 addLocatorItems ()
 Add session locator. More...
 
 getTabs ()
 Build tabs. More...
 
 afterSaveCallback (ilObject $a_obj)
 Custom callback after object is created (in parent containert. More...
 
 readMemberData ($a_usr_ids)
 Used for waiting list. More...
 
 getContainerRefId ()
 container ref id More...
 
 getDefaultMemberRole ()
 Get default member role. More...
 
 getLocalRoles ()
 get all local roles More...
 
 createMailSignature ()
 Create a course mail signature. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 Add desktop item @access public. More...
 
 removeFromDeskObject ()
 Remove from desktop @access public. More...
 

Static Public Member Functions

static _goto ($a_target)
 goto More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

 $lng
 
 $ctrl
 
 $tpl
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 membersObject ()
 Redirect to member adminsitration. More...
 
 refuseParticipationObject ()
 refuse participation More...
 
 showJoinRequestButton (ilToolbarGUI $ilToolbar=null)
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 createRecurringSessions ($a_activate_lp=true)
 create recurring sessions More...
 
 initContainer ($a_init_participants=false)
 
 initAttendanceList ()
 Init attendance list object. More...
 
 printAttendanceListObject ()
 print attendance list More...
 
 initForm (string $a_mode)
 Init Form. More...
 
 load ()
 load settings More...
 
 loadRecurrenceSettings ()
 load recurrence settings More...
 
 __toUnix ($date, $time)
 @access protected More...
 
 redirectToParentContentPageObject ()
 Redirect to parent content page. More...
 
 cancelEditObject ()
 Cancel editigin @global type $ilCtrl @global type $tree. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $logger = null
 
 $http
 
 $container_ref_id = 0
 
 $container_obj_id = 0
 
 $files = array()
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

@access public

Parameters

return

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

65 {
66 global $DIC;
67
68 $ilCtrl = $DIC['ilCtrl'];
69 $lng = $DIC['lng'];
70 $tpl = $DIC['tpl'];
71
72 $this->type = "sess";
73 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
74
75 $this->lng = $lng;
76 $this->lng->loadLanguageModule("event");
77 $this->lng->loadLanguageModule('crs');
78 $this->lng->loadLanguageModule('trac');
79 $this->lng->loadLanguageModule('sess');
80
81 $this->tpl = $tpl;
82 $this->ctrl = $ilCtrl;
83
84 $this->http = $DIC->http();
85 $this->logger = $DIC->logger()->sess();
86 $this->ui = $DIC->ui();
87 }
global $DIC
Definition: goto.php:24
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
ui()
Definition: ui.php:5

References $DIC, $lng, $tpl, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\FileDelivery\http(), and ui().

+ Here is the call graph for this function:

Member Function Documentation

◆ __toUnix()

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

@access protected

Parameters

return

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

2056 {
2057 return mktime($time['h'], $time['m'], 0, $date['m'], $date['d'], $date['y']);
2058 }

◆ _goto()

static ilObjSessionGUI::_goto (   $a_target)
static

goto

@access public

Parameters

return

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

447 {
448 global $DIC;
449
450 $ilAccess = $DIC->access();
451 $ilErr = $DIC["ilErr"];
452 $lng = $DIC->language();
453
454 $ilCtrl = $DIC->ctrl();
455 $parts = explode('_', $a_target);
456 $a_target = $parts[0];
457
458 if ($ilAccess->checkAccess('write', '', $a_target)) {
459 if (isset($parts[1]) && 'part' === $parts[1]) {
460 $ilCtrl->initBaseClass('ilRepositoryGUI');
461 $ilCtrl->setParameterByClass('ilSessionMembershipGUI', 'ref_id', (int) $a_target);
462 $ilCtrl->setTargetScript('ilias.php');
463 $ilCtrl->redirectByClass(array('ilRepositoryGUI', __CLASS__, 'ilSessionMembershipGUI'));
464 }
465 }
466
467 if ($ilAccess->checkAccess('visible', "", $a_target)) {
468 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
469 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
471 sprintf(
472 $lng->txt("msg_no_perm_read_item"),
474 ),
475 true
476 );
478 }
479 }
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const ROOT_FOLDER_ID
Definition: constants.php:30

References $DIC, ilObjectGUI\$ilErr, $lng, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ROOT_FOLDER_ID, and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSessionGUI::addLocatorItems ( )

Add session locator.

@access public

Reimplemented from ilObjectGUI.

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

2067 {
2068 global $DIC;
2069
2070 $ilLocator = $DIC['ilLocator'];
2071
2072 if (!$this->getCreationMode()) {
2073 // see prepareOutput()
2074 include_once './Modules/Session/classes/class.ilSessionAppointment.php';
2075 $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
2076 $title = $this->object->getFirstAppointment()->appointmentToString() . $title;
2077
2078 $ilLocator->addItem($title, $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
2079 }
2080 }
$_GET["client_id"]
getCreationMode()
get creation mode

References $_GET, $DIC, and ilObjectGUI\getCreationMode().

+ Here is the call graph for this function:

◆ afterSaveCallback()

ilObjSessionGUI::afterSaveCallback ( ilObject  $a_obj)

Custom callback after object is created (in parent containert.

Parameters
ilObject$a_obj

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

2229 {
2230 // add new object to materials
2231 include_once './Modules/Session/classes/class.ilEventItems.php';
2232 $event_items = new ilEventItems($this->object->getId());
2233 $event_items->addItem($a_obj->getRefId());
2234 $event_items->update();
2235
2236 /*
2237 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
2238 $this->ctrl->redirect($this, "materials");
2239 */
2240 }
class ilEvent
getRefId()
get reference id @access public

References ilObject\getRefId().

+ Here is the call graph for this function:

◆ applyFilter()

ilObjSessionGUI::applyFilter ( )

Apply filter.

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

1347 {
1348 $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1349 $tbl->writeFilterToSession(); // writes filter to session
1350 $tbl->resetOffset(); // sets record offest to 0 (first page)
1351 $this->ctrl->redirect($this, "materials");
1352 }

◆ attendanceListObject()

ilObjSessionGUI::attendanceListObject ( )

show attendance list selection

@access public

Returns

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

1424 {
1425 global $DIC;
1426
1427 $tpl = $DIC['tpl'];
1428 $ilTabs = $DIC['ilTabs'];
1429
1430 $this->checkPermission('manage_members');
1431 $ilTabs->setTabActive('event_edit_members');
1432
1433 $list = $this->initAttendanceList();
1434 $form = $list->initForm('printAttendanceList');
1435 $tpl->setContent($form->getHTML());
1436 }
initAttendanceList()
Init attendance list object.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.

References $DIC, $tpl, ilObjectGUI\checkPermission(), and initAttendanceList().

+ Here is the call graph for this function:

◆ cancelEditObject()

ilObjSessionGUI::cancelEditObject ( )
protected

Cancel editigin @global type $ilCtrl @global type $tree.

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

2276 {
2277 global $DIC;
2278
2279 $ilCtrl = $DIC['ilCtrl'];
2280 $tree = $DIC['tree'];
2281
2282 $parent_id = $tree->getParentId((int) $_REQUEST['ref_id']);
2283
2284 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent_id);
2285
2286 $ilCtrl->redirectByClass("ilrepositorygui", "");
2287 }

References $DIC, and ilObjectGUI\$tree.

◆ confirmDeleteFilesObject()

ilObjSessionGUI::confirmDeleteFilesObject ( )

confirm delete files

@access public

Parameters

return

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

1201 {
1202 $this->tabs_gui->setTabActive('settings');
1203
1204 if (!count($_POST['file_id'])) {
1205 ilUtil::sendFailure($this->lng->txt('select_one'));
1206 $this->editObject();
1207 return false;
1208 }
1209
1210 include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1211 $c_gui = new ilConfirmationGUI();
1212
1213 // set confirm/cancel commands
1214 $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteFiles"));
1215 $c_gui->setHeaderText($this->lng->txt("info_delete_sure"));
1216 $c_gui->setCancel($this->lng->txt("cancel"), "edit");
1217 $c_gui->setConfirm($this->lng->txt("confirm"), "deleteFiles");
1218
1219 // add items to delete
1220 foreach ($_POST["file_id"] as $file_id) {
1221 $file = new ilSessionFile($file_id);
1222 if ($file->getSessionId() != $this->object->getEventId()) {
1223 ilUtil::sendFailure($this->lng->txt('select_one'));
1224 $this->edit();
1225 return false;
1226 }
1227 $c_gui->addItem("file_id[]", $file_id, $file->getFileName());
1228 }
1229
1230 $this->tpl->setContent($c_gui->getHTML());
1231 return true;
1232 }
$_POST["username"]
Confirmation screen class.

References $_POST, editObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ createMailSignature()

ilObjSessionGUI::createMailSignature ( )

Create a course mail signature.

Returns
string

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

2323 {
2324 $link = chr(13) . chr(10) . chr(13) . chr(10);
2325 $link .= $this->lng->txt('sess_mail_permanent_link');
2326 $link .= chr(13) . chr(10) . chr(13) . chr(10);
2327 include_once './Services/Link/classes/class.ilLink.php';
2328 $link .= ilLink::_getLink($this->object->getRefId());
2329 return rawurlencode(base64_encode($link));
2330 }

References ilLink\_getLink().

+ Here is the call graph for this function:

◆ createRecurringSessions()

ilObjSessionGUI::createRecurringSessions (   $a_activate_lp = true)
protected

create recurring sessions

@access protected

Parameters
bool$a_activate_lp
Returns

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

972 {
973 global $DIC;
974
975 $tree = $DIC['tree'];
976
977 if (!$this->rec->getFrequenceType()) {
978 return true;
979 }
980 include_once('./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php');
981 $calc = new ilCalendarRecurrenceCalculator($this->object->getFirstAppointment(), $this->rec);
982
983 $period_start = clone $this->object->getFirstAppointment()->getStart();
984
985
986 $period_end = clone $this->object->getFirstAppointment()->getStart();
987 $period_end->increment(IL_CAL_YEAR, 5);
988 $date_list = $calc->calculateDateList($period_start, $period_end);
989
990 $period_diff = $this->object->getFirstAppointment()->getEnd()->get(IL_CAL_UNIX) -
991 $this->object->getFirstAppointment()->getStart()->get(IL_CAL_UNIX);
992 $parent_id = $tree->getParentId($this->object->getRefId());
993
994 include_once './Modules/Session/classes/class.ilEventItems.php';
995 $evi = new ilEventItems($this->object->getId());
996 $eitems = $evi->getItems();
997
998 $counter = 0;
999 foreach ($date_list->get() as $date) {
1000 if (!$counter++) {
1001 continue;
1002 }
1003
1004 $new_obj = $this->object->cloneObject($parent_id);
1005
1006 // apply didactic template?
1007 $dtpl = $this->getDidacticTemplateVar("dtpl");
1008 if ($dtpl) {
1009 $new_obj->applyDidacticTemplate($dtpl);
1010 }
1011
1012 $new_obj->read();
1013 $new_obj->getFirstAppointment()->setStartingTime($date->get(IL_CAL_UNIX));
1014 $new_obj->getFirstAppointment()->setEndingTime($date->get(IL_CAL_UNIX) + $period_diff);
1015 $new_obj->getFirstAppointment()->update();
1016 $new_obj->update(true);
1017
1018 // #14547 - active is default
1019 if (!$a_activate_lp) {
1020 include_once "Services/Tracking/classes/class.ilLPObjSettings.php";
1021 $lp_obj_settings = new ilLPObjSettings($new_obj->getId());
1022 $lp_obj_settings->setMode(ilLPObjSettings::LP_MODE_DEACTIVATED);
1023 $lp_obj_settings->update(false);
1024 }
1025
1026 $new_evi = new ilEventItems($new_obj->getId());
1027 $new_evi->setItems($eitems);
1028 $new_evi->update();
1029 }
1030 }
const IL_CAL_UNIX
const IL_CAL_YEAR
Calculates an ilDateList for a given calendar entry and recurrence rule.
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.

References $DIC, ilObjectGUI\$tree, ilObjectGUI\getDidacticTemplateVar(), IL_CAL_UNIX, IL_CAL_YEAR, and ilLPObjSettings\LP_MODE_DEACTIVATED.

Referenced by saveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteFilesObject()

ilObjSessionGUI::deleteFilesObject ( )

delete files

@access public

Parameters

return

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

1242 {
1243 if (!count($_POST['file_id'])) {
1244 ilUtil::sendFailure($this->lng->txt('select_one'));
1245 $this->editObject();
1246 return false;
1247 }
1248 foreach ($_POST['file_id'] as $id) {
1249 $file = new ilSessionFile($id);
1250 $file->delete();
1251 }
1252 $this->object->initFiles();
1253 $this->editObject();
1254 return true;
1255 }

References $_POST, editObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ editObject()

ilObjSessionGUI::editObject ( )

edit object

@access protected

Parameters

return

Reimplemented from ilObjectGUI.

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

1041 {
1042 $this->tabs_gui->setTabActive('settings');
1043
1044 $this->initForm('edit');
1045 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit.html', 'Modules/Session');
1046 $this->tpl->setVariable('EVENT_EDIT_TABLE', $this->form->getHTML());
1047
1048 if (!count($this->object->getFiles())) {
1049 return true;
1050 }
1051 $rows = array();
1052 foreach ($this->object->getFiles() as $file) {
1053 $table_data['id'] = $file->getFileId();
1054 $table_data['filename'] = $file->getFileName();
1055 $table_data['filetype'] = $file->getFileType();
1056 $table_data['filesize'] = $file->getFileSize();
1057
1058 $rows[] = $table_data;
1059 }
1060
1061 include_once("./Modules/Session/classes/class.ilSessionFileTableGUI.php");
1062 $table_gui = new ilSessionFileTableGUI($this, "edit");
1063 $table_gui->setTitle($this->lng->txt("event_files"));
1064 $table_gui->setData($rows);
1065 $table_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
1066 $table_gui->addMultiCommand("confirmDeleteFiles", $this->lng->txt("delete"));
1067 $table_gui->setSelectAllCheckbox("file_id");
1068 $this->tpl->setVariable('EVENT_FILE_TABLE', $table_gui->getHTML());
1069
1070 return true;
1071 }
initForm(string $a_mode)
Init Form.
$rows
Definition: xhr_table.php:10

References $rows, and initForm().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eventsListObject()

ilObjSessionGUI::eventsListObject ( )

list sessions of all user

@access public

Parameters

return

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

1530 {
1531 global $DIC;
1532
1533 $ilErr = $DIC['ilErr'];
1534 $ilAccess = $DIC['ilAccess'];
1535 $ilUser = $DIC['ilUser'];
1536 $tree = $DIC['tree'];
1537
1538 if (!$ilAccess->checkAccess('manage_members', '', $this->object->getRefId())) {
1539 $ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $ilErr->MESSAGE);
1540 }
1541
1542 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_list.html', 'Modules/Session');
1543 $this->__showButton($this->ctrl->getLinkTarget($this, 'exportCSV'), $this->lng->txt('event_csv_export'));
1544
1545 include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1546
1547 $this->tpl->addBlockfile("EVENTS_TABLE", "events_table", "tpl.table.html");
1548 $this->tpl->addBlockfile('TBL_CONTENT', 'tbl_content', 'tpl.sess_list_row.html', 'Modules/Session');
1549
1550 $members_obj = $this->initContainer(true);
1551 $members = $members_obj->getParticipants();
1552 $members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
1553
1554 // Table
1555 $tbl = new ilTableGUI();
1556 $tbl->setTitle(
1557 $this->lng->txt("event_overview"),
1558 'icon_usr.svg',
1559 $this->lng->txt('obj_usr')
1560 );
1561 $this->ctrl->setParameter($this, 'offset', (int) $_GET['offset']);
1562
1563 $course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1564 $events = array();
1565 foreach ($tree->getSubtree($tree->getNodeData($course_ref_id), false, 'sess') as $event_id) {
1566 $tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
1567 if (!is_object($tmp_event) or $tmp_event->getType() != 'sess') {
1568 continue;
1569 }
1570 $events[] = $tmp_event;
1571 }
1572
1573 $headerNames = array();
1574 $headerVars = array();
1575 $colWidth = array();
1576
1577 $headerNames[] = $this->lng->txt('name');
1578 $headerVars[] = "name";
1579 $colWidth[] = '20%';
1580
1581 for ($i = 1; $i <= count($events); $i++) {
1582 $headerNames[] = $i;
1583 $headerVars[] = "event_" . $i;
1584 $colWidth[] = 80 / count($events) . "%";
1585 }
1586
1587 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1588 $tbl->setHeaderNames($headerNames);
1589 $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this, 'eventsList'));
1590 $tbl->setColumnWidth($colWidth);
1591
1592 $tbl->setOrderColumn($_GET["sort_by"]);
1593 $tbl->setOrderDirection($_GET["sort_order"]);
1594 $tbl->setOffset($_GET["offset"]);
1595 $tbl->setLimit($ilUser->getPref("hits_per_page"));
1596 $tbl->setMaxCount(count($members));
1597 $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
1598
1599 $sliced_users = array_slice($members, $_GET['offset'], $_SESSION['tbl_limit']);
1600 $tbl->disable('sort');
1601 $tbl->render();
1602
1603 $counter = 0;
1604 foreach ($sliced_users as $user_id) {
1605 foreach ($events as $event_obj) {
1606 $this->tpl->setCurrentBlock("eventcols");
1607
1608 $event_part = new ilEventParticipants($this->object->getId());
1609
1610 {
1611 $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1612 ilUtil::getImagePath('icon_ok.svg') :
1613 ilUtil::getImagePath('icon_not_ok.svg'));
1614
1615 $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
1616 $this->lng->txt('event_participated') :
1617 $this->lng->txt('event_not_participated'));
1618 }
1619
1620 $this->tpl->parseCurrentBlock();
1621 }
1622
1623 $this->tpl->setCurrentBlock("tbl_content");
1624 $name = ilObjUser::_lookupName($user_id);
1625 $this->tpl->setVariable("CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
1626 $this->tpl->setVariable("LASTNAME", $name['lastname']);
1627 $this->tpl->setVariable("FIRSTNAME", $name['firstname']);
1628 $this->tpl->setVariable("LOGIN", ilObjUser::_lookupLogin($user_id));
1629 $this->tpl->parseCurrentBlock();
1630 }
1631
1632 $this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));
1633 $this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
1634 $this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
1635 $this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
1636 $this->tpl->setVariable("HEAD_TXT_DATE_TIME", $this->lng->txt("event_date_time"));
1637 $i = 1;
1638 foreach ($events as $event_obj) {
1639 $this->tpl->setCurrentBlock("legend_loop");
1640 $this->tpl->setVariable("LEGEND_CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
1641 $this->tpl->setVariable("LEGEND_DIGIT", $i++);
1642 $this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
1643 $this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1644 $this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1645 $this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1646 $this->tpl->parseCurrentBlock();
1647 }
1648 }
$_SESSION["AccountId"]
initContainer($a_init_participants=false)
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
__showButton($a_cmd, $a_text, $a_target='')
Class ilTableGUI.
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
if($format !==null) $name
Definition: metadata.php:230
$i
Definition: metadata.php:24

References $_GET, $_SESSION, $DIC, $i, ilObjectGUI\$ilErr, $ilUser, $name, ilObjectGUI\$tree, ilObjectGUI\__showButton(), ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilUtil\_sortIds(), ilUtil\getImagePath(), ilObjectFactory\getInstanceByRefId(), initContainer(), and ilUtil\switchColor().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjSessionGUI::executeCommand ( )

execute command

@access public

Returns

Reimplemented from ilObjectGUI.

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

97 {
98 global $DIC;
99
100 $ilUser = $DIC['ilUser'];
101 $ilCtrl = $DIC['ilCtrl'];
102
103 $next_class = $this->ctrl->getNextClass($this);
104 $cmd = $this->ctrl->getCmd();
105
106 if (
107 !$this->getCreationMode() &&
108 $GLOBALS['DIC']->access()->checkAccess('read', '', $_GET['ref_id'])
109 ) {
110 $GLOBALS['DIC']['ilNavigationHistory']->addItem(
111 (int) $_GET['ref_id'],
112 ilLink::_getLink((int) $_GET['ref_id'], 'sess'),
113 'sess'
114 );
115 }
116
117 $this->prepareOutput();
118 switch ($next_class) {
119 case 'ilsessionmembershipgui':
120 $this->tabs_gui->activateTab('members');
121 include_once './Modules/Session/classes/class.ilSessionMembershipGUI.php';
122 $mem_gui = new ilSessionMembershipGUI($this, $this->object);
123 $this->ctrl->forwardCommand($mem_gui);
124 break;
125
126 case "ilinfoscreengui":
127 $this->checkPermission("visible");
128 $this->infoScreen(); // forwards command
129 break;
130
131 case 'ilobjectmetadatagui':
132 $this->checkPermission('edit_metadata');
133 $this->tabs_gui->activateTab('metadata');
134 $md_gui = new ilObjectMetaDataGUI($this->object);
135 $this->ctrl->forwardCommand($md_gui);
136 break;
137
138
139 case 'ilpermissiongui':
140 $this->tabs_gui->setTabActive('perm_settings');
141 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
142 $perm_gui = new ilPermissionGUI($this);
143 $ret = $this->ctrl->forwardCommand($perm_gui);
144 break;
145
146 case 'ilobjectcopygui':
147 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
148 $cp = new ilObjectCopyGUI($this);
149 $cp->setType('sess');
150 $this->ctrl->forwardCommand($cp);
151 break;
152
153 case "ilexportgui":
154// $this->prepareOutput();
155 $this->tabs_gui->setTabActive("export");
156 include_once("./Services/Export/classes/class.ilExportGUI.php");
157 $exp_gui = new ilExportGUI($this);
158 $exp_gui->addFormat("xml");
159 $ret = $this->ctrl->forwardCommand($exp_gui);
160// $this->tpl->show();
161 break;
162
163 case "ilcommonactiondispatchergui":
164 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
166 $this->ctrl->forwardCommand($gui);
167 break;
168
169 case 'ilmembershipgui':
170 $this->ctrl->setReturn($this, 'members');
171 include_once './Services/Membership/classes/class.ilMembershipMailGUI.php';
172 $mem = new ilMembershipMailGUI($this);
173 $this->ctrl->forwardCommand($mem);
174 break;
175
176 case "illearningprogressgui":
177 include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
178 $new_gui = new ilLearningProgressGUI(
180 $this->object->getRefId(),
181 $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()
182 );
183 $this->ctrl->forwardCommand($new_gui);
184 $this->tabs_gui->setTabActive('learning_progress');
185 break;
186
187 case "ilpropertyformgui":
188 // only case is currently adv metadata internal link in info settings, see #24497
189 if (!is_object($this->object)) {
190 $form = $this->initCreateForm("sess");
191 } else {
192 $form = $this->initForm("edit");
193 }
194 $ilCtrl->forwardCommand($form);
195 break;
196
197 case "ilbookinggatewaygui":
198 $tree = $DIC['tree'];
199 $parent_id = $tree->getParentId((int) $_REQUEST['ref_id']);
200
201 $this->tabs_gui->activateTab('obj_tool_setting_booking');
202 $gui = new ilBookingGatewayGUI($this, $parent_id);
203 $this->ctrl->forwardCommand($gui);
204 break;
205
206 default:
207 if ($cmd == "applyFilter") {
208 $cmd == "applyFilter";
209 $this->$cmd();
210 } elseif ($cmd == "resetFilter") {
211 $cmd == "resetFilter";
212 $this->$cmd();
213 }
214 if (!$cmd) {
215 $cmd = "infoScreen";
216 }
217 $cmd .= "Object";
218 $this->$cmd();
219
220 break;
221 }
222
223 $this->addHeaderAction();
224
225 return true;
226 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
This class is used for inegration of the booking manager as a service into other repository objects,...
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Export User Interface Class.
Class ilObjUserTrackingGUI.
prepareOutput($a_show_subobjects=true)
initCreateForm($a_new_type)
Init object creation form.
GUI class for the workflow of copying objects.
addHeaderAction()
Add header action menu.
Class ilObjectMetaDataGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
GUI class for membership features.
$ret
Definition: parser.php:6

References $_GET, $DIC, $GLOBALS, $ilUser, $ret, ilObjectGUI\$tree, ilLink\_getLink(), ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreen(), initCreateForm(), initForm(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, and prepareOutput().

+ Here is the call graph for this function:

◆ getAttendanceListUserData()

ilObjSessionGUI::getAttendanceListUserData (   $a_user_id,
  $a_filters 
)

Get user data for attendance list.

Parameters
int$a_user_id
bool$a_is_admin
bool$a_is_tutor
bool$a_is_member
array$a_filters
Returns
array

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

1505 {
1506 $data = $this->event_part->getUser($a_user_id);
1507
1508 if ($a_filters && $a_filters["registered"] && !$data["registered"]) {
1509 return;
1510 }
1511
1512 $data['registered'] = $data['registered'] ?
1513 $this->lng->txt('yes') :
1514 $this->lng->txt('no');
1515 $data['participated'] = $data['participated'] ?
1516 $this->lng->txt('yes') :
1517 $this->lng->txt('no');
1518
1519 return $data;
1520 }

References ilObjectGUI\$data.

◆ getContainerRefId()

ilObjSessionGUI::getContainerRefId ( )

container ref id

Returns
int ref id

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

2262 {
2263 if (!$this->container_ref_id) {
2264 $this->initContainer();
2265 }
2267 }

References $container_ref_id, and initContainer().

Referenced by materialsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentObject()

ilObjSessionGUI::getCurrentObject ( )

Get session object.

Returns
ilObjSession

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

242 {
243 return $this->object;
244 }

References ilObjectGUI\$object.

Referenced by registerObject(), showJoinRequestButton(), and unregisterObject().

+ Here is the caller graph for this function:

◆ getDefaultMemberRole()

ilObjSessionGUI::getDefaultMemberRole ( )

Get default member role.

Returns
int

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

2295 {
2296 $local_roles = $GLOBALS['DIC']->rbac()->review()->getRolesOfRoleFolder($this->object->getRefId(), false);
2297
2298 foreach ($local_roles as $role_id) {
2299 $title = ilObject::_lookupTitle($role_id);
2300 if (substr($title, 0, 19) == 'il_sess_participant') {
2301 return $role_id;
2302 }
2303 }
2304 return 0;
2305 }

References $GLOBALS, and ilObject\_lookupTitle().

+ Here is the call graph for this function:

◆ getLocalRoles()

ilObjSessionGUI::getLocalRoles ( )

get all local roles

Returns
int[]

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

2313 {
2314 return $GLOBALS['DIC']->rbac()->review()->getRolesOfRoleFolder($this->object->getRefId(), false);
2315 }

References $GLOBALS.

◆ getTabs()

ilObjSessionGUI::getTabs ( )

Build tabs.

@access public

Reimplemented from ilObjectGUI.

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

2115 {
2116 global $DIC;
2117
2118 $ilAccess = $DIC['ilAccess'];
2119 $ilTabs = $DIC['ilTabs'];
2120 $tree = $DIC['tree'];
2121 $ilCtrl = $DIC['ilCtrl'];
2122 $ilHelp = $DIC['ilHelp'];
2123 $ilUser = $DIC->user();
2124
2125 $ilHelp->setScreenIdComponent("sess");
2126
2127 $parent_id = $tree->getParentId($this->object->getRefId());
2128
2129 // #11650
2130 $parent_type = ilObject::_lookupType($parent_id, true);
2131
2132 $this->tabs_gui->setBackTarget(
2133 $this->lng->txt('back_to_' . $parent_type . '_content'),
2134 $ilCtrl->getLinkTarget($this, "redirectToParentContentPage")
2135 );
2136
2137 $this->tabs_gui->addTarget(
2138 'info_short',
2139 $this->ctrl->getLinkTarget($this, 'infoScreen')
2140 );
2141
2142 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
2143 $this->tabs_gui->addTarget(
2144 'settings',
2145 $this->ctrl->getLinkTarget($this, 'edit')
2146 );
2147 }
2148 if ($ilAccess->checkAccess('manage_materials', '', $this->object->getRefId())) {
2149 $this->tabs_gui->addTab(
2150 'materials',
2151 $this->lng->txt('crs_materials'),
2152 $this->ctrl->getLinkTarget($this, 'materials')
2153 );
2154 }
2155
2156 // booking
2157 $tree = $DIC['tree'];
2158 $parent_id = $tree->getParentId((int) $_REQUEST['ref_id']);
2159
2160 if ($ilAccess->checkAccess('write', '', $this->ref_id) && ilContainer::_lookupContainerSetting(
2161 ilObject::_lookupObjId($parent_id),
2163 false
2164 )) {
2165 $this->tabs_gui->addTarget(
2166 "obj_tool_setting_booking",
2167 $this->ctrl->getLinkTargetByClass(array("ilbookinggatewaygui"), "")
2168 );
2169 }
2170
2171 // member tab
2172 $is_participant = $this->object->getMembersObject()->isAssigned($ilUser->getId());
2173 $membership_gui = new ilSessionMembershipGUI($this, $this->object);
2174 $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
2175
2176
2177 // learning progress
2178 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
2179 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
2180 $this->tabs_gui->addTarget(
2181 'learning_progress',
2182 $this->ctrl->getLinkTargetByClass(array('ilobjsessiongui','illearningprogressgui'), ''),
2183 '',
2184 array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
2185 );
2186 }
2187
2188 // meta data
2189 if ($ilAccess->checkAccess('edit_metadata', '', $this->ref_id)) {
2190 $mdgui = new ilObjectMetaDataGUI($this->object);
2191 $mdtab = $mdgui->getTab();
2192 if ($mdtab) {
2193 $this->tabs_gui->addTab(
2194 "metadata",
2195 $this->lng->txt('meta_data'),
2196 $mdtab
2197 );
2198 }
2199 }
2200
2201 // export
2202 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
2203 $this->tabs_gui->addTarget(
2204 "export",
2205 $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
2206 "",
2207 "ilexportgui"
2208 );
2209 }
2210
2211
2212 // edit permissions
2213 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
2214 $this->tabs_gui->addTarget(
2215 "perm_settings",
2216 $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"),
2217 array("perm","info","owner"),
2218 'ilpermissiongui'
2219 );
2220 }
2221 }
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _lookupType($a_id, $a_reference=false)
lookup object type

References $DIC, $ilUser, ilObjectGUI\$tree, ilContainer\_lookupContainerSetting(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjectServiceSettingsGUI\BOOKING, and ilLearningProgressAccess\checkAccess().

+ Here is the call graph for this function:

◆ handleFileUpload()

ilObjSessionGUI::handleFileUpload ( )

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

913 {
914 global $DIC;
915
916 $tree = $DIC['tree'];
917
918 include_once './Modules/Session/classes/class.ilEventItems.php';
919 $ev = new ilEventItems($this->object->getId());
920 $items = $ev->getItems();
921
922 $counter = 0;
923 while (true) {
924 if (!isset($_FILES['files']['name'][$counter])) {
925 break;
926 }
927 if (!strlen($_FILES['files']['name'][$counter])) {
928 $counter++;
929 continue;
930 }
931
932 include_once './Modules/File/classes/class.ilObjFile.php';
933 $file = new ilObjFile();
934 $file->setTitle(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
935 $file->setDescription('');
936 $file->setFileName(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
937 $file->setFileType($_FILES['files']['type'][$counter]);
938 $file->setFileSize($_FILES['files']['size'][$counter]);
939 $file->create();
940 $new_ref_id = $file->createReference();
941 $file->putInTree($tree->getParentId($this->object->getRefId()));
942 $file->setPermissions($tree->getParentId($this->object->getRefId()));
943 $file->createDirectory();
944
945 $upload = $DIC->upload();
946 if (!$upload->hasBeenProcessed()) {
947 $upload->process();
948 }
949 $file->getUploadFile(
950 $_FILES['files']['tmp_name'][$counter],
951 $_FILES['files']['name'][$counter]
952 );
953
954 $items[] = $new_ref_id;
955 $counter++;
956 }
957
958 $ev->setItems($items);
959 $ev->update();
960 }
Class ilObjFile.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $DIC, ilObjectGUI\$tree, and ilUtil\stripSlashes().

Referenced by saveObject(), and updateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importFileObject()

ilObjSessionGUI::importFileObject (   $parent_id = null,
  $a_catch_errors = true 
)
protected

Import.

Reimplemented from ilObjectGUI.

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

2336 {
2337 return parent::importFileObject($parent_id, $a_catch_errors);
2338 }

◆ infoScreen()

ilObjSessionGUI::infoScreen ( )

info screen

@access protected

Parameters

return

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

652 {
653 global $DIC;
654
655 $ilAccess = $DIC['ilAccess'];
656 $ilUser = $DIC['ilUser'];
657 $ilCtrl = $DIC['ilCtrl'];
658 $tree = $DIC['tree'];
659 $ilToolbar = $DIC['ilToolbar'];
660 $lng = $DIC['lng'];
661
662 $this->checkPermission('visible');
663 $this->tabs_gui->setTabActive('info_short');
664
665 $this->showJoinRequestButton();
666
667 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
668 $info = new ilInfoScreenGUI($this);
669 $info->enableBookingInfo(true);
670
671 $eventItems = ilObjectActivation::getItemsByEvent($this->object->getId());
672 $parent_id = $tree->getParentId($this->object->getRefId());
673 $parent_id = ilObject::_lookupObjId($parent_id);
674 $eventItems = ilContainerSorting::_getInstance($parent_id)->sortSubItems(
675 'sess',
676 $this->object->getId(),
677 $eventItems
678 );
679
680 $lng->loadLanguageModule("cntr");// #14158
681
682 $html = '';
683 foreach ($eventItems as $item) {
684 $list_gui = ilSessionObjectListGUIFactory::factory($item['type']);
685 $list_gui->setContainerObject($this);
686
687 $this->modifyItemGUI($list_gui, $item, false);
688
689 $html .= $list_gui->getListItemHTML(
690 $item['ref_id'],
691 $item['obj_id'],
692 $item['title'],
693 $item['description']
694 );
695 }
696
697 if (strlen($html)) {
698 $info->addSection($this->lng->txt('event_materials'));
699 $info->addProperty(
700 '&nbsp;',
701 $html
702 );
703 }
704
705
706
707 // Session information
708 if (strlen($this->object->getLocation()) or strlen($this->object->getDetails())) {
709 $info->addSection($this->lng->txt('event_section_information'));
710 }
711 if (strlen($location = $this->object->getLocation())) {
712 $info->addProperty(
713 $this->lng->txt('event_location'),
714 ilUtil::makeClickable(nl2br($this->object->getLocation()), true)
715 );
716 }
717 if (strlen($this->object->getDetails())) {
718 $info->addProperty(
719 $this->lng->txt('event_details_workflow'),
720 ilUtil::makeClickable(nl2br($this->object->getDetails()), true)
721 );
722 }
723
724 $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'sess', $this->object->getId());
725 $record_gui->setInfoObject($info);
726 $record_gui->parse();
727
728 // meta data
729 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
730
731
732 // Tutor information
733 if ($this->object->hasTutorSettings()) {
734 $info->addSection($this->lng->txt('event_tutor_data'));
735 if (strlen($fullname = $this->object->getName())) {
736 $info->addProperty(
737 $this->lng->txt('event_lecturer'),
738 $fullname
739 );
740 }
741 if (strlen($email = $this->object->getEmail())) {
742 $info->addProperty(
743 $this->lng->txt('tutor_email'),
744 $email
745 );
746 }
747 if (strlen($phone = $this->object->getPhone())) {
748 $info->addProperty(
749 $this->lng->txt('tutor_phone'),
750 $phone
751 );
752 }
753 }
754
755 // support contacts
756 $parts = ilParticipants::getInstance($this->object->getRefId());
757 $contacts = $parts->getContacts();
758 if (count($contacts) > 0) {
759 $info->addSection($this->lng->txt("crs_mem_contacts"));
760 foreach ($contacts as $contact) {
761 $pgui = new ilPublicUserProfileGUI($contact);
762 $pgui->setBackUrl($this->ctrl->getLinkTargetByClass("ilinfoscreengui"));
763 $pgui->setEmbedded(true);
764 $info->addProperty("", $pgui->getHTML());
765 }
766 }
767
768 // forward the command
769 $this->ctrl->forwardCommand($info);
770
771 // store read event
772 require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
774 $this->object->getType(),
775 $this->object->getRefId(),
776 $this->object->getId(),
777 $ilUser->getId()
778 );
779 }
$location
Definition: buildRTE.php:44
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static _getInstance($a_obj_id)
get instance by obj_id
Class ilInfoScreenGUI.
modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
Modify Item ListGUI for presentation in container @global type $tree.
showJoinRequestButton(ilToolbarGUI $ilToolbar=null)
static getItemsByEvent($a_event_id)
Get session material / event items.
static getInstance($a_ref_id)
Get instance by ref_id.
GUI class for public user profile presentation.
static factory($a_type)
Get list gui by type This method caches all the returned list guis.
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
if( $orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:285

References $DIC, $email, $ilUser, $lng, $location, ilObjectGUI\$tree, ilContainerSorting\_getInstance(), ilObject\_lookupObjId(), ilChangeEvent\_recordReadEvent(), ilObjectGUI\checkPermission(), ilSessionObjectListGUIFactory\factory(), ilParticipants\getInstance(), ilObjectActivation\getItemsByEvent(), ilUtil\makeClickable(), ilAdvancedMDRecordGUI\MODE_INFO, modifyItemGUI(), and showJoinRequestButton().

Referenced by executeCommand(), and infoScreenObject().

+ 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 488 of file class.ilObjSessionGUI.php.

489 {
490 $this->ctrl->setCmd("showSummary");
491 $this->ctrl->setCmdClass("ilinfoscreengui");
492 $this->infoScreen();
493 }

References infoScreen().

+ Here is the call graph for this function:

◆ initAttendanceList()

ilObjSessionGUI::initAttendanceList ( )
protected

Init attendance list object.

Returns
ilAttendanceList

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

1444 {
1445 $members_obj = $this->initContainer(true);
1446
1447 include_once 'Services/Membership/classes/class.ilAttendanceList.php';
1448 $list = new ilAttendanceList(
1449 $this,
1450 $this->object,
1451 $members_obj
1452 );
1453 $list->setId('sessattlst');
1454
1455 $event_app = $this->object->getFirstAppointment();
1457 $desc = ilDatePresentation::formatPeriod($event_app->getStart(), $event_app->getEnd());
1459 $desc .= " " . $this->object->getTitle();
1460 $list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
1461
1462 $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
1463 $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
1464 if ($this->object->enabledRegistration()) {
1465 $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
1466 }
1467 $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1468 $list->addBlank($this->lng->txt('sess_signature'));
1469
1470 $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1471
1472 return $list;
1473 }
Base class for attendance lists.
static setUseRelativeDates($a_status)
set use relative dates
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.

References ilDatePresentation\formatPeriod(), initContainer(), and ilDatePresentation\setUseRelativeDates().

Referenced by attendanceListObject(), and printAttendanceListObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initContainer()

ilObjSessionGUI::initContainer (   $a_init_participants = false)
protected

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

1258 {
1259 global $DIC;
1260
1261 $tree = $DIC['tree'];
1262
1263 $is_course = $is_group = false;
1264
1265 // #13178
1266 $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
1267 if ($this->container_ref_id) {
1268 $is_group = true;
1269 }
1270 if (!$this->container_ref_id) {
1271 $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1272 if ($this->container_ref_id) {
1273 $is_course = true;
1274 }
1275 }
1276 if (!$this->container_ref_id) {
1277 ilUtil::sendFailure('No container object found. Aborting');
1278 return true;
1279 }
1280 $this->container_obj_id = ilObject::_lookupObjId($this->container_ref_id);
1281
1282 if ($a_init_participants && $this->container_obj_id) {
1283 if ($is_course) {
1284 include_once './Modules/Course/classes/class.ilCourseParticipants.php';
1285 return ilCourseParticipants::_getInstanceByObjId($this->container_obj_id);
1286 } elseif ($is_group) {
1287 include_once './Modules/Group/classes/class.ilGroupParticipants.php';
1288 return ilGroupParticipants::_getInstanceByObjId($this->container_obj_id);
1289 }
1290 }
1291 }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.

References $DIC, ilObjectGUI\$tree, ilCourseParticipants\_getInstanceByObjId(), ilGroupParticipants\_getInstanceByObjId(), ilObject\_lookupObjId(), and ilUtil\sendFailure().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

ilObjSessionGUI::initCreateForm (   $a_new_type)
protected

Init object creation form.

Parameters
string$a_new_type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

795 {
796 if (!is_object($this->object)) {
797 $this->object = new ilObjSession();
798 }
799 return $this->initForm('create');
800 }

References initForm().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilObjSessionGUI::initForm ( string  $a_mode)
protected

Init Form.

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

1654 {
1655 global $DIC;
1656
1657 $ilUser = $DIC['ilUser'];
1658
1659 if (is_object($this->form)) {
1660 return $this->form;
1661 }
1662
1663 $this->lng->loadLanguageModule('dateplaner');
1664
1665 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1666
1667 include_once('./Services/YUI/classes/class.ilYuiUtil.php');
1669
1670 $this->form = new ilPropertyFormGUI();
1671 $this->form->setMultipart(true);
1672 $this->form->setTableWidth('600px');
1673 $this->form->setFormAction($this->ctrl->getFormAction($this));
1674 $this->form->setMultipart(true);
1675
1676 $this->form = $this->initDidacticTemplate($this->form);
1677
1678 $this->lng->loadLanguageModule('dateplaner');
1679 include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
1680 $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
1681 $dur->setRequired(true);
1682 $dur->enableToggleFullTime(
1683 $this->lng->txt('event_fulltime_info'),
1684 $this->object->getFirstAppointment()->enabledFulltime() ? true : false
1685 );
1686 $dur->setShowTime(true);
1687 $dur->setStart($this->object->getFirstAppointment()->getStart());
1688 $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1689
1690 $this->form->addItem($dur);
1691
1692
1693 // Recurrence
1694 if ($a_mode == 'create') {
1695 if (!is_object($this->rec)) {
1696 include_once('./Modules/Session/classes/class.ilEventRecurrence.php');
1697 $this->rec = new ilEventRecurrence();
1698 }
1699 include_once('./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
1700 $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
1701 $rec->allowUnlimitedRecurrences(false);
1702 $rec->setRecurrence($this->rec);
1703 $this->form->addItem($rec);
1704
1705 // #14547
1706 $lp = new ilCheckboxInputGUI($this->lng->txt("sess_lp_preset"), "lp_preset");
1707 $lp->setInfo($this->lng->txt("sess_lp_preset_info"));
1708 $lp->setChecked(true);
1709 $this->form->addItem($lp);
1710 }
1711
1713 $section->setTitle($this->lng->txt('event_section_information'));
1714 $this->form->addItem($section);
1715
1716 // title
1717 $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title');
1718 $title->setRequired(true);
1719 $title->setValue($this->object->getTitle());
1720 $title->setSize(50);
1721 $title->setMaxLength(70);
1722 $this->form->addItem($title);
1723
1724 // desc
1725 $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc');
1726 $desc->setValue($this->object->getLongDescription());
1727 $desc->setRows(4);
1728 $desc->setCols(50);
1729 $this->form->addItem($desc);
1730
1731 // location
1732 $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location');
1733 $desc->setValue($this->object->getLocation());
1734 $desc->setRows(4);
1735 $desc->setCols(50);
1736 $this->form->addItem($desc);
1737
1738 // workflow
1739 $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details');
1740 $details->setValue($this->object->getDetails());
1741 $details->setCols(50);
1742 $details->setRows(4);
1743 $this->form->addItem($details);
1744
1745 if ($a_mode == 'create') {
1746 $this->record_gui = new ilAdvancedMDRecordGUI(
1748 'sess'
1749 );
1750 $this->record_gui->setRefId((int) $_GET['ref_id']);
1751 $this->record_gui->setPropertyForm($this->form);
1752 $this->record_gui->parse();
1753 } elseif ($this->checkPermissionBool('edit_metadata')) {
1754 $this->record_gui = new ilAdvancedMDRecordGUI(
1756 'sess',
1757 $this->object->getId()
1758 );
1759 $this->record_gui->setPropertyForm($this->form);
1760 $this->record_gui->parse();
1761 }
1762
1763
1764 // section
1766 $section->setTitle($this->lng->txt('event_tutor_data'));
1767 $this->form->addItem($section);
1768
1769 // name
1770 $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name');
1771 $tutor_name->setValue($this->object->getName());
1772 $tutor_name->setSize(20);
1773 $tutor_name->setMaxLength(70);
1774 $this->form->addItem($tutor_name);
1775
1776 // email
1777 $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email');
1778 $tutor_email->setValue($this->object->getEmail());
1779 $tutor_email->setSize(20);
1780 $tutor_email->setMaxLength(70);
1781 $this->form->addItem($tutor_email);
1782
1783 // phone
1784 $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone');
1785 $tutor_phone->setValue($this->object->getPhone());
1786 $tutor_phone->setSize(20);
1787 $tutor_phone->setMaxLength(70);
1788 $this->form->addItem($tutor_phone);
1789
1791 $section->setTitle($this->lng->txt('sess_section_reg'));
1792 $this->form->addItem($section);
1793
1794 include_once './Modules/Session/classes/class.ilSessionMembershipRegistrationSettingsGUI.php';
1795 include_once './Services/Membership/classes/class.ilMembershipRegistrationSettings.php';
1797 $this,
1798 $this->object,
1799 array(
1805 )
1806 );
1807 $reg_settings->addMembershipFormElements($this->form, '');
1808
1809
1811 $section->setTitle($this->lng->txt('event_assign_files'));
1812 $this->form->addItem($section);
1813
1814 $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
1815 $files->setFilenames(array(0 => ''));
1816 $this->form->addItem($files);
1817
1819 $section->setTitle($this->lng->txt('sess_setting_header_presentation'));
1820 $this->form->addItem($section);
1821
1822 $DIC->object()->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
1823
1824 $features = new ilFormSectionHeaderGUI();
1825 $features->setTitle($this->lng->txt('obj_features'));
1826 $this->form->addItem($features);
1828 $this->object->getId(),
1829 $this->form,
1830 array(
1832 )
1833 );
1834
1835 $gallery = new ilCheckboxInputGUI($this->lng->txt('sess_show_members'), 'show_members');
1836 $gallery->setChecked($this->object->getShowMembers());
1837 $gallery->setInfo($this->lng->txt('sess_show_participants_info'));
1838 $this->form->addItem($gallery);
1839
1840
1841 // Show mail to members type
1842 $mail_type = new ilRadioGroupInputGUI($this->lng->txt('sess_mail_type'), 'mail_type');
1843 $mail_type->setValue($this->object->getMailToMembersType());
1844
1845 $mail_tutors = new ilRadioOption(
1846 $this->lng->txt('sess_mail_admins_only'),
1848 $this->lng->txt('sess_mail_admins_only_info')
1849 );
1850 $mail_type->addOption($mail_tutors);
1851
1852 $mail_all = new ilRadioOption(
1853 $this->lng->txt('sess_mail_all'),
1855 $this->lng->txt('sess_mail_all_info')
1856 );
1857 $mail_type->addOption($mail_all);
1858 $this->form->addItem($mail_type);
1859
1860
1861
1862 switch ($a_mode) {
1863 case 'create':
1864 $this->form->setTitle($this->lng->txt('event_table_create'));
1865 $this->form->addCommandButton('save', $this->lng->txt('event_btn_add'));
1866 $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit'));
1867 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
1868 return $this->form;
1869
1870 case 'edit':
1871 $this->form->setTitle($this->lng->txt('event_table_update'));
1872 $this->form->addCommandButton('update', $this->lng->txt('save'));
1873 $this->form->addCommandButton('cancelEdit', $this->lng->txt('cancel'));
1874 return $this->form;
1875 }
1876 return $this->form;
1877 }
$section
Definition: Utf8Test.php:83
This class represents a checkbox property in a property form.
input GUI for a time span (start and end date)
This class represents a file wizard property in a property form.
This class represents a section header in a property form.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
initDidacticTemplate(ilPropertyFormGUI $form)
Show didactic template types.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents an input GUI for recurring events/appointments (course events or calendar appoi...
This class represents a text area property in a property form.
This class represents a text property in a property form.
static initDomEvent(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI DomEvent.

References $_GET, $DIC, $files, $ilUser, $section, ilObjectGUI\checkPermissionBool(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilObjectGUI\initDidacticTemplate(), ilYuiUtil\initDomEvent(), ilObjectServiceSettingsGUI\initServiceSettingsForm(), ilObjSession\MAIL_ALLOWED_ADMIN, ilObjSession\MAIL_ALLOWED_ALL, ilAdvancedMDRecordGUI\MODE_EDITOR, ilMembershipRegistrationSettings\REGISTRATION_LIMITED_USERS, ilMembershipRegistrationSettings\TYPE_DIRECT, ilMembershipRegistrationSettings\TYPE_NONE, ilMembershipRegistrationSettings\TYPE_REQUEST, and ilMembershipRegistrationSettings\TYPE_TUTOR.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ joinObject()

ilObjSessionGUI::joinObject ( )

Called from info screen.

Returns

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

350 {
351 global $DIC;
352
353 $ilUser = $DIC['ilUser'];
354
355 $this->checkPermission('read');
356
357 if ($ilUser->isAnonymous()) {
358 $this->ctrl->redirect($this, 'infoScreen');
359 }
360
361 include_once './Modules/Session/classes/class.ilEventParticipants.php';
362
363 if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->object->getId())) {
364 $_SESSION['sess_hide_info'] = true;
365 ilEventParticipants::_unregister($ilUser->getId(), $this->object->getId());
366 ilUtil::sendSuccess($this->lng->txt('event_unregistered'), true);
367 } else {
368 ilEventParticipants::_register($ilUser->getId(), $this->object->getId());
369 ilUtil::sendSuccess($this->lng->txt('event_registered'), true);
370 }
371
372 $this->ctrl->redirect($this, 'infoScreen');
373 }
static _isRegistered($a_usr_id, $a_event_id)
static _register($a_usr_id, $a_event_id)
static _unregister($a_usr_id, $a_event_id)

References $_SESSION, $DIC, $ilUser, ilEventParticipants\_isRegistered(), ilEventParticipants\_register(), ilEventParticipants\_unregister(), and ilObjectGUI\checkPermission().

+ Here is the call graph for this function:

◆ load()

ilObjSessionGUI::load ( )
protected

load settings

@access protected

Parameters

return

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

1887 {
1888 $event = $this->form->getItemByPostVar('event');
1889 if ($event->getStart() && $event->getEnd()) {
1890 $this->object->getFirstAppointment()->setStartingTime($event->getStart()->get(IL_CAL_UNIX));
1891 $this->object->getFirstAppointment()->setEndingTime($event->getStart()->get(IL_CAL_UNIX));
1892 $this->object->getFirstAppointment()->setStart($event->getStart());
1893 $this->object->getFirstAppointment()->setEnd($event->getEnd());
1894 $this->object->getFirstAppointment()->toggleFulltime($event->getStart() instanceof ilDate);
1895 }
1896
1897 $this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
1898 $this->object->setDescription(ilUtil::stripSlashes($_POST['desc']));
1899 $this->object->setLocation(ilUtil::stripSlashes($_POST['location']));
1900 $this->object->setName(ilUtil::stripSlashes($_POST['tutor_name']));
1901 $this->object->setPhone(ilUtil::stripSlashes($_POST['tutor_phone']));
1902 $this->object->setEmail(ilUtil::stripSlashes($_POST['tutor_email']));
1903 $this->object->setDetails(ilUtil::stripSlashes($_POST['details']));
1904
1905 $this->object->setRegistrationNotificationEnabled(ilUtil::stripSlashes($_POST['registration_notification']));
1906 $this->object->setRegistrationNotificationOption(ilUtil::stripSlashes($_POST['notification_option']));
1907
1908 $this->object->setRegistrationType((int) $_POST['registration_type']);
1909
1910 switch ($this->object->getRegistrationType()) {
1912 $this->object->enableCannotParticipateOption((bool) $_POST['show_cannot_participate_direct']);
1913 break;
1915 $this->object->enableCannotParticipateOption((bool) $_POST['show_cannot_participate_request']);
1916 break;
1917 default:
1918 $this->object->enableCannotParticipateOption(false);
1919 break;
1920 }
1921
1922
1923 // $this->object->setRegistrationMinUsers((int) $_POST['registration_min_members']);
1924 $this->object->setRegistrationMaxUsers((int) $_POST['registration_max_members']);
1925 $this->object->enableRegistrationUserLimit((int) $_POST['registration_membership_limited']);
1926 $this->object->setShowMembers((int) $_POST['show_members']);
1927 $this->object->setMailToMembersType((int) $_POST['mail_type']);
1928
1929 switch ((int) $_POST['waiting_list']) {
1930 case 2:
1931 $this->object->enableRegistrationWaitingList(true);
1932 $this->object->setWaitingListAutoFill(true);
1933 break;
1934
1935 case 1:
1936 $this->object->enableRegistrationWaitingList(true);
1937 $this->object->setWaitingListAutoFill(false);
1938 break;
1939
1940 default:
1941 $this->object->enableRegistrationWaitingList(false);
1942 $this->object->setWaitingListAutoFill(false);
1943 break;
1944 }
1945 }
Class for single dates.

References $_POST, IL_CAL_UNIX, ilUtil\stripSlashes(), ilMembershipRegistrationSettings\TYPE_DIRECT, and ilMembershipRegistrationSettings\TYPE_REQUEST.

Referenced by saveObject(), and updateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRecurrenceSettings()

ilObjSessionGUI::loadRecurrenceSettings ( )
protected

load recurrence settings

@access protected

Returns

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

1954 {
1955 include_once('./Modules/Session/classes/class.ilSessionRecurrence.php');
1956 $this->rec = new ilSessionRecurrence();
1957
1958 switch ($_POST['frequence']) {
1959 case IL_CAL_FREQ_DAILY:
1960 $this->rec->setFrequenceType($_POST['frequence']);
1961 $this->rec->setInterval((int) $_POST['count_DAILY']);
1962 break;
1963
1964 case IL_CAL_FREQ_WEEKLY:
1965 $this->rec->setFrequenceType($_POST['frequence']);
1966 $this->rec->setInterval((int) $_POST['count_WEEKLY']);
1967 if (is_array($_POST['byday_WEEKLY'])) {
1968 $this->rec->setBYDAY(ilUtil::stripSlashes(implode(',', $_POST['byday_WEEKLY'])));
1969 }
1970 break;
1971
1973 $this->rec->setFrequenceType($_POST['frequence']);
1974 $this->rec->setInterval((int) $_POST['count_MONTHLY']);
1975 switch ((int) $_POST['subtype_MONTHLY']) {
1976 case 0:
1977 // nothing to do;
1978 break;
1979
1980 case 1:
1981 switch ((int) $_POST['monthly_byday_day']) {
1982 case 8:
1983 // Weekday
1984 $this->rec->setBYSETPOS((int) $_POST['monthly_byday_num']);
1985 $this->rec->setBYDAY('MO,TU,WE,TH,FR');
1986 break;
1987
1988 case 9:
1989 // Day of month
1990 $this->rec->setBYMONTHDAY((int) $_POST['monthly_byday_num']);
1991 break;
1992
1993 default:
1994 $this->rec->setBYDAY((int) $_POST['monthly_byday_num'] . $_POST['monthly_byday_day']);
1995 break;
1996 }
1997 break;
1998
1999 case 2:
2000 $this->rec->setBYMONTHDAY((int) $_POST['monthly_bymonthday']);
2001 break;
2002 }
2003 break;
2004
2005 case IL_CAL_FREQ_YEARLY:
2006 $this->rec->setFrequenceType($_POST['frequence']);
2007 $this->rec->setInterval((int) $_POST['count_YEARLY']);
2008 switch ((int) $_POST['subtype_YEARLY']) {
2009 case 0:
2010 // nothing to do;
2011 break;
2012
2013 case 1:
2014 $this->rec->setBYMONTH((int) $_POST['yearly_bymonth_byday']);
2015 $this->rec->setBYDAY((int) $_POST['yearly_byday_num'] . $_POST['yearly_byday']);
2016 break;
2017
2018 case 2:
2019 $this->rec->setBYMONTH((int) $_POST['yearly_bymonth_by_monthday']);
2020 $this->rec->setBYMONTHDAY((int) $_POST['yearly_bymonthday']);
2021 break;
2022 }
2023 break;
2024 }
2025
2026 // UNTIL
2027 switch ((int) $_POST['until_type']) {
2028 case 1:
2029 $this->rec->setFrequenceUntilDate(null);
2030 // nothing to do
2031 break;
2032
2033 case 2:
2034 $this->rec->setFrequenceUntilDate(null);
2035 $this->rec->setFrequenceUntilCount((int) $_POST['count']);
2036 break;
2037
2038 case 3:
2039 $frequence = $this->form->getItemByPostVar('frequence');
2040 $end = $frequence->getRecurrence()->getFrequenceUntilDate();
2041 $this->rec->setFrequenceUntilCount(0);
2042 $this->rec->setFrequenceUntilDate($end);
2043 break;
2044 }
2045 }
const IL_CAL_FREQ_YEARLY
const IL_CAL_FREQ_MONTHLY
const IL_CAL_FREQ_WEEKLY
const IL_CAL_FREQ_DAILY
Model of calendar entry recurrcences.

References $_POST, IL_CAL_FREQ_DAILY, IL_CAL_FREQ_MONTHLY, IL_CAL_FREQ_WEEKLY, IL_CAL_FREQ_YEARLY, and ilUtil\stripSlashes().

Referenced by saveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ materialsObject()

ilObjSessionGUI::materialsObject ( )

show material assignment

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

1297 {
1298 global $DIC;
1299
1300 $tree = $DIC['tree'];
1301 $objDefinition = $DIC['objDefinition'];
1302
1303 $this->tabs_gui->activateTab('materials');
1304
1305 // #11337 - support ANY parent container (crs, grp, fld)
1306 $parent_ref_id = $tree->getParentId($this->object->getRefId());
1307
1308 include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
1309 $gui = new ilObjectAddNewItemGUI($parent_ref_id);
1310 $gui->setDisabledObjectTypes(
1311 array_merge(
1312 [
1313 'itgr', 'sess'
1314 ],
1315 $objDefinition->getSideBlockTypes()
1316 )
1317 );
1318 $gui->setAfterCreationCallback($this->ref_id);
1319 $gui->render();
1320
1321 include_once 'Modules/Session/classes/class.ilEventItems.php';
1322 $this->event_items = new ilEventItems($this->object->getId());
1323
1324 include_once 'Modules/Session/classes/class.ilSessionMaterialsTableGUI.php';
1325 $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1326
1327 $tbl->setDisableFilterHiding(true);
1328
1329 $tbl->addMultiCommand('saveMaterials', $this->lng->txt('sess_assign'));
1330 $tbl->addMultiCommand("removeMaterials", $this->lng->txt("remove"));
1331
1332 $tbl->setTitle($this->lng->txt("event_assign_materials_table"));
1333 $tbl->setDescription($this->lng->txt('event_assign_materials_info'));
1334
1335 $tbl->setMaterialItems($this->event_items->getItems());
1336 $tbl->setContainerRefId($this->getContainerRefId());
1337 $data = $tbl->getDataFromDb();
1338 $tbl->setMaterials($data);
1339
1340 $this->tpl->setContent($tbl->getHTML());
1341 }
getContainerRefId()
container ref id
Render add new item selector.

References ilObjectGUI\$data, $DIC, ilObjectGUI\$objDefinition, ilObjectGUI\$tree, and getContainerRefId().

+ Here is the call graph for this function:

◆ membersObject()

ilObjSessionGUI::membersObject ( )
protected

Redirect to member adminsitration.

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

233 {
234 $this->ctrl->redirectByClass('ilSessionMembershipGUI', 'participants');
235 }

◆ modifyItemGUI()

ilObjSessionGUI::modifyItemGUI (   $a_item_list_gui,
  $a_item_data,
  $a_show_path 
)

Modify Item ListGUI for presentation in container @global type $tree.

Parameters
type$a_item_list_gui
type$a_item_data
type$a_show_path

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

503 {
504 global $DIC;
505
506 $tree = $DIC['tree'];
507
508 // if folder is in a course, modify item list gui according to course requirements
509 if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs')) {
510 // #10611
511 include_once "Services/Object/classes/class.ilObjectActivation.php";
512 ilObjectActivation::addListGUIActivationProperty($a_item_list_gui, $a_item_data);
513
514 include_once("./Modules/Course/classes/class.ilObjCourse.php");
515 include_once("./Modules/Course/classes/class.ilObjCourseGUI.php");
516 $course_obj_id = ilObject::_lookupObjId($course_ref_id);
518 $a_item_list_gui,
519 get_class($this),
520 $a_item_data,
521 $a_show_path,
522 ilObjCourse::_lookupAboStatus($course_obj_id),
523 $course_ref_id,
524 $course_obj_id,
525 $this->object->getRefId()
526 );
527 }
528 }
static _modifyItemGUI( $a_item_list_gui, $a_cmd_class, $a_item_data, $a_show_path, $a_abo_status, $a_course_ref_id, $a_course_obj_id, $a_parent_ref_id=0)
We need a static version of this, e.g.
static _lookupAboStatus($a_id)
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.

References $DIC, ilObjectGUI\$tree, ilObjCourse\_lookupAboStatus(), ilObject\_lookupObjId(), ilObjCourseGUI\_modifyItemGUI(), and ilObjectActivation\addListGUIActivationProperty().

Referenced by infoScreen().

+ 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 1405 of file class.ilObjSessionGUI.php.

1406 {
1407 include_once 'Modules/Session/classes/class.ilSessionMaterialsTableGUI.php';
1408 $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1409 $tbl->setOffset(0);
1410 $tbl->storeNavParameter();//remove offset and go to page 1
1411
1412 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1413 $this->ctrl->redirect($this, 'materials');
1414 }

Referenced by removeMaterialsObject(), and saveMaterialsObject().

+ Here is the caller graph for this function:

◆ prepareOutput()

ilObjSessionGUI::prepareOutput (   $a_show_subobjects = true)
See also
ilObjectGUI::prepareOutput()

Reimplemented from ilObjectGUI.

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

250 {
251 parent::prepareOutput($a_show_subobjects);
252
253 if (!$this->getCreationMode()) {
254 $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
255
256 include_once './Modules/Session/classes/class.ilSessionAppointment.php';
257 $this->tpl->setTitle(
258 $this->object->getFirstAppointment()->appointmentToString() . $title
259 );
260 }
261 }

References ilObjectGUI\getCreationMode().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printAttendanceListObject()

ilObjSessionGUI::printAttendanceListObject ( )
protected

print attendance list

@access protected

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

1481 {
1482 $this->checkPermission('manage_members');
1483
1484 $list = $this->initAttendanceList();
1485 $list->initFromForm();
1486 $list->setCallback(array($this, 'getAttendanceListUserData'));
1487
1488 include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1489 $this->event_part = new ilEventParticipants($this->object->getId());
1490
1491 echo $list->getFullscreenHTML();
1492 exit();
1493 }
exit
Definition: login.php:29

References ilObjectGUI\checkPermission(), exit, and initAttendanceList().

+ Here is the call graph for this function:

◆ readMemberData()

ilObjSessionGUI::readMemberData (   $a_usr_ids)

Used for waiting list.

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

2247 {
2248 $tmp_data = array();
2249 foreach ($a_usr_ids as $usr_id) {
2250 $tmp_data[$usr_id] = array();
2251 }
2252 return $tmp_data;
2253 }

◆ redirectToParentContentPageObject()

ilObjSessionGUI::redirectToParentContentPageObject ( )
protected

Redirect to parent content page.

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

2087 {
2088 global $DIC;
2089
2090 $objDefinition = $DIC['objDefinition'];
2091
2092 $tree = $DIC->repositoryTree();
2093 $ctrl = $DIC->ctrl();
2094
2095 $parent_id = $tree->getParentId($this->object->getRefId());
2096
2097 // #11650
2098 $parent_type = ilObject::_lookupType($parent_id, true);
2099
2100 $parent_class = $objDefinition->getClassName($parent_type);
2101 $parent_class = 'ilObj' . $parent_class . 'GUI';
2102
2103 $ctrl->setParameterByClass($parent_class, "ref_id", $parent_id);
2104 $ctrl->redirectByClass($parent_class, "view");
2105 }

References $ctrl, $DIC, ilObjectGUI\$objDefinition, ilObjectGUI\$tree, and ilObject\_lookupType().

+ Here is the call graph for this function:

◆ refuseParticipationObject()

ilObjSessionGUI::refuseParticipationObject ( )
protected

refuse participation

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

545 {
546 return $this->unregisterObject(true);
547 }
unregisterObject($a_refuse_participation=false)
unregister from session

References unregisterObject().

+ Here is the call graph for this function:

◆ registerObject()

ilObjSessionGUI::registerObject ( )

register to session

@access public

Parameters

return

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

271 {
272 global $DIC;
273
274 $ilUser = $DIC->user();
275 $ilAppEventHandler = $DIC['ilAppEventHandler'];
276
277 $this->checkPermission('visible');
278
279 include_once './Services/Membership/classes/class.ilParticipants.php';
280 $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
281
282 include_once './Modules/Session/classes/class.ilEventParticipants.php';
283 $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
284 $event_part->updateExcusedForUser($ilUser->getId(), false);
285
286 if (
287 $this->getCurrentObject()->isRegistrationUserLimitEnabled() and
288 $this->getCurrentObject()->getRegistrationMaxUsers() and
289 (count($event_part->getRegistered()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
290 ) {
291 if (!$this->getCurrentObject()->isRegistrationWaitingListEnabled()) {
292 ilUtil::sendInfo($this->lng->txt('sess_reg_max_users_exceeded'), true);
293 $this->ctrl->redirect($this, 'infoScreen');
294 }
295 include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
296 $wait = new ilSessionWaitingList($this->getCurrentObject()->getId());
297 $wait->addToList($ilUser->getId());
298 ilUtil::sendInfo($this->lng->txt('sess_reg_added_to_wl'), true);
299 $this->ctrl->redirect($this, 'infoScreen');
300 return true;
301 }
302
303
304 switch ($this->getCurrentObject()->getRegistrationType()) {
306 $this->ctrl->redirect($this, 'info');
307 break;
308
310 $part->register($ilUser->getId());
311 ilUtil::sendSuccess($this->lng->txt('event_registered'), true);
312
313 $ilAppEventHandler->raise(
314 "Modules/Session",
315 'enter',
316 array(
317 'obj_id' => $this->getCurrentObject()->getId(),
318 'ref_id' => $this->getCurrentObject()->getRefId(),
319 'usr_id' => $ilUser->getId()
320 )
321 );
322
323 $this->ctrl->redirect($this, 'infoScreen');
324 break;
325
327 ilUtil::sendSuccess($this->lng->txt('sess_registered_confirm'), true);
328 $part->addSubscriber($ilUser->getId());
329
330 $ilAppEventHandler->raise(
331 "Modules/Session",
332 'register',
333 array(
334 'obj_id' => $this->getCurrentObject()->getId(),
335 'ref_id' => $this->getCurrentObject()->getRefId(),
336 'usr_id' => $ilUser->getId()
337 )
338 );
339
340 $this->ctrl->redirect($this, 'infoScreen');
341 break;
342 }
343 }
getCurrentObject()
Get session object.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $DIC, $ilUser, ilObjectGUI\checkPermission(), getCurrentObject(), ilParticipants\getInstance(), ilUtil\sendInfo(), ilMembershipRegistrationSettings\TYPE_DIRECT, ilMembershipRegistrationSettings\TYPE_NONE, and ilMembershipRegistrationSettings\TYPE_REQUEST.

+ Here is the call graph for this function:

◆ removeMaterialsObject()

ilObjSessionGUI::removeMaterialsObject ( )

Remove materials from the current object.

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

1369 {
1370 $items_checked = is_array($_POST['items']) ? $_POST['items'] : array();
1371
1372 $this->event_items = new ilEventItems($this->object->getId());
1373 $this->event_items->removeItems($items_checked);
1374
1375 $this->postUpdateMaterials();
1376 }
postUpdateMaterials()
redirect to list of materials without offset/page.

References $_POST, and postUpdateMaterials().

+ Here is the call graph for this function:

◆ resetFilter()

ilObjSessionGUI::resetFilter ( )

Reset filter.

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

1358 {
1359 $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1360 $tbl->resetOffset(); // sets record offest to 0 (first page)
1361 $tbl->resetFilter(); // clears filter
1362 $this->ctrl->redirect($this, "materials");
1363 }

◆ saveAndAssignMaterialsObject()

ilObjSessionGUI::saveAndAssignMaterialsObject ( )

Save and assign sessoin materials.

@access protected

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

808 {
809 $this->saveObject(false);
810
811 $this->ctrl->setParameter($this, 'ref_id', $this->object->getRefId());
812 $this->ctrl->setParameter($this, 'new_type', '');
813 $this->ctrl->redirect($this, 'materials');
814 }
saveObject()
save object

References ilObjectGUI\saveObject().

+ Here is the call graph for this function:

◆ saveMaterialsObject()

ilObjSessionGUI::saveMaterialsObject ( )

save material assignment

@access public

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

1385 {
1386 include_once './Modules/Session/classes/class.ilEventItems.php';
1387
1388 $this->event_items = new ilEventItems($this->object->getId());
1389 $db_items = $this->event_items->getItems();
1390
1391 $list_items_checked = is_array($_POST['items']) ? $_POST['items'] : array();
1392 $list_items_checked = array_map('intval', $list_items_checked);
1393
1394 $items_to_save = array_merge($db_items, $list_items_checked);
1395 $items_to_save = array_unique($items_to_save);
1396
1397 $this->event_items->setItems($items_to_save);
1398 $this->event_items->update();
1399 $this->postUpdateMaterials();
1400 }

References $_POST, and postUpdateMaterials().

+ Here is the call graph for this function:

◆ saveObject()

ilObjSessionGUI::saveObject (   $a_redirect_on_success = true)

save object

@access protected

Parameters
bool$a_redirect_on_successRedirect to repository after success.
Returns

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

824 {
825 global $DIC;
826
827 $ilErr = $DIC['ilErr'];
828 $ilUser = $DIC['ilUser'];
829
830 $this->object = new ilObjSession();
831
832 $this->ctrl->saveParameter($this, "new_type");
833
834 $form = $this->initForm('create');
835 $ilErr->setMessage('');
836 if (!$form->checkInput()) {
837 $form->setValuesByPost();
838 $ilErr->setMessage($this->lng->txt('err_check_input'));
839 $this->createObject($form);
840 return false;
841 }
842
843 if (
844 $this->record_gui instanceof \ilAdvancedMDRecordGUI &&
845 !$this->record_gui->importEditFormPostValues()
846 ) {
847 $ilErr->setMessage($this->lng->txt('err_check_input'));
848 }
849
850 $this->load();
851 $this->loadRecurrenceSettings();
852
853 $this->object->validate();
854 $this->object->getFirstAppointment()->validate();
855
856 if (strlen($ilErr->getMessage())) {
857 ilUtil::sendFailure($ilErr->getMessage());
858 $this->form->setValuesByPost();
859 $this->createObject();
860 return false;
861 }
862 // Create session
863 $this->object->create();
864 $this->object->createReference();
865 $this->object->putInTree($_GET["ref_id"]);
866 $this->object->setPermissions($_GET["ref_id"]);
867
869 $this->object->getId(),
870 $this->form,
871 array(
873 )
874 );
875 if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
876 $this->record_gui->writeEditForm($this->object->getId());
877 }
878
879
880 // apply didactic template?
881 $dtpl = $this->getDidacticTemplateVar("dtpl");
882 if ($dtpl) {
883 $this->object->applyDidacticTemplate($dtpl);
884 }
885
886 // #14547 - active is default
887 if (!$this->form->getInput("lp_preset")) {
888 include_once "Services/Tracking/classes/class.ilLPObjSettings.php";
889 $lp_obj_settings = new ilLPObjSettings($this->object->getId());
890 $lp_obj_settings->setMode(ilLPObjSettings::LP_MODE_DEACTIVATED);
891 $lp_obj_settings->update(false);
892 }
893
894 // create appointment
895 $this->object->getFirstAppointment()->setSessionId($this->object->getId());
896 $this->object->getFirstAppointment()->create();
897
898 $this->handleFileUpload();
899
900 $DIC->object()->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
901
902 $this->createRecurringSessions($this->form->getInput("lp_preset"));
903
904 if ($a_redirect_on_success) {
905 ilUtil::sendInfo($this->lng->txt('event_add_new_event'), true);
906 $this->ctrl->returnToParent($this);
907 }
908
909 return true;
910 }
importEditFormPostValues()
Load edit form values from post.
loadRecurrenceSettings()
load recurrence settings
createRecurringSessions($a_activate_lp=true)
create recurring sessions
createObject()
create new object form
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.

References $_GET, $DIC, ilObjectGUI\$ilErr, $ilUser, ilObjectGUI\createObject(), createRecurringSessions(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilObjectGUI\getDidacticTemplateVar(), handleFileUpload(), ilAdvancedMDRecordGUI\importEditFormPostValues(), initForm(), load(), loadRecurrenceSettings(), ilLPObjSettings\LP_MODE_DEACTIVATED, ilUtil\sendFailure(), ilUtil\sendInfo(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

+ Here is the call graph for this function:

◆ sendFileObject()

ilObjSessionGUI::sendFileObject ( )

send file

@access public

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

787 {
788 $file = new ilSessionFile((int) $_GET['file_id']);
789
790 ilUtil::deliverFile($file->getAbsolutePath(), $file->getFileName(), $file->getFileType());
791 return true;
792 }
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.

References $_GET, and ilUtil\deliverFile().

+ Here is the call graph for this function:

◆ showJoinRequestButton()

ilObjSessionGUI::showJoinRequestButton ( ilToolbarGUI  $ilToolbar = null)
protected
Parameters
$ilToolbarilToolbarGUI show join request

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

554 {
555 global $DIC;
556
557 $ilUser = $DIC['ilUser'];
558
559 if (!$ilToolbar) {
560 global $DIC;
561
562 $ilToolbar = $DIC['ilToolbar'];
563 }
564
565 if (!$this->getCurrentObject()->enabledRegistrationForUsers() || $ilUser->isAnonymous()) {
566 return false;
567 }
568
569 include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
570
571 include_once './Services/Membership/classes/class.ilParticipants.php';
572 $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
573
574 include_once './Modules/Session/classes/class.ilEventParticipants.php';
575
576 $this->ctrl->setParameter($this, "ref_id", $this->getCurrentObject()->getRefId());
577
578 $btn_excused = null;
579 if ($this->object->isCannotParticipateOptionEnabled()) {
580 $btn_excused = $this->ui->factory()->button()->standard(
581 $this->lng->txt('sess_bt_refuse'),
582 $this->ctrl->getLinkTarget($this, 'refuseParticipation')
583 );
584 }
585
586
587 if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->getCurrentObject()->getId())) {
588 if (!is_null($btn_excused)) {
589 $ilToolbar->addComponent($btn_excused);
590 }
591 return true;
592 } elseif ($part->isSubscriber($ilUser->getId())) {
593 if (!is_null($btn_excused)) {
594 $ilToolbar->addComponent($btn_excused);
595 }
596 return true;
597 } elseif (ilSessionWaitingList::_isOnList($ilUser->getId(), $this->getCurrentObject()->getId())) {
598 if (!is_null($btn_excused)) {
599 $ilToolbar->addComponent($btn_excused);
600 }
601 return true;
602 }
603
604 $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
605
606 if (
607 $this->getCurrentObject()->isRegistrationUserLimitEnabled() and
608 $this->getCurrentObject()->getRegistrationMaxUsers() and
609 (count($event_part->getRegistered()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
610 ) {
611 if ($this->getCurrentObject()->isRegistrationWaitingListEnabled()) {
612 ilUtil::sendInfo($this->lng->txt('sess_reg_max_users_exceeded_wl'));
613 $btn_attend = $this->ui->factory()->button()->primary(
614 $this->lng->txt("mem_add_to_wl"),
615 $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register")
616 );
617 $ilToolbar->addComponent($btn_attend);
618 if (!$event_part->isExcused($ilUser->getId()) && !is_null($btn_excused)) {
619 $ilToolbar->addComponent($btn_excused);
620 }
621 return true;
622 } else {
623 ilUtil::sendInfo($this->lng->txt('sess_reg_max_users_exceeded'));
624 return true;
625 }
626 } else {
627 if (!isset($_SESSION['sess_hide_info'])) {
628 ilUtil::sendInfo($this->lng->txt('sess_join_info'));
629 $btn_attend = $this->ui->factory()->button()->primary(
630 $this->lng->txt("join_session"),
631 $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register")
632 );
633 $ilToolbar->addComponent($btn_attend);
634 if (!$event_part->isExcused($ilUser->getId()) && !is_null($btn_excused)) {
635 $ilToolbar->addComponent($btn_excused);
636 }
637 return true;
638 }
639 }
640 }
addComponent(\ILIAS\UI\Component\Component $a_comp)
Add component.
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.

References $_SESSION, $DIC, $ilUser, ilWaitingList\_isOnList(), ilEventParticipants\_isRegistered(), getCurrentObject(), ilParticipants\getInstance(), ilUtil\sendInfo(), and ui().

Referenced by infoScreen(), and showJoinRequestButtonInCalendar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showJoinRequestButtonInCalendar()

ilObjSessionGUI::showJoinRequestButtonInCalendar ( ilToolbarGUI  $a_ilToolbar)
Parameters
$ilToolbarilToolbarGUI show join request This method is only needed to keep showJoinRequestButton method protected.

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

536 {
537 $this->showJoinRequestButton($a_ilToolbar);
538 }

References showJoinRequestButton().

+ Here is the call graph for this function:

◆ unregisterObject()

ilObjSessionGUI::unregisterObject (   $a_refuse_participation = false)

unregister from session

@access public

Parameters
bool$a_refuse_participation
Returns
void

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

383 {
384 global $DIC;
385
386 $ilUser = $DIC->user();
387 $ilAppEventHandler = $DIC['ilAppEventHandler'];
388
389 include_once './Modules/Session/classes/class.ilSessionParticipants.php';
390 $part = ilSessionParticipants::getInstance($this->object->getRefId());
391 if ($part->isSubscriber($ilUser->getId())) {
392 $part->deleteSubscriber($ilUser->getId());
393 }
394
395 $part->unregister($ilUser->getId());
396
397 if ($a_refuse_participation) {
398 $event_part = new \ilEventParticipants($this->object->getId());
399 $event_part->updateExcusedForUser($ilUser->getId(), true);
400 }
401
402
403 include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
404 ilSessionWaitingList::deleteUserEntry($ilUser->getId(), $this->getCurrentObject()->getId());
405
406 // check for visible permission of user
408 $GLOBALS['DIC']->access()->clear();
409 $has_access = $GLOBALS['DIC']->access()->checkAccessOfUser(
410 $GLOBALS['DIC']->user()->getId(),
411 'visible',
412 '',
413 $this->object->getRefId()
414 );
415 if (!$has_access) {
416 $parent = $GLOBALS['DIC']->repositoryTree()->getParentId($this->object->getRefId());
417 $this->redirectToRefId($parent);
418 return;
419 }
420
421 $ilAppEventHandler->raise(
422 "Modules/Session",
423 'unregister',
424 array(
425 'obj_id' => $this->getCurrentObject()->getId(),
426 'ref_id' => $this->getCurrentObject()->getRefId(),
427 'usr_id' => $ilUser->getId()
428 )
429 );
430 if ($a_refuse_participation) {
431 \ilUtil::sendInfo($this->lng->txt('sess_participation_refused_info'), true);
432 } else {
433 ilUtil::sendSuccess($this->lng->txt('event_unregistered'), true);
434 }
435 $this->ctrl->returnToParent($this);
436 }
user()
Definition: user.php:4
redirectToRefId($a_ref_id, $a_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($a_ref_id)
Get instance.
static deleteUserEntry($a_usr_id, $a_obj_id)
Delete one user entry.

References $DIC, $GLOBALS, $ilUser, ilWaitingList\deleteUserEntry(), getCurrentObject(), ilSessionParticipants\getInstance(), ilObjectGUI\redirectToRefId(), ilRbacSystem\resetCaches(), ilUtil\sendInfo(), and user().

Referenced by refuseParticipationObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateObject()

ilObjSessionGUI::updateObject ( )

update object

Reimplemented from ilObjectGUI.

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

1076 : bool
1077 {
1078 global $DIC;
1079
1080 $ilErr = $DIC['ilErr'];
1081
1082 $old_autofill = $this->object->hasWaitingListAutoFill();
1083
1084 $form = $this->initForm('edit');
1085 $ilErr->setMessage('');
1086 if (!$this->form->checkInput()) {
1087 $ilErr->setMessage($this->lng->txt('err_check_input'));
1088 $form->setValuesByPost();
1089 $this->editObject();
1090 return false;
1091 }
1092
1093 //Mantis 21972: Choose didactic template on settings screen
1094 $old_type = ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
1095
1096 $modified = false;
1097 $new_type_info = $form->getInput('didactic_type');
1098 if ($new_type_info) {
1099 $new_type = explode('_', $form->getInput('didactic_type'));
1100 $new_type = $new_type[1];
1101
1102 $modified = ($new_type != $old_type);
1103 $this->logger->info('Switched group type from ' . $old_type . ' to ' . $new_type);
1104 }
1105
1106 if (
1107 $this->record_gui instanceof \ilAdvancedMDRecordGUI &&
1108 !$this->record_gui->importEditFormPostValues()
1109 ) {
1110 $ilErr->setMessage($this->lng->txt('err_check_input'));
1111 }
1112
1113 $this->load();
1114
1115 $this->object->validate();
1116 $this->object->getFirstAppointment()->validate();
1117
1118 if (strlen($ilErr->getMessage())) {
1119 ilUtil::sendFailure($ilErr->getMessage());
1120 $this->editObject();
1121 return false;
1122 }
1123 // Update event
1124 $this->object->update();
1125 $this->object->getFirstAppointment()->update();
1126
1128 $this->object->getId(),
1129 $this->form,
1130 array(
1132 )
1133 );
1134 if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
1135 $this->record_gui->writeEditForm();
1136 }
1137 $this->handleFileUpload();
1138
1139 $DIC->object()->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
1140
1141 // if autofill has been activated trigger process
1142 if (!$old_autofill &&
1143 $this->object->hasWaitingListAutoFill()) {
1144 $this->object->handleAutoFill();
1145 }
1146
1147 //Mantis 21972: Choose didactic template on settings screen
1148 if ($modified) {
1149 if ($new_type == 0) {
1150 $new_type_txt = $this->lng->txt('il_sess_status_open');
1151 } else {
1152 $dtpl = new ilDidacticTemplateSetting($new_type);
1153 $new_type_txt = $dtpl->getPresentationTitle($this->lng->getLangKey());
1154 }
1155 $this->tabs_gui->activateTab('settings');
1156
1157 ilUtil::sendQuestion($this->lng->txt('sess_warn_sess_type_changed'));
1158 $confirm = new ilConfirmationGUI();
1159 $confirm->setFormAction($this->ctrl->getFormAction($this));
1160 $confirm->addItem(
1161 'sess_type',
1162 $new_type,
1163 $this->lng->txt('sess_info_new_sess_type') . ': ' . $new_type_txt
1164 );
1165 $confirm->addButton($this->lng->txt('sess_change_type'), 'updateSessionType');
1166 $confirm->setCancel($this->lng->txt('cancel'), 'edit');
1167
1168 $this->tpl->setContent($confirm->getHTML());
1169 return true;
1170 } else {
1171 ilUtil::sendSuccess($this->lng->txt('event_updated'), true);
1172 $this->ctrl->redirect($this, 'edit');
1173 #$this->object->initFiles();
1174 #$this->editObject();
1175 return true;
1176 }
1177 }
static lookupTemplateId($a_ref_id)
Lookup template id @global ilDB $ilDB.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.

References $DIC, ilObjectGUI\$ilErr, ilObjectServiceSettingsGUI\CUSTOM_METADATA, editObject(), handleFileUpload(), ilAdvancedMDRecordGUI\importEditFormPostValues(), initForm(), load(), ilDidacticTemplateObjSettings\lookupTemplateId(), ilUtil\sendFailure(), ilUtil\sendQuestion(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

+ Here is the call graph for this function:

◆ updateSessionTypeObject()

ilObjSessionGUI::updateSessionTypeObject ( )

change session type

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

1182 : void
1183 {
1185 $this->object->getRefId(),
1186 $this->http->request()->getParsedBody()['sess_type']
1187 );
1188
1189 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1190 $this->ctrl->redirect($this, 'edit');
1191 }
static switchTemplate($a_ref_id, $a_new_tpl_id)

References ilDidacticTemplateUtils\switchTemplate().

+ Here is the call graph for this function:

Field Documentation

◆ $container_obj_id

ilObjSessionGUI::$container_obj_id = 0
protected

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

◆ $container_ref_id

ilObjSessionGUI::$container_ref_id = 0
protected

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

Referenced by getContainerRefId().

◆ $ctrl

ilObjSessionGUI::$ctrl

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

Referenced by redirectToParentContentPageObject().

◆ $files

ilObjSessionGUI::$files = array()
protected

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

Referenced by initForm().

◆ $http

ilObjSessionGUI::$http
protected

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

◆ $lng

ilObjSessionGUI::$lng

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

Referenced by __construct(), _goto(), and infoScreen().

◆ $logger

ilObjSessionGUI::$logger = null
protected

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

◆ $tpl

ilObjSessionGUI::$tpl

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

Referenced by __construct(), and attendanceListObject().


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