ILIAS  release_4-4 Revision
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...
 
 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. More...
 
 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...
 
 setShowHidePrefs ()
 set preferences (show/hide tabel content) More...
 
 updateMembersObject ()
 update participants 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 ($tabs_gui)
 Build tabs. More...
 
 afterSaveCallback (ilObject $a_obj)
 Custom callback after object is created (in parent containert. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 editObject ()
 edit object More...
 
 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
 
 $ilias
 
 $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

 prepareOutput ()
 
 initCreateForm ($a_new_type)
 
 createRecurringSessions ()
 create recurring sessions More...
 
 initContainer ($a_init_participants=false)
 
 membersObject ()
 Show participants table. More...
 
 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...
 
 formatPath ($a_ref_id)
 format path More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 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...
 
 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...
 
 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)
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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

 $container_ref_id = 0
 
 $container_obj_id = 0
 
 $files = array()
 

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

References $ilCtrl, $lng, and $tpl.

40  {
41  global $ilCtrl, $lng, $tpl;
42 
43  $this->type = "sess";
44  parent::__construct($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
45 
46  $this->lng = $lng;
47  $this->lng->loadLanguageModule("event");
48  $this->lng->loadLanguageModule('crs');
49  $this->lng->loadLanguageModule('trac');
50 
51  $this->tpl = $tpl;
52  $this->ctrl = $ilCtrl;
53  }
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ __toUnix()

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

protected

Parameters

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

Referenced by load().

1705  {
1706  return mktime($time['h'],$time['m'],0,$date['m'],$date['d'],$date['y']);
1707  }
+ Here is the caller graph for this function:

◆ _goto()

static ilObjSessionGUI::_goto (   $a_target)
static

goto

public

Parameters

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

References $ilErr, $lng, and ilObjectGUI\_gotoRepositoryNode().

225  {
226  global $ilAccess,$ilErr,$lng;
227 
228  if($ilAccess->checkAccess('visible', "", $a_target))
229  {
230  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
231  }
232  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
233  }
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSessionGUI::addLocatorItems ( )

Add session locator.

public

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

References $_GET.

1743  {
1744  global $ilLocator;
1745 
1746  if (is_object($this->object))
1747  {
1748  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
1749  }
1750  }
$_GET["client_id"]

◆ addToDeskObject()

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

Implements ilDesktopItemHandling.

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

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

239  {
240  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
242  $this->infoScreenObject();
243  }
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 1809 of file class.ilObjSessionGUI.php.

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

1810  {
1811  // add new object to materials
1812  include_once './Modules/Session/classes/class.ilEventItems.php';
1813  $event_items = new ilEventItems($this->object->getId());
1814  $event_items->addItem($a_obj->getRefId());
1815  $event_items->update();
1816 
1817  /*
1818  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
1819  $this->ctrl->redirect($this, "materials");
1820  */
1821  }
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 1123 of file class.ilObjSessionGUI.php.

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

1124  {
1125  global $tpl,$ilTabs;
1126 
1127  $this->checkPermission('write');
1128  $ilTabs->setTabActive('event_edit_members');
1129 
1130  $list = $this->initAttendanceList();
1131  $form = $list->initForm('printAttendanceList');
1132  $tpl->setContent($form->getHTML());
1133  }
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:

◆ confirmDeleteFilesObject()

ilObjSessionGUI::confirmDeleteFilesObject ( )

confirm delete files

public

Parameters

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

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

712  {
713  $this->tabs_gui->setTabActive('settings');
714 
715  if(!count($_POST['file_id']))
716  {
717  ilUtil::sendFailure($this->lng->txt('select_one'));
718  $this->editObject();
719  return false;
720  }
721 
722  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
723  $c_gui = new ilConfirmationGUI();
724 
725  // set confirm/cancel commands
726  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteFiles"));
727  $c_gui->setHeaderText($this->lng->txt("info_delete_sure"));
728  $c_gui->setCancel($this->lng->txt("cancel"), "edit");
729  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteFiles");
730 
731  // add items to delete
732  foreach($_POST["file_id"] as $file_id)
733  {
734  $file = new ilSessionFile($file_id);
735  if($file->getSessionId() != $this->object->getEventId())
736  {
737  ilUtil::sendFailure($this->lng->txt('select_one'));
738  $this->edit();
739  return false;
740  }
741  $c_gui->addItem("file_id[]", $file_id, $file->getFileName());
742  }
743 
744  $this->tpl->setContent($c_gui->getHTML());
745  return true;
746  }
print $file
$_POST['username']
Definition: cron.php:12
class ilEvent
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Confirmation screen class.
+ Here is the call graph for this function:

◆ createRecurringSessions()

ilObjSessionGUI::createRecurringSessions ( )
protected

create recurring sessions

protected

Parameters

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

References ilObjectGUI\$tree, ilCalendarRecurrenceCalculator\calculateDateList(), ilEventItems\getItems(), IL_CAL_UNIX, IL_CAL_YEAR, and ilEventItems\setItems().

Referenced by saveObject().

574  {
575  global $tree;
576 
577  if(!$this->rec->getFrequenceType())
578  {
579  return true;
580  }
581  include_once('./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php');
582  $calc = new ilCalendarRecurrenceCalculator($this->object->getFirstAppointment(),$this->rec);
583 
584  $period_start = clone $this->object->getFirstAppointment()->getStart();
585 
586 
587  $period_end = clone $this->object->getFirstAppointment()->getStart();
588  $period_end->increment(IL_CAL_YEAR,5);
589  $date_list = $calc->calculateDateList($period_start,$period_end);
590 
591  $period_diff = $this->object->getFirstAppointment()->getEnd()->get(IL_CAL_UNIX) -
592  $this->object->getFirstAppointment()->getStart()->get(IL_CAL_UNIX);
593  $parent_id = $tree->getParentId($this->object->getRefId());
594 
595  include_once './Modules/Session/classes/class.ilEventItems.php';
596  $evi = new ilEventItems($this->object->getId());
597  $eitems = $evi->getItems();
598 
599  $counter = 0;
600  foreach($date_list->get() as $date)
601  {
602  if(!$counter++)
603  {
604  continue;
605  }
606 
607  $new_obj = $this->object->cloneObject($parent_id);
608  $new_obj->read();
609  $new_obj->getFirstAppointment()->setStartingTime($date->get(IL_CAL_UNIX));
610  $new_obj->getFirstAppointment()->setEndingTime($date->get(IL_CAL_UNIX) + $period_diff);
611  $new_obj->getFirstAppointment()->update();
612  $new_obj->update();
613 
614  $new_evi = new ilEventItems($new_obj->getId());
615  $new_evi->setItems($eitems);
616  $new_evi->update();
617  }
618  }
getItems()
get assigned items
const IL_CAL_UNIX
calculateDateList(ilDateTime $a_start, ilDateTime $a_end, $a_limit=-1)
calculate date list
Calculates an ilDateList for a given calendar entry and recurrence rule.
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 755 of file class.ilObjSessionGUI.php.

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

756  {
757  if(!count($_POST['file_id']))
758  {
759  ilUtil::sendFailure($this->lng->txt('select_one'));
760  $this->editObject();
761  return false;
762  }
763  foreach($_POST['file_id'] as $id)
764  {
765  $file = new ilSessionFile($id);
766  $file->delete();
767  }
768  $this->object->initFiles();
769  $this->editObject();
770  return true;
771  }
print $file
$_POST['username']
Definition: cron.php:12
class ilEvent
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ editObject()

ilObjSessionGUI::editObject ( )

edit object

protected

Parameters

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

References $file, and initForm().

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

629  {
630  $this->tabs_gui->setTabActive('settings');
631 
632  $this->initForm('edit');
633  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.sess_edit.html','Modules/Session');
634  $this->tpl->setVariable('EVENT_EDIT_TABLE',$this->form->getHTML());
635 
636  if(!count($this->object->getFiles()))
637  {
638  return true;
639  }
640  $rows = array();
641  foreach($this->object->getFiles() as $file)
642  {
643  $table_data['id'] = $file->getFileId();
644  $table_data['filename'] = $file->getFileName();
645  $table_data['filetype'] = $file->getFileType();
646  $table_data['filesize'] = $file->getFileSize();
647 
648  $rows[] = $table_data;
649  }
650 
651  include_once("./Modules/Session/classes/class.ilSessionFileTableGUI.php");
652  $table_gui = new ilSessionFileTableGUI($this, "edit");
653  $table_gui->setTitle($this->lng->txt("event_files"));
654  $table_gui->setData($rows);
655  $table_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
656  $table_gui->addMultiCommand("confirmDeleteFiles", $this->lng->txt("delete"));
657  $table_gui->setSelectAllCheckbox("file_id");
658  $this->tpl->setVariable('EVENT_FILE_TABLE',$table_gui->getHTML());
659 
660  return true;
661  }
print $file
initForm($a_mode)
Init Form.
+ 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 1224 of file class.ilObjSessionGUI.php.

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

1225  {
1226  global $ilErr,$ilAccess, $ilUser,$tree;
1227 
1228  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
1229  {
1230  $ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$ilErr->MESSAGE);
1231  }
1232 
1233  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.sess_list.html','Modules/Session');
1234  $this->__showButton($this->ctrl->getLinkTarget($this,'exportCSV'),$this->lng->txt('event_csv_export'));
1235 
1236  include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1237 
1238  $this->tpl->addBlockfile("EVENTS_TABLE","events_table", "tpl.table.html");
1239  $this->tpl->addBlockfile('TBL_CONTENT','tbl_content','tpl.sess_list_row.html','Modules/Session');
1240 
1241  $members_obj = $this->initContainer(true);
1242  $members = $members_obj->getParticipants();
1243  $members = ilUtil::_sortIds($members,'usr_data','lastname','usr_id');
1244 
1245  // Table
1246  $tbl = new ilTableGUI();
1247  $tbl->setTitle($this->lng->txt("event_overview"),
1248  'icon_usr.png',
1249  $this->lng->txt('obj_usr'));
1250  $this->ctrl->setParameter($this,'offset',(int) $_GET['offset']);
1251 
1252  $course_ref_id = $tree->checkForParentType($this->object->getRefId(),'crs');
1253  $events = array();
1254  foreach($tree->getSubtree($tree->getNodeData($course_ref_id),false,'sess') as $event_id)
1255  {
1256  $tmp_event = ilObjectFactory::getInstanceByRefId($event_id,false);
1257  if(!is_object($tmp_event) or $tmp_event->getType() != 'sess')
1258  {
1259  continue;
1260  }
1261  $events[] = $tmp_event;
1262  }
1263 
1264  $headerNames = array();
1265  $headerVars = array();
1266  $colWidth = array();
1267 
1268  $headerNames[] = $this->lng->txt('name');
1269  $headerVars[] = "name";
1270  $colWidth[] = '20%';
1271 
1272  for ($i = 1; $i <= count($events); $i++)
1273  {
1274  $headerNames[] = $i;
1275  $headerVars[] = "event_".$i;
1276  $colWidth[] = 80/count($events)."%";
1277  }
1278 
1279  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
1280  $tbl->setHeaderNames($headerNames);
1281  $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this,'eventsList'));
1282  $tbl->setColumnWidth($colWidth);
1283 
1284  $tbl->setOrderColumn($_GET["sort_by"]);
1285  $tbl->setOrderDirection($_GET["sort_order"]);
1286  $tbl->setOffset($_GET["offset"]);
1287  $tbl->setLimit($ilUser->getPref("hits_per_page"));
1288  $tbl->setMaxCount(count($members));
1289  $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
1290 
1291  $sliced_users = array_slice($members,$_GET['offset'],$_SESSION['tbl_limit']);
1292  $tbl->disable('sort');
1293  $tbl->render();
1294 
1295  $counter = 0;
1296  foreach($sliced_users as $user_id)
1297  {
1298  foreach($events as $event_obj)
1299  {
1300  $this->tpl->setCurrentBlock("eventcols");
1301 
1302  $event_part = new ilEventParticipants($this->object->getId());
1303 
1304  {
1305  $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1306  ilUtil::getImagePath('icon_ok.png') :
1307  ilUtil::getImagePath('icon_not_ok.png'));
1308 
1309  $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
1310  $this->lng->txt('event_participated') :
1311  $this->lng->txt('event_not_participated'));
1312  }
1313 
1314  $this->tpl->parseCurrentBlock();
1315  }
1316 
1317  $this->tpl->setCurrentBlock("tbl_content");
1318  $name = ilObjUser::_lookupName($user_id);
1319  $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
1320  $this->tpl->setVariable("LASTNAME",$name['lastname']);
1321  $this->tpl->setVariable("FIRSTNAME",$name['firstname']);
1322  $this->tpl->setVariable("LOGIN",ilObjUser::_lookupLogin($user_id));
1323  $this->tpl->parseCurrentBlock();
1324  }
1325 
1326  $this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));
1327  $this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
1328  $this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
1329  $this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
1330  $this->tpl->setVariable("HEAD_TXT_DATE_TIME",$this->lng->txt("event_date_time"));
1331  $i = 1;
1332  foreach($events as $event_obj)
1333  {
1334  $this->tpl->setCurrentBlock("legend_loop");
1335  $this->tpl->setVariable("LEGEND_CSS_ROW",ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
1336  $this->tpl->setVariable("LEGEND_DIGIT", $i++);
1337  $this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
1338  $this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1339  $this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1340  $this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1341  $this->tpl->parseCurrentBlock();
1342  }
1343 
1344  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static _lookupName($a_user_id)
lookup user name
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$_GET["client_id"]
__showButton($a_cmd, $a_text, $a_target='')
Class ilTableGUI.
Util class various functions, usage as namespace.
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)
_lookupLogin($a_user_id)
lookup login
global $ilUser
Definition: imgupload.php:15
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSessionGUI::executeCommand ( )

