ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 saveMaterialsObject ()
 save material assignment 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...
 

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...
 
- Protected Member Functions inherited from ilObjectGUI
 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
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

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 $GLOBALS, $ilCtrl, $lng, and $tpl.

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

Member Function Documentation

◆ __toUnix()

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

protected

Parameters

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

References $time.

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

◆ _goto()

static ilObjSessionGUI::_goto (   $a_target)
static

goto

public

Parameters

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

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

337  {
338  global $DIC;
339 
340  $ilAccess = $DIC->access();
341  $ilErr = $DIC["ilErr"];
342  $lng = $DIC->language();
343 
344  if ($ilAccess->checkAccess('visible', "", $a_target)) {
345  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
346  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
348  sprintf(
349  $lng->txt("msg_no_perm_read_item"),
351  ),
352  true
353  );
355  }
356  }
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 1734 of file class.ilObjSessionGUI.php.

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

1735  {
1736  global $ilLocator;
1737 
1738  if (!$this->getCreationMode()) {
1739  // see prepareOutput()
1740  include_once './Modules/Session/classes/class.ilSessionAppointment.php';
1741  $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
1742  $title = $this->object->getFirstAppointment()->appointmentToString() . $title;
1743 
1744  $ilLocator->addItem($title, $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
1745  }
1746  }
$_GET["client_id"]
Create new PHPExcel object
obj_idprivate
getCreationMode()
get creation mode
+ Here is the call graph for this function:

◆ addToDeskObject()

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

Implements ilDesktopItemHandling.

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

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

362  {
363  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
365  $this->infoScreenObject();
366  }
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 1872 of file class.ilObjSessionGUI.php.

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

1873  {
1874  // add new object to materials
1875  include_once './Modules/Session/classes/class.ilEventItems.php';
1876  $event_items = new ilEventItems($this->object->getId());
1877  $event_items->addItem($a_obj->getRefId());
1878  $event_items->update();
1879 
1880  /*
1881  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
1882  $this->ctrl->redirect($this, "materials");
1883  */
1884  }
Create new PHPExcel object
obj_idprivate
getRefId()
get reference id public
addItem($a_item_ref_id)
Add one item.
class ilEvent
+ Here is the call graph for this function:

◆ attendanceListObject()

ilObjSessionGUI::attendanceListObject ( )

show attendance list selection

public

Returns

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

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

1134  {
1135  global $tpl,$ilTabs;
1136 
1137  $this->checkPermission('write');
1138  $ilTabs->setTabActive('event_edit_members');
1139 
1140  $list = $this->initAttendanceList();
1141  $form = $list->initForm('printAttendanceList');
1142  $tpl->setContent($form->getHTML());
1143  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
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 1919 of file class.ilObjSessionGUI.php.

References $ilCtrl, and ilObjectGUI\$tree.

1920  {
1921  global $ilCtrl, $tree;
1922 
1923  $parent_id = $tree->getParentId((int) $_REQUEST['ref_id']);
1924 
1925  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent_id);
1926 
1927  $ilCtrl->redirectByClass("ilrepositorygui", "");
1928  }
global $ilCtrl
Definition: ilias.php:18

◆ confirmDeleteFilesObject()

ilObjSessionGUI::confirmDeleteFilesObject ( )

confirm delete files

public

Parameters

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

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

966  {
967  $this->tabs_gui->setTabActive('settings');
968 
969  if (!count($_POST['file_id'])) {
970  ilUtil::sendFailure($this->lng->txt('select_one'));
971  $this->editObject();
972  return false;
973  }
974 
975  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
976  $c_gui = new ilConfirmationGUI();
977 
978  // set confirm/cancel commands
979  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteFiles"));
980  $c_gui->setHeaderText($this->lng->txt("info_delete_sure"));
981  $c_gui->setCancel($this->lng->txt("cancel"), "edit");
982  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteFiles");
983 
984  // add items to delete
985  foreach ($_POST["file_id"] as $file_id) {
986  $file = new ilSessionFile($file_id);
987  if ($file->getSessionId() != $this->object->getEventId()) {
988  ilUtil::sendFailure($this->lng->txt('select_one'));
989  $this->edit();
990  return false;
991  }
992  $c_gui->addItem("file_id[]", $file_id, $file->getFileName());
993  }
994 
995  $this->tpl->setContent($c_gui->getHTML());
996  return true;
997  }
class ilEvent
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
$_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 1963 of file class.ilObjSessionGUI.php.

References ilLink\_getLink(), and object.

1964  {
1965  $link = chr(13) . chr(10) . chr(13) . chr(10);
1966  $link .= $this->lng->txt('sess_mail_permanent_link');
1967  $link .= chr(13) . chr(10) . chr(13) . chr(10);
1968  include_once './Services/Link/classes/class.ilLink.php';
1969  $link .= ilLink::_getLink($this->object->getRefId());
1970  return rawurlencode(base64_encode($link));
1971  }
Create new PHPExcel object
obj_idprivate
+ 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 797 of file class.ilObjSessionGUI.php.

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

Referenced by saveObject().

798  {
799  global $tree;
800 
801  if (!$this->rec->getFrequenceType()) {
802  return true;
803  }
804  include_once('./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php');
805  $calc = new ilCalendarRecurrenceCalculator($this->object->getFirstAppointment(), $this->rec);
806 
807  $period_start = clone $this->object->getFirstAppointment()->getStart();
808 
809 
810  $period_end = clone $this->object->getFirstAppointment()->getStart();
811  $period_end->increment(IL_CAL_YEAR, 5);
812  $date_list = $calc->calculateDateList($period_start, $period_end);
813 
814  $period_diff = $this->object->getFirstAppointment()->getEnd()->get(IL_CAL_UNIX) -
815  $this->object->getFirstAppointment()->getStart()->get(IL_CAL_UNIX);
816  $parent_id = $tree->getParentId($this->object->getRefId());
817 
818  include_once './Modules/Session/classes/class.ilEventItems.php';
819  $evi = new ilEventItems($this->object->getId());
820  $eitems = $evi->getItems();
821 
822  $counter = 0;
823  foreach ($date_list->get() as $date) {
824  if (!$counter++) {
825  continue;
826  }
827 
828  $new_obj = $this->object->cloneObject($parent_id);
829 
830  // apply didactic template?
831  $dtpl = $this->getDidacticTemplateVar("dtpl");
832  if ($dtpl) {
833  $new_obj->applyDidacticTemplate($dtpl);
834  }
835 
836  $new_obj->read();
837  $new_obj->getFirstAppointment()->setStartingTime($date->get(IL_CAL_UNIX));
838  $new_obj->getFirstAppointment()->setEndingTime($date->get(IL_CAL_UNIX) + $period_diff);
839  $new_obj->getFirstAppointment()->update();
840  $new_obj->update(true);
841 
842  // #14547 - active is default
843  if (!$a_activate_lp) {
844  include_once "Services/Tracking/classes/class.ilLPObjSettings.php";
845  $lp_obj_settings = new ilLPObjSettings($new_obj->getId());
847  $lp_obj_settings->update(false);
848  }
849 
850  $new_evi = new ilEventItems($new_obj->getId());
851  $new_evi->setItems($eitems);
852  $new_evi->update();
853  }
854  }
getItems()
get assigned items
const IL_CAL_UNIX
$counter
calculateDateList(ilDateTime $a_start, ilDateTime $a_end, $a_limit=-1)
calculate date list
Calculates an ilDateList for a given calendar entry and recurrence rule.
Create new PHPExcel object
obj_idprivate
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 1006 of file class.ilObjSessionGUI.php.

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

1007  {
1008  if (!count($_POST['file_id'])) {
1009  ilUtil::sendFailure($this->lng->txt('select_one'));
1010  $this->editObject();
1011  return false;
1012  }
1013  foreach ($_POST['file_id'] as $id) {
1014  $file = new ilSessionFile($id);
1015  $file->delete();
1016  }
1017  $this->object->initFiles();
1018  $this->editObject();
1019  return true;
1020  }
if(!array_key_exists('StateId', $_REQUEST)) $id
class ilEvent
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
$_POST["username"]
+ Here is the call graph for this function:

◆ editObject()

ilObjSessionGUI::editObject ( )

edit object

protected

Parameters

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

References $file, $rows, array, initForm(), and object.

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

865  {
866  $this->tabs_gui->setTabActive('settings');
867 
868  $this->initForm('edit');
869  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit.html', 'Modules/Session');
870  $this->tpl->setVariable('EVENT_EDIT_TABLE', $this->form->getHTML());
871 
872  if (!count($this->object->getFiles())) {
873  return true;
874  }
875  $rows = array();
876  foreach ($this->object->getFiles() as $file) {
877  $table_data['id'] = $file->getFileId();
878  $table_data['filename'] = $file->getFileName();
879  $table_data['filetype'] = $file->getFileType();
880  $table_data['filesize'] = $file->getFileSize();
881 
882  $rows[] = $table_data;
883  }
884 
885  include_once("./Modules/Session/classes/class.ilSessionFileTableGUI.php");
886  $table_gui = new ilSessionFileTableGUI($this, "edit");
887  $table_gui->setTitle($this->lng->txt("event_files"));
888  $table_gui->setData($rows);
889  $table_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
890  $table_gui->addMultiCommand("confirmDeleteFiles", $this->lng->txt("delete"));
891  $table_gui->setSelectAllCheckbox("file_id");
892  $this->tpl->setVariable('EVENT_FILE_TABLE', $table_gui->getHTML());
893 
894  return true;
895  }
initForm($a_mode)
Init Form.
Create styles array
The data for the language used.
$rows
Definition: xhr_table.php:10
Create new PHPExcel object
obj_idprivate
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ 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 1236 of file class.ilObjSessionGUI.php.

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

1237  {
1238  global $ilErr,$ilAccess, $ilUser,$tree;
1239 
1240  if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1241  $ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $ilErr->MESSAGE);
1242  }
1243 
1244  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_list.html', 'Modules/Session');
1245  $this->__showButton($this->ctrl->getLinkTarget($this, 'exportCSV'), $this->lng->txt('event_csv_export'));
1246 
1247  include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1248 
1249  $this->tpl->addBlockfile("EVENTS_TABLE", "events_table", "tpl.table.html");
1250  $this->tpl->addBlockfile('TBL_CONTENT', 'tbl_content', 'tpl.sess_list_row.html', 'Modules/Session');
1251 
1252  $members_obj = $this->initContainer(true);
1253  $members = $members_obj->getParticipants();
1254  $members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
1255 
1256  // Table
1257  $tbl = new ilTableGUI();
1258  $tbl->setTitle(
1259  $this->lng->txt("event_overview"),
1260  'icon_usr.svg',
1261  $this->lng->txt('obj_usr')
1262  );
1263  $this->ctrl->setParameter($this, 'offset', (int) $_GET['offset']);
1264 
1265  $course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1266  $events = array();
1267  foreach ($tree->getSubtree($tree->getNodeData($course_ref_id), false, 'sess') as $event_id) {
1268  $tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
1269  if (!is_object($tmp_event) or $tmp_event->getType() != 'sess') {
1270  continue;
1271  }
1272  $events[] = $tmp_event;
1273  }
1274 
1275  $headerNames = array();
1276  $headerVars = array();
1277  $colWidth = array();
1278 
1279  $headerNames[] = $this->lng->txt('name');
1280  $headerVars[] = "name";
1281  $colWidth[] = '20%';
1282 
1283  for ($i = 1; $i <= count($events); $i++) {
1284  $headerNames[] = $i;
1285  $headerVars[] = "event_" . $i;
1286  $colWidth[] = 80/count($events) . "%";
1287  }
1288 
1289  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1290  $tbl->setHeaderNames($headerNames);
1291  $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this, 'eventsList'));
1292  $tbl->setColumnWidth($colWidth);
1293 
1294  $tbl->setOrderColumn($_GET["sort_by"]);
1295  $tbl->setOrderDirection($_GET["sort_order"]);
1296  $tbl->setOffset($_GET["offset"]);
1297  $tbl->setLimit($ilUser->getPref("hits_per_page"));
1298  $tbl->setMaxCount(count($members));
1299  $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
1300 
1301  $sliced_users = array_slice($members, $_GET['offset'], $_SESSION['tbl_limit']);
1302  $tbl->disable('sort');
1303  $tbl->render();
1304 
1305  $counter = 0;
1306  foreach ($sliced_users as $user_id) {
1307  foreach ($events as $event_obj) {
1308  $this->tpl->setCurrentBlock("eventcols");
1309 
1310  $event_part = new ilEventParticipants($this->object->getId());
1311 
1312  {
1313  $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1314  ilUtil::getImagePath('icon_ok.svg') :
1315  ilUtil::getImagePath('icon_not_ok.svg'));
1316 
1317  $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
1318  $this->lng->txt('event_participated') :
1319  $this->lng->txt('event_not_participated'));
1320  }
1321 
1322  $this->tpl->parseCurrentBlock();
1323  }
1324 
1325  $this->tpl->setCurrentBlock("tbl_content");
1326  $name = ilObjUser::_lookupName($user_id);
1327  $this->tpl->setVariable("CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
1328  $this->tpl->setVariable("LASTNAME", $name['lastname']);
1329  $this->tpl->setVariable("FIRSTNAME", $name['firstname']);
1330  $this->tpl->setVariable("LOGIN", ilObjUser::_lookupLogin($user_id));
1331  $this->tpl->parseCurrentBlock();
1332  }
1333 
1334  $this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));
1335  $this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
1336  $this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
1337  $this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
1338  $this->tpl->setVariable("HEAD_TXT_DATE_TIME", $this->lng->txt("event_date_time"));
1339  $i = 1;
1340  foreach ($events as $event_obj) {
1341  $this->tpl->setCurrentBlock("legend_loop");
1342  $this->tpl->setVariable("LEGEND_CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
1343  $this->tpl->setVariable("LEGEND_DIGIT", $i++);
1344  $this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
1345  $this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1346  $this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1347  $this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1348  $this->tpl->parseCurrentBlock();
1349  }
1350  }
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
$_SESSION["AccountId"]
$_GET["client_id"]
$tbl
Definition: example_048.php:81
__showButton($a_cmd, $a_text, $a_target='')
Class ilTableGUI.
$counter
if($format !==null) $name
Definition: metadata.php:146
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
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
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 71 of file class.ilObjSessionGUI.php.

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

