ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 unregister from session More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 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 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...
 
 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 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 ()
 list childs of current object 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...
 

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 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...
 
 showJoinRequestButton (ilToolbarGUI $ilToolbar=null)
 
 initCreateForm ($a_new_type)
 
 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 ($a_mode)
 Init Form. More...
 
 load ()
 load settings More...
 
 loadRecurrenceSettings ()
 load recurrence settings More...
 
 __toUnix ($date, $time)
 protected More...
 
 redirectToParentContentPageObject ()
 Redirect to parent content page. More...
 
 cancelEditObject ()
 Cancel editigin type $ilCtrl 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...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs 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
 
 $container_ref_id = 0
 
 $container_obj_id = 0
 
 $files = array()
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

public

Parameters

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

References $DIC, $GLOBALS, $ilCtrl, $lng, and $tpl.

45  {
46  global $DIC;
47 
48  $ilCtrl = $DIC['ilCtrl'];
49  $lng = $DIC['lng'];
50  $tpl = $DIC['tpl'];
51 
52  $this->type = "sess";
53  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
54 
55  $this->lng = $lng;
56  $this->lng->loadLanguageModule("event");
57  $this->lng->loadLanguageModule('crs');
58  $this->lng->loadLanguageModule('trac');
59  $this->lng->loadLanguageModule('sess');
60 
61 
62  $this->tpl = $tpl;
63  $this->ctrl = $ilCtrl;
64 
65  $this->logger = $GLOBALS['DIC']->logger()->sess();
66  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

Member Function Documentation

◆ __toUnix()

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

protected

Parameters

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

References $time.

1885  {
1886  return mktime($time['h'], $time['m'], 0, $date['m'], $date['d'], $date['y']);
1887  }
$time
Definition: cron.php:21

◆ _goto()

static ilObjSessionGUI::_goto (   $a_target)
static

goto

public

Parameters

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

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

370  {
371  global $DIC;
372 
373  $ilAccess = $DIC->access();
374  $ilErr = $DIC["ilErr"];
375  $lng = $DIC->language();
376 
377  if ($ilAccess->checkAccess('visible', "", $a_target)) {
378  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
379  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
381  sprintf(
382  $lng->txt("msg_no_perm_read_item"),
384  ),
385  true
386  );
388  }
389  }
global $DIC
Definition: saml.php:7
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSessionGUI::addLocatorItems ( )

Add session locator.

public

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

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