execute command

public

Returns

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

References $cmd, $ilCtrl, $ilUser, $ret, ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreen(), and prepareOutput().

63  {
64  global $ilUser,$ilCtrl;
65 
66  $next_class = $this->ctrl->getNextClass($this);
67  $cmd = $this->ctrl->getCmd();
68 
69 
70  $this->prepareOutput();
71  switch($next_class)
72  {
73  case "ilinfoscreengui":
74  $this->checkPermission("visible");
75  $this->infoScreen(); // forwards command
76  break;
77 
78  case 'ilpermissiongui':
79  $this->tabs_gui->setTabActive('perm_settings');
80  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
81  $perm_gui = new ilPermissionGUI($this);
82  $ret = $this->ctrl->forwardCommand($perm_gui);
83  break;
84 
85  case 'ilobjectcopygui':
86  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
87  $cp = new ilObjectCopyGUI($this);
88  $cp->setType('sess');
89  $this->ctrl->forwardCommand($cp);
90  break;
91 
92  case "ilexportgui":
93 // $this->prepareOutput();
94  $this->tabs_gui->setTabActive("export");
95  include_once("./Services/Export/classes/class.ilExportGUI.php");
96  $exp_gui = new ilExportGUI($this);
97  $exp_gui->addFormat("xml");
98  $ret = $this->ctrl->forwardCommand($exp_gui);
99 // $this->tpl->show();
100  break;
101 
102  case "ilcommonactiondispatchergui":
103  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
105  $this->ctrl->forwardCommand($gui);
106  break;
107 
108  default:
109  if(!$cmd)
110  {
111  $cmd = "infoScreen";
112  }
113  $cmd .= "Object";
114  if ($cmd != "infoScreenObject")
115  {
116  $this->checkPermission("read");
117  }
118  else
119  {
120  $this->checkPermission("visible");
121  }
122  $this->$cmd();
123 
124  break;
125  }
126 
127  $this->addHeaderAction();
128 
129  return true;
130  }
GUI class for the workflow of copying objects.
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
Export User Interface Class.
global $ilUser
Definition: imgupload.php:15
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.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ formatPath()