72  {
73  global $ilUser,$ilCtrl;
74 
75  $next_class = $this->ctrl->getNextClass($this);
76  $cmd = $this->ctrl->getCmd();
77 
78  if (
79  !$this->getCreationMode() &&
80  $GLOBALS['DIC']->access()->checkAccess('read', '', $_GET['ref_id'])
81  ) {
82  $GLOBALS['DIC']['ilNavigationHistory']->addItem(
83  (int) $_GET['ref_id'],
84  ilLink::_getLink((int) $_GET['ref_id'], 'sess'),
85  'sess'
86  );
87  }
88 
89  $this->prepareOutput();
90  switch ($next_class) {
91  case 'ilsessionmembershipgui':
92  $this->tabs_gui->activateTab('members');
93  include_once './Modules/Session/classes/class.ilSessionMembershipGUI.php';
94  $mem_gui = new ilSessionMembershipGUI($this, $this->object);
95  $this->ctrl->forwardCommand($mem_gui);
96  break;
97 
98  case "ilinfoscreengui":
99  $this->checkPermission("visible");
100  $this->infoScreen(); // forwards command
101  break;
102 
103  case 'ilobjectmetadatagui':
104  $this->checkPermission('write');
105  $this->tabs_gui->setTabActive('meta_data');
106  $md_gui = new ilObjectMetaDataGUI($this->object);
107  $this->ctrl->forwardCommand($md_gui);
108  break;
109 
110 
111  case 'ilpermissiongui':
112  $this->tabs_gui->setTabActive('perm_settings');
113  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
114  $perm_gui = new ilPermissionGUI($this);
115  $ret = $this->ctrl->forwardCommand($perm_gui);
116  break;
117 
118  case 'ilobjectcopygui':
119  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
120  $cp = new ilObjectCopyGUI($this);
121  $cp->setType('sess');
122  $this->ctrl->forwardCommand($cp);
123  break;
124 
125  case "ilexportgui":
126 // $this->prepareOutput();
127  $this->tabs_gui->setTabActive("export");
128  include_once("./Services/Export/classes/class.ilExportGUI.php");
129  $exp_gui = new ilExportGUI($this);
130  $exp_gui->addFormat("xml");
131  $ret = $this->ctrl->forwardCommand($exp_gui);
132 // $this->tpl->show();
133  break;
134 
135  case "ilcommonactiondispatchergui":
136  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
138  $this->ctrl->forwardCommand($gui);
139  break;
140 
141  case 'ilmembershipgui':
142  $this->ctrl->setReturn($this, 'members');
143  include_once './Services/Membership/classes/class.ilMembershipMailGUI.php';
144  $mem = new ilMembershipMailGUI($this);
145  $this->ctrl->forwardCommand($mem);
146  break;
147 
148  case "illearningprogressgui":
149  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
150  $new_gui = new ilLearningProgressGUI(
152  $this->object->getRefId(),
153  $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()
154  );
155  $this->ctrl->forwardCommand($new_gui);
156  $this->tabs_gui->setTabActive('learning_progress');
157  break;
158 
159  default:
160  if (!$cmd) {
161  $cmd = "infoScreen";
162  }
163  $cmd .= "Object";
164  $this->$cmd();
165 
166  break;
167  }
168 
169  $this->addHeaderAction();
170 
171  return true;
172  }
Class ilObjectMetaDataGUI.
GUI class for the workflow of copying objects.
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
prepareOutput($a_show_subobjects=true)
global $ilCtrl
Definition: ilias.php:18
Export User Interface Class.
GUI class for membership features.
$ilUser
Definition: imgupload.php:18
Create new PHPExcel object
obj_idprivate
$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
+ 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 1211 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$data.