1896  {
1897  global $DIC;
1898 
1899  $ilLocator = $DIC['ilLocator'];
1900 
1901  if (!$this->getCreationMode()) {
1902  // see prepareOutput()
1903  include_once './Modules/Session/classes/class.ilSessionAppointment.php';
1904  $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
1905  $title = $this->object->getFirstAppointment()->appointmentToString() . $title;
1906 
1907  $ilLocator->addItem($title, $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
1908  }
1909  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
getCreationMode()
get creation mode
+ Here is the call graph for this function:

◆ addToDeskObject()

ilObjSessionGUI::addToDeskObject ( )
See also
ilDesktopItemHandling::addToDesk()

Implements ilDesktopItemHandling.

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

References ilDesktopItemGUI\addToDesktop(), and infoScreenObject().

395  {
396  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
398  $this->infoScreenObject();
399  }
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
static addToDesktop()
Add desktop item public.
+ 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 2043 of file class.ilObjSessionGUI.php.

References ilEventItems\addItem(), and ilObject\getRefId().

2044  {
2045  // add new object to materials
2046  include_once './Modules/Session/classes/class.ilEventItems.php';
2047  $event_items = new ilEventItems($this->object->getId());
2048  $event_items->addItem($a_obj->getRefId());
2049  $event_items->update();
2050 
2051  /*
2052  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
2053  $this->ctrl->redirect($this, "materials");
2054  */
2055  }
getRefId()
get reference id public
addItem($a_item_ref_id)
Add one item.
class ilEvent
+ Here is the call graph for this function:

◆ applyFilter()

ilObjSessionGUI::applyFilter ( )

Apply filter.

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

References $tbl.

1193  {
1194  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1195  $tbl->writeFilterToSession(); // writes filter to session
1196  $tbl->resetOffset(); // sets record offest to 0 (first page)
1197  $this->ctrl->redirect($this, "materials");
1198  }
$tbl
Definition: example_048.php:81

◆ attendanceListObject()

ilObjSessionGUI::attendanceListObject ( )

show attendance list selection

public

Returns

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

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

1270  {
1271  global $DIC;
1272 
1273  $tpl = $DIC['tpl'];
1274  $ilTabs = $DIC['ilTabs'];
1275 
1276  $this->checkPermission('manage_members');
1277  $ilTabs->setTabActive('event_edit_members');
1278 
1279  $list = $this->initAttendanceList();
1280  $form = $list->initForm('printAttendanceList');
1281  $tpl->setContent($form->getHTML());
1282  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
global $DIC
Definition: saml.php:7
if(isset($_POST['submit'])) $form
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
initAttendanceList()
Init attendance list object.
+ Here is the call graph for this function:

◆ cancelEditObject()

ilObjSessionGUI::cancelEditObject ( )
protected

Cancel editigin type $ilCtrl type $tree.

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

References $DIC, $ilCtrl, and ilObjectGUI\$tree.

2091  {
2092  global $DIC;
2093 
2094  $ilCtrl = $DIC['ilCtrl'];
2095  $tree = $DIC['tree'];
2096 
2097  $parent_id = $tree->getParentId((int) $_REQUEST['ref_id']);
2098 
2099  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent_id);
2100 
2101  $ilCtrl->redirectByClass("ilrepositorygui", "");
2102  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18

◆ confirmDeleteFilesObject()

ilObjSessionGUI::confirmDeleteFilesObject ( )

confirm delete files

public

Parameters

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

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

1047  {
1048  $this->tabs_gui->setTabActive('settings');
1049 
1050  if (!count($_POST['file_id'])) {
1051  ilUtil::sendFailure($this->lng->txt('select_one'));
1052  $this->editObject();
1053  return false;
1054  }
1055 
1056  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1057  $c_gui = new ilConfirmationGUI();
1058 
1059  // set confirm/cancel commands
1060  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteFiles"));
1061  $c_gui->setHeaderText($this->lng->txt("info_delete_sure"));
1062  $c_gui->setCancel($this->lng->txt("cancel"), "edit");
1063  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteFiles");
1064 
1065  // add items to delete
1066  foreach ($_POST["file_id"] as $file_id) {
1067  $file = new ilSessionFile($file_id);
1068  if ($file->getSessionId() != $this->object->getEventId()) {
1069  ilUtil::sendFailure($this->lng->txt('select_one'));
1070  $this->edit();
1071  return false;
1072  }
1073  $c_gui->addItem("file_id[]", $file_id, $file->getFileName());
1074  }
1075 
1076  $this->tpl->setContent($c_gui->getHTML());
1077  return true;
1078  }
class ilEvent
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ createMailSignature()

ilObjSessionGUI::createMailSignature ( )

Create a course mail signature.

Returns
string

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

References ilLink\_getLink().

2138  {
2139  $link = chr(13) . chr(10) . chr(13) . chr(10);
2140  $link .= $this->lng->txt('sess_mail_permanent_link');
2141  $link .= chr(13) . chr(10) . chr(13) . chr(10);
2142  include_once './Services/Link/classes/class.ilLink.php';
2143  $link .= ilLink::_getLink($this->object->getRefId());
2144  return rawurlencode(base64_encode($link));
2145  }
+ Here is the call graph for this function:

◆ createRecurringSessions()

ilObjSessionGUI::createRecurringSessions (   $a_activate_lp = true)
protected

create recurring sessions

protected

Parameters
bool$a_activate_lp
Returns

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

References $DIC, ilObjectGUI\$tree, ilCalendarRecurrenceCalculator\calculateDateList(), ilObjectGUI\getDidacticTemplateVar(), ilEventItems\getItems(), IL_CAL_UNIX, IL_CAL_YEAR, ilLPObjSettings\LP_MODE_DEACTIVATED, ilEventItems\setItems(), and ilLPObjSettings\setMode().

Referenced by saveObject().

871  {
872  global $DIC;
873 
874  $tree = $DIC['tree'];
875 
876  if (!$this->rec->getFrequenceType()) {
877  return true;
878  }
879  include_once('./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php');
880  $calc = new ilCalendarRecurrenceCalculator($this->object->getFirstAppointment(), $this->rec);
881 
882  $period_start = clone $this->object->getFirstAppointment()->getStart();
883 
884 
885  $period_end = clone $this->object->getFirstAppointment()->getStart();
886  $period_end->increment(IL_CAL_YEAR, 5);
887  $date_list = $calc->calculateDateList($period_start, $period_end);
888 
889  $period_diff = $this->object->getFirstAppointment()->getEnd()->get(IL_CAL_UNIX) -
890  $this->object->getFirstAppointment()->getStart()->get(IL_CAL_UNIX);
891  $parent_id = $tree->getParentId($this->object->getRefId());
892 
893  include_once './Modules/Session/classes/class.ilEventItems.php';
894  $evi = new ilEventItems($this->object->getId());
895  $eitems = $evi->getItems();
896 
897  $counter = 0;
898  foreach ($date_list->get() as $date) {
899  if (!$counter++) {
900  continue;
901  }
902 
903  $new_obj = $this->object->cloneObject($parent_id);
904 
905  // apply didactic template?
906  $dtpl = $this->getDidacticTemplateVar("dtpl");
907  if ($dtpl) {
908  $new_obj->applyDidacticTemplate($dtpl);
909  }
910 
911  $new_obj->read();
912  $new_obj->getFirstAppointment()->setStartingTime($date->get(IL_CAL_UNIX));
913  $new_obj->getFirstAppointment()->setEndingTime($date->get(IL_CAL_UNIX) + $period_diff);
914  $new_obj->getFirstAppointment()->update();
915  $new_obj->update(true);
916 
917  // #14547 - active is default
918  if (!$a_activate_lp) {
919  include_once "Services/Tracking/classes/class.ilLPObjSettings.php";
920  $lp_obj_settings = new ilLPObjSettings($new_obj->getId());
922  $lp_obj_settings->update(false);
923  }
924 
925  $new_evi = new ilEventItems($new_obj->getId());
926  $new_evi->setItems($eitems);
927  $new_evi->update();
928  }
929  }
getItems()
get assigned items
global $DIC
Definition: saml.php:7
const IL_CAL_UNIX
calculateDateList(ilDateTime $a_start, ilDateTime $a_end, $a_limit=-1)
calculate date list
Calculates an ilDateList for a given calendar entry and recurrence rule.
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
class ilEvent
const IL_CAL_YEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteFilesObject()

ilObjSessionGUI::deleteFilesObject ( )

delete files

public

Parameters

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

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

1088  {
1089  if (!count($_POST['file_id'])) {
1090  ilUtil::sendFailure($this->lng->txt('select_one'));
1091  $this->editObject();
1092  return false;
1093  }
1094  foreach ($_POST['file_id'] as $id) {
1095  $file = new ilSessionFile($id);
1096  $file->delete();
1097  }
1098  $this->object->initFiles();
1099  $this->editObject();
1100  return true;
1101  }
if(!array_key_exists('StateId', $_REQUEST)) $id
class ilEvent
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ editObject()

ilObjSessionGUI::editObject ( )

edit object

protected

Parameters

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

References $rows, and initForm().

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

940  {
941  $this->tabs_gui->setTabActive('settings');
942 
943  $this->initForm('edit');
944  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit.html', 'Modules/Session');
945  $this->tpl->setVariable('EVENT_EDIT_TABLE', $this->form->getHTML());
946 
947  if (!count($this->object->getFiles())) {
948  return true;
949  }
950  $rows = array();
951  foreach ($this->object->getFiles() as $file) {
952  $table_data['id'] = $file->getFileId();
953  $table_data['filename'] = $file->getFileName();
954  $table_data['filetype'] = $file->getFileType();
955  $table_data['filesize'] = $file->getFileSize();
956 
957  $rows[] = $table_data;
958  }
959 
960  include_once("./Modules/Session/classes/class.ilSessionFileTableGUI.php");
961  $table_gui = new ilSessionFileTableGUI($this, "edit");
962  $table_gui->setTitle($this->lng->txt("event_files"));
963  $table_gui->setData($rows);
964  $table_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
965  $table_gui->addMultiCommand("confirmDeleteFiles", $this->lng->txt("delete"));
966  $table_gui->setSelectAllCheckbox("file_id");
967  $this->tpl->setVariable('EVENT_FILE_TABLE', $table_gui->getHTML());
968 
969  return true;
970  }
initForm($a_mode)
Init Form.
$rows
Definition: xhr_table.php:10
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eventsListObject()

ilObjSessionGUI::eventsListObject ( )

list sessions of all user

public

Parameters

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

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

1376  {
1377  global $DIC;
1378 
1379  $ilErr = $DIC['ilErr'];
1380  $ilAccess = $DIC['ilAccess'];
1381  $ilUser = $DIC['ilUser'];
1382  $tree = $DIC['tree'];
1383 
1384  if (!$ilAccess->checkAccess('manage_members', '', $this->object->getRefId())) {
1385  $ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $ilErr->MESSAGE);
1386  }
1387 
1388  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_list.html', 'Modules/Session');
1389  $this->__showButton($this->ctrl->getLinkTarget($this, 'exportCSV'), $this->lng->txt('event_csv_export'));
1390 
1391  include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1392 
1393  $this->tpl->addBlockfile("EVENTS_TABLE", "events_table", "tpl.table.html");
1394  $this->tpl->addBlockfile('TBL_CONTENT', 'tbl_content', 'tpl.sess_list_row.html', 'Modules/Session');
1395 
1396  $members_obj = $this->initContainer(true);
1397  $members = $members_obj->getParticipants();
1398  $members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
1399 
1400  // Table
1401  $tbl = new ilTableGUI();
1402  $tbl->setTitle(
1403  $this->lng->txt("event_overview"),
1404  'icon_usr.svg',
1405  $this->lng->txt('obj_usr')
1406  );
1407  $this->ctrl->setParameter($this, 'offset', (int) $_GET['offset']);
1408 
1409  $course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1410  $events = array();
1411  foreach ($tree->getSubtree($tree->getNodeData($course_ref_id), false, 'sess') as $event_id) {
1412  $tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
1413  if (!is_object($tmp_event) or $tmp_event->getType() != 'sess') {
1414  continue;
1415  }
1416  $events[] = $tmp_event;
1417  }
1418 
1419  $headerNames = array();
1420  $headerVars = array();
1421  $colWidth = array();
1422 
1423  $headerNames[] = $this->lng->txt('name');
1424  $headerVars[] = "name";
1425  $colWidth[] = '20%';
1426 
1427  for ($i = 1; $i <= count($events); $i++) {
1428  $headerNames[] = $i;
1429  $headerVars[] = "event_" . $i;
1430  $colWidth[] = 80 / count($events) . "%";
1431  }
1432 
1433  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1434  $tbl->setHeaderNames($headerNames);
1435  $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this, 'eventsList'));
1436  $tbl->setColumnWidth($colWidth);
1437 
1438  $tbl->setOrderColumn($_GET["sort_by"]);
1439  $tbl->setOrderDirection($_GET["sort_order"]);
1440  $tbl->setOffset($_GET["offset"]);
1441  $tbl->setLimit($ilUser->getPref("hits_per_page"));
1442  $tbl->setMaxCount(count($members));
1443  $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
1444 
1445  $sliced_users = array_slice($members, $_GET['offset'], $_SESSION['tbl_limit']);
1446  $tbl->disable('sort');
1447  $tbl->render();
1448 
1449  $counter = 0;
1450  foreach ($sliced_users as $user_id) {
1451  foreach ($events as $event_obj) {
1452  $this->tpl->setCurrentBlock("eventcols");
1453 
1454  $event_part = new ilEventParticipants($this->object->getId());
1455 
1456  {
1457  $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1458  ilUtil::getImagePath('icon_ok.svg') :
1459  ilUtil::getImagePath('icon_not_ok.svg'));
1460 
1461  $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
1462  $this->lng->txt('event_participated') :
1463  $this->lng->txt('event_not_participated'));
1464  }
1465 
1466  $this->tpl->parseCurrentBlock();
1467  }
1468 
1469  $this->tpl->setCurrentBlock("tbl_content");
1470  $name = ilObjUser::_lookupName($user_id);
1471  $this->tpl->setVariable("CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
1472  $this->tpl->setVariable("LASTNAME", $name['lastname']);
1473  $this->tpl->setVariable("FIRSTNAME", $name['firstname']);
1474  $this->tpl->setVariable("LOGIN", ilObjUser::_lookupLogin($user_id));
1475  $this->tpl->parseCurrentBlock();
1476  }
1477 
1478  $this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));
1479  $this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
1480  $this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
1481  $this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
1482  $this->tpl->setVariable("HEAD_TXT_DATE_TIME", $this->lng->txt("event_date_time"));
1483  $i = 1;
1484  foreach ($events as $event_obj) {
1485  $this->tpl->setCurrentBlock("legend_loop");
1486  $this->tpl->setVariable("LEGEND_CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
1487  $this->tpl->setVariable("LEGEND_DIGIT", $i++);
1488  $this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
1489  $this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1490  $this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1491  $this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1492  $this->tpl->parseCurrentBlock();
1493  }
1494  }
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
$tbl
Definition: example_048.php:81
__showButton($a_cmd, $a_text, $a_target='')
if($argc< 2) $events
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,7),&#39;usr_data&#39;,&#39;lastname&#39;,&#39;usr_id&#39;) => sorts by lastname.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
initContainer($a_init_participants=false)
$ilUser
Definition: imgupload.php:18
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
$i
Definition: disco.tpl.php:19
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSessionGUI::executeCommand ( )

execute command

public

Returns

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

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