ilObjSessionGUI::formatPath (   $a_ref_id)
protected

format path

protected

Parameters
intref_id

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

References $path, and ilObjectGUI\$tree.

Referenced by materialsObject().

1716  {
1717  global $tree;
1718 
1719  $path = $this->lng->txt('path') . ': ';
1720  $first = true;
1721  foreach($tree->getPathFull($a_ref_id,$this->container_ref_id) as $node)
1722  {
1723  if($node['ref_id'] != $a_ref_id)
1724  {
1725  if(!$first)
1726  {
1727  $path .= ' -> ';
1728  }
1729  $first = false;
1730  $path .= $node['title'];
1731  }
1732  }
1733  return $path;
1734  }
$path
Definition: index.php:22
+ Here is the caller 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 1198 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$data.

1199  {
1200  $data = $this->event_part->getUser($a_user_id);
1201 
1202  if($a_filters && $a_filters["registered"] && !$data["registered"])
1203  {
1204  return;
1205  }
1206 
1207  $data['registered'] = $data['registered'] ?
1208  $this->lng->txt('yes') :
1209  $this->lng->txt('no');
1210  $data['participated'] = $data['participated'] ?
1211  $this->lng->txt('yes') :
1212  $this->lng->txt('no');
1213 
1214  return $data;
1215  }

◆ getTabs()

ilObjSessionGUI::getTabs (   $tabs_gui)

Build tabs.

public

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

References $_GET, $ilCtrl, ilObjectGUI\$tree, and ilObject\_lookupType().