1212  {
1213  $data = $this->event_part->getUser($a_user_id);
1214 
1215  if ($a_filters && $a_filters["registered"] && !$data["registered"]) {
1216  return;
1217  }
1218 
1219  $data['registered'] = $data['registered'] ?
1220  $this->lng->txt('yes') :
1221  $this->lng->txt('no');
1222  $data['participated'] = $data['participated'] ?
1223  $this->lng->txt('yes') :
1224  $this->lng->txt('no');
1225 
1226  return $data;
1227  }

◆ getContainerRefId()

ilObjSessionGUI::getContainerRefId ( )

container ref id

Returns
int ref id

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

References $container_ref_id, and initContainer().

Referenced by materialsObject().

1906  {
1907  if (!$this->container_ref_id) {
1908  $this->initContainer();
1909  }
1910  return $this->container_ref_id;
1911  }
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 187 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$object.

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

188  {
189  return $this->object;
190  }
+ Here is the caller graph for this function:

◆ getDefaultMemberRole()

ilObjSessionGUI::getDefaultMemberRole ( )

Get default member role.

Returns
int

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

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

1936  {
1937  $local_roles = $GLOBALS['DIC']->rbac()->review()->getRolesOfRoleFolder($this->object->getRefId(), false);
1938 
1939  foreach ($local_roles as $role_id) {
1940  $title = ilObject::_lookupTitle($role_id);
1941  if (substr($title, 0, 19) == 'il_sess_participant') {
1942  return $role_id;
1943  }
1944  }
1945  return 0;
1946  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _lookupTitle($a_id)
lookup object title
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ getLocalRoles()

ilObjSessionGUI::getLocalRoles ( )

get all local roles

Returns
int[]

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

References $GLOBALS, and object.

1954  {
1955  return $GLOBALS['DIC']->rbac()->review()->getRolesOfRoleFolder($this->object->getRefId(), false);
1956  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create new PHPExcel object
obj_idprivate

◆ getTabs()

ilObjSessionGUI::getTabs ( )

Build tabs.

public

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

References $ilCtrl, ilObjectGUI\$tree, ilObject\_lookupType(), array, ilLearningProgressAccess\checkAccess(), and object.

1781  {
1782  global $ilAccess, $ilTabs, $tree, $ilCtrl, $ilHelp;
1783 
1784  $ilHelp->setScreenIdComponent("sess");
1785 
1786  $parent_id = $tree->getParentId($this->object->getRefId());
1787 
1788  // #11650
1789  $parent_type = ilObject::_lookupType($parent_id, true);
1790 
1791  $this->tabs_gui->setBackTarget(
1792  $this->lng->txt('back_to_' . $parent_type . '_content'),
1793  $ilCtrl->getLinkTarget($this, "redirectToParentContentPage")
1794  );
1795 
1796  $this->tabs_gui->addTarget(
1797  'info_short',
1798  $this->ctrl->getLinkTarget($this, 'infoScreen')
1799  );
1800 
1801  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1802  $this->tabs_gui->addTarget(
1803  'settings',
1804  $this->ctrl->getLinkTarget($this, 'edit')
1805  );
1806  $this->tabs_gui->addTarget(
1807  'crs_materials',
1808  $this->ctrl->getLinkTarget($this, 'materials')
1809  );
1810 
1811  $this->tabs_gui->addTab(
1812  'members',
1813  $this->lng->txt('event_edit_members'),
1814  $this->ctrl->getLinkTargetByClass('ilsessionmembershipgui', '')
1815  );
1816  }
1817 
1818  // learning progress
1819  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
1820  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1821  $this->tabs_gui->addTarget(
1822  'learning_progress',
1823  $this->ctrl->getLinkTargetByClass(array('ilobjsessiongui','illearningprogressgui'), ''),
1824  '',
1825  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
1826  );
1827  }
1828 
1829  // meta data
1830  if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
1831  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
1832  $mdgui = new ilObjectMetaDataGUI($this->object);
1833  $mdtab = $mdgui->getTab();
1834  if ($mdtab) {
1835  $this->tabs_gui->addTarget(
1836  "meta_data",
1837  $mdtab,
1838  "",
1839  "ilobjectmetadatagui"
1840  );
1841  }
1842  }
1843 
1844 
1845  // export
1846  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1847  $this->tabs_gui->addTarget(
1848  "export",
1849  $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1850  "",
1851  "ilexportgui"
1852  );
1853  }
1854 
1855 
1856  // edit permissions
1857  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
1858  $this->tabs_gui->addTarget(
1859  "perm_settings",
1860  $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"),
1861  array("perm","info","owner"),
1862  'ilpermissiongui'
1863  );
1864  }
1865  }
Class ilObjectMetaDataGUI.
global $ilCtrl
Definition: ilias.php:18
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ handleFileUpload()

ilObjSessionGUI::handleFileUpload ( )

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

References $counter, $file, ilObjectGUI\$tree, ilEventItems\getItems(), object, ilEventItems\setItems(), and ilUtil\stripSlashes().

Referenced by saveObject(), and updateObject().