76  {
77  global $DIC;
78 
79  $ilUser = $DIC['ilUser'];
80  $ilCtrl = $DIC['ilCtrl'];
81 
82  $next_class = $this->ctrl->getNextClass($this);
83  $cmd = $this->ctrl->getCmd();
84 
85  if (
86  !$this->getCreationMode() &&
87  $GLOBALS['DIC']->access()->checkAccess('read', '', $_GET['ref_id'])
88  ) {
89  $GLOBALS['DIC']['ilNavigationHistory']->addItem(
90  (int) $_GET['ref_id'],
91  ilLink::_getLink((int) $_GET['ref_id'], 'sess'),
92  'sess'
93  );
94  }
95 
96  $this->prepareOutput();
97  switch ($next_class) {
98  case 'ilsessionmembershipgui':
99  $this->tabs_gui->activateTab('members');
100  include_once './Modules/Session/classes/class.ilSessionMembershipGUI.php';
101  $mem_gui = new ilSessionMembershipGUI($this, $this->object);
102  $this->ctrl->forwardCommand($mem_gui);
103  break;
104 
105  case "ilinfoscreengui":
106  $this->checkPermission("visible");
107  $this->infoScreen(); // forwards command
108  break;
109 
110  case 'ilobjectmetadatagui':
111  $this->checkPermission('edit_metadata');
112  $this->tabs_gui->activateTab('metadata');
113  $md_gui = new ilObjectMetaDataGUI($this->object);
114  $this->ctrl->forwardCommand($md_gui);
115  break;
116 
117 
118  case 'ilpermissiongui':
119  $this->tabs_gui->setTabActive('perm_settings');
120  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
121  $perm_gui = new ilPermissionGUI($this);
122  $ret = $this->ctrl->forwardCommand($perm_gui);
123  break;
124 
125  case 'ilobjectcopygui':
126  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
127  $cp = new ilObjectCopyGUI($this);
128  $cp->setType('sess');
129  $this->ctrl->forwardCommand($cp);
130  break;
131 
132  case "ilexportgui":
133 // $this->prepareOutput();
134  $this->tabs_gui->setTabActive("export");
135  include_once("./Services/Export/classes/class.ilExportGUI.php");
136  $exp_gui = new ilExportGUI($this);
137  $exp_gui->addFormat("xml");
138  $ret = $this->ctrl->forwardCommand($exp_gui);
139 // $this->tpl->show();
140  break;
141 
142  case "ilcommonactiondispatchergui":
143  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
145  $this->ctrl->forwardCommand($gui);
146  break;
147 
148  case 'ilmembershipgui':
149  $this->ctrl->setReturn($this, 'members');
150  include_once './Services/Membership/classes/class.ilMembershipMailGUI.php';
151  $mem = new ilMembershipMailGUI($this);
152  $this->ctrl->forwardCommand($mem);
153  break;
154 
155  case "illearningprogressgui":
156  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
157  $new_gui = new ilLearningProgressGUI(
159  $this->object->getRefId(),
160  $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()
161  );
162  $this->ctrl->forwardCommand($new_gui);
163  $this->tabs_gui->setTabActive('learning_progress');
164  break;
165 
166  case "ilpropertyformgui":
167  // only case is currently adv metadata internal link in info settings, see #24497
168  if (!is_object($this->object)) {
169  $form = $this->initCreateForm("sess");
170  } else {
171  $form = $this->initForm("edit");
172  if ($form === true) {
173  $form = $this->form;
174  }
175  }
176  $ilCtrl->forwardCommand($form);
177  break;
178 
179  default:
180  if ($cmd == "applyFilter") {
181  $cmd == "applyFilter";
182  $this->$cmd();
183  } elseif ($cmd == "resetFilter") {
184  $cmd == "resetFilter";
185  $this->$cmd();
186  }
187  if (!$cmd) {
188  $cmd = "infoScreen";
189  }
190  $cmd .= "Object";
191  $this->$cmd();
192 
193  break;
194  }
195 
196  $this->addHeaderAction();
197 
198  return true;
199  }
Class ilObjectMetaDataGUI.
initForm($a_mode)
Init Form.
GUI class for the workflow of copying objects.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
prepareOutput($a_show_subobjects=true)
global $ilCtrl
Definition: ilias.php:18
Export User Interface Class.
if(isset($_POST['submit'])) $form
GUI class for membership features.
$ilUser
Definition: imgupload.php:18
$ret
Definition: parser.php:6
getCreationMode()
get creation mode
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ 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 1350 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$data.

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

◆ getContainerRefId()

ilObjSessionGUI::getContainerRefId ( )

container ref id

Returns
int ref id

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

References $container_ref_id, and initContainer().

Referenced by materialsObject().

2077  {
2078  if (!$this->container_ref_id) {
2079  $this->initContainer();
2080  }
2081  return $this->container_ref_id;
2082  }
initContainer($a_init_participants=false)
+ 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 214 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$object.

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

215  {
216  return $this->object;
217  }
+ Here is the caller graph for this function:

◆ getDefaultMemberRole()

ilObjSessionGUI::getDefaultMemberRole ( )

Get default member role.

Returns
int

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

References $GLOBALS, $title, and ilObject\_lookupTitle().

2110  {
2111  $local_roles = $GLOBALS['DIC']->rbac()->review()->getRolesOfRoleFolder($this->object->getRefId(), false);
2112 
2113  foreach ($local_roles as $role_id) {
2114  $title = ilObject::_lookupTitle($role_id);
2115  if (substr($title, 0, 19) == 'il_sess_participant') {
2116  return $role_id;
2117  }
2118  }
2119  return 0;
2120  }
static _lookupTitle($a_id)
lookup object title
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ getLocalRoles()

ilObjSessionGUI::getLocalRoles ( )

get all local roles

Returns
int[]

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

References $GLOBALS.

2128  {
2129  return $GLOBALS['DIC']->rbac()->review()->getRolesOfRoleFolder($this->object->getRefId(), false);
2130  }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

◆ getTabs()

ilObjSessionGUI::getTabs ( )

Build tabs.

public

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

References $DIC, $ilCtrl, $ilUser, ilObjectGUI\$tree, ilObject\_lookupType(), and ilLearningProgressAccess\checkAccess().

1944  {
1945  global $DIC;
1946 
1947  $ilAccess = $DIC['ilAccess'];
1948  $ilTabs = $DIC['ilTabs'];
1949  $tree = $DIC['tree'];
1950  $ilCtrl = $DIC['ilCtrl'];
1951  $ilHelp = $DIC['ilHelp'];
1952  $ilUser = $DIC->user();
1953 
1954  $ilHelp->setScreenIdComponent("sess");
1955 
1956  $parent_id = $tree->getParentId($this->object->getRefId());
1957 
1958  // #11650
1959  $parent_type = ilObject::_lookupType($parent_id, true);
1960 
1961  $this->tabs_gui->setBackTarget(
1962  $this->lng->txt('back_to_' . $parent_type . '_content'),
1963  $ilCtrl->getLinkTarget($this, "redirectToParentContentPage")
1964  );
1965 
1966  $this->tabs_gui->addTarget(
1967  'info_short',
1968  $this->ctrl->getLinkTarget($this, 'infoScreen')
1969  );
1970 
1971  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1972  $this->tabs_gui->addTarget(
1973  'settings',
1974  $this->ctrl->getLinkTarget($this, 'edit')
1975  );
1976  }
1977  if ($ilAccess->checkAccess('manage_materials', '', $this->object->getRefId())) {
1978  $this->tabs_gui->addTab(
1979  'materials',
1980  $this->lng->txt('crs_materials'),
1981  $this->ctrl->getLinkTarget($this, 'materials')
1982  );
1983  }
1984 
1985 
1986  // member tab
1987  $is_participant = $this->object->getMembersObject()->isAssigned($ilUser->getId());
1988  $membership_gui = new ilSessionMembershipGUI($this, $this->object);
1989  $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
1990 
1991 
1992  // learning progress
1993  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
1994  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1995  $this->tabs_gui->addTarget(
1996  'learning_progress',
1997  $this->ctrl->getLinkTargetByClass(array('ilobjsessiongui','illearningprogressgui'), ''),
1998  '',
1999  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
2000  );
2001  }
2002 
2003  // meta data
2004  if ($ilAccess->checkAccess('edit_metadata', '', $this->ref_id)) {
2005  $mdgui = new ilObjectMetaDataGUI($this->object);
2006  $mdtab = $mdgui->getTab();
2007  if ($mdtab) {
2008  $this->tabs_gui->addTab(
2009  "metadata",
2010  $this->lng->txt('meta_data'),
2011  $mdtab
2012  );
2013  }
2014  }
2015 
2016  // export
2017  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
2018  $this->tabs_gui->addTarget(
2019  "export",
2020  $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
2021  "",
2022  "ilexportgui"
2023  );
2024  }
2025 
2026 
2027  // edit permissions
2028  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
2029  $this->tabs_gui->addTarget(
2030  "perm_settings",
2031  $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"),
2032  array("perm","info","owner"),
2033  'ilpermissiongui'
2034  );
2035  }
2036  }
Class ilObjectMetaDataGUI.
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
GUI class for membership features.
$ilUser
Definition: imgupload.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ handleFileUpload()

ilObjSessionGUI::handleFileUpload ( )

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

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

Referenced by saveObject(), and updateObject().