1759  {
1760  global $ilAccess, $ilTabs, $tree, $ilCtrl, $ilHelp;
1761 
1762  $ilHelp->setScreenIdComponent("sess");
1763 
1764  $parent_id = $tree->getParentId($this->object->getRefId());
1765 
1766  // #11650
1767  $parent_type = ilObject::_lookupType($parent_id, true);
1768 
1769  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent_id);
1770  $tabs_gui->setBackTarget($this->lng->txt('back_to_'.$parent_type.'_content'),
1771  $ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
1772  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
1773 
1774  $tabs_gui->addTarget('info_short',
1775  $this->ctrl->getLinkTarget($this,'infoScreen'));
1776 
1777  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
1778  {
1779  $tabs_gui->addTarget('settings',
1780  $this->ctrl->getLinkTarget($this,'edit'));
1781  $tabs_gui->addTarget('crs_materials',
1782  $this->ctrl->getLinkTarget($this,'materials'));
1783  $tabs_gui->addTarget('event_edit_members',
1784  $this->ctrl->getLinkTarget($this,'members'));
1785  }
1786 
1787  // export
1788  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1789  {
1790  $ilTabs->addTarget("export",
1791  $this->ctrl->getLinkTargetByClass("ilexportgui", ""), "", "ilexportgui");
1792  }
1793 
1794 
1795  // edit permissions
1796  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId()))
1797  {
1798  $tabs_gui->addTarget("perm_settings",
1799  $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"), array("perm","info","owner"), 'ilpermissiongui');
1800  }
1801 
1802  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ handleFileUpload()

ilObjSessionGUI::handleFileUpload ( )

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

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

Referenced by saveObject(), and updateObject().

518  {
519  global $tree;
520 
521  include_once './Modules/Session/classes/class.ilEventItems.php';
522  $ev = new ilEventItems($this->object->getId());
523  $items = $ev->getItems();
524 
525  $counter = 0;
526  while(true)
527  {
528  if(!isset($_FILES['files']['name'][$counter]))
529  {
530  break;
531  }
532  if(!strlen($_FILES['files']['name'][$counter]))
533  {
534  $counter++;
535  continue;
536  }
537 
538  include_once './Modules/File/classes/class.ilObjFile.php';
539  $file = new ilObjFile();
540  $file->setTitle(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
541  $file->setDescription('');
542  $file->setFileName(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
543  $file->setFileType($_FILES['files']['type'][$counter]);
544  $file->setFileSize($_FILES['files']['size'][$counter]);
545  $file->create();
546  $new_ref_id = $file->createReference();
547  $file->putInTree($tree->getParentId($this->object->getRefId()));
548  $file->setPermissions($tree->getParentId($this->object->getRefId()));
549  $file->createDirectory();
550  $file->getUploadFile(
551  $_FILES['files']['tmp_name'][$counter],
552  $_FILES['files']['name'][$counter]
553  );
554 
555  $items[] = $new_ref_id;
556  $counter++;
557 
558  }
559 
560  $ev->setItems($items);
561  $ev->update();
562  }
getItems()
get assigned items
print $file
Class ilObjFile.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
class ilEvent
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreen()

ilObjSessionGUI::infoScreen ( )

info screen

protected

Parameters

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

References $_SESSION, $ilCtrl, $ilUser, $location, ilObjectGUI\$tree, ilContainerSorting\_getInstance(), ilEventParticipants\_isRegistered(), ilObject\_lookupObjId(), ilChangeEvent\_recordReadEvent(), ilObjectGUI\checkPermission(), ilSessionObjectListGUIFactory\factory(), ilObjectActivation\getItemsByEvent(), modifyItemGUI(), and ilUtil\sendInfo().

Referenced by executeCommand(), and infoScreenObject().

305  {
306  global $ilAccess, $ilUser,$ilCtrl,$tree,$ilToolbar;
307 
308  $this->checkPermission('visible');
309  $this->tabs_gui->setTabActive('info_short');
310 
311  $appointment_obj = $this->object->getFirstAppointment();
312 
313  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
314  $info = new ilInfoScreenGUI($this);
315 
316  if($this->object->enabledRegistration() && !$ilUser->isAnonymous())
317  {
318  include_once './Modules/Session/classes/class.ilEventParticipants.php';
319  if(ilEventParticipants::_isRegistered($ilUser->getId(), $this->object->getId()))
320  {
321  $ilToolbar->addFormButton($this->lng->txt('event_unregister'),'join');
322  }
323  else
324  {
325  if(!isset($_SESSION['sess_hide_info']))
326  {
327  ilUtil::sendInfo($this->lng->txt('sess_join_info'));
328  }
329  $ilToolbar->addFormButton($this->lng->txt('join_session'),'join', '', true);
330  }
331  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
332  }
333 
334  // Session information
335  if(strlen($this->object->getLocation()) or strlen($this->object->getDetails()))
336  {
337  $info->addSection($this->lng->txt('event_section_information'));
338  }
339  if(strlen($location = $this->object->getLocation()))
340  {
341  $info->addProperty($this->lng->txt('event_location'),
342  nl2br($this->object->getLocation()));
343  }
344  if(strlen($this->object->getDetails()))
345  {
346  $info->addProperty($this->lng->txt('event_details_workflow'),
347  nl2br($this->object->getDetails()));
348  }
349 
350  // Tutor information
351  if($this->object->hasTutorSettings())
352  {
353  $info->addSection($this->lng->txt('event_tutor_data'));
354  if(strlen($fullname = $this->object->getName()))
355  {
356  $info->addProperty($this->lng->txt('event_lecturer'),
357  $fullname);
358  }
359  if(strlen($email = $this->object->getEmail()))
360  {
361  $info->addProperty($this->lng->txt('tutor_email'),
362  $email);
363  }
364  if(strlen($phone = $this->object->getPhone()))
365  {
366  $info->addProperty($this->lng->txt('tutor_phone'),
367  $phone);
368  }
369  }
370 
371 
372  $html = '';
373 
374  include_once './Services/Object/classes/class.ilObjectActivation.php';
375  include_once './Services/Container/classes/class.ilContainerSorting.php';
376  include_once './Modules/Session/classes/class.ilSessionObjectListGUIFactory.php';
377 
378  $eventItems = ilObjectActivation::getItemsByEvent($this->object->getId());
379  $parent_id = $tree->getParentId($this->object->getRefId());
380  $parent_id = ilObject::_lookupObjId($parent_id);
381  $eventItems = ilContainerSorting::_getInstance($parent_id)->sortSubItems(
382  'sess',
383  $this->object->getId(),
384  $eventItems
385  );
386 
387  foreach($eventItems as $item)
388  {
389  $list_gui = ilSessionObjectListGUIFactory::factory($item['type']);
390  $list_gui->setContainerObject($this);
391 
392  $this->modifyItemGUI($list_gui, $item, false);
393 
394  $html .= $list_gui->getListItemHTML(
395  $item['ref_id'],
396  $item['obj_id'],
397  $item['title'],
398  $item['description']
399  );
400  }
401 
402  if(strlen($html))
403  {
404  $info->addSection($this->lng->txt('event_materials'));
405  $info->addProperty(
406  '&nbsp;',
407  $html);
408  }
409 
410  // forward the command
411  $this->ctrl->forwardCommand($info);
412 
413  // store read event
414  require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
415  ilChangeEvent::_recordReadEvent($this->object->getType(), $this->object->getRefId(),
416  $this->object->getId(), $ilUser->getId());
417  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
Class ilInfoScreenGUI.
static getItemsByEvent($a_event_id)
Get session material / event items.
$location
Definition: buildRTE.php:44
static _isRegistered($a_usr_id, $a_event_id)
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
_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.
global $ilUser
Definition: imgupload.php:15
modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
Modify Item ListGUI for presentation in container.
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
static factory($a_type)
Get list gui by type This method caches all the returned list guis.
+ 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 261 of file class.ilObjSessionGUI.php.

References infoScreen().

Referenced by addToDeskObject(), and removeFromDeskObject().

262  {
263  $this->ctrl->setCmd("showSummary");
264  $this->ctrl->setCmdClass("ilinfoscreengui");
265  $this->infoScreen();
266  }
+ 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 1140 of file class.ilObjSessionGUI.php.

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

Referenced by attendanceListObject(), and printAttendanceListObject().

1141  {
1142  $members_obj = $this->initContainer(true);
1143 
1144  include_once 'Services/Membership/classes/class.ilAttendanceList.php';
1145  $list = new ilAttendanceList($this, $members_obj);
1146  $list->setId('sessattlst');
1147 
1148  $event_app = $this->object->getFirstAppointment();
1150  $desc = ilDatePresentation::formatPeriod($event_app->getStart(),$event_app->getEnd());
1152  $desc .= " ".$this->object->getTitle();
1153  $list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
1154 
1155  $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
1156  $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
1157  if($this->object->enabledRegistration())
1158  {
1159  $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
1160  }
1161  $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1162  $list->addBlank($this->lng->txt('sess_signature'));
1163 
1164  $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1165 
1166  return $list;
1167  }
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
static setUseRelativeDates($a_status)
set use relative dates
Base class for attendance lists.
initContainer($a_init_participants=false)
+ 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 773 of file class.ilObjSessionGUI.php.

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

Referenced by eventsListObject(), initAttendanceList(), membersObject(), and updateMembersObject().

774  {
775  global $tree;
776 
777  $is_course = $is_group = false;
778 
779  // #13178
780  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(),'grp');
781  if($this->container_ref_id)
782  {
783  $is_group = true;
784  }
785  if(!$this->container_ref_id)
786  {
787  $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(),'crs');
788  if($this->container_ref_id)
789  {
790  $is_course = true;
791  }
792  }
793  if(!$this->container_ref_id)
794  {
795  ilUtil::sendFailure('No container object found. Aborting');
796  return true;
797  }
798  $this->container_obj_id = ilObject::_lookupObjId($this->container_ref_id);
799 
800  if($a_init_participants && $this->container_obj_id)
801  {
802  if($is_course)
803  {
804  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
805  return ilCourseParticipants::_getInstanceByObjId($this->container_obj_id);
806  }
807  else if($is_group)
808  {
809  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
810  return ilGroupParticipants::_getInstanceByObjId($this->container_obj_id);
811  }
812  }
813 
814  }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupObjId($a_id)
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

ilObjSessionGUI::initCreateForm (   $a_new_type)
protected

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

References initForm().

433  {
434  if(!is_object($this->object))
435  {
436  $this->object = new ilObjSession();
437  }
438  $this->initForm('create');
439  return $this->form;
440  }
initForm($a_mode)
Init Form.
+ Here is the call graph for this function:

◆ initForm()

ilObjSessionGUI::initForm (   $a_mode)
protected

Init Form.

protected

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

References $files, $ilUser, $section, ilRecurrenceInputGUI\allowUnlimitedRecurrences(), ilUtil\getImagePath(), ilYuiUtil\initDomEvent(), ilCheckboxInputGUI\setChecked(), ilDateDurationInputGUI\setStartText(), ilTextInputGUI\setValue(), and ilTextAreaInputGUI\setValue().

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

1352  {
1353  global $ilUser;
1354 
1355  if(is_object($this->form))
1356  {
1357  return true;
1358  }
1359 
1360  $this->lng->loadLanguageModule('dateplaner');
1361 
1362  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1363 
1364  include_once('./Services/YUI/classes/class.ilYuiUtil.php');
1366 
1367  $this->form = new ilPropertyFormGUI();
1368  $this->form->setMultipart(true);
1369  $this->form->setTableWidth('600px');
1370  $this->form->setFormAction($this->ctrl->getFormAction($this));
1371  $this->form->setMultipart(true);
1372 
1373  /*
1374  $full = new ilCheckboxInputGUI('','fulltime');
1375  $full->setChecked($this->object->getFirstAppointment()->enabledFulltime() ? true : false);
1376  $full->setOptionTitle($this->lng->txt('event_fulltime_info'));
1377  $full->setAdditionalAttributes('onchange="ilToggleSessionTime(this);"');
1378  #$this->form->addItem($full);
1379  */
1380 
1381  $this->lng->loadLanguageModule('dateplaner');
1382  include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
1383  #$this->tpl->addJavaScript('./Modules/Session/js/toggle_session_time.js');
1384  $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
1385  $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'),'event');
1386  $dur->setStartText($this->lng->txt('event_start_date'));
1387  $dur->setEndText($this->lng->txt('event_end_date'));
1388  $dur->enableToggleFullTime(
1389  $this->lng->txt('event_fulltime_info'),
1390  $this->object->getFirstAppointment()->enabledFulltime() ? true : false
1391  );
1392  $dur->setMinuteStepSize(5);
1393  $dur->setShowTime(true);
1394  $dur->setShowDate(true);
1395  $dur->setStart($this->object->getFirstAppointment()->getStart());
1396  $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1397 
1398  $this->form->addItem($dur);
1399 
1400  /*
1401  // start
1402  $start = new ilDateTimeInputGUI($this->lng->txt('event_start_date'),'start');
1403  $start->setMinuteStepSize(5);
1404  $start->setDate($this->object->getFirstAppointment()->getStart());
1405  $start->setShowTime(true);
1406  #$this->form->addItem($start);
1407 
1408  // end
1409  $end = new ilDateTimeInputGUI($this->lng->txt('event_end_date'),'end');
1410  $end->setMinuteStepSize(5);
1411  $end->setDate($this->object->getFirstAppointment()->getEnd());
1412  $end->setShowTime(true);
1413  #$this->form->addItem($end);
1414  */
1415 
1416  // Recurrence
1417  if($a_mode == 'create')
1418  {
1419  if(!is_object($this->rec))
1420  {
1421  include_once('./Modules/Session/classes/class.ilEventRecurrence.php');
1422  $this->rec = new ilEventRecurrence();
1423  }
1424  include_once('./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
1425  $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'),'frequence');
1426  $rec->allowUnlimitedRecurrences(false);
1427  $rec->setRecurrence($this->rec);
1428  $this->form->addItem($rec);
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  // section
1465  $section->setTitle($this->lng->txt('event_tutor_data'));
1466  $this->form->addItem($section);
1467 
1468  // name
1469  $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'),'tutor_name');
1470  $tutor_name->setValue($this->object->getName());
1471  $tutor_name->setSize(20);
1472  $tutor_name->setMaxLength(70);
1473  $this->form->addItem($tutor_name);
1474 
1475  // email
1476  $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'),'tutor_email');
1477  $tutor_email->setValue($this->object->getEmail());
1478  $tutor_email->setSize(20);
1479  $tutor_email->setMaxLength(70);
1480  $this->form->addItem($tutor_email);
1481 
1482  // phone
1483  $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'),'tutor_phone');
1484  $tutor_phone->setValue($this->object->getPhone());
1485  $tutor_phone->setSize(20);
1486  $tutor_phone->setMaxLength(70);
1487  $this->form->addItem($tutor_phone);
1488 
1490  $section->setTitle($this->lng->txt('crs_further_settings'));
1491  $this->form->addItem($section);
1492 
1493  // registration
1494  $reg = new ilCheckboxInputGUI($this->lng->txt('event_registration'),'registration');
1495  $reg->setChecked($this->object->enabledRegistration() ? true : false);
1496  $reg->setOptionTitle($this->lng->txt('event_registration_info'));
1497  $this->form->addItem($reg);
1498 
1499 
1501  $section->setTitle($this->lng->txt('event_assign_files'));
1502  $this->form->addItem($section);
1503 
1504  $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'),'files');
1505  $files->setFilenames(array(0 => ''));
1506  $this->form->addItem($files);
1507 
1508  switch($a_mode)
1509  {
1510  case 'create':
1511  $this->form->setTitle($this->lng->txt('event_table_create'));
1512  $this->form->setTitleIcon(ilUtil::getImagePath('icon_event.png'));
1513 
1514  $this->form->addCommandButton('save',$this->lng->txt('event_btn_add'));
1515  $this->form->addCommandButton('saveAndAssignMaterials',$this->lng->txt('event_btn_add_edit'));
1516  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
1517 
1518  return true;
1519 
1520  case 'edit':
1521  $this->form->setTitle($this->lng->txt('event_table_update'));
1522  $this->form->setTitleIcon(ilUtil::getImagePath('icon_event.png'));
1523 
1524  $this->form->addCommandButton('update',$this->lng->txt('save'));
1525  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
1526 
1527  return true;
1528  }
1529  return true;
1530  }
This class represents a property form user interface.
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.
$section
Definition: Utf8Test.php:84
setChecked($a_checked)
Set Checked.
input GUI for a time span (start and end date)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class represents a text property in a property form.
static initDomEvent()
Init YUI DomEvent.
setStartText($a_txt)
Set text, which will be shown before the start date.
global $ilUser
Definition: imgupload.php:15
This class represents a text area property in a property form.
setValue($a_value)
Set Value.
+ 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 171 of file class.ilObjSessionGUI.php.

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

172  {
173  global $ilUser;
174 
175  $this->checkPermission('read');
176 
177  if($ilUser->isAnonymous())
178  {
179  $this->ctrl->redirect($this,'infoScreen');
180  }
181 
182  include_once './Modules/Session/classes/class.ilEventParticipants.php';
183 
184  if(ilEventParticipants::_isRegistered($ilUser->getId(),$this->object->getId()))
185  {
186  $_SESSION['sess_hide_info'] = true;
187  ilEventParticipants::_unregister($ilUser->getId(),$this->object->getId());
188  ilUtil::sendSuccess($this->lng->txt('event_unregistered'),true);
189  }
190  else
191  {
192  ilEventParticipants::_register($ilUser->getId(),$this->object->getId());
193  ilUtil::sendSuccess($this->lng->txt('event_registered'),true);
194  }
195 
196  $this->ctrl->redirect($this,'infoScreen');
197  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
_unregister($a_usr_id, $a_event_id)
_register($a_usr_id, $a_event_id)
static _isRegistered($a_usr_id, $a_event_id)
global $ilUser
Definition: imgupload.php:15
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 1539 of file class.ilObjSessionGUI.php.

References $_POST, $ilUser, __toUnix(), IL_CAL_DATE, IL_CAL_FKT_GETDATE, and ilUtil\stripSlashes().

Referenced by saveObject(), and updateObject().

1540  {
1541  global $ilUser;
1542 
1543  $this->object->getFirstAppointment()->setStartingTime($this->__toUnix($_POST['event']['start']['date'],$_POST['event']['start']['time']));
1544  $this->object->getFirstAppointment()->setEndingTime($this->__toUnix($_POST['event']['end']['date'],$_POST['event']['end']['time']));
1545  $this->object->getFirstAppointment()->toggleFullTime((bool) $_POST['event']['fulltime']);
1546 
1547  include_once('./Services/Calendar/classes/class.ilDate.php');
1548  if($this->object->getFirstAppointment()->isFullday())
1549  {
1550  $start = new ilDate($_POST['event']['start']['date']['y'].'-'.$_POST['event']['start']['date']['m'].'-'.$_POST['event']['start']['date']['d'],
1551  IL_CAL_DATE);
1552  $this->object->getFirstAppointment()->setStart($start);
1553 
1554  $end = new ilDate($_POST['event']['end']['date']['y'].'-'.$_POST['event']['end']['date']['m'].'-'.$_POST['event']['end']['date']['d'],
1555  IL_CAL_DATE);
1556  $this->object->getFirstAppointment()->setEnd($end);
1557  }
1558  else
1559  {
1560  $start_dt['year'] = (int) $_POST['event']['start']['date']['y'];
1561  $start_dt['mon'] = (int) $_POST['event']['start']['date']['m'];
1562  $start_dt['mday'] = (int) $_POST['event']['start']['date']['d'];
1563  $start_dt['hours'] = (int) $_POST['event']['start']['time']['h'];
1564  $start_dt['minutes'] = (int) $_POST['event']['start']['time']['m'];
1565 
1566  $start = new ilDateTime($start_dt,IL_CAL_FKT_GETDATE,$ilUser->getTimeZone());
1567  $this->object->getFirstAppointment()->setStart($start);
1568 
1569  $end_dt['year'] = (int) $_POST['event']['end']['date']['y'];
1570  $end_dt['mon'] = (int) $_POST['event']['end']['date']['m'];
1571  $end_dt['mday'] = (int) $_POST['event']['end']['date']['d'];
1572  $end_dt['hours'] = (int) $_POST['event']['end']['time']['h'];
1573  $end_dt['minutes'] = (int) $_POST['event']['end']['time']['m'];
1574  $end = new ilDateTime($end_dt,IL_CAL_FKT_GETDATE,$ilUser->getTimeZone());
1575  $this->object->getFirstAppointment()->setEnd($end);
1576  }
1577 
1578  $this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
1579  $this->object->setDescription(ilUtil::stripSlashes($_POST['desc']));
1580  $this->object->setLocation(ilUtil::stripSlashes($_POST['location']));
1581  $this->object->setName(ilUtil::stripSlashes($_POST['tutor_name']));
1582  $this->object->setPhone(ilUtil::stripSlashes($_POST['tutor_phone']));
1583  $this->object->setEmail(ilUtil::stripSlashes($_POST['tutor_email']));
1584  $this->object->setDetails(ilUtil::stripSlashes($_POST['details']));
1585  $this->object->enableRegistration((int) $_POST['registration']);
1586  }
$_POST['username']
Definition: cron.php:12
__toUnix($date, $time)
protected
Class for single dates.
Date and time handling
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
const IL_CAL_FKT_GETDATE
const IL_CAL_DATE
global $ilUser
Definition: imgupload.php:15
+ 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 1594 of file class.ilObjSessionGUI.php.

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

Referenced by saveObject().

1595  {
1596  include_once('./Modules/Session/classes/class.ilSessionRecurrence.php');
1597  $this->rec = new ilSessionRecurrence();
1598 
1599  switch($_POST['frequence'])
1600  {
1601  case IL_CAL_FREQ_DAILY:
1602  $this->rec->setFrequenceType($_POST['frequence']);
1603  $this->rec->setInterval((int) $_POST['count_DAILY']);
1604  break;
1605 
1606  case IL_CAL_FREQ_WEEKLY:
1607  $this->rec->setFrequenceType($_POST['frequence']);
1608  $this->rec->setInterval((int) $_POST['count_WEEKLY']);
1609  if(is_array($_POST['byday_WEEKLY']))
1610  {
1611  $this->rec->setBYDAY(ilUtil::stripSlashes(implode(',',$_POST['byday_WEEKLY'])));
1612  }
1613  break;
1614 
1615  case IL_CAL_FREQ_MONTHLY:
1616  $this->rec->setFrequenceType($_POST['frequence']);
1617  $this->rec->setInterval((int) $_POST['count_MONTHLY']);
1618  switch((int) $_POST['subtype_MONTHLY'])
1619  {
1620  case 0:
1621  // nothing to do;
1622  break;
1623 
1624  case 1:
1625  switch((int) $_POST['monthly_byday_day'])
1626  {
1627  case 8:
1628  // Weekday
1629  $this->rec->setBYSETPOS((int) $_POST['monthly_byday_num']);
1630  $this->rec->setBYDAY('MO,TU,WE,TH,FR');
1631  break;
1632 
1633  case 9:
1634  // Day of month
1635  $this->rec->setBYMONTHDAY((int) $_POST['monthly_byday_num']);
1636  break;
1637 
1638  default:
1639  $this->rec->setBYDAY((int) $_POST['monthly_byday_num'].$_POST['monthly_byday_day']);
1640  break;
1641  }
1642  break;
1643 
1644  case 2:
1645  $this->rec->setBYMONTHDAY((int) $_POST['monthly_bymonthday']);
1646  break;
1647  }
1648  break;
1649 
1650  case IL_CAL_FREQ_YEARLY:
1651  $this->rec->setFrequenceType($_POST['frequence']);
1652  $this->rec->setInterval((int) $_POST['count_YEARLY']);
1653  switch((int) $_POST['subtype_YEARLY'])
1654  {
1655  case 0:
1656  // nothing to do;
1657  break;
1658 
1659  case 1:
1660  $this->rec->setBYMONTH((int) $_POST['yearly_bymonth_byday']);
1661  $this->rec->setBYDAY((int) $_POST['yearly_byday_num'].$_POST['yearly_byday']);
1662  break;
1663 
1664  case 2:
1665  $this->rec->setBYMONTH((int) $_POST['yearly_bymonth_by_monthday']);
1666  $this->rec->setBYMONTHDAY((int) $_POST['yearly_bymonthday']);
1667  break;
1668  }
1669  break;
1670  }
1671 
1672  // UNTIL
1673  switch((int) $_POST['until_type'])
1674  {
1675  case 1:
1676  $this->rec->setFrequenceUntilDate(null);
1677  // nothing to do
1678  break;
1679 
1680  case 2:
1681  $this->rec->setFrequenceUntilDate(null);
1682  $this->rec->setFrequenceUntilCount((int) $_POST['count']);
1683  break;
1684 
1685  case 3:
1686  $end_dt['year'] = (int) $_POST['until_end']['date']['y'];
1687  $end_dt['mon'] = (int) $_POST['until_end']['date']['m'];
1688  $end_dt['mday'] = (int) $_POST['until_end']['date']['d'];
1689 
1690  $this->rec->setFrequenceUntilCount(0);
1691  $this->rec->setFrequenceUntilDate(new ilDate($end_dt,IL_CAL_FKT_GETDATE,$this->timezone));
1692  break;
1693  }
1694  }
const IL_CAL_FREQ_MONTHLY
$_POST['username']
Definition: cron.php:12
Class for single dates.
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
const IL_CAL_FKT_GETDATE
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 823 of file class.ilObjSessionGUI.php.

References ilObjectGUI\$objDefinition, ilObjectGUI\$tree, ilObject\_getIcon(), formatPath(), ilUtil\formCheckbox(), ilUtil\getImagePath(), ilEventItems\getItems(), ilUtil\sortArray(), and ilUtil\switchColor().

Referenced by saveMaterialsObject().

824  {
825  global $tree, $objDefinition;
826 
827  $this->tabs_gui->setTabActive('crs_materials');
828 
829  // #11337 - support ANY parent container (crs, grp, fld)
830  $parent_ref_id = $tree->getParentId($this->object->getRefId());
831 
832  include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
833  $gui = new ilObjectAddNewItemGUI($parent_ref_id);
834  $gui->setDisabledObjectTypes(array("itgr", "sess"));
835  $gui->setAfterCreationCallback($this->ref_id);
836  $gui->render();
837 
838  include_once 'Modules/Session/classes/class.ilEventItems.php';
839  $this->event_items = new ilEventItems($this->object->getId());
840  $items = $this->event_items->getItems();
841 
842  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.sess_materials.html','Modules/Session');
843  #$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
844 
845  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this,'materials'));
846  $this->tpl->setVariable("COLL_TITLE_IMG",ilUtil::getImagePath('icon_sess.png'));
847  $this->tpl->setVariable("COLL_TITLE_IMG_ALT",$this->lng->txt('events'));
848  $this->tpl->setVariable("TABLE_TITLE",$this->lng->txt('event_assign_materials_table'));
849  $this->tpl->setVariable("TABLE_INFO",$this->lng->txt('event_assign_materials_info'));
850 
851  $materials = array();
852  $nodes = $tree->getSubTree($tree->getNodeData($parent_ref_id));
853  foreach($nodes as $node)
854  {
855  // No side blocks here
856  if ($node['child'] == $parent_ref_id ||
857  $objDefinition->isSideBlock($node['type']) ||
858  in_array($node['type'], array('sess', 'itgr', 'rolf')))
859  {
860  continue;
861  }
862 
863  if($node['type'] == 'rolf')
864  {
865  continue;
866  }
867 
868  $node["sorthash"] = (int)(!in_array($node['ref_id'],$items)).$node["title"];
869  $materials[] = $node;
870  }
871 
872 
873  $materials = ilUtil::sortArray($materials, "sorthash", "ASC");
874 
875  $counter = 1;
876  foreach($materials as $node)
877  {
878  $counter++;
879 
880  $this->tpl->setCurrentBlock("material_row");
881 
882  $this->tpl->setVariable('TYPE_IMG', ilObject::_getIcon('', 'tiny', $node['type']));
883  $this->tpl->setVariable('IMG_ALT',$this->lng->txt('obj_'.$node['type']));
884  $this->tpl->setVariable("ROW_CLASS",ilUtil::switchColor($counter,'tblrow1','tblrow2'));
885  $this->tpl->setVariable("CHECK_COLL",ilUtil::formCheckbox(in_array($node['ref_id'],$items) ? 1 : 0,
886  'items[]',$node['ref_id']));
887  $this->tpl->setVariable("COLL_TITLE",$node['title']);
888 
889  if(strlen($node['description']))
890  {
891  $this->tpl->setVariable("COLL_DESC",$node['description']);
892  }
893  $this->tpl->setVariable("ASSIGNED_IMG_OK",in_array($node['ref_id'],$items) ?
894  ilUtil::getImagePath('icon_ok.png') :
895  ilUtil::getImagePath('icon_not_ok.png'));
896  $this->tpl->setVariable("ASSIGNED_STATUS",$this->lng->txt('event_material_assigned'));
897  $this->tpl->setVariable("COLL_PATH",$this->formatPath($node['ref_id']));
898  $this->tpl->parseCurrentBlock();
899  }
900 
901  $this->tpl->setVariable("SELECT_ROW",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
902  $this->tpl->setVariable("SELECT_ALL",$this->lng->txt('select_all'));
903  $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.png'));
904  $this->tpl->setVariable("BTN_SAVE",$this->lng->txt('save'));
905  }
getItems()
get assigned items
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
formatPath($a_ref_id)
format path
Render add new item selector.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
class ilEvent
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ membersObject()

ilObjSessionGUI::membersObject ( )
protected

Show participants table.

Returns
void

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

References $ilUser, ilObjectGUI\$tree, ilObjectGUI\checkPermission(), ilUtil\getImagePath(), initContainer(), setShowHidePrefs(), ilSessionParticipantsTableGUI\TYPE_ADMIN, ilSessionParticipantsTableGUI\TYPE_MEMBER, and ilSessionParticipantsTableGUI\TYPE_TUTOR.

Referenced by updateMembersObject().

931  {
932  global $tree,$ilUser;
933 
934  $this->checkPermission('write');
935  $this->tabs_gui->setTabActive('event_edit_members');
936 
937  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_members.html', 'Modules/Session');
938 
939  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
940  $toolbar = new ilToolbarGUI();
941  $toolbar->addButton($this->lng->txt('sess_gen_attendance_list'),
942  $this->ctrl->getLinkTarget($this,'attendanceList'));
943 
944  $this->tpl->setVariable('ACTION_BUTTONS',$toolbar->getHTML());
945 
946  $members_obj = $this->initContainer(true);
947 
948  include_once './Modules/Session/classes/class.ilEventParticipants.php';
949 
950  // Save hide/show table settings
951  $this->setShowHidePrefs();
952 
953  // Admins
954  if(count($admins = $members_obj->getAdmins()))
955  {
956  include_once('./Modules/Session/classes/class.ilSessionParticipantsTableGUI.php');
957  if($ilUser->getPref('sess_admin_hide'))
958  {
960  $this->ctrl->setParameter($this,'admin_hide',0);
961  $table->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
962  $this->lng->txt('show'),
963  '',
964  ilUtil::getImagePath('edit_add.png'));
965  $this->ctrl->clearParameters($this);
966  }
967  else
968  {
970  $this->ctrl->setParameter($this,'admin_hide',1);
971  $table->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
972  $this->lng->txt('hide'),
973  '',
974  ilUtil::getImagePath('edit_remove.png'));
975  $this->ctrl->clearParameters($this);
976  }
977 
978  $table->addCommandButton('updateMembers',$this->lng->txt('save'));
979  $table->setTitle($this->lng->txt('event_tbl_admins'),'icon_usr.png',$this->lng->txt('event_tbl_admins'));
980  $table->enableRegistration($this->object->enabledRegistration());
981  $table->setParticipants($admins);
982  $table->parse();
983  $this->tpl->setVariable('ADMINS',$table->getHTML());
984  }
985 
986  // Tutors
987  if(count($tutors = $members_obj->getTutors()))
988  {
989  include_once('./Modules/Session/classes/class.ilSessionParticipantsTableGUI.php');
990  if($ilUser->getPref('sess_tutor_hide'))
991  {
993  $this->ctrl->setParameter($this,'tutor_hide',0);
994  $table->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
995  $this->lng->txt('show'),
996  '',
997  ilUtil::getImagePath('edit_add.png'));
998  $this->ctrl->clearParameters($this);
999  }
1000  else
1001  {
1003  $this->ctrl->setParameter($this,'tutor_hide',1);
1004  $table->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1005  $this->lng->txt('hide'),
1006  '',
1007  ilUtil::getImagePath('edit_remove.png'));
1008  $this->ctrl->clearParameters($this);
1009  }
1010  $table->addCommandButton('updateMembers',$this->lng->txt('save'));
1011  $table->setTitle($this->lng->txt('event_tbl_tutors'),'icon_usr.png',$this->lng->txt('event_tbl_admins'));
1012  $table->enableRegistration($this->object->enabledRegistration());
1013  $table->setParticipants($tutors);
1014  $table->parse();
1015  $this->tpl->setVariable('TUTORS',$table->getHTML());
1016  }
1017 
1018  // Members
1019  if(count($members = $members_obj->getMembers()))
1020  {
1021  include_once('./Modules/Session/classes/class.ilSessionParticipantsTableGUI.php');
1022  if($ilUser->getPref('sess_member_hide'))
1023  {
1025  $this->ctrl->setParameter($this,'member_hide',0);
1026  $table->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1027  $this->lng->txt('show'),
1028  '',
1029  ilUtil::getImagePath('edit_add.png'));
1030  $this->ctrl->clearParameters($this);
1031  }
1032  else
1033  {
1035  $this->ctrl->setParameter($this,'member_hide',1);
1036  $table->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1037  $this->lng->txt('hide'),
1038  '',
1039  ilUtil::getImagePath('edit_remove.png'));
1040  $this->ctrl->clearParameters($this);
1041  }
1042  $table->addCommandButton('updateMembers',$this->lng->txt('save'));
1043  $table->setTitle($this->lng->txt('event_tbl_members'),'icon_usr.png',$this->lng->txt('event_tbl_admins'));
1044  $table->enableRegistration($this->object->enabledRegistration());
1045  $table->setParticipants($members);
1046  $table->parse();
1047  $this->tpl->setVariable('MEMBERS',$table->getHTML());
1048  }
1049 
1050 
1051 
1052 
1053 
1054  }
setShowHidePrefs()
set preferences (show/hide tabel content)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
initContainer($a_init_participants=false)
global $ilUser
Definition: imgupload.php:15
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:
+ Here is the caller graph for this function:

◆ modifyItemGUI()

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

Modify Item ListGUI for presentation in container.

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

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

Referenced by infoScreen().

272  {
273  global $tree;
274 
275  // if folder is in a course, modify item list gui according to course requirements
276  if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(),'crs'))
277  {
278  // #10611
279  include_once "Services/Object/classes/class.ilObjectActivation.php";
280  ilObjectActivation::addListGUIActivationProperty($a_item_list_gui, $a_item_data);
281 
282  include_once("./Modules/Course/classes/class.ilObjCourse.php");
283  include_once("./Modules/Course/classes/class.ilObjCourseGUI.php");
284  $course_obj_id = ilObject::_lookupObjId($course_ref_id);
286  $a_item_list_gui,
287  get_class($this),
288  $a_item_data,
289  $a_show_path,
290  ilObjCourse::_lookupAboStatus($course_obj_id),
291  $course_ref_id,
292  $course_obj_id,
293  $this->object->getRefId());
294  }
295  }
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilObjSessionGUI::prepareOutput ( )
protected
See also
ilObjectGUI::prepareOutput()

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

References ilObjectGUI\getCreationMode().

Referenced by executeCommand().

136  {
137  parent::prepareOutput();
138 
139  if(!$this->getCreationMode())
140  {
141  $title = strlen($this->object->getTitle()) ? (': '.$this->object->getTitle()) : '';
142 
143  include_once './Modules/Session/classes/class.ilSessionAppointment.php';
144  $this->tpl->setTitle(
145  $this->object->getFirstAppointment()->appointmentToString().$title);
146  }
147  }
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 1174 of file class.ilObjSessionGUI.php.

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