746  {
747  global $tree;
748 
749  include_once './Modules/Session/classes/class.ilEventItems.php';
750  $ev = new ilEventItems($this->object->getId());
751  $items = $ev->getItems();
752 
753  $counter = 0;
754  while (true) {
755  if (!isset($_FILES['files']['name'][$counter])) {
756  break;
757  }
758  if (!strlen($_FILES['files']['name'][$counter])) {
759  $counter++;
760  continue;
761  }
762 
763  include_once './Modules/File/classes/class.ilObjFile.php';
764  $file = new ilObjFile();
765  $file->setTitle(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
766  $file->setDescription('');
767  $file->setFileName(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
768  $file->setFileType($_FILES['files']['type'][$counter]);
769  $file->setFileSize($_FILES['files']['size'][$counter]);
770  $file->create();
771  $new_ref_id = $file->createReference();
772  $file->putInTree($tree->getParentId($this->object->getRefId()));
773  $file->setPermissions($tree->getParentId($this->object->getRefId()));
774  $file->createDirectory();
775  $file->getUploadFile(
776  $_FILES['files']['tmp_name'][$counter],
777  $_FILES['files']['name'][$counter]
778  );
779 
780  $items[] = $new_ref_id;
781  $counter++;
782  }
783 
784  $ev->setItems($items);
785  $ev->update();
786  }
getItems()
get assigned items
$counter
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create new PHPExcel object
obj_idprivate
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
class ilEvent
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreen()

ilObjSessionGUI::infoScreen ( )

info screen

protected

Parameters

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

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

Referenced by executeCommand(), and infoScreenObject().

516  {
517  global $ilAccess, $ilUser,$ilCtrl,$tree,$ilToolbar,$lng;
518 
519  $this->checkPermission('visible');
520  $this->tabs_gui->setTabActive('info_short');
521 
522  $this->showJoinRequestButton();
523 
524  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
525  $info = new ilInfoScreenGUI($this);
526 
527 
528  $eventItems = ilObjectActivation::getItemsByEvent($this->object->getId());
529  $parent_id = $tree->getParentId($this->object->getRefId());
530  $parent_id = ilObject::_lookupObjId($parent_id);
531  $eventItems = ilContainerSorting::_getInstance($parent_id)->sortSubItems(
532  'sess',
533  $this->object->getId(),
534  $eventItems
535  );
536 
537  $lng->loadLanguageModule("cntr");// #14158
538 
539  $html = '';
540  foreach ($eventItems as $item) {
541  $list_gui = ilSessionObjectListGUIFactory::factory($item['type']);
542  $list_gui->setContainerObject($this);
543 
544  $this->modifyItemGUI($list_gui, $item, false);
545 
546  $html .= $list_gui->getListItemHTML(
547  $item['ref_id'],
548  $item['obj_id'],
549  $item['title'],
550  $item['description']
551  );
552  }
553 
554  if (strlen($html)) {
555  $info->addSection($this->lng->txt('event_materials'));
556  $info->addProperty(
557  '&nbsp;',
558  $html
559  );
560  }
561 
562 
563 
564  // Session information
565  if (strlen($this->object->getLocation()) or strlen($this->object->getDetails())) {
566  $info->addSection($this->lng->txt('event_section_information'));
567  }
568  if (strlen($location = $this->object->getLocation())) {
569  $info->addProperty(
570  $this->lng->txt('event_location'),
571  ilUtil::makeClickable(nl2br($this->object->getLocation()), true)
572  );
573  }
574  if (strlen($this->object->getDetails())) {
575  $info->addProperty(
576  $this->lng->txt('event_details_workflow'),
577  ilUtil::makeClickable(nl2br($this->object->getDetails()), true)
578  );
579  }
580 
581  $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'sess', $this->object->getId());
582  $record_gui->setInfoObject($info);
583  $record_gui->parse();
584 
585  // meta data
586  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
587 
588 
589  // Tutor information
590  if ($this->object->hasTutorSettings()) {
591  $info->addSection($this->lng->txt('event_tutor_data'));
592  if (strlen($fullname = $this->object->getName())) {
593  $info->addProperty(
594  $this->lng->txt('event_lecturer'),
595  $fullname
596  );
597  }
598  if (strlen($email = $this->object->getEmail())) {
599  $info->addProperty(
600  $this->lng->txt('tutor_email'),
601  $email
602  );
603  }
604  if (strlen($phone = $this->object->getPhone())) {
605  $info->addProperty(
606  $this->lng->txt('tutor_phone'),
607  $phone
608  );
609  }
610  }
611  // forward the command
612  $this->ctrl->forwardCommand($info);
613 
614  // store read event
615  require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
617  $this->object->getType(),
618  $this->object->getRefId(),
619  $this->object->getId(),
620  $ilUser->getId()
621  );
622  }
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:193
Class ilInfoScreenGUI.
showJoinRequestButton(ilToolbarGUI $ilToolbar=null)
static getItemsByEvent($a_event_id)
Get session material / event items.
$location
Definition: buildRTE.php:44
global $ilCtrl
Definition: ilias.php:18
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
Create new PHPExcel object
obj_idprivate
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 384 of file class.ilObjSessionGUI.php.

References infoScreen().

Referenced by addToDeskObject(), and removeFromDeskObject().

385  {
386  $this->ctrl->setCmd("showSummary");
387  $this->ctrl->setCmdClass("ilinfoscreengui");
388  $this->infoScreen();
389  }
+ 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 1150 of file class.ilObjSessionGUI.php.

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

Referenced by attendanceListObject(), and printAttendanceListObject().

1151  {
1152  $members_obj = $this->initContainer(true);
1153 
1154  include_once 'Services/Membership/classes/class.ilAttendanceList.php';
1155  $list = new ilAttendanceList(
1156  $this,
1157  $this->object,
1158  $members_obj
1159  );
1160  $list->setId('sessattlst');
1161 
1162  $event_app = $this->object->getFirstAppointment();
1164  $desc = ilDatePresentation::formatPeriod($event_app->getStart(), $event_app->getEnd());
1166  $desc .= " " . $this->object->getTitle();
1167  $list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
1168 
1169  $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
1170  $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
1171  if ($this->object->enabledRegistration()) {
1172  $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
1173  }
1174  $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1175  $list->addBlank($this->lng->txt('sess_signature'));
1176 
1177  $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1178 
1179  return $list;
1180  }
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.
Create new PHPExcel object
obj_idprivate
+ 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 1022 of file class.ilObjSessionGUI.php.

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

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

1023  {
1024  global $tree;
1025 
1026  $is_course = $is_group = false;
1027 
1028  // #13178
1029  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
1030  if ($this->container_ref_id) {
1031  $is_group = true;
1032  }
1033  if (!$this->container_ref_id) {
1034  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1035  if ($this->container_ref_id) {
1036  $is_course = true;
1037  }
1038  }
1039  if (!$this->container_ref_id) {
1040  ilUtil::sendFailure('No container object found. Aborting');
1041  return true;
1042  }
1043  $this->container_obj_id = ilObject::_lookupObjId($this->container_ref_id);
1044 
1045  if ($a_init_participants && $this->container_obj_id) {
1046  if ($is_course) {
1047  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
1048  return ilCourseParticipants::_getInstanceByObjId($this->container_obj_id);
1049  } elseif ($is_group) {
1050  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
1051  return ilGroupParticipants::_getInstanceByObjId($this->container_obj_id);
1052  }
1053  }
1054  }
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.
Create new PHPExcel object
obj_idprivate
+ 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 637 of file class.ilObjSessionGUI.php.

References $form, and initForm().

638  {
639  if (!is_object($this->object)) {
640  $this->object = new ilObjSession();
641  }
642  $this->initForm('create');
643  return $this->form;
644  }
initForm($a_mode)
Init Form.
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:

◆ initForm()

ilObjSessionGUI::initForm (   $a_mode)
protected

Init Form.

protected

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