812  {
813  global $DIC;
814 
815  $tree = $DIC['tree'];
816 
817  include_once './Modules/Session/classes/class.ilEventItems.php';
818  $ev = new ilEventItems($this->object->getId());
819  $items = $ev->getItems();
820 
821  $counter = 0;
822  while (true) {
823  if (!isset($_FILES['files']['name'][$counter])) {
824  break;
825  }
826  if (!strlen($_FILES['files']['name'][$counter])) {
827  $counter++;
828  continue;
829  }
830 
831  include_once './Modules/File/classes/class.ilObjFile.php';
832  $file = new ilObjFile();
833  $file->setTitle(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
834  $file->setDescription('');
835  $file->setFileName(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
836  $file->setFileType($_FILES['files']['type'][$counter]);
837  $file->setFileSize($_FILES['files']['size'][$counter]);
838  $file->create();
839  $new_ref_id = $file->createReference();
840  $file->putInTree($tree->getParentId($this->object->getRefId()));
841  $file->setPermissions($tree->getParentId($this->object->getRefId()));
842  $file->createDirectory();
843 
844  $upload = $DIC->upload();
845  if (!$upload->hasBeenProcessed()) {
846  $upload->process();
847  }
848  $file->getUploadFile(
849  $_FILES['files']['tmp_name'][$counter],
850  $_FILES['files']['name'][$counter]
851  );
852 
853  $items[] = $new_ref_id;
854  $counter++;
855  }
856 
857  $ev->setItems($items);
858  $ev->update();
859  }
getItems()
get assigned items
global $DIC
Definition: saml.php:7
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
class ilEvent
+ 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.

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

References $_GET, $form, ilObjectGUI\$ilErr, ilObjectGUI\$objDefinition, $tpl, ilObjectGUI\afterImport(), ilObjectGUI\checkPermissionBool(), ilObjectFactory\getInstanceByObjId(), ilObjectGUI\initImportForm(), and ilUtil\sendFailure().

2151  {
2153  $tpl = $this->tpl;
2154  $ilErr = $this->ilErr;
2155 
2156  if (!$parent_id) {
2157  $parent_id = $_GET["ref_id"];
2158  }
2159  $new_type = $_REQUEST["new_type"];
2160 
2161  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
2162  if (!$this->checkPermissionBool("create", "", $new_type)) {
2163  $ilErr->raiseError($this->lng->txt("no_create_permission"));
2164  }
2165 
2166  $this->lng->loadLanguageModule($new_type);
2167  $this->ctrl->setParameter($this, "new_type", $new_type);
2168 
2169  $form = $this->initImportForm($new_type);
2170  if ($form->checkInput()) {
2171  // :todo: make some check on manifest file
2172  include_once("./Services/Export/classes/class.ilImport.php");
2173  $imp = new ilImport((int) $parent_id);
2174  try {
2175  $new_id = $imp->importObject(
2176  null,
2177  $_FILES["importfile"]["tmp_name"],
2178  $_FILES["importfile"]["name"],
2179  $new_type
2180  );
2181  } catch (ilException $e) {
2182  $this->tmp_import_dir = $imp->getTemporaryImportDir();
2183  if (!$a_catch_errors) {
2184  throw $e;
2185  }
2186  // display message and form again
2187  ilUtil::sendFailure($this->lng->txt("obj_import_file_error") . " <br />" . $e->getMessage());
2188  $form->setValuesByPost();
2189  $tpl->setContent($form->getHtml());
2190  return;
2191  }
2192 
2193  if ($new_id > 0) {
2194  $this->ctrl->setParameter($this, "new_type", "");
2195  $newObj = ilObjectFactory::getInstanceByObjId($new_id);
2196  $this->afterImport($newObj);
2197  }
2198  // import failed
2199  else {
2200  if ($objDefinition->isContainer($new_type)) {
2201  ilUtil::sendFailure($this->lng->txt("container_import_zip_file_invalid"));
2202  } else {
2203  // not enough information here...
2204  return;
2205  }
2206  }
2207  }
2208 
2209  // display form to correct errors
2210  $form->setValuesByPost();
2211  $tpl->setContent($form->getHtml());
2212  }
$_GET["client_id"]
Import class.
initImportForm($a_new_type)
Init object import form.
if(isset($_POST['submit'])) $form
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
afterImport(ilObject $a_new_object)
Post (successful) object import hook.
+ Here is the call graph for this function:

◆ infoScreen()

ilObjSessionGUI::infoScreen ( )

info screen

protected

Parameters

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

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

Referenced by executeCommand(), and infoScreenObject().

555  {
556  global $DIC;
557 
558  $ilAccess = $DIC['ilAccess'];
559  $ilUser = $DIC['ilUser'];
560  $ilCtrl = $DIC['ilCtrl'];
561  $tree = $DIC['tree'];
562  $ilToolbar = $DIC['ilToolbar'];
563  $lng = $DIC['lng'];
564 
565  $this->checkPermission('visible');
566  $this->tabs_gui->setTabActive('info_short');
567 
568  $this->showJoinRequestButton();
569 
570  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
571  $info = new ilInfoScreenGUI($this);
572 
573 
574  $eventItems = ilObjectActivation::getItemsByEvent($this->object->getId());
575  $parent_id = $tree->getParentId($this->object->getRefId());
576  $parent_id = ilObject::_lookupObjId($parent_id);
577  $eventItems = ilContainerSorting::_getInstance($parent_id)->sortSubItems(
578  'sess',
579  $this->object->getId(),
580  $eventItems
581  );
582 
583  $lng->loadLanguageModule("cntr");// #14158
584 
585  $html = '';
586  foreach ($eventItems as $item) {
587  $list_gui = ilSessionObjectListGUIFactory::factory($item['type']);
588  $list_gui->setContainerObject($this);
589 
590  $this->modifyItemGUI($list_gui, $item, false);
591 
592  $html .= $list_gui->getListItemHTML(
593  $item['ref_id'],
594  $item['obj_id'],
595  $item['title'],
596  $item['description']
597  );
598  }
599 
600  if (strlen($html)) {
601  $info->addSection($this->lng->txt('event_materials'));
602  $info->addProperty(
603  '&nbsp;',
604  $html
605  );
606  }
607 
608 
609 
610  // Session information
611  if (strlen($this->object->getLocation()) or strlen($this->object->getDetails())) {
612  $info->addSection($this->lng->txt('event_section_information'));
613  }
614  if (strlen($location = $this->object->getLocation())) {
615  $info->addProperty(
616  $this->lng->txt('event_location'),
617  ilUtil::makeClickable(nl2br($this->object->getLocation()), true)
618  );
619  }
620  if (strlen($this->object->getDetails())) {
621  $info->addProperty(
622  $this->lng->txt('event_details_workflow'),
623  ilUtil::makeClickable(nl2br($this->object->getDetails()), true)
624  );
625  }
626 
627  $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'sess', $this->object->getId());
628  $record_gui->setInfoObject($info);
629  $record_gui->parse();
630 
631  // meta data
632  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
633 
634 
635  // Tutor information
636  if ($this->object->hasTutorSettings()) {
637  $info->addSection($this->lng->txt('event_tutor_data'));
638  if (strlen($fullname = $this->object->getName())) {
639  $info->addProperty(
640  $this->lng->txt('event_lecturer'),
641  $fullname
642  );
643  }
644  if (strlen($email = $this->object->getEmail())) {
645  $info->addProperty(
646  $this->lng->txt('tutor_email'),
647  $email
648  );
649  }
650  if (strlen($phone = $this->object->getPhone())) {
651  $info->addProperty(
652  $this->lng->txt('tutor_phone'),
653  $phone
654  );
655  }
656  }
657 
658  // support contacts
659  $parts = ilParticipants::getInstance($this->object->getRefId());
660  $contacts = $parts->getContacts();
661  if (count($contacts) > 0) {
662  $info->addSection($this->lng->txt("crs_mem_contacts"));
663  foreach ($contacts as $contact) {
664  $pgui = new ilPublicUserProfileGUI($contact);
665  $pgui->setBackUrl($this->ctrl->getLinkTargetByClass("ilinfoscreengui"));
666  $pgui->setEmbedded(true);
667  $info->addProperty("", $pgui->getHTML());
668  }
669  }
670 
671  // forward the command
672  $this->ctrl->forwardCommand($info);
673 
674  // store read event
675  require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
677  $this->object->getType(),
678  $this->object->getRefId(),
679  $this->object->getId(),
680  $ilUser->getId()
681  );
682  }
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.
if($orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:201
Class ilInfoScreenGUI.
showJoinRequestButton(ilToolbarGUI $ilToolbar=null)
static getItemsByEvent($a_event_id)
Get session material / event items.
global $DIC
Definition: saml.php:7
$location
Definition: buildRTE.php:44
global $ilCtrl
Definition: ilias.php:18
static getInstance($a_ref_id)
Get instance by ref_id.
GUI class for public user profile presentation.
setInfoObject($info)
get info sections
static _lookupObjId($a_id)
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
$ilUser
Definition: imgupload.php:18
modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
Modify Item ListGUI for presentation in container type $tree.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static _getInstance($a_obj_id)
get instance by obj_id
$info
Definition: index.php:5
static factory($a_type)
Get list gui by type This method caches all the returned list guis.
$html
Definition: example_001.php:87
+ 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 417 of file class.ilObjSessionGUI.php.

References infoScreen().

Referenced by addToDeskObject(), and removeFromDeskObject().

418  {
419  $this->ctrl->setCmd("showSummary");
420  $this->ctrl->setCmdClass("ilinfoscreengui");
421  $this->infoScreen();
422  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAttendanceList()

ilObjSessionGUI::initAttendanceList ( )
protected

Init attendance list object.

Returns
ilAttendanceList

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

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

Referenced by attendanceListObject(), and printAttendanceListObject().

1290  {
1291  $members_obj = $this->initContainer(true);
1292 
1293  include_once 'Services/Membership/classes/class.ilAttendanceList.php';
1294  $list = new ilAttendanceList(
1295  $this,
1296  $this->object,
1297  $members_obj
1298  );
1299  $list->setId('sessattlst');
1300 
1301  $event_app = $this->object->getFirstAppointment();
1303  $desc = ilDatePresentation::formatPeriod($event_app->getStart(), $event_app->getEnd());
1305  $desc .= " " . $this->object->getTitle();
1306  $list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
1307 
1308  $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
1309  $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
1310  if ($this->object->enabledRegistration()) {
1311  $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
1312  }
1313  $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1314  $list->addBlank($this->lng->txt('sess_signature'));
1315 
1316  $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1317 
1318  return $list;
1319  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
static setUseRelativeDates($a_status)
set use relative dates
Base class for attendance lists.
initContainer($a_init_participants=false)
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
+ 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 1103 of file class.ilObjSessionGUI.php.

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

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

1104  {
1105  global $DIC;
1106 
1107  $tree = $DIC['tree'];
1108 
1109  $is_course = $is_group = false;
1110 
1111  // #13178
1112  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
1113  if ($this->container_ref_id) {
1114  $is_group = true;
1115  }
1116  if (!$this->container_ref_id) {
1117  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1118  if ($this->container_ref_id) {
1119  $is_course = true;
1120  }
1121  }
1122  if (!$this->container_ref_id) {
1123  ilUtil::sendFailure('No container object found. Aborting');
1124  return true;
1125  }
1126  $this->container_obj_id = ilObject::_lookupObjId($this->container_ref_id);
1127 
1128  if ($a_init_participants && $this->container_obj_id) {
1129  if ($is_course) {
1130  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
1131  return ilCourseParticipants::_getInstanceByObjId($this->container_obj_id);
1132  } elseif ($is_group) {
1133  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
1134  return ilGroupParticipants::_getInstanceByObjId($this->container_obj_id);
1135  }
1136  }
1137  }
global $DIC
Definition: saml.php:7
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupObjId($a_id)
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

ilObjSessionGUI::initCreateForm (   $a_new_type)
protected

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

References $form, and initForm().

Referenced by executeCommand().

698  {
699  if (!is_object($this->object)) {
700  $this->object = new ilObjSession();
701  }
702  $this->initForm('create');
703  return $this->form;
704  }
initForm($a_mode)
Init Form.
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilObjSessionGUI::initForm (   $a_mode)
protected

Init Form.

protected

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

References $_GET, $DIC, $files, $form, $ilUser, $section, $title, ilRecurrenceInputGUI\allowUnlimitedRecurrences(), 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, ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setInfo(), ilAdvancedMDRecordGUI\setPropertyForm(), ilFormPropertyGUI\setRequired(), ilRadioOption\setTitle(), ilTextInputGUI\setValue(), ilRadioGroupInputGUI\setValue(), ilTextAreaInputGUI\setValue(), ilMembershipRegistrationSettings\TYPE_DIRECT, ilMembershipRegistrationSettings\TYPE_NONE, and ilMembershipRegistrationSettings\TYPE_REQUEST.

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

1502  {
1503  global $DIC;
1504 
1505  $ilUser = $DIC['ilUser'];
1506 
1507  if (is_object($this->form)) {
1508  return true;
1509  }
1510 
1511  $this->lng->loadLanguageModule('dateplaner');
1512 
1513  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1514 
1515  include_once('./Services/YUI/classes/class.ilYuiUtil.php');
1517 
1518  $this->form = new ilPropertyFormGUI();
1519  $this->form->setMultipart(true);
1520  $this->form->setTableWidth('600px');
1521  $this->form->setFormAction($this->ctrl->getFormAction($this));
1522  $this->form->setMultipart(true);
1523 
1524  if ($a_mode == 'create') {
1525  $this->form = $this->initDidacticTemplate($this->form);
1526  }
1527 
1528  $this->lng->loadLanguageModule('dateplaner');
1529  include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
1530  $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
1531  $dur->setRequired(true);
1532  $dur->enableToggleFullTime(
1533  $this->lng->txt('event_fulltime_info'),
1534  $this->object->getFirstAppointment()->enabledFulltime() ? true : false
1535  );
1536  $dur->setShowTime(true);
1537  $dur->setStart($this->object->getFirstAppointment()->getStart());
1538  $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1539 
1540  $this->form->addItem($dur);
1541 
1542 
1543  // Recurrence
1544  if ($a_mode == 'create') {
1545  if (!is_object($this->rec)) {
1546  include_once('./Modules/Session/classes/class.ilEventRecurrence.php');
1547  $this->rec = new ilEventRecurrence();
1548  }
1549  include_once('./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
1550  $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
1551  $rec->allowUnlimitedRecurrences(false);
1552  $rec->setRecurrence($this->rec);
1553  $this->form->addItem($rec);
1554 
1555  // #14547
1556  $lp = new ilCheckboxInputGUI($this->lng->txt("sess_lp_preset"), "lp_preset");
1557  $lp->setInfo($this->lng->txt("sess_lp_preset_info"));
1558  $lp->setChecked(true);
1559  $this->form->addItem($lp);
1560  }
1561 
1563  $section->setTitle($this->lng->txt('event_section_information'));
1564  $this->form->addItem($section);
1565 
1566  // title
1567  $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title');
1568  $title->setValue($this->object->getTitle());
1569  $title->setSize(50);
1570  $title->setMaxLength(70);
1571  $this->form->addItem($title);
1572 
1573  // desc
1574  $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc');
1575  $desc->setValue($this->object->getLongDescription());
1576  $desc->setRows(4);
1577  $desc->setCols(50);
1578  $this->form->addItem($desc);
1579 
1580  // location
1581  $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location');
1582  $desc->setValue($this->object->getLocation());
1583  $desc->setRows(4);
1584  $desc->setCols(50);
1585  $this->form->addItem($desc);
1586 
1587  // workflow
1588  $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details');
1589  $details->setValue($this->object->getDetails());
1590  $details->setCols(50);
1591  $details->setRows(4);
1592  $this->form->addItem($details);
1593 
1594  if ($a_mode == 'create') {
1595  $this->record_gui = new ilAdvancedMDRecordGUI(
1597  'sess'
1598  );
1599  $this->record_gui->setRefId((int) $_GET['ref_id']);
1600  $this->record_gui->setPropertyForm($this->form);
1601  $this->record_gui->parse();
1602  } elseif ($this->checkPermissionBool('edit_metadata')) {
1603  $this->record_gui = new ilAdvancedMDRecordGUI(
1605  'sess',
1606  $this->object->getId()
1607  );
1608  $this->record_gui->setPropertyForm($this->form);
1609  $this->record_gui->parse();
1610  }
1611 
1612 
1613  // section
1615  $section->setTitle($this->lng->txt('event_tutor_data'));
1616  $this->form->addItem($section);
1617 
1618  // name
1619  $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name');
1620  $tutor_name->setValue($this->object->getName());
1621  $tutor_name->setSize(20);
1622  $tutor_name->setMaxLength(70);
1623  $this->form->addItem($tutor_name);
1624 
1625  // email
1626  $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email');
1627  $tutor_email->setValue($this->object->getEmail());
1628  $tutor_email->setSize(20);
1629  $tutor_email->setMaxLength(70);
1630  $this->form->addItem($tutor_email);
1631 
1632  // phone
1633  $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone');
1634  $tutor_phone->setValue($this->object->getPhone());
1635  $tutor_phone->setSize(20);
1636  $tutor_phone->setMaxLength(70);
1637  $this->form->addItem($tutor_phone);
1638 
1640  $section->setTitle($this->lng->txt('sess_section_reg'));
1641  $this->form->addItem($section);
1642 
1643  include_once './Modules/Session/classes/class.ilSessionMembershipRegistrationSettingsGUI.php';
1644  include_once './Services/Membership/classes/class.ilMembershipRegistrationSettings.php';
1645  $reg_settings = new ilSessionMembershipRegistrationSettingsGUI(
1646  $this,
1647  $this->object,
1648  array(
1653  )
1654  );
1655  $reg_settings->addMembershipFormElements($this->form, '');
1656 
1657 
1659  $section->setTitle($this->lng->txt('event_assign_files'));
1660  $this->form->addItem($section);
1661 
1662  $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
1663  $files->setFilenames(array(0 => ''));
1664  $this->form->addItem($files);
1665 
1666  $features = new ilFormSectionHeaderGUI();
1667  $features->setTitle($this->lng->txt('obj_features'));
1668  $this->form->addItem($features);
1670  $this->object->getId(),
1671  $this->form,
1672  array(
1674  )
1675  );
1676 
1677  $gallery = new ilCheckboxInputGUI($this->lng->txt('sess_show_members'), 'show_members');
1678  $gallery->setChecked($this->object->getShowMembers());
1679  $gallery->setInfo($this->lng->txt('sess_show_participants_info'));
1680  $this->form->addItem($gallery);
1681 
1682 
1683  // Show mail to members type
1684  $mail_type = new ilRadioGroupInputGUI($this->lng->txt('sess_mail_type'), 'mail_type');
1685  $mail_type->setValue($this->object->getMailToMembersType());
1686 
1687  $mail_tutors = new ilRadioOption(
1688  $this->lng->txt('sess_mail_admins_only'),
1690  $this->lng->txt('sess_mail_admins_only_info')
1691  );
1692  $mail_type->addOption($mail_tutors);
1693 
1694  $mail_all = new ilRadioOption(
1695  $this->lng->txt('sess_mail_all'),
1697  $this->lng->txt('sess_mail_all_info')
1698  );
1699  $mail_type->addOption($mail_all);
1700  $this->form->addItem($mail_type);
1701 
1702 
1703 
1704  switch ($a_mode) {
1705  case 'create':
1706  $this->form->setTitle($this->lng->txt('event_table_create'));
1707 
1708  $this->form->addCommandButton('save', $this->lng->txt('event_btn_add'));
1709  $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit'));
1710  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
1711 
1712  return true;
1713 
1714  case 'edit':
1715  $this->form->setTitle($this->lng->txt('event_table_update'));
1716 
1717  $this->form->addCommandButton('update', $this->lng->txt('save'));
1718  $this->form->addCommandButton('cancelEdit', $this->lng->txt('cancel'));
1719 
1720  return true;
1721  }
1722  return true;
1723  }
This class represents an option in a radio group.
setTitle($a_title)
Set Title.
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
setPropertyForm($form)
set property form object
$_GET["client_id"]
This class represents a section header in a property form.
This class represents an input GUI for recurring events/appointments (course events or calendar appoi...
This class represents a file wizard property in a property form.
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
allowUnlimitedRecurrences($a_status)
Allow unlimited recurrences.
setInfo($a_info)
Set Information Text.
$section
Definition: Utf8Test.php:83
setChecked($a_checked)
Set Checked.
input GUI for a time span (start and end date)
This class represents a property in a property form.
if(isset($_POST['submit'])) $form
initDidacticTemplate(ilPropertyFormGUI $form)
Show didactic template types.
This class represents a text property in a property form.
static initDomEvent()
Init YUI DomEvent.
$ilUser
Definition: imgupload.php:18
This class represents a text area property in a property form.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
setValue($a_value)
Set Value.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
setRequired($a_required)
Set Required.
+ 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 293 of file class.ilObjSessionGUI.php.

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

294  {
295  global $DIC;
296 
297  $ilUser = $DIC['ilUser'];
298 
299  $this->checkPermission('read');
300 
301  if ($ilUser->isAnonymous()) {
302  $this->ctrl->redirect($this, 'infoScreen');
303  }
304 
305  include_once './Modules/Session/classes/class.ilEventParticipants.php';
306 
307  if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->object->getId())) {
308  $_SESSION['sess_hide_info'] = true;
309  ilEventParticipants::_unregister($ilUser->getId(), $this->object->getId());
310  ilUtil::sendSuccess($this->lng->txt('event_unregistered'), true);
311  } else {
312  ilEventParticipants::_register($ilUser->getId(), $this->object->getId());
313  ilUtil::sendSuccess($this->lng->txt('event_registered'), true);
314  }
315 
316  $this->ctrl->redirect($this, 'infoScreen');
317  }
static _unregister($a_usr_id, $a_event_id)
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
static _isRegistered($a_usr_id, $a_event_id)
$ilUser
Definition: imgupload.php:18
static _register($a_usr_id, $a_event_id)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ load()

ilObjSessionGUI::load ( )
protected

load settings

protected

Parameters

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

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

Referenced by saveObject(), and updateObject().

1733  {
1734  $event = $this->form->getItemByPostVar('event');
1735  if ($event->getStart() && $event->getEnd()) {
1736  $this->object->getFirstAppointment()->setStartingTime($event->getStart()->get(IL_CAL_UNIX));
1737  $this->object->getFirstAppointment()->setEndingTime($event->getStart()->get(IL_CAL_UNIX));
1738  $this->object->getFirstAppointment()->setStart($event->getStart());
1739  $this->object->getFirstAppointment()->setEnd($event->getEnd());
1740  $this->object->getFirstAppointment()->toggleFulltime($event->getStart() instanceof ilDate);
1741  }
1742 
1743  $this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
1744  $this->object->setDescription(ilUtil::stripSlashes($_POST['desc']));
1745  $this->object->setLocation(ilUtil::stripSlashes($_POST['location']));
1746  $this->object->setName(ilUtil::stripSlashes($_POST['tutor_name']));
1747  $this->object->setPhone(ilUtil::stripSlashes($_POST['tutor_phone']));
1748  $this->object->setEmail(ilUtil::stripSlashes($_POST['tutor_email']));
1749  $this->object->setDetails(ilUtil::stripSlashes($_POST['details']));
1750 
1751  $this->object->setRegistrationType((int) $_POST['registration_type']);
1752  // $this->object->setRegistrationMinUsers((int) $_POST['registration_min_members']);
1753  $this->object->setRegistrationMaxUsers((int) $_POST['registration_max_members']);
1754  $this->object->enableRegistrationUserLimit((int) $_POST['registration_membership_limited']);
1755  $this->object->setShowMembers((int) $_POST['show_members']);
1756  $this->object->setMailToMembersType((int) $_POST['mail_type']);
1757 
1758  switch ((int) $_POST['waiting_list']) {
1759  case 2:
1760  $this->object->enableRegistrationWaitingList(true);
1761  $this->object->setWaitingListAutoFill(true);
1762  break;
1763 
1764  case 1:
1765  $this->object->enableRegistrationWaitingList(true);
1766  $this->object->setWaitingListAutoFill(false);
1767  break;
1768 
1769  default:
1770  $this->object->enableRegistrationWaitingList(false);
1771  $this->object->setWaitingListAutoFill(false);
1772  break;
1773  }
1774  }
const IL_CAL_UNIX
Class for single dates.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRecurrenceSettings()

ilObjSessionGUI::loadRecurrenceSettings ( )
protected

load recurrence settings

protected

Returns

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

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

Referenced by saveObject().

1783  {
1784  include_once('./Modules/Session/classes/class.ilSessionRecurrence.php');
1785  $this->rec = new ilSessionRecurrence();
1786 
1787  switch ($_POST['frequence']) {
1788  case IL_CAL_FREQ_DAILY:
1789  $this->rec->setFrequenceType($_POST['frequence']);
1790  $this->rec->setInterval((int) $_POST['count_DAILY']);
1791  break;
1792 
1793  case IL_CAL_FREQ_WEEKLY:
1794  $this->rec->setFrequenceType($_POST['frequence']);
1795  $this->rec->setInterval((int) $_POST['count_WEEKLY']);
1796  if (is_array($_POST['byday_WEEKLY'])) {
1797  $this->rec->setBYDAY(ilUtil::stripSlashes(implode(',', $_POST['byday_WEEKLY'])));
1798  }
1799  break;
1800 
1801  case IL_CAL_FREQ_MONTHLY:
1802  $this->rec->setFrequenceType($_POST['frequence']);
1803  $this->rec->setInterval((int) $_POST['count_MONTHLY']);
1804  switch ((int) $_POST['subtype_MONTHLY']) {
1805  case 0:
1806  // nothing to do;
1807  break;
1808 
1809  case 1:
1810  switch ((int) $_POST['monthly_byday_day']) {
1811  case 8:
1812  // Weekday
1813  $this->rec->setBYSETPOS((int) $_POST['monthly_byday_num']);
1814  $this->rec->setBYDAY('MO,TU,WE,TH,FR');
1815  break;
1816 
1817  case 9:
1818  // Day of month
1819  $this->rec->setBYMONTHDAY((int) $_POST['monthly_byday_num']);
1820  break;
1821 
1822  default:
1823  $this->rec->setBYDAY((int) $_POST['monthly_byday_num'] . $_POST['monthly_byday_day']);
1824  break;
1825  }
1826  break;
1827 
1828  case 2:
1829  $this->rec->setBYMONTHDAY((int) $_POST['monthly_bymonthday']);
1830  break;
1831  }
1832  break;
1833 
1834  case IL_CAL_FREQ_YEARLY:
1835  $this->rec->setFrequenceType($_POST['frequence']);
1836  $this->rec->setInterval((int) $_POST['count_YEARLY']);
1837  switch ((int) $_POST['subtype_YEARLY']) {
1838  case 0:
1839  // nothing to do;
1840  break;
1841 
1842  case 1:
1843  $this->rec->setBYMONTH((int) $_POST['yearly_bymonth_byday']);
1844  $this->rec->setBYDAY((int) $_POST['yearly_byday_num'] . $_POST['yearly_byday']);
1845  break;
1846 
1847  case 2:
1848  $this->rec->setBYMONTH((int) $_POST['yearly_bymonth_by_monthday']);
1849  $this->rec->setBYMONTHDAY((int) $_POST['yearly_bymonthday']);
1850  break;
1851  }
1852  break;
1853  }
1854 
1855  // UNTIL
1856  switch ((int) $_POST['until_type']) {
1857  case 1:
1858  $this->rec->setFrequenceUntilDate(null);
1859  // nothing to do
1860  break;
1861 
1862  case 2:
1863  $this->rec->setFrequenceUntilDate(null);
1864  $this->rec->setFrequenceUntilCount((int) $_POST['count']);
1865  break;
1866 
1867  case 3:
1868  $frequence = $this->form->getItemByPostVar('frequence');
1869  $end = $frequence->getRecurrence()->getFrequenceUntilDate();
1870  $this->rec->setFrequenceUntilCount(0);
1871  $this->rec->setFrequenceUntilDate($end);
1872  break;
1873  }
1874  }
const IL_CAL_FREQ_MONTHLY
const IL_CAL_FREQ_DAILY
Model of calendar entry recurrcences.
const IL_CAL_FREQ_YEARLY
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
const IL_CAL_FREQ_WEEKLY
+ 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 1142 of file class.ilObjSessionGUI.php.

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

1143  {
1144  global $DIC;
1145 
1146  $tree = $DIC['tree'];
1147  $objDefinition = $DIC['objDefinition'];
1148 
1149  $this->tabs_gui->activateTab('materials');
1150 
1151  // #11337 - support ANY parent container (crs, grp, fld)
1152  $parent_ref_id = $tree->getParentId($this->object->getRefId());
1153 
1154  include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
1155  $gui = new ilObjectAddNewItemGUI($parent_ref_id);
1156  $gui->setDisabledObjectTypes(
1157  array_merge(
1158  [
1159  'itgr', 'sess'
1160  ],
1161  $objDefinition->getSideBlockTypes()
1162  )
1163  );
1164  $gui->setAfterCreationCallback($this->ref_id);
1165  $gui->render();
1166 
1167  include_once 'Modules/Session/classes/class.ilEventItems.php';
1168  $this->event_items = new ilEventItems($this->object->getId());
1169 
1170  include_once 'Modules/Session/classes/class.ilSessionMaterialsTableGUI.php';
1171  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1172 
1173  $tbl->setDisableFilterHiding(true);
1174 
1175  $tbl->addMultiCommand('saveMaterials', $this->lng->txt('sess_assign'));
1176  $tbl->addMultiCommand("removeMaterials", $this->lng->txt("remove"));
1177 
1178  $tbl->setTitle($this->lng->txt("event_assign_materials_table"));
1179  $tbl->setDescription($this->lng->txt('event_assign_materials_info'));
1180 
1181  $tbl->setMaterialItems($this->event_items->getItems());
1182  $tbl->setContainerRefId($this->getContainerRefId());
1183  $data = $tbl->getDataFromDb();
1184  $tbl->setMaterials($data);
1185 
1186  $this->tpl->setContent($tbl->getHTML());
1187  }
global $DIC
Definition: saml.php:7
$tbl
Definition: example_048.php:81
Render add new item selector.
getContainerRefId()
container ref id
class ilEvent
+ Here is the call graph for this function:

◆ membersObject()

ilObjSessionGUI::membersObject ( )
protected

Redirect to member adminsitration.

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

206  {
207  $this->ctrl->redirectByClass('ilSessionMembershipGUI', 'participants');
208  }

◆ modifyItemGUI()

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

Modify Item ListGUI for presentation in container type $tree.

Parameters
type$a_item_list_gui
type$a_item_data
type$a_show_path

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

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

Referenced by infoScreen().

432  {
433  global $DIC;
434 
435  $tree = $DIC['tree'];
436 
437  // if folder is in a course, modify item list gui according to course requirements
438  if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs')) {
439  // #10611
440  include_once "Services/Object/classes/class.ilObjectActivation.php";
441  ilObjectActivation::addListGUIActivationProperty($a_item_list_gui, $a_item_data);
442 
443  include_once("./Modules/Course/classes/class.ilObjCourse.php");
444  include_once("./Modules/Course/classes/class.ilObjCourseGUI.php");
445  $course_obj_id = ilObject::_lookupObjId($course_ref_id);
447  $a_item_list_gui,
448  get_class($this),
449  $a_item_data,
450  $a_show_path,
451  ilObjCourse::_lookupAboStatus($course_obj_id),
452  $course_ref_id,
453  $course_obj_id,
454  $this->object->getRefId()
455  );
456  }
457  }
global $DIC
Definition: saml.php:7
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 _lookupObjId($a_id)
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
static _lookupAboStatus($a_id)
+ 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 1251 of file class.ilObjSessionGUI.php.