1175  {
1176  $this->checkPermission('write');
1177 
1178  $list = $this->initAttendanceList();
1179  $list->initFromForm();
1180  $list->setCallback(array($this, 'getAttendanceListUserData'));
1181 
1182  include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1183  $this->event_part = new ilEventParticipants($this->object->getId());
1184 
1185  echo $list->getFullscreenHTML();
1186  exit();
1187  }
exit
Definition: login.php:54
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:

◆ registerObject()

ilObjSessionGUI::registerObject ( )

register to session

public

Parameters

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

References $ilUser, ilEventParticipants\_register(), and ilUtil\sendSuccess().

157  {
158  global $ilUser;
159 
160  include_once 'Modules/Session/classes/class.ilEventParticipants.php';
161  ilEventParticipants::_register($ilUser->getId(),$this->object->getId());
162 
163  ilUtil::sendSuccess($this->lng->txt('event_registered'),true);
164  $this->ctrl->returnToParent($this);
165  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
_register($a_usr_id, $a_event_id)
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ removeFromDeskObject()

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

Implements ilDesktopItemHandling.

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

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

249  {
250  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
252  $this->infoScreenObject();
253  }
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 447 of file class.ilObjSessionGUI.php.

References $ilLog, and ilObjectGUI\saveObject().

448  {
449  global $ilLog;
450 
451  $this->saveObject(false);
452 
453  /*
454  $this->ctrl->setParameter($this,'ref_id',$this->object->getRefId());
455  $target = $this->ctrl->getLinkTarget($this,'materials');
456  $target = str_replace('new_type=','nt=',$target);
457  */
458  $this->ctrl->setParameter($this,'ref_id',$this->object->getRefId());
459  $this->ctrl->redirect($this,'materials');
460  }
saveObject()
save object
+ Here is the call graph for this function:

◆ saveMaterialsObject()

ilObjSessionGUI::saveMaterialsObject ( )

save material assignment

public

Parameters

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

References $_POST, materialsObject(), ilUtil\sendSuccess(), and ilEventItems\setItems().

915  {
916  include_once './Modules/Session/classes/class.ilEventItems.php';
917 
918  $this->event_items = new ilEventItems($this->object->getId());
919  $this->event_items->setItems(is_array($_POST['items']) ? $_POST['items'] : array());
920  $this->event_items->update();
921 
922  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
923  $this->materialsObject();
924  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
materialsObject()
show material assignment
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 469 of file class.ilObjSessionGUI.php.

References $_GET, $ilErr, $ilUser, ilObjectGUI\createObject(), createRecurringSessions(), handleFileUpload(), initForm(), load(), loadRecurrenceSettings(), ilUtil\sendFailure(), and ilUtil\sendInfo().

470  {
471  global $ilErr,$ilUser;
472 
473  $this->object = new ilObjSession();
474 
475  $this->load();
476  $this->loadRecurrenceSettings();
477  $this->initForm('create');
478 
479  $ilErr->setMessage('');
480  if(!$this->form->checkInput()) {
481  $ilErr->setMessage($this->lng->txt('err_check_input'));
482  }
483 
484  $this->object->validate();
485  $this->object->getFirstAppointment()->validate();
486 
487  if(strlen($ilErr->getMessage()))
488  {
489  ilUtil::sendFailure($ilErr->getMessage().$_GET['ref_id']);
490  $this->createObject();
491  return false;
492  }
493  // Create session
494  $this->object->create();
495  $this->object->createReference();
496  $this->object->putInTree($_GET["ref_id"]);
497  $this->object->setPermissions($_GET["ref_id"]);
498 
499  // create appointment
500  $this->object->getFirstAppointment()->setSessionId($this->object->getId());
501  $this->object->getFirstAppointment()->create();
502 
503  $this->handleFileUpload();
504 
505  $this->createRecurringSessions();
506 
507  if($a_redirect_on_success)
508  {
509  ilUtil::sendInfo($this->lng->txt('event_add_new_event'),true);
510  $this->ctrl->returnToParent($this);
511  }
512 
513  return true;
514 
515  }
loadRecurrenceSettings()
load recurrence settings
createRecurringSessions()
create recurring sessions
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.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ sendFileObject()

ilObjSessionGUI::sendFileObject ( )

send file

public

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

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

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

◆ setShowHidePrefs()

ilObjSessionGUI::setShowHidePrefs ( )

set preferences (show/hide tabel content)

public

Returns

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

References $_GET, and $ilUser.

Referenced by membersObject().

1063  {
1064  global $ilUser;
1065 
1066  if(isset($_GET['admin_hide']))
1067  {
1068  $ilUser->writePref('sess_admin_hide',(int) $_GET['admin_hide']);
1069  }
1070  if(isset($_GET['tutor_hide']))
1071  {
1072  $ilUser->writePref('sess_tutor_hide',(int) $_GET['tutor_hide']);
1073  }
1074  if(isset($_GET['member_hide']))
1075  {
1076  $ilUser->writePref('sess_member_hide',(int) $_GET['member_hide']);
1077  }
1078  }
$_GET["client_id"]
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ unregisterObject()

ilObjSessionGUI::unregisterObject ( )

unregister from session

public

Returns

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

References $ilUser, ilEventParticipants\_unregister(), and ilUtil\sendSuccess().

206  {
207  global $ilUser;
208 
209  include_once './Modules/Session/classes/class.ilEventParticipants.php';
210  ilEventParticipants::_unregister($ilUser->getId(),$this->object->getId());
211 
212  ilUtil::sendSuccess($this->lng->txt('event_unregistered'),true);
213  $this->ctrl->returnToParent($this);
214  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
_unregister($a_usr_id, $a_event_id)
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ updateMembersObject()

ilObjSessionGUI::updateMembersObject ( )

update participants

public

Parameters

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

References $_POST, ilObjectGUI\$tree, ilObjectGUI\checkPermission(), initContainer(), membersObject(), ilUtil\sendSuccess(), ilEventParticipants\setUserId(), and ilUtil\stripSlashes().

1088  {
1089  global $tree;
1090 
1091  $this->checkPermission('write');
1092 
1093 
1094 
1095  $this->initContainer();
1096 
1097  $_POST['participants'] = is_array($_POST['participants']) ? $_POST['participants'] : array();
1098  $_POST['registered'] = is_array($_POST['registered']) ? $_POST['registered'] : array();
1099 
1100  include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1101 
1102  $visible = $_POST['visible_participants'] ? $_POST['visible_participants'] : array();
1103  foreach($visible as $user)
1104  {
1105  $part = new ilEventParticipants($this->object->getId());
1106  $part->setUserId($user);
1107  $part->setMark(ilUtil::stripSlashes($_POST['mark'][$user]));
1108  $part->setComment(ilUtil::stripSlashes($_POST['comment'][$user]));
1109  $part->setParticipated(isset($_POST['participants'][$user]) ? true : false);
1110  $part->setRegistered(isset($_POST['registered'][$user]) ? true : false);
1111  $part->updateUser();
1112  }
1113  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1114  $this->membersObject();
1115  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
membersObject()
Show participants table.
initContainer($a_init_participants=false)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
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:

◆ updateObject()

ilObjSessionGUI::updateObject ( )

update object

protected

Parameters

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

References $ilErr, editObject(), handleFileUpload(), initForm(), load(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

671  {
672  global $ilErr;
673 
674  $this->load();
675  $this->initForm('edit');
676 
677  $ilErr->setMessage('');
678  if(!$this->form->checkInput())
679  {
680  $ilErr->setMessage($this->lng->txt('err_check_input'));
681  }
682  $this->object->validate();
683  $this->object->getFirstAppointment()->validate();
684 
685  if(strlen($ilErr->getMessage()))
686  {
687  ilUtil::sendFailure($ilErr->getMessage());
688  $this->editObject();
689  return false;
690  }
691  // Update event
692  $this->object->update();
693  $this->object->getFirstAppointment()->update();
694 
695  $this->handleFileUpload();
696 
697  ilUtil::sendSuccess($this->lng->txt('event_updated'),true);
698  $this->ctrl->redirect($this,'edit');
699  #$this->object->initFiles();
700  #$this->editObject();
701  return true;
702  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initForm($a_mode)
Init Form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

Field Documentation

◆ $container_obj_id

ilObjSessionGUI::$container_obj_id = 0
protected

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

◆ $container_ref_id

ilObjSessionGUI::$container_ref_id = 0
protected

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

◆ $ctrl

ilObjSessionGUI::$ctrl

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

◆ $files

ilObjSessionGUI::$files = array()
protected

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

Referenced by initForm().

◆ $lng

ilObjSessionGUI::$lng

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

Referenced by __construct(), and _goto().

◆ $tpl

ilObjSessionGUI::$tpl

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

Referenced by __construct(), and attendanceListObject().


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