References $_GET, $files, $form, $ilUser, $section, $title, ilRecurrenceInputGUI\allowUnlimitedRecurrences(), array, ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilObjectGUI\initDidacticTemplate(), ilYuiUtil\initDomEvent(), ilObjectServiceSettingsGUI\initServiceSettingsForm(), ilAdvancedMDRecordGUI\MODE_EDITOR, object, ilMembershipRegistrationSettings\REGISTRATION_LIMITED_USERS, ilFormPropertyGUI\setInfo(), ilAdvancedMDRecordGUI\setPropertyForm(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setValue(), ilTextAreaInputGUI\setValue(), ilMembershipRegistrationSettings\TYPE_DIRECT, ilMembershipRegistrationSettings\TYPE_NONE, and ilMembershipRegistrationSettings\TYPE_REQUEST.

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

1358  {
1359  global $ilUser;
1360 
1361  if (is_object($this->form)) {
1362  return true;
1363  }
1364 
1365  $this->lng->loadLanguageModule('dateplaner');
1366 
1367  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1368 
1369  include_once('./Services/YUI/classes/class.ilYuiUtil.php');
1371 
1372  $this->form = new ilPropertyFormGUI();
1373  $this->form->setMultipart(true);
1374  $this->form->setTableWidth('600px');
1375  $this->form->setFormAction($this->ctrl->getFormAction($this));
1376  $this->form->setMultipart(true);
1377 
1378  if ($a_mode == 'create') {
1379  $this->form = $this->initDidacticTemplate($this->form);
1380  }
1381 
1382  $this->lng->loadLanguageModule('dateplaner');
1383  include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
1384  $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
1385  $dur->setRequired(true);
1386  $dur->enableToggleFullTime(
1387  $this->lng->txt('event_fulltime_info'),
1388  $this->object->getFirstAppointment()->enabledFulltime() ? true : false
1389  );
1390  $dur->setShowTime(true);
1391  $dur->setStart($this->object->getFirstAppointment()->getStart());
1392  $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1393 
1394  $this->form->addItem($dur);
1395 
1396  /*
1397  // start
1398  $start = new ilDateTimeInputGUI($this->lng->txt('event_start_date'),'start');
1399  $start->setMinuteStepSize(5);
1400  $start->setDate($this->object->getFirstAppointment()->getStart());
1401  $start->setShowTime(true);
1402  #$this->form->addItem($start);
1403 
1404  // end
1405  $end = new ilDateTimeInputGUI($this->lng->txt('event_end_date'),'end');
1406  $end->setMinuteStepSize(5);
1407  $end->setDate($this->object->getFirstAppointment()->getEnd());
1408  $end->setShowTime(true);
1409  #$this->form->addItem($end);
1410  */
1411 
1412  // Recurrence
1413  if ($a_mode == 'create') {
1414  if (!is_object($this->rec)) {
1415  include_once('./Modules/Session/classes/class.ilEventRecurrence.php');
1416  $this->rec = new ilEventRecurrence();
1417  }
1418  include_once('./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
1419  $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
1420  $rec->allowUnlimitedRecurrences(false);
1421  $rec->setRecurrence($this->rec);
1422  $this->form->addItem($rec);
1423 
1424  // #14547
1425  $lp = new ilCheckboxInputGUI($this->lng->txt("sess_lp_preset"), "lp_preset");
1426  $lp->setInfo($this->lng->txt("sess_lp_preset_info"));
1427  $lp->setChecked(true);
1428  $this->form->addItem($lp);
1429  }
1430 
1432  $section->setTitle($this->lng->txt('event_section_information'));
1433  $this->form->addItem($section);
1434 
1435  // title
1436  $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title');
1437  $title->setValue($this->object->getTitle());
1438  $title->setSize(50);
1439  $title->setMaxLength(70);
1440  $this->form->addItem($title);
1441 
1442  // desc
1443  $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc');
1444  $desc->setValue($this->object->getLongDescription());
1445  $desc->setRows(4);
1446  $desc->setCols(50);
1447  $this->form->addItem($desc);
1448 
1449  // location
1450  $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location');
1451  $desc->setValue($this->object->getLocation());
1452  $desc->setRows(4);
1453  $desc->setCols(50);
1454  $this->form->addItem($desc);
1455 
1456  // workflow
1457  $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details');
1458  $details->setValue($this->object->getDetails());
1459  $details->setCols(50);
1460  $details->setRows(4);
1461  $this->form->addItem($details);
1462 
1463  if ($a_mode == 'create') {
1464  $this->record_gui = new ilAdvancedMDRecordGUI(
1466  'sess'
1467  );
1468  $this->record_gui->setRefId((int) $_GET['ref_id']);
1469  } else {
1470  $this->record_gui = new ilAdvancedMDRecordGUI(
1472  'sess',
1473  $this->object->getId()
1474  );
1475  }
1476  $this->record_gui->setPropertyForm($this->form);
1477  $this->record_gui->parse();
1478 
1479 
1480  // section
1482  $section->setTitle($this->lng->txt('event_tutor_data'));
1483  $this->form->addItem($section);
1484 
1485  // name
1486  $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name');
1487  $tutor_name->setValue($this->object->getName());
1488  $tutor_name->setSize(20);
1489  $tutor_name->setMaxLength(70);
1490  $this->form->addItem($tutor_name);
1491 
1492  // email
1493  $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email');
1494  $tutor_email->setValue($this->object->getEmail());
1495  $tutor_email->setSize(20);
1496  $tutor_email->setMaxLength(70);
1497  $this->form->addItem($tutor_email);
1498 
1499  // phone
1500  $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone');
1501  $tutor_phone->setValue($this->object->getPhone());
1502  $tutor_phone->setSize(20);
1503  $tutor_phone->setMaxLength(70);
1504  $this->form->addItem($tutor_phone);
1505 
1507  $section->setTitle($this->lng->txt('sess_section_reg'));
1508  $this->form->addItem($section);
1509 
1510  include_once './Modules/Session/classes/class.ilSessionMembershipRegistrationSettingsGUI.php';
1511  include_once './Services/Membership/classes/class.ilMembershipRegistrationSettings.php';
1512  $reg_settings = new ilSessionMembershipRegistrationSettingsGUI(
1513  $this,
1514  $this->object,
1515  array(
1520  )
1521  );
1522  $reg_settings->addMembershipFormElements($this->form, '');
1523 
1524 
1526  $section->setTitle($this->lng->txt('event_assign_files'));
1527  $this->form->addItem($section);
1528 
1529  $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
1530  $files->setFilenames(array(0 => ''));
1531  $this->form->addItem($files);
1532 
1533  $features = new ilFormSectionHeaderGUI();
1534  $features->setTitle($this->lng->txt('obj_features'));
1535  $this->form->addItem($features);
1537  $this->object->getId(),
1538  $this->form,
1539  array(
1541  )
1542  );
1543 
1544 
1545  switch ($a_mode) {
1546  case 'create':
1547  $this->form->setTitle($this->lng->txt('event_table_create'));
1548 
1549  $this->form->addCommandButton('save', $this->lng->txt('event_btn_add'));
1550  $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit'));
1551  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
1552 
1553  return true;
1554 
1555  case 'edit':
1556  $this->form->setTitle($this->lng->txt('event_table_update'));
1557 
1558  $this->form->addCommandButton('update', $this->lng->txt('save'));
1559  $this->form->addCommandButton('cancelEdit', $this->lng->txt('cancel'));
1560 
1561  return true;
1562  }
1563  return true;
1564  }
This class represents a property form user interface.
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
input GUI for a time span (start and end date)
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
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
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.
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 264 of file class.ilObjSessionGUI.php.

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

265  {
266  global $ilUser;
267 
268  $this->checkPermission('read');
269 
270  if ($ilUser->isAnonymous()) {
271  $this->ctrl->redirect($this, 'infoScreen');
272  }
273 
274  include_once './Modules/Session/classes/class.ilEventParticipants.php';
275 
276  if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->object->getId())) {
277  $_SESSION['sess_hide_info'] = true;
278  ilEventParticipants::_unregister($ilUser->getId(), $this->object->getId());
279  ilUtil::sendSuccess($this->lng->txt('event_unregistered'), true);
280  } else {
281  ilEventParticipants::_register($ilUser->getId(), $this->object->getId());
282  ilUtil::sendSuccess($this->lng->txt('event_registered'), true);
283  }
284 
285  $this->ctrl->redirect($this, 'infoScreen');
286  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _unregister($a_usr_id, $a_event_id)
$_SESSION["AccountId"]
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 1573 of file class.ilObjSessionGUI.php.

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