References $tbl.

Referenced by removeMaterialsObject(), and saveMaterialsObject().

1252  {
1253  include_once 'Modules/Session/classes/class.ilSessionMaterialsTableGUI.php';
1254  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1255  $tbl->setOffset(0);
1256  $tbl->storeNavParameter();//remove offset and go to page 1
1257 
1258  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1259  $this->ctrl->redirect($this, 'materials');
1260  }
$tbl
Definition: example_048.php:81
+ Here is the caller graph for this function:

◆ prepareOutput()

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

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

References $title, and ilObjectGUI\getCreationMode().

Referenced by executeCommand().

223  {
224  parent::prepareOutput($a_show_subobjects);
225 
226  if (!$this->getCreationMode()) {
227  $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
228 
229  include_once './Modules/Session/classes/class.ilSessionAppointment.php';
230  $this->tpl->setTitle(
231  $this->object->getFirstAppointment()->appointmentToString() . $title
232  );
233  }
234  }
getCreationMode()
get creation mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printAttendanceListObject()

ilObjSessionGUI::printAttendanceListObject ( )
protected

print attendance list

protected

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

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

1327  {
1328  $this->checkPermission('manage_members');
1329 
1330  $list = $this->initAttendanceList();
1331  $list->initFromForm();
1332  $list->setCallback(array($this, 'getAttendanceListUserData'));
1333 
1334  include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1335  $this->event_part = new ilEventParticipants($this->object->getId());
1336 
1337  echo $list->getFullscreenHTML();
1338  exit();
1339  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
exit
Definition: backend.php:16
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
initAttendanceList()
Init attendance list object.
+ Here is the call graph for this function:

◆ readMemberData()

ilObjSessionGUI::readMemberData (   $a_usr_ids)

Used for waiting list.

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

2062  {
2063  $tmp_data = array();
2064  foreach ($a_usr_ids as $usr_id) {
2065  $tmp_data[$usr_id] = array();
2066  }
2067  return $tmp_data;
2068  }

◆ redirectToParentContentPageObject()

ilObjSessionGUI::redirectToParentContentPageObject ( )
protected

Redirect to parent content page.

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

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

1916  {
1917  global $DIC;
1918 
1919  $objDefinition = $DIC['objDefinition'];
1920 
1921  $tree = $DIC->repositoryTree();
1922  $ctrl = $DIC->ctrl();
1923 
1924  $parent_id = $tree->getParentId($this->object->getRefId());
1925 
1926  // #11650
1927  $parent_type = ilObject::_lookupType($parent_id, true);
1928 
1929  $parent_class = $objDefinition->getClassName($parent_type);
1930  $parent_class = 'ilObj' . $parent_class . 'GUI';
1931 
1932  $ctrl->setParameterByClass($parent_class, "ref_id", $parent_id);
1933  $ctrl->redirectByClass($parent_class, "view");
1934  }
global $DIC
Definition: saml.php:7
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ registerObject()

ilObjSessionGUI::registerObject ( )

register to session

public

Parameters

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

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

244  {
245  global $DIC;
246 
247  $ilUser = $DIC['ilUser'];
248 
249  $this->checkPermission('visible');
250 
251  include_once './Services/Membership/classes/class.ilParticipants.php';
252  $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
253 
254  include_once './Modules/Session/classes/class.ilEventParticipants.php';
255  $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
256  if (
257  $this->getCurrentObject()->isRegistrationUserLimitEnabled() and
258  $this->getCurrentObject()->getRegistrationMaxUsers() and
259  (count($event_part->getRegistered()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
260  ) {
261  include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
262  $wait = new ilSessionWaitingList($this->getCurrentObject()->getId());
263  $wait->addToList($ilUser->getId());
264  ilUtil::sendInfo($this->lng->txt('sess_reg_added_to_wl'), true);
265  $this->ctrl->redirect($this, 'infoScreen');
266  return true;
267  }
268 
269 
270  switch ($this->getCurrentObject()->getRegistrationType()) {
272  $this->ctrl->redirect($this, 'info');
273  break;
274 
276  $part->register($ilUser->getId());
277  ilUtil::sendSuccess($this->lng->txt('event_registered'), true);
278  $this->ctrl->redirect($this, 'infoScreen');
279  break;
280 
282  ilUtil::sendSuccess($this->lng->txt('sess_registered_confirm'), true);
283  $part->addSubscriber($ilUser->getId());
284  $this->ctrl->redirect($this, 'infoScreen');
285  break;
286  }
287  }
global $DIC
Definition: saml.php:7
getCurrentObject()
Get session object.
static getInstance($a_ref_id)
Get instance by ref_id.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$ilUser
Definition: imgupload.php:18
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
+ Here is the call graph for this function:

◆ removeFromDeskObject()

ilObjSessionGUI::removeFromDeskObject ( )
See also
ilDesktopItemHandling::removeFromDesk()

Implements ilDesktopItemHandling.

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

References infoScreenObject(), and ilDesktopItemGUI\removeFromDesktop().

405  {
406  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
408  $this->infoScreenObject();
409  }
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
static removeFromDesktop()
Remove item from personal desktop public.
+ Here is the call graph for this function:

◆ removeMaterialsObject()

ilObjSessionGUI::removeMaterialsObject ( )

Remove materials from the current object.

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

References $_POST, postUpdateMaterials(), and ilEventItems\removeItems().

1215  {
1216  $items_checked = is_array($_POST['items']) ? $_POST['items'] : array();
1217 
1218  $this->event_items = new ilEventItems($this->object->getId());
1219  $this->event_items->removeItems($items_checked);
1220 
1221  $this->postUpdateMaterials();
1222  }
removeItems($a_items)
Remove specific items from the DB.
$_POST["username"]
class ilEvent
postUpdateMaterials()
redirect to list of materials without offset/page.
+ Here is the call graph for this function:

◆ resetFilter()

ilObjSessionGUI::resetFilter ( )

Reset filter.

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

References $tbl.

1204  {
1205  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1206  $tbl->resetOffset(); // sets record offest to 0 (first page)
1207  $tbl->resetFilter(); // clears filter
1208  $this->ctrl->redirect($this, "materials");
1209  }
$tbl
Definition: example_048.php:81

◆ saveAndAssignMaterialsObject()

ilObjSessionGUI::saveAndAssignMaterialsObject ( )

Save and assign sessoin materials.

protected

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

References ilObjectGUI\saveObject().

712  {
713  $this->saveObject(false);
714 
715  $this->ctrl->setParameter($this, 'ref_id', $this->object->getRefId());
716  $this->ctrl->setParameter($this, 'new_type', '');
717  $this->ctrl->redirect($this, 'materials');
718  }
saveObject()
save object
+ Here is the call graph for this function:

◆ saveMaterialsObject()

ilObjSessionGUI::saveMaterialsObject ( )

save material assignment

public

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

References $_POST, ilEventItems\getItems(), and postUpdateMaterials().

1231  {
1232  include_once './Modules/Session/classes/class.ilEventItems.php';
1233 
1234  $this->event_items = new ilEventItems($this->object->getId());
1235  $db_items = $this->event_items->getItems();
1236 
1237  $list_items_checked = is_array($_POST['items']) ? $_POST['items'] : array();
1238  $list_items_checked = array_map('intval', $list_items_checked);
1239 
1240  $items_to_save = array_merge($db_items, $list_items_checked);
1241  $items_to_save = array_unique($items_to_save);
1242 
1243  $this->event_items->setItems($items_to_save);
1244  $this->event_items->update();
1245  $this->postUpdateMaterials();
1246  }
getItems()
get assigned items
$_POST["username"]
class ilEvent
postUpdateMaterials()
redirect to list of materials without offset/page.
+ Here is the call graph for this function:

◆ saveObject()

ilObjSessionGUI::saveObject (   $a_redirect_on_success = true)

save object

protected

Parameters
bool$a_redirect_on_successRedirect to repository after success.
Returns

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

References $_GET, $DIC, $form, 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(), ilLPObjSettings\setMode(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

728  {
729  global $DIC;
730 
731  $ilErr = $DIC['ilErr'];
732  $ilUser = $DIC['ilUser'];
733 
734  $this->object = new ilObjSession();
735 
736  $this->ctrl->saveParameter($this, "new_type");
737 
738  $this->initForm('create');
739  $ilErr->setMessage('');
740  if (!$this->form->checkInput()) {
741  $ilErr->setMessage($this->lng->txt('err_check_input'));
742  }
743 
744  if (
745  $this->record_gui instanceof \ilAdvancedMDRecordGUI &&
746  !$this->record_gui->importEditFormPostValues()
747  ) {
748  $ilErr->setMessage($this->lng->txt('err_check_input'));
749  }
750 
751  $this->load();
752  $this->loadRecurrenceSettings();
753 
754  $this->object->validate();
755  $this->object->getFirstAppointment()->validate();
756 
757  if (strlen($ilErr->getMessage())) {
758  ilUtil::sendFailure($ilErr->getMessage());
759  $this->form->setValuesByPost();
760  $this->createObject();
761  return false;
762  }
763  // Create session
764  $this->object->create();
765  $this->object->createReference();
766  $this->object->putInTree($_GET["ref_id"]);
767  $this->object->setPermissions($_GET["ref_id"]);
768 
770  $this->object->getId(),
771  $this->form,
772  array(
774  )
775  );
776  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
777  $this->record_gui->writeEditForm($this->object->getId());
778  }
779 
780 
781  // apply didactic template?
782  $dtpl = $this->getDidacticTemplateVar("dtpl");
783  if ($dtpl) {
784  $this->object->applyDidacticTemplate($dtpl);
785  }
786 
787  // #14547 - active is default
788  if (!$this->form->getInput("lp_preset")) {
789  include_once "Services/Tracking/classes/class.ilLPObjSettings.php";
790  $lp_obj_settings = new ilLPObjSettings($this->object->getId());
792  $lp_obj_settings->update(false);
793  }
794 
795  // create appointment
796  $this->object->getFirstAppointment()->setSessionId($this->object->getId());
797  $this->object->getFirstAppointment()->create();
798 
799  $this->handleFileUpload();
800 
801  $this->createRecurringSessions($this->form->getInput("lp_preset"));
802 
803  if ($a_redirect_on_success) {
804  ilUtil::sendInfo($this->lng->txt('event_add_new_event'), true);
805  $this->ctrl->returnToParent($this);
806  }
807 
808  return true;
809  }
loadRecurrenceSettings()
load recurrence settings
initForm($a_mode)
Init Form.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
importEditFormPostValues()
Load edit form values from post.
createObject()
create new object form
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
createRecurringSessions($a_activate_lp=true)
create recurring sessions
if(isset($_POST['submit'])) $form
$ilUser
Definition: imgupload.php:18
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
+ Here is the call graph for this function:

◆ sendFileObject()

ilObjSessionGUI::sendFileObject ( )

send file

public

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

References $_GET, and ilUtil\deliverFile().

690  {
691  $file = new ilSessionFile((int) $_GET['file_id']);
692 
693  ilUtil::deliverFile($file->getAbsolutePath(), $file->getFileName(), $file->getFileType());
694  return true;
695  }
$_GET["client_id"]
class ilEvent
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ showJoinRequestButton()

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

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

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

Referenced by infoScreen(), and showJoinRequestButtonInCalendar().

474  {
475  global $DIC;
476 
477  $ilUser = $DIC['ilUser'];
478 
479  if (!$ilToolbar) {
480  global $DIC;
481 
482  $ilToolbar = $DIC['ilToolbar'];
483  }
484 
485  if (!$this->getCurrentObject()->enabledRegistration() || $ilUser->isAnonymous()) {
486  return false;
487  }
488 
489  include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
490 
491  include_once './Services/Membership/classes/class.ilParticipants.php';
492  $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
493 
494  include_once './Modules/Session/classes/class.ilEventParticipants.php';
495 
496  $btn_attend = ilLinkButton::getInstance();
497  $btn_attend->addCSSClass("btn-primary");
498  $this->ctrl->setParameter($this, "ref_id", $this->getCurrentObject()->getRefId());
499 
500  if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->getCurrentObject()->getId())) {
501  $btn_attend->setCaption($this->lng->txt("event_unregister"), false);
502  $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "unregister"));
503  $ilToolbar->addButtonInstance($btn_attend);
504  return true;
505  } elseif ($part->isSubscriber($ilUser->getId())) {
506  $btn_attend->setCaption($this->lng->txt("event_unregister"), false);
507  $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "unregister"));
508  $ilToolbar->addButtonInstance($btn_attend);
509  return true;
510  } elseif (ilSessionWaitingList::_isOnList($ilUser->getId(), $this->getCurrentObject()->getId())) {
511  $btn_attend->setCaption($this->lng->txt("leave_waiting_list"), false);
512  $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "unregister"));
513  $ilToolbar->addButtonInstance($btn_attend);
514  return true;
515  }
516 
517  $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
518 
519  if (
520  $this->getCurrentObject()->isRegistrationUserLimitEnabled() and
521  $this->getCurrentObject()->getRegistrationMaxUsers() and
522  (count($event_part->getRegistered()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
523  ) {
524  if ($this->getCurrentObject()->isRegistrationWaitingListEnabled()) {
525  ilUtil::sendInfo($this->lng->txt('sess_reg_max_users_exceeded_wl'));
526  $btn_attend->setCaption($this->lng->txt("mem_add_to_wl"), false);
527  $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register"));
528  $ilToolbar->addButtonInstance($btn_attend);
529  return true;
530  } else {
531  ilUtil::sendInfo($this->lng->txt('sess_reg_max_users_exceeded'));
532  return true;
533  }
534  } else {
535  if (!isset($_SESSION['sess_hide_info'])) {
536  ilUtil::sendInfo($this->lng->txt('sess_join_info'));
537  $btn_attend->setCaption($this->lng->txt("join_session"), false);
538  $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register"));
539  $ilToolbar->addButtonInstance($btn_attend);
540  return true;
541  }
542  }
543  }
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
addButtonInstance(ilButtonBase $a_button)
Add button instance.
getCurrentObject()
Get session object.
static _isRegistered($a_usr_id, $a_event_id)
static getInstance($a_ref_id)
Get instance by ref_id.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$ilUser
Definition: imgupload.php:18
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
+ 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 464 of file class.ilObjSessionGUI.php.

References showJoinRequestButton().

465  {
466  $this->showJoinRequestButton($a_ilToolbar);
467  }
showJoinRequestButton(ilToolbarGUI $ilToolbar=null)
+ Here is the call graph for this function:

◆ unregisterObject()

ilObjSessionGUI::unregisterObject ( )

unregister from session

public

Returns

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

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

326  {
327  global $DIC;
328 
329  $ilUser = $DIC['ilUser'];
330 
331  include_once './Modules/Session/classes/class.ilSessionParticipants.php';
332  $part = ilSessionParticipants::getInstance($this->object->getRefId());
333  if ($part->isSubscriber($ilUser->getId())) {
334  $part->deleteSubscriber($ilUser->getId());
335  }
336 
337  $part->unregister($ilUser->getId());
338 
339  include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
341 
342  // check for visible permission of user
344  $GLOBALS['DIC']->access()->clear();
345  $has_access = $GLOBALS['DIC']->access()->checkAccessOfUser(
346  $GLOBALS['DIC']->user()->getId(),
347  'visible',
348  '',
349  $this->object->getRefId()
350  );
351  if (!$has_access) {
352  $parent = $GLOBALS['DIC']->repositoryTree()->getParentId($this->object->getRefId());
353  $this->redirectToRefId($parent);
354  return;
355  }
356 
357  ilUtil::sendSuccess($this->lng->txt('event_unregistered'), true);
358  $this->ctrl->returnToParent($this);
359  }
global $DIC
Definition: saml.php:7
static resetCaches()
Reset internal caches.
getCurrentObject()
Get session object.
user()
Definition: user.php:4
$ilUser
Definition: imgupload.php:18
static getInstance($a_ref_id)
Get instance.
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 deleteUserEntry($a_usr_id, $a_obj_id)
Delete one user entry.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ updateObject()

ilObjSessionGUI::updateObject ( )

update object

protected

Parameters

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

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

980  {
981  global $DIC;
982 
983  $ilErr = $DIC['ilErr'];
984 
985  $old_autofill = $this->object->hasWaitingListAutoFill();
986 
987  $this->initForm('edit');
988  $ilErr->setMessage('');
989  if (!$this->form->checkInput()) {
990  $ilErr->setMessage($this->lng->txt('err_check_input'));
991  }
992 
993  if (
994  $this->record_gui instanceof \ilAdvancedMDRecordGUI &&
995  !$this->record_gui->importEditFormPostValues()
996  ) {
997  $ilErr->setMessage($this->lng->txt('err_check_input'));
998  }
999 
1000  $this->load();
1001 
1002  $this->object->validate();
1003  $this->object->getFirstAppointment()->validate();
1004 
1005  if (strlen($ilErr->getMessage())) {
1006  ilUtil::sendFailure($ilErr->getMessage());
1007  $this->editObject();
1008  return false;
1009  }
1010  // Update event
1011  $this->object->update();
1012  $this->object->getFirstAppointment()->update();
1013 
1015  $this->object->getId(),
1016  $this->form,
1017  array(
1019  )
1020  );
1021  if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
1022  $this->record_gui->writeEditForm();
1023  }
1024  $this->handleFileUpload();
1025 
1026  // if autofill has been activated trigger process
1027  if (!$old_autofill &&
1028  $this->object->hasWaitingListAutoFill()) {
1029  $this->object->handleAutoFill();
1030  }
1031 
1032  ilUtil::sendSuccess($this->lng->txt('event_updated'), true);
1033  $this->ctrl->redirect($this, 'edit');
1034  #$this->object->initFiles();
1035  #$this->editObject();
1036  return true;
1037  }
initForm($a_mode)
Init Form.
global $DIC
Definition: saml.php:7
importEditFormPostValues()
Load edit form values from post.
if(isset($_POST['submit'])) $form
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

Field Documentation

◆ $container_obj_id

ilObjSessionGUI::$container_obj_id = 0
protected

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

◆ $container_ref_id

ilObjSessionGUI::$container_ref_id = 0
protected

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

Referenced by getContainerRefId().

◆ $ctrl

ilObjSessionGUI::$ctrl

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

Referenced by redirectToParentContentPageObject().

◆ $files

ilObjSessionGUI::$files = array()
protected

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

Referenced by initForm().

◆ $lng

ilObjSessionGUI::$lng

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

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

◆ $logger

ilObjSessionGUI::$logger = null
protected

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

◆ $tpl

ilObjSessionGUI::$tpl

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

Referenced by __construct(), attendanceListObject(), and importFileObject().


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