Referenced by saveObject(), and updateObject().

1574  {
1575  $event = $this->form->getItemByPostVar('event');
1576  if ($event->getStart() && $event->getEnd()) {
1577  $this->object->getFirstAppointment()->setStartingTime($event->getStart()->get(IL_CAL_UNIX));
1578  $this->object->getFirstAppointment()->setEndingTime($event->getStart()->get(IL_CAL_UNIX));
1579  $this->object->getFirstAppointment()->setStart($event->getStart());
1580  $this->object->getFirstAppointment()->setEnd($event->getEnd());
1581  $this->object->getFirstAppointment()->toggleFulltime($event->getStart() instanceof ilDate);
1582  }
1583 
1584  $this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
1585  $this->object->setDescription(ilUtil::stripSlashes($_POST['desc']));
1586  $this->object->setLocation(ilUtil::stripSlashes($_POST['location']));
1587  $this->object->setName(ilUtil::stripSlashes($_POST['tutor_name']));
1588  $this->object->setPhone(ilUtil::stripSlashes($_POST['tutor_phone']));
1589  $this->object->setEmail(ilUtil::stripSlashes($_POST['tutor_email']));
1590  $this->object->setDetails(ilUtil::stripSlashes($_POST['details']));
1591 
1592  $this->object->setRegistrationType((int) $_POST['registration_type']);
1593  // $this->object->setRegistrationMinUsers((int) $_POST['registration_min_members']);
1594  $this->object->setRegistrationMaxUsers((int) $_POST['registration_max_members']);
1595  $this->object->enableRegistrationUserLimit((int) $_POST['registration_membership_limited']);
1596 
1597  switch ((int) $_POST['waiting_list']) {
1598  case 2:
1599  $this->object->enableRegistrationWaitingList(true);
1600  $this->object->setWaitingListAutoFill(true);
1601  break;
1602 
1603  case 1:
1604  $this->object->enableRegistrationWaitingList(true);
1605  $this->object->setWaitingListAutoFill(false);
1606  break;
1607 
1608  default:
1609  $this->object->enableRegistrationWaitingList(false);
1610  $this->object->setWaitingListAutoFill(false);
1611  break;
1612  }
1613  }
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 1621 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().

1622  {
1623  include_once('./Modules/Session/classes/class.ilSessionRecurrence.php');
1624  $this->rec = new ilSessionRecurrence();
1625 
1626  switch ($_POST['frequence']) {
1627  case IL_CAL_FREQ_DAILY:
1628  $this->rec->setFrequenceType($_POST['frequence']);
1629  $this->rec->setInterval((int) $_POST['count_DAILY']);
1630  break;
1631 
1632  case IL_CAL_FREQ_WEEKLY:
1633  $this->rec->setFrequenceType($_POST['frequence']);
1634  $this->rec->setInterval((int) $_POST['count_WEEKLY']);
1635  if (is_array($_POST['byday_WEEKLY'])) {
1636  $this->rec->setBYDAY(ilUtil::stripSlashes(implode(',', $_POST['byday_WEEKLY'])));
1637  }
1638  break;
1639 
1640  case IL_CAL_FREQ_MONTHLY:
1641  $this->rec->setFrequenceType($_POST['frequence']);
1642  $this->rec->setInterval((int) $_POST['count_MONTHLY']);
1643  switch ((int) $_POST['subtype_MONTHLY']) {
1644  case 0:
1645  // nothing to do;
1646  break;
1647 
1648  case 1:
1649  switch ((int) $_POST['monthly_byday_day']) {
1650  case 8:
1651  // Weekday
1652  $this->rec->setBYSETPOS((int) $_POST['monthly_byday_num']);
1653  $this->rec->setBYDAY('MO,TU,WE,TH,FR');
1654  break;
1655 
1656  case 9:
1657  // Day of month
1658  $this->rec->setBYMONTHDAY((int) $_POST['monthly_byday_num']);
1659  break;
1660 
1661  default:
1662  $this->rec->setBYDAY((int) $_POST['monthly_byday_num'] . $_POST['monthly_byday_day']);
1663  break;
1664  }
1665  break;
1666 
1667  case 2:
1668  $this->rec->setBYMONTHDAY((int) $_POST['monthly_bymonthday']);
1669  break;
1670  }
1671  break;
1672 
1673  case IL_CAL_FREQ_YEARLY:
1674  $this->rec->setFrequenceType($_POST['frequence']);
1675  $this->rec->setInterval((int) $_POST['count_YEARLY']);
1676  switch ((int) $_POST['subtype_YEARLY']) {
1677  case 0:
1678  // nothing to do;
1679  break;
1680 
1681  case 1:
1682  $this->rec->setBYMONTH((int) $_POST['yearly_bymonth_byday']);
1683  $this->rec->setBYDAY((int) $_POST['yearly_byday_num'] . $_POST['yearly_byday']);
1684  break;
1685 
1686  case 2:
1687  $this->rec->setBYMONTH((int) $_POST['yearly_bymonth_by_monthday']);
1688  $this->rec->setBYMONTHDAY((int) $_POST['yearly_bymonthday']);
1689  break;
1690  }
1691  break;
1692  }
1693 
1694  // UNTIL
1695  switch ((int) $_POST['until_type']) {
1696  case 1:
1697  $this->rec->setFrequenceUntilDate(null);
1698  // nothing to do
1699  break;
1700 
1701  case 2:
1702  $this->rec->setFrequenceUntilDate(null);
1703  $this->rec->setFrequenceUntilCount((int) $_POST['count']);
1704  break;
1705 
1706  case 3:
1707  $frequence = $this->form->getItemByPostVar('frequence');
1708  $end = $frequence->getRecurrence()->getFrequenceUntilDate();
1709  $this->rec->setFrequenceUntilCount(0);
1710  $this->rec->setFrequenceUntilDate($end);
1711  break;
1712  }
1713  }
const IL_CAL_FREQ_MONTHLY
$end
Definition: saml1-acs.php:18
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

protected

Parameters

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

References ilObjectGUI\$objDefinition, $tbl, ilObjectGUI\$tree, array, getContainerRefId(), and object.

1064  {
1065  global $tree, $objDefinition;
1066 
1067  $this->tabs_gui->setTabActive('crs_materials');
1068 
1069  // #11337 - support ANY parent container (crs, grp, fld)
1070  $parent_ref_id = $tree->getParentId($this->object->getRefId());
1071 
1072  include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
1073  $gui = new ilObjectAddNewItemGUI($parent_ref_id);
1074  $gui->setDisabledObjectTypes(array("itgr", "sess"));
1075  $gui->setAfterCreationCallback($this->ref_id);
1076  $gui->render();
1077 
1078  include_once 'Modules/Session/classes/class.ilEventItems.php';
1079  $this->event_items = new ilEventItems($this->object->getId());
1080 
1081  include_once 'Modules/Session/classes/class.ilSessionMaterialsTableGUI.php';
1082  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1083  $tbl->setTitle($this->lng->txt("event_assign_materials_table"));
1084  $tbl->setDescription($this->lng->txt('event_assign_materials_info'));
1085 
1086  $tbl->setMaterialItems($this->event_items->getItems());
1087  $tbl->setContainerRefId($this->getContainerRefId());
1088  $tbl->getDataFromDb();
1089 
1090  $this->tpl->setContent($tbl->getHTML());
1091  }
$tbl
Definition: example_048.php:81
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
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 178 of file class.ilObjSessionGUI.php.

179  {
180  $this->ctrl->redirectByClass('ilSessionMembershipGUI', 'participants');
181  }

◆ 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 398 of file class.ilObjSessionGUI.php.

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

Referenced by infoScreen().

399  {
400  global $tree;
401 
402  // if folder is in a course, modify item list gui according to course requirements
403  if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs')) {
404  // #10611
405  include_once "Services/Object/classes/class.ilObjectActivation.php";
406  ilObjectActivation::addListGUIActivationProperty($a_item_list_gui, $a_item_data);
407 
408  include_once("./Modules/Course/classes/class.ilObjCourse.php");
409  include_once("./Modules/Course/classes/class.ilObjCourseGUI.php");
410  $course_obj_id = ilObject::_lookupObjId($course_ref_id);
412  $a_item_list_gui,
413  get_class($this),
414  $a_item_data,
415  $a_show_path,
416  ilObjCourse::_lookupAboStatus($course_obj_id),
417  $course_ref_id,
418  $course_obj_id,
419  $this->object->getRefId()
420  );
421  }
422  }
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)
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

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

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

References $title, ilObjectGUI\getCreationMode(), and object.

Referenced by executeCommand().

196  {
197  parent::prepareOutput($a_show_subobjects);
198 
199  if (!$this->getCreationMode()) {
200  $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
201 
202  include_once './Modules/Session/classes/class.ilSessionAppointment.php';
203  $this->tpl->setTitle(
204  $this->object->getFirstAppointment()->appointmentToString() . $title
205  );
206  }
207  }
Create new PHPExcel object
obj_idprivate
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 1187 of file class.ilObjSessionGUI.php.

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

1188  {
1189  $this->checkPermission('write');
1190 
1191  $list = $this->initAttendanceList();
1192  $list->initFromForm();
1193  $list->setCallback(array($this, 'getAttendanceListUserData'));
1194 
1195  include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1196  $this->event_part = new ilEventParticipants($this->object->getId());
1197 
1198  echo $list->getFullscreenHTML();
1199  exit();
1200  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
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 1890 of file class.ilObjSessionGUI.php.

References array.

1891  {
1892  $tmp_data = array();
1893  foreach ($a_usr_ids as $usr_id) {
1894  $tmp_data[$usr_id] = array();
1895  }
1896  return $tmp_data;
1897  }
Create styles array
The data for the language used.

◆ redirectToParentContentPageObject()

ilObjSessionGUI::redirectToParentContentPageObject ( )
protected

Redirect to parent content page.

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

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

1753  {
1754  global $DIC;
1755 
1756  $objDefinition = $DIC['objDefinition'];
1757 
1758  $tree = $DIC->repositoryTree();
1759  $ctrl = $DIC->ctrl();
1760 
1761  $parent_id = $tree->getParentId($this->object->getRefId());
1762 
1763  // #11650
1764  $parent_type = ilObject::_lookupType($parent_id, true);
1765 
1766  $parent_class = $objDefinition->getClassName($parent_type);
1767  $parent_class = 'ilObj' . $parent_class . 'GUI';
1768 
1769  $ctrl->setParameterByClass($parent_class, "ref_id", $parent_id);
1770  $ctrl->redirectByClass($parent_class, "view");
1771  }
global $DIC
Definition: saml.php:7
static _lookupType($a_id, $a_reference=false)
lookup object type
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ registerObject()

ilObjSessionGUI::registerObject ( )

register to session

public

Parameters

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

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

217  {
218  global $ilUser;
219 
220  $this->checkPermission('visible');
221 
222  include_once './Services/Membership/classes/class.ilParticipants.php';
223  $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
224 
225  include_once './Modules/Session/classes/class.ilEventParticipants.php';
226  $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
227  if (
228  $this->getCurrentObject()->isRegistrationUserLimitEnabled() and
229  $this->getCurrentObject()->getRegistrationMaxUsers() and
230  (count($event_part->getRegistered()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
231  ) {
232  include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
233  $wait = new ilSessionWaitingList($this->getCurrentObject()->getId());
234  $wait->addToList($ilUser->getId());
235  ilUtil::sendInfo($this->lng->txt('sess_reg_added_to_wl'), true);
236  $this->ctrl->redirect($this, 'infoScreen');
237  return true;
238  }
239 
240 
241  switch ($this->getCurrentObject()->getRegistrationType()) {
243  $this->ctrl->redirect($this, 'info');
244  break;
245 
247  $part->register($ilUser->getId());
248  ilUtil::sendSuccess($this->lng->txt('event_registered'), true);
249  $this->ctrl->redirect($this, 'infoScreen');
250  break;
251 
253  ilUtil::sendSuccess($this->lng->txt('sess_registered_confirm'), true);
254  $part->addSubscriber($ilUser->getId());
255  $this->ctrl->redirect($this, 'infoScreen');
256  break;
257  }
258  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 371 of file class.ilObjSessionGUI.php.

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

372  {
373  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
375  $this->infoScreenObject();
376  }
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:

◆ saveAndAssignMaterialsObject()

ilObjSessionGUI::saveAndAssignMaterialsObject ( )

Save and assign sessoin materials.

protected

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

References $ilLog, object, and ilObjectGUI\saveObject().

652  {
653  global $ilLog;
654 
655  $this->saveObject(false);
656 
657  $this->ctrl->setParameter($this, 'ref_id', $this->object->getRefId());
658  $this->ctrl->setParameter($this, 'new_type', '');
659  $this->ctrl->redirect($this, 'materials');
660  }
saveObject()
save object
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ saveMaterialsObject()

ilObjSessionGUI::saveMaterialsObject ( )

save material assignment

public

Parameters

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

References $_POST, $tbl, array, object, and ilUtil\sendSuccess().

1101  {
1102  include_once './Modules/Session/classes/class.ilEventItems.php';
1103 
1104  $this->event_items = new ilEventItems($this->object->getId());
1105 
1106  $list_items = is_array($_POST['all_items']) ? $_POST['all_items'] : array();
1107  $list_items_checked = is_array($_POST['items']) ? $_POST['items'] : array();
1108 
1109  $checked = $this->event_items->getItems();
1110  $checked = array_diff($checked, $list_items);//remove all visible items in list
1111  $checked = array_merge($checked, $list_items_checked);//add checked items in list
1112 
1113  $this->event_items->setItems($checked);
1114  $this->event_items->update();
1115 
1116  include_once 'Modules/Session/classes/class.ilSessionMaterialsTableGUI.php';
1117  $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1118  $tbl->setOffset(0);
1119  $tbl->storeNavParameter();//remove offset and go to page 1
1120 
1121  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1122  $this->ctrl->redirect($this, 'materials');
1123  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$tbl
Definition: example_048.php:81
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
$_POST["username"]
class ilEvent
+ 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 669 of file class.ilObjSessionGUI.php.

References $_GET, $form, ilObjectGUI\$ilErr, $ilUser, array, ilObjectGUI\createObject(), createRecurringSessions(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilObjectGUI\getDidacticTemplateVar(), handleFileUpload(), initForm(), load(), loadRecurrenceSettings(), ilLPObjSettings\LP_MODE_DEACTIVATED, object, ilUtil\sendFailure(), ilUtil\sendInfo(), ilLPObjSettings\setMode(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

670  {
671  global $ilErr,$ilUser;
672 
673  $this->object = new ilObjSession();
674 
675  $this->ctrl->saveParameter($this, "new_type");
676 
677  $this->initForm('create');
678  $ilErr->setMessage('');
679  if (!$this->form->checkInput()) {
680  $ilErr->setMessage($this->lng->txt('err_check_input'));
681  }
682 
683  if (!$this->record_gui->importEditFormPostValues()) {
684  $ilErr->setMessage($this->lng->txt('err_check_input'));
685  }
686 
687  $this->load();
688  $this->loadRecurrenceSettings();
689 
690  $this->object->validate();
691  $this->object->getFirstAppointment()->validate();
692 
693  if (strlen($ilErr->getMessage())) {
694  ilUtil::sendFailure($ilErr->getMessage());
695  $this->form->setValuesByPost();
696  $this->createObject();
697  return false;
698  }
699  // Create session
700  $this->object->create();
701  $this->object->createReference();
702  $this->object->putInTree($_GET["ref_id"]);
703  $this->object->setPermissions($_GET["ref_id"]);
704 
706  $this->object->getId(),
707  $this->form,
708  array(
710  )
711  );
712  $this->record_gui->writeEditForm($this->object->getId());
713 
714 
715  // apply didactic template?
716  $dtpl = $this->getDidacticTemplateVar("dtpl");
717  if ($dtpl) {
718  $this->object->applyDidacticTemplate($dtpl);
719  }
720 
721  // #14547 - active is default
722  if (!$this->form->getInput("lp_preset")) {
723  include_once "Services/Tracking/classes/class.ilLPObjSettings.php";
724  $lp_obj_settings = new ilLPObjSettings($this->object->getId());
726  $lp_obj_settings->update(false);
727  }
728 
729  // create appointment
730  $this->object->getFirstAppointment()->setSessionId($this->object->getId());
731  $this->object->getFirstAppointment()->create();
732 
733  $this->handleFileUpload();
734 
735  $this->createRecurringSessions($this->form->getInput("lp_preset"));
736 
737  if ($a_redirect_on_success) {
738  ilUtil::sendInfo($this->lng->txt('event_add_new_event'), true);
739  $this->ctrl->returnToParent($this);
740  }
741 
742  return true;
743  }
loadRecurrenceSettings()
load recurrence settings
initForm($a_mode)
Init Form.
$_GET["client_id"]
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.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
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 629 of file class.ilObjSessionGUI.php.

References $_GET, $file, and ilUtil\deliverFile().

630  {
631  $file = new ilSessionFile((int) $_GET['file_id']);
632 
633  ilUtil::deliverFile($file->getAbsolutePath(), $file->getFileName(), $file->getFileType());
634  return true;
635  }
$_GET["client_id"]
class ilEvent
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
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 438 of file class.ilObjSessionGUI.php.

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

Referenced by infoScreen(), and showJoinRequestButtonInCalendar().

439  {
440  global $ilUser;
441 
442  if (!$ilToolbar) {
443  global $ilToolbar;
444  }
445 
446  if (!$this->getCurrentObject()->enabledRegistration() || $ilUser->isAnonymous()) {
447  return false;
448  }
449 
450  include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
451 
452  include_once './Services/Membership/classes/class.ilParticipants.php';
453  $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
454 
455  include_once './Modules/Session/classes/class.ilEventParticipants.php';
456 
457  $btn_attend = ilLinkButton::getInstance();
458  $btn_attend->addCSSClass("btn-primary");
459  $this->ctrl->setParameter($this, "ref_id", $this->getCurrentObject()->getRefId());
460 
461  if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->getCurrentObject()->getId())) {
462  $btn_attend->setCaption($this->lng->txt("event_unregister"), false);
463  $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "unregister"));
464  $ilToolbar->addButtonInstance($btn_attend);
465  return true;
466  } elseif ($part->isSubscriber($ilUser->getId())) {
467  $btn_attend->setCaption($this->lng->txt("event_unregister"), false);
468  $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "unregister"));
469  $ilToolbar->addButtonInstance($btn_attend);
470  return true;
471  } elseif (ilSessionWaitingList::_isOnList($ilUser->getId(), $this->getCurrentObject()->getId())) {
472  $btn_attend->setCaption($this->lng->txt("leave_waiting_list"), false);
473  $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "unregister"));
474  $ilToolbar->addButtonInstance($btn_attend);
475  return true;
476  }
477 
478  $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
479 
480  if (
481  $this->getCurrentObject()->isRegistrationUserLimitEnabled() and
482  $this->getCurrentObject()->getRegistrationMaxUsers() and
483  (count($event_part->getRegistered()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
484  ) {
485  if ($this->getCurrentObject()->isRegistrationWaitingListEnabled()) {
486  ilUtil::sendInfo($this->lng->txt('sess_reg_max_users_exceeded_wl'));
487  $btn_attend->setCaption($this->lng->txt("mem_add_to_wl"), false);
488  $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register"));
489  $ilToolbar->addButtonInstance($btn_attend);
490  return true;
491  } else {
492  ilUtil::sendInfo($this->lng->txt('sess_reg_max_users_exceeded'));
493  return true;
494  }
495  } else {
496  if (!isset($_SESSION['sess_hide_info'])) {
497  ilUtil::sendInfo($this->lng->txt('sess_join_info'));
498  $btn_attend->setCaption($this->lng->txt("join_session"), false);
499  $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register"));
500  $ilToolbar->addButtonInstance($btn_attend);
501  return true;
502  }
503  }
504  }
$_SESSION["AccountId"]
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.
Create styles array
The data for the language used.
+ 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 429 of file class.ilObjSessionGUI.php.

References showJoinRequestButton().

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

◆ unregisterObject()

ilObjSessionGUI::unregisterObject ( )

unregister from session

public

Returns

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

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

295  {
296  global $ilUser;
297 
298  include_once './Modules/Session/classes/class.ilSessionParticipants.php';
299  $part = ilSessionParticipants::getInstance($this->object->getRefId());
300  if ($part->isSubscriber($ilUser->getId())) {
301  $part->deleteSubscriber($ilUser->getId());
302  }
303 
304  $part->unregister($ilUser->getId());
305 
306  include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
307  ilSessionWaitingList::deleteUserEntry($ilUser->getId(), $this->getCurrentObject()->getId());
308 
309  // check for visible permission of user
311  $GLOBALS['DIC']->access()->clear();
312  $has_access = $GLOBALS['DIC']->access()->checkAccessOfUser(
313  $GLOBALS['DIC']->user()->getId(),
314  'visible',
315  '',
316  $this->object->getRefId()
317  );
318  if (!$has_access) {
319  $parent = $GLOBALS['DIC']->repositoryTree()->getParentId($this->object->getRefId());
320  $this->redirectToRefId($parent);
321  return;
322  }
323 
324  ilUtil::sendSuccess($this->lng->txt('event_unregistered'), true);
325  $this->ctrl->returnToParent($this);
326  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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...
Create new PHPExcel object
obj_idprivate
static deleteUserEntry($a_usr_id, $a_obj_id)
Delete one user entry.
+ Here is the call graph for this function:

◆ updateObject()

ilObjSessionGUI::updateObject ( )

update object

protected

Parameters

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

References $form, ilObjectGUI\$ilErr, array, ilObjectServiceSettingsGUI\CUSTOM_METADATA, editObject(), handleFileUpload(), initForm(), load(), object, ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

905  {
906  global $ilErr;
907 
908  $old_autofill = $this->object->hasWaitingListAutoFill();
909 
910  $this->initForm('edit');
911  $ilErr->setMessage('');
912  if (!$this->form->checkInput()) {
913  $ilErr->setMessage($this->lng->txt('err_check_input'));
914  }
915 
916  if (!$this->record_gui->importEditFormPostValues()) {
917  $ilErr->setMessage($this->lng->txt('err_check_input'));
918  }
919 
920 
921  $this->load();
922 
923  $this->object->validate();
924  $this->object->getFirstAppointment()->validate();
925 
926  if (strlen($ilErr->getMessage())) {
927  ilUtil::sendFailure($ilErr->getMessage());
928  $this->editObject();
929  return false;
930  }
931  // Update event
932  $this->object->update();
933  $this->object->getFirstAppointment()->update();
934 
936  $this->object->getId(),
937  $this->form,
938  array(
940  )
941  );
942  $this->record_gui->writeEditForm();
943  $this->handleFileUpload();
944 
945  // if autofill has been activated trigger process
946  if (!$old_autofill &&
947  $this->object->hasWaitingListAutoFill()) {
948  $this->object->handleAutoFill();
949  }
950 
951  ilUtil::sendSuccess($this->lng->txt('event_updated'), true);
952  $this->ctrl->redirect($this, 'edit');
953  #$this->object->initFiles();
954  #$this->editObject();
955  return true;
956  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initForm($a_mode)
Init Form.
if(isset($_POST['submit'])) $form
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
+ 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(), and attendanceListObject().


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