4 include_once(
'./classes/class.ilObjectGUI.php');
5 include_once(
'./Modules/Session/classes/class.ilObjSession.php');
6 include_once(
'./Modules/Session/classes/class.ilSessionFile.php');
7 include_once
'./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
39 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
47 $this->lng->loadLanguageModule(
"event");
48 $this->lng->loadLanguageModule(
'crs');
49 $this->lng->loadLanguageModule(
'trac');
66 $next_class = $this->ctrl->getNextClass($this);
67 $cmd = $this->ctrl->getCmd();
73 case "ilinfoscreengui":
78 case 'ilpermissiongui':
79 $this->tabs_gui->setTabActive(
'perm_settings');
80 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
82 $ret = $this->ctrl->forwardCommand($perm_gui);
85 case 'ilcourseitemadministrationgui':
86 include_once
'Modules/Course/classes/class.ilCourseItemAdministrationGUI.php';
87 $this->tabs_gui->clearSubTabs();
88 $this->ctrl->setReturn($this,
'info');
90 $this->ctrl->forwardCommand($item_adm_gui);
93 case 'ilobjectcopygui':
94 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
97 $this->ctrl->forwardCommand($cp);
102 $this->tabs_gui->setTabActive(
"export");
103 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
105 $exp_gui->addFormat(
"xml");
106 $ret = $this->ctrl->forwardCommand($exp_gui);
110 case "ilcommonactiondispatchergui":
111 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
113 $this->ctrl->forwardCommand($gui);
122 if (
$cmd !=
"infoScreenObject")
149 $title = strlen($this->object->getTitle()) ? (
': '.$this->object->getTitle()) :
'';
151 include_once
'./Modules/Session/classes/class.ilSessionAppointment.php';
152 $this->tpl->setTitle(
153 $this->object->getFirstAppointment()->appointmentToString().$title);
168 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
172 $this->ctrl->returnToParent($this);
185 include_once
'./Modules/Session/classes/class.ilEventParticipants.php';
199 $this->ctrl->redirect($this,
'infoScreen');
212 include_once
'./Modules/Session/classes/class.ilEventParticipants.php';
216 $this->ctrl->returnToParent($this);
227 public static function _goto($a_target)
231 if($ilAccess->checkAccess(
'visible',
"", $a_target))
233 $_GET[
"cmd"] =
"infoScreen";
234 $_GET[
"ref_id"] = $a_target;
235 include(
"repository.php");
238 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
246 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
256 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
269 $this->ctrl->setCmd(
"showSummary");
270 $this->ctrl->setCmdClass(
"ilinfoscreengui");
282 if (
$course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs'))
284 include_once(
"./Modules/Course/classes/class.ilObjCourse.php");
285 include_once(
"./Modules/Course/classes/class.ilObjCourseGUI.php");
295 $this->object->getRefId());
311 $this->tabs_gui->setTabActive(
'info_short');
313 $appointment_obj = $this->
object->getFirstAppointment();
315 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
318 if($this->object->enabledRegistration())
320 include_once
'./Modules/Session/classes/class.ilEventParticipants.php';
323 $ilToolbar->addFormButton($this->lng->txt(
'event_unregister'),
'join');
331 $ilToolbar->addFormButton($this->lng->txt(
'join_session'),
'join');
333 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
337 if(strlen($this->object->getLocation()) or strlen($this->object->getDetails()))
339 $info->addSection($this->lng->txt(
'event_section_information'));
341 if(strlen(
$location = $this->object->getLocation()))
343 $info->addProperty($this->lng->txt(
'event_location'),
344 nl2br($this->object->getLocation()));
346 if(strlen($this->object->getDetails()))
348 $info->addProperty($this->lng->txt(
'event_details_workflow'),
349 nl2br($this->object->getDetails()));
353 if($this->object->hasTutorSettings())
355 $info->addSection($this->lng->txt(
'event_tutor_data'));
356 if(strlen($fullname = $this->object->getName()))
358 $info->addProperty($this->lng->txt(
'event_lecturer'),
361 if(strlen($email = $this->object->getEmail()))
363 $info->addProperty($this->lng->txt(
'tutor_email'),
366 if(strlen($phone = $this->object->getPhone()))
368 $info->addProperty($this->lng->txt(
'tutor_phone'),
373 include_once
'./Modules/Session/classes/class.ilSessionObjectListGUIFactory.php';
374 include_once
'./Modules/Session/classes/class.ilEventItems.php';
375 include_once
'./Modules/Course/classes/class.ilCourseItems.php';
380 $parent_id = $tree->getParentId($this->object->getRefId());
382 $eventItems = $items->getItemsByEvent($this->object->getId());
383 include_once
'./Services/Container/classes/class.ilContainerSorting.php';
387 $this->object->getId(),
391 foreach($eventItems as $item)
393 $item_id = $item[
'ref_id'];
399 $list_gui->setContainerObject($this);
402 $html .= $list_gui->getListItemHTML(
412 $info->addSection($this->lng->txt(
'event_materials'));
419 $this->ctrl->forwardCommand($info);
422 require_once
'Services/Tracking/classes/class.ilChangeEvent.php';
424 $this->
object->getId(), $ilUser->getId());
442 if(!is_object($this->
object))
466 $this->ctrl->setParameter($this,
'ref_id',$this->object->getRefId());
467 $this->ctrl->redirect($this,
'materials');
487 $ilErr->setMessage(
'');
488 if(!$this->form->checkInput()) {
489 $ilErr->setMessage($this->lng->txt(
'err_check_input'));
492 $this->
object->validate();
493 $this->
object->getFirstAppointment()->validate();
495 if(strlen($ilErr->getMessage()))
502 $this->
object->create();
503 $this->
object->createReference();
504 $this->
object->putInTree(
$_GET[
"ref_id"]);
505 $this->
object->setPermissions(
$_GET[
"ref_id"]);
508 $this->
object->getFirstAppointment()->setSessionId($this->object->getId());
509 $this->
object->getFirstAppointment()->create();
518 include_once
'./Modules/Course/classes/class.ilCourseItems.php';
522 if($a_redirect_on_success)
525 $this->ctrl->returnToParent($this);
536 include_once
'./Modules/Session/classes/class.ilEventItems.php';
543 if(!isset($_FILES[
'files'][
'name'][$counter]))
547 if(!strlen($_FILES[
'files'][
'name'][$counter]))
553 include_once
'./Modules/File/classes/class.ilObjFile.php';
556 $file->setDescription(
'');
558 $file->setFileType($_FILES[
'files'][
'type'][$counter]);
559 $file->setFileSize($_FILES[
'files'][
'size'][$counter]);
561 $new_ref_id =
$file->createReference();
562 $file->putInTree($tree->getParentId($this->object->getRefId()));
563 $file->setPermissions($tree->getParentId($this->object->getRefId()));
564 $file->createDirectory();
565 $file->getUploadFile(
566 $_FILES[
'files'][
'tmp_name'][$counter],
567 $_FILES[
'files'][
'name'][$counter]
570 $items[] = $new_ref_id;
592 if(!$this->rec->getFrequenceType())
596 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php');
599 $period_start = clone $this->
object->getFirstAppointment()->getStart();
602 $period_end = clone $this->
object->getFirstAppointment()->getStart();
606 $period_diff = $this->
object->getFirstAppointment()->getEnd()->get(
IL_CAL_UNIX) -
607 $this->
object->getFirstAppointment()->getStart()->get(
IL_CAL_UNIX);
608 $parent_id = $tree->getParentId($this->object->getRefId());
610 include_once
'./Modules/Session/classes/class.ilEventItems.php';
615 foreach($date_list->get() as $date)
622 $new_obj = $this->
object->cloneObject($parent_id);
624 $new_obj->getFirstAppointment()->setStartingTime($date->get(
IL_CAL_UNIX));
625 $new_obj->getFirstAppointment()->setEndingTime($date->get(
IL_CAL_UNIX) + $period_diff);
626 $new_obj->getFirstAppointment()->update();
645 $this->tabs_gui->setTabActive(
'edit_properties');
648 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_edit.html',
'Modules/Session');
649 $this->tpl->setVariable(
'EVENT_EDIT_TABLE',$this->form->getHTML());
651 if(!count($this->object->getFiles()))
656 foreach($this->object->getFiles() as
$file)
658 $table_data[
'id'] =
$file->getFileId();
659 $table_data[
'filename'] =
$file->getFileName();
660 $table_data[
'filetype'] =
$file->getFileType();
661 $table_data[
'filesize'] =
$file->getFileSize();
663 $rows[] = $table_data;
666 include_once(
"./Modules/Session/classes/class.ilSessionFileTableGUI.php");
668 $table_gui->setTitle($this->lng->txt(
"event_files"));
669 $table_gui->setData($rows);
670 $table_gui->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
671 $table_gui->addMultiCommand(
"confirmDeleteFiles", $this->lng->txt(
"delete"));
672 $table_gui->setSelectAllCheckbox(
"file_id");
673 $this->tpl->setVariable(
'EVENT_FILE_TABLE',$table_gui->getHTML());
692 $ilErr->setMessage(
'');
693 if(!$this->form->checkInput())
695 $ilErr->setMessage($this->lng->txt(
'err_check_input'));
697 $this->
object->validate();
698 $this->
object->getFirstAppointment()->validate();
700 if(strlen($ilErr->getMessage()))
707 $this->
object->update();
708 $this->
object->getFirstAppointment()->update();
713 $this->ctrl->redirect($this,
'edit');
714 #$this->object->initFiles();
715 #$this->editObject();
728 $this->tabs_gui->setTabActive(
'edit_properties');
730 if(!count(
$_POST[
'file_id']))
737 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
741 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteFiles"));
742 $c_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
743 $c_gui->setCancel($this->lng->txt(
"cancel"),
"edit");
744 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteFiles");
747 foreach(
$_POST[
"file_id"] as $file_id)
750 if(
$file->getSessionId() != $this->
object->getEventId())
756 $c_gui->addItem(
"file_id[]", $file_id,
$file->getFileName());
759 $this->tpl->setContent($c_gui->getHTML());
772 if(!count(
$_POST[
'file_id']))
778 foreach(
$_POST[
'file_id'] as $id)
783 $this->
object->initFiles();
799 $this->tabs_gui->setTabActive(
'crs_materials');
801 include_once
'Modules/Session/classes/class.ilEventItems.php';
802 $this->event_items =
new ilEventItems($this->object->getId());
803 $items = $this->event_items->
getItems();
805 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_materials.html',
'Modules/Session');
806 #$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
808 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this,
'materials'));
810 $this->tpl->setVariable(
"COLL_TITLE_IMG_ALT",$this->lng->txt(
'events'));
811 $this->tpl->setVariable(
"TABLE_TITLE",$this->lng->txt(
'event_assign_materials_table'));
812 $this->tpl->setVariable(
"TABLE_INFO",$this->lng->txt(
'event_assign_materials_info'));
814 $this->course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
815 if(!$this->course_ref_id)
821 $materials = array();
822 $nodes = $tree->getSubTree($tree->getNodeData($this->course_ref_id));
823 foreach($nodes as $node)
826 if ($objDefinition->isSideBlock($node[
'type']) or $node[
'type'] ==
'sess')
831 if($node[
'type'] ==
'rolf')
836 $node[
"sorthash"] = (int)(!in_array($node[
'ref_id'],$items)).$node[
"title"];
837 $materials[] = $node;
844 foreach($materials as $node)
848 $this->tpl->setCurrentBlock(
"material_row");
851 $this->tpl->setVariable(
'IMG_ALT',$this->lng->txt(
'obj_'.$node[
'type']));
853 $this->tpl->setVariable(
"CHECK_COLL",
ilUtil::formCheckbox(in_array($node[
'ref_id'],$items) ? 1 : 0,
854 'items[]',$node[
'ref_id']));
855 $this->tpl->setVariable(
"COLL_TITLE",$node[
'title']);
857 if(strlen($node[
'description']))
859 $this->tpl->setVariable(
"COLL_DESC",$node[
'description']);
861 $this->tpl->setVariable(
"ASSIGNED_IMG_OK",in_array($node[
'ref_id'],$items) ?
864 $this->tpl->setVariable(
"ASSIGNED_STATUS",$this->lng->txt(
'event_material_assigned'));
865 $this->tpl->setVariable(
"COLL_PATH",$this->
formatPath($node[
'ref_id']));
866 $this->tpl->parseCurrentBlock();
870 $this->tpl->setVariable(
"SELECT_ALL",$this->lng->txt(
'select_all'));
872 $this->tpl->setVariable(
"BTN_SAVE",$this->lng->txt(
'save'));
884 include_once
'./Modules/Session/classes/class.ilEventItems.php';
886 $this->event_items =
new ilEventItems($this->object->getId());
888 $this->event_items->update();
900 global
$tree,$ilUser;
903 $this->tabs_gui->setTabActive(
'event_edit_members');
905 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_members.html',
'Modules/Session');
907 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
910 $this->lng->txt(
'print'),
911 $this->ctrl->getLinkTarget($this,
'printViewMembers'),
913 $toolbar->addButton($this->lng->txt(
'sess_gen_attendance_list'),
914 $this->ctrl->getLinkTarget($this,
'attendanceList'));
916 $this->tpl->setVariable(
'ACTION_BUTTONS',$toolbar->getHTML());
918 $this->course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
920 if(!$this->course_ref_id)
926 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
927 include_once
'./Modules/Session/classes/class.ilEventParticipants.php';
936 if(count($admins = $members_obj->getAdmins()))
938 include_once(
'./Modules/Session/classes/class.ilSessionParticipantsTableGUI.php');
939 if($ilUser->getPref(
'sess_admin_hide'))
942 $this->ctrl->setParameter($this,
'admin_hide',0);
943 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
944 $this->lng->txt(
'show'),
947 $this->ctrl->clearParameters($this);
952 $this->ctrl->setParameter($this,
'admin_hide',1);
953 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
954 $this->lng->txt(
'hide'),
957 $this->ctrl->clearParameters($this);
960 $table->addCommandButton(
'updateMembers',$this->lng->txt(
'save'));
961 $table->setTitle($this->lng->txt(
'event_tbl_admins'),
'icon_usr.gif',$this->lng->txt(
'event_tbl_admins'));
962 $table->enableRegistration($this->object->enabledRegistration());
963 $table->setParticipants($admins);
965 $this->tpl->setVariable(
'ADMINS',$table->getHTML());
969 if(count($tutors = $members_obj->getTutors()))
971 include_once(
'./Modules/Session/classes/class.ilSessionParticipantsTableGUI.php');
972 if($ilUser->getPref(
'sess_tutor_hide'))
975 $this->ctrl->setParameter($this,
'tutor_hide',0);
976 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
977 $this->lng->txt(
'show'),
980 $this->ctrl->clearParameters($this);
985 $this->ctrl->setParameter($this,
'tutor_hide',1);
986 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
987 $this->lng->txt(
'hide'),
990 $this->ctrl->clearParameters($this);
992 $table->addCommandButton(
'updateMembers',$this->lng->txt(
'save'));
993 $table->setTitle($this->lng->txt(
'event_tbl_tutors'),
'icon_usr.gif',$this->lng->txt(
'event_tbl_admins'));
994 $table->enableRegistration($this->object->enabledRegistration());
995 $table->setParticipants($tutors);
997 $this->tpl->setVariable(
'TUTORS',$table->getHTML());
1001 if(count($members = $members_obj->getMembers()))
1003 include_once(
'./Modules/Session/classes/class.ilSessionParticipantsTableGUI.php');
1004 if($ilUser->getPref(
'sess_member_hide'))
1007 $this->ctrl->setParameter($this,
'member_hide',0);
1008 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
1009 $this->lng->txt(
'show'),
1012 $this->ctrl->clearParameters($this);
1017 $this->ctrl->setParameter($this,
'member_hide',1);
1018 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
1019 $this->lng->txt(
'hide'),
1022 $this->ctrl->clearParameters($this);
1024 $table->addCommandButton(
'updateMembers',$this->lng->txt(
'save'));
1025 $table->setTitle($this->lng->txt(
'event_tbl_members'),
'icon_usr.gif',$this->lng->txt(
'event_tbl_admins'));
1026 $table->enableRegistration($this->object->enabledRegistration());
1027 $table->setParticipants($members);
1029 $this->tpl->setVariable(
'MEMBERS',$table->getHTML());
1048 if(isset(
$_GET[
'admin_hide']))
1050 $ilUser->writePref(
'sess_admin_hide',(
int)
$_GET[
'admin_hide']);
1052 if(isset(
$_GET[
'tutor_hide']))
1054 $ilUser->writePref(
'sess_tutor_hide',(
int)
$_GET[
'tutor_hide']);
1056 if(isset(
$_GET[
'member_hide']))
1058 $ilUser->writePref(
'sess_member_hide',(
int)
$_GET[
'member_hide']);
1075 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
1076 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
1078 $this->course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
1080 if(!$this->course_ref_id)
1086 $_POST[
'participants'] = is_array(
$_POST[
'participants']) ?
$_POST[
'participants'] : array();
1091 $visible =
$_POST[
'visible_participants'] ?
$_POST[
'visible_participants'] : array();
1092 foreach($visible as $user)
1098 $part->setParticipated(isset(
$_POST[
'participants'][$user]) ?
true :
false);
1100 $part->updateUser();
1114 global
$tpl,$ilTabs;
1118 $ilTabs->setTabActive(
'event_edit_members');
1121 $tpl->setContent($this->form->getHTML());
1133 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1136 $this->form->setFormAction($this->ctrl->getFormAction($this));
1137 $this->form->setTarget(
'_blank');
1138 $this->form->setTitle($this->lng->txt(
'sess_gen_attendance_list'));
1143 $this->form->addItem($mark);
1146 $comment->setOptionTitle($this->lng->txt(
'sess_gen_comment'));
1150 $signature =
new ilCheckboxInputGUI($this->lng->txt(
'sess_signature'),
'show_signature');
1151 $signature->
setOptionTitle($this->lng->txt(
'sess_gen_signature'));
1152 $signature->setValue(1);
1153 $this->form->addItem($signature);
1156 $part->setTitle($this->lng->txt(
'event_participant_selection'));
1157 $this->form->addItem($part);
1162 $admin->setValue(1);
1163 $this->form->addItem($admin);
1168 $tutor->setValue(1);
1169 $this->form->addItem($tutor);
1172 $member =
new ilCheckboxInputGUI($this->lng->txt(
'event_tbl_members'),
'show_members');
1174 $member->setValue(1);
1175 $member->setChecked(
true);
1176 $this->form->addItem($member);
1178 $this->form->addCommandButton(
'printAttendanceList',$this->lng->txt(
'sess_print_attendance_list'));
1179 #$this->form->addCommandButton('members', $this->lng->txt('cancel'));
1192 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
1193 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
1197 $this->course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
1199 if(!$this->course_ref_id)
1206 $event_app = $this->
object->getFirstAppointment();
1210 $this->tpl =
new ilTemplate(
'tpl.main.html',
true,
true);
1213 $this->tpl->setVariable(
"LOCATION_STYLESHEET",$location_stylesheet);
1215 $tpl =
new ilTemplate(
'tpl.sess_attendance_list_print.html',
true,
true,
'Modules/Session');
1217 $tpl->setVariable(
"ATTENDANCE_LIST",$this->lng->txt(
'sess_attendance_list'));
1218 $tpl->setVariable(
"EVENT_NAME",$this->object->getTitle() ?
': '.$this->object->getTitle() :
'');
1223 $tpl->setVariable(
"TXT_NAME",$this->lng->txt(
'name'));
1226 $tpl->setVariable(
"TXT_MARK",$this->lng->txt(
'trac_mark'));
1228 if(
$_POST[
'show_comment'])
1230 $tpl->setVariable(
"TXT_COMMENT",$this->lng->txt(
'trac_comment'));
1232 if(
$_POST[
'show_signature'])
1234 $tpl->setVariable(
"TXT_SIGNATURE",$this->lng->txt(
'sess_signature'));
1237 if(
$_POST[
'show_admins'])
1239 $members = array_merge((array) $members,$members_obj->getAdmins());
1241 if(
$_POST[
'show_tutors'])
1243 $members = array_merge((array) $members,$members_obj->getTutors());
1245 if(
$_POST[
'show_members'])
1247 $members = array_merge((array) $members,$members_obj->getMembers());
1249 $members =
ilUtil::_sortIds((array) $members,
'usr_data',
'lastname',
'usr_id');
1251 foreach($members as $user_id)
1253 $user_data = $event_part->getUser($user_id);
1257 $tpl->setVariable(
"MARK",$user_data[
'mark'] ? $user_data[
'mark'] :
' ');
1259 if(
$_POST[
'show_comment'])
1261 $tpl->setVariable(
"COMMENT",$user_data[
'comment'] ? $user_data[
'comment'] :
' ');
1263 if(
$_POST[
'show_signature'])
1265 $tpl->touchBlock(
'row_signature');
1268 $tpl->setCurrentBlock(
"member_row");
1270 $tpl->setVariable(
"LASTNAME",$name[
'lastname']);
1271 $tpl->setVariable(
"FIRSTNAME",$name[
'firstname']);
1273 $tpl->parseCurrentBlock();
1276 $this->tpl->setVariable(
"CONTENT",
$tpl->get());
1277 $this->tpl->setVariable(
"BODY_ATTRIBUTES",
'onload="window.print()"');
1292 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
1293 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
1297 $this->course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
1299 if(!$this->course_ref_id)
1306 $event_app = $this->
object->getFirstAppointment();
1309 $this->tpl =
new ilTemplate(
'tpl.main.html',
true,
true);
1312 $this->tpl->setVariable(
"LOCATION_STYLESHEET",$location_stylesheet);
1314 $tpl =
new ilTemplate(
'tpl.sess_members_print.html',
true,
true,
'Modules/Session');
1316 #$tpl->setVariable("EVENT",$this->lng->txt('event'));
1317 $tpl->setVariable(
"EVENT_NAME",$this->object->getTitle() ?
': '.$this->object->getTitle() : $this->
object->getTitle());
1323 if(!$ilUser->getPref(
'sess_admin_hide') and count($members_obj->getAdmins()))
1325 $tmp[
'txt'] = $this->lng->txt(
'event_tbl_admins');
1326 $tmp[
'users'] = $members_obj->getAdmins();
1328 $participants[] = $tmp;
1330 if(!$ilUser->getPref(
'sess_tutor_hide') and count($members_obj->getTutors()))
1332 $tmp[
'txt'] = $this->lng->txt(
'event_tbl_tutors');
1333 $tmp[
'users'] = $members_obj->getTutors();
1335 $participants[] = $tmp;
1337 if(!$ilUser->getPref(
'sess_member_hide') and count($members_obj->getMembers()))
1339 $tmp[
'txt'] = $this->lng->txt(
'event_tbl_members');
1340 $tmp[
'users'] = $members_obj->getMembers();
1342 $participants[] = $tmp;
1345 foreach((array) $participants as $participants_data)
1347 $members =
ilUtil::_sortIds($participants_data[
'users'],
'usr_data',
'lastname',
'usr_id');
1348 foreach($members as $user_id)
1351 $user_data = $event_part->getUser($user_id);
1353 if($this->object->enabledRegistration())
1355 $tpl->setCurrentBlock(
"reg_col");
1356 $tpl->setVariable(
"REGISTERED",$event_part->isRegistered($user_id) ?
"X" :
"");
1357 $tpl->parseCurrentBlock();
1359 $tpl->setVariable(
"COMMENT",$user_data[
'comment']);
1361 $tpl->setCurrentBlock(
"member_row");
1363 $tpl->setVariable(
"LASTNAME",$name[
'lastname']);
1364 $tpl->setVariable(
"FIRSTNAME",$name[
'firstname']);
1366 $tpl->setVariable(
"MARK",$user_data[
'mark']);
1367 $tpl->setVariable(
"PARTICIPATED",$event_part->hasParticipated($user_id) ?
"X" :
"");
1368 $tpl->parseCurrentBlock();
1371 $tpl->setCurrentBlock(
'part_group');
1372 $tpl->setVariable(
'GROUP_NAME',$participants_data[
'txt']);
1373 $tpl->setVariable(
"TXT_NAME",$this->lng->txt(
'name'));
1374 $tpl->setVariable(
"TXT_MARK",$this->lng->txt(
'trac_mark'));
1375 $tpl->setVariable(
"TXT_COMMENT",$this->lng->txt(
'trac_comment'));
1376 $tpl->setVariable(
"TXT_PARTICIPATED",$this->lng->txt(
'event_tbl_participated'));
1377 if($this->object->enabledRegistration())
1379 $tpl->setVariable(
"TXT_REGISTERED",$this->lng->txt(
'event_tbl_registered'));
1381 $tpl->parseCurrentBlock();
1385 $this->tpl->setVariable(
"CONTENT",
$tpl->get());
1386 $this->tpl->setVariable(
"BODY_ATTRIBUTES",
'onload="window.print()"');
1403 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1405 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->MESSAGE);
1408 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_list.html',
'Modules/Session');
1409 $this->
__showButton($this->ctrl->getLinkTarget($this,
'exportCSV'),$this->lng->txt(
'event_csv_export'));
1411 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
1412 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
1414 $this->tpl->addBlockfile(
"EVENTS_TABLE",
"events_table",
"tpl.table.html");
1415 $this->tpl->addBlockfile(
'TBL_CONTENT',
'tbl_content',
'tpl.sess_list_row.html',
'Modules/Session');
1418 $members = $members_obj->getParticipants();
1423 $tbl->setTitle($this->lng->txt(
"event_overview"),
1425 $this->lng->txt(
'obj_usr'));
1426 $this->ctrl->setParameter($this,
'offset',(
int)
$_GET[
'offset']);
1428 $course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
1430 foreach($tree->getSubtree($tree->getNodeData(
$course_ref_id),
false,
'sess') as $event_id)
1433 if(!is_object($tmp_event) or $tmp_event->getType() !=
'sess')
1437 $events[] = $tmp_event;
1440 $headerNames = array();
1441 $headerVars = array();
1442 $colWidth = array();
1444 $headerNames[] = $this->lng->txt(
'name');
1445 $headerVars[] =
"name";
1446 $colWidth[] =
'20%';
1448 for ($i = 1; $i <= count($events); $i++)
1450 $headerNames[] = $i;
1451 $headerVars[] =
"event_".$i;
1452 $colWidth[] = 80/count($events).
"%";
1455 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1456 $tbl->setHeaderNames($headerNames);
1457 $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this,
'eventsList'));
1458 $tbl->setColumnWidth($colWidth);
1460 $tbl->setOrderColumn($_GET[
"sort_by"]);
1461 $tbl->setOrderDirection($_GET[
"sort_order"]);
1462 $tbl->setOffset($_GET[
"offset"]);
1463 $tbl->setLimit($ilUser->getPref(
"hits_per_page"));
1464 $tbl->setMaxCount(count($members));
1465 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1467 $sliced_users = array_slice($members,$_GET[
'offset'],
$_SESSION[
'tbl_limit']);
1468 $tbl->disable(
'sort');
1472 foreach($sliced_users as $user_id)
1474 foreach($events as $event_obj)
1476 $this->tpl->setCurrentBlock(
"eventcols");
1481 $this->tpl->setVariable(
"IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1485 $this->tpl->setVariable(
"PARTICIPATED", $event_part->hasParticipated($user_id) ?
1486 $this->lng->txt(
'event_participated') :
1487 $this->lng->txt(
'event_not_participated'));
1490 $this->tpl->parseCurrentBlock();
1493 $this->tpl->setCurrentBlock(
"tbl_content");
1496 $this->tpl->setVariable(
"LASTNAME",$name[
'lastname']);
1497 $this->tpl->setVariable(
"FIRSTNAME",$name[
'firstname']);
1499 $this->tpl->parseCurrentBlock();
1502 $this->tpl->setVariable(
"HEAD_TXT_LEGEND", $this->lng->txt(
"legend"));
1503 $this->tpl->setVariable(
"HEAD_TXT_DIGIT", $this->lng->txt(
"event_digit"));
1504 $this->tpl->setVariable(
"HEAD_TXT_EVENT", $this->lng->txt(
"event"));
1505 $this->tpl->setVariable(
"HEAD_TXT_LOCATION", $this->lng->txt(
"event_location"));
1506 $this->tpl->setVariable(
"HEAD_TXT_DATE_TIME",$this->lng->txt(
"event_date_time"));
1508 foreach($events as $event_obj)
1510 $this->tpl->setCurrentBlock(
"legend_loop");
1511 $this->tpl->setVariable(
"LEGEND_CSS_ROW",
ilUtil::switchColor($counter++,
'tblrow1',
'tblrow2'));
1512 $this->tpl->setVariable(
"LEGEND_DIGIT", $i++);
1513 $this->tpl->setVariable(
"LEGEND_EVENT_TITLE", $event_obj->getTitle());
1514 $this->tpl->setVariable(
"LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1515 $this->tpl->setVariable(
"LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1516 $this->tpl->setVariable(
"LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1517 $this->tpl->parseCurrentBlock();
1531 if(is_object($this->form))
1536 $this->lng->loadLanguageModule(
'dateplaner');
1538 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1540 include_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
1544 $this->form->setMultipart(
true);
1545 $this->form->setTableWidth(
'600px');
1546 $this->form->setFormAction($this->ctrl->getFormAction($this));
1547 $this->form->setMultipart(
true);
1557 $this->lng->loadLanguageModule(
'dateplaner');
1558 include_once
'./Services/Form/classes/class.ilDateDurationInputGUI.php';
1559 #$this->tpl->addJavaScript('./Modules/Session/js/toggle_session_time.js');
1560 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
1562 $dur->
setStartText($this->lng->txt(
'event_start_date'));
1563 $dur->setEndText($this->lng->txt(
'event_end_date'));
1564 $dur->enableToggleFullTime(
1565 $this->lng->txt(
'event_fulltime_info'),
1566 $this->
object->getFirstAppointment()->enabledFulltime() ?
true : false
1568 $dur->setMinuteStepSize(5);
1569 $dur->setShowTime(
true);
1570 $dur->setShowDate(
true);
1571 $dur->setStart($this->object->getFirstAppointment()->getStart());
1572 $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1574 $this->form->addItem($dur);
1593 if($a_mode ==
'create')
1595 if(!is_object($this->rec))
1597 include_once(
'./Modules/Session/classes/class.ilEventRecurrence.php');
1600 include_once(
'./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
1603 $rec->setRecurrence($this->rec);
1604 $this->form->addItem($rec);
1608 $section->setTitle($this->lng->txt(
'event_section_information'));
1613 $title->setValue($this->object->getTitle());
1615 $title->setMaxLength(70);
1616 $this->form->addItem(
$title);
1620 $desc->
setValue($this->object->getLongDescription());
1623 $this->form->addItem($desc);
1627 $desc->
setValue($this->object->getLocation());
1630 $this->form->addItem($desc);
1633 $details =
new ilTextAreaInputGUI($this->lng->txt(
'event_details_workflow'),
'details');
1634 $details->
setValue($this->object->getDetails());
1635 $details->setCols(50);
1636 $details->setRows(4);
1637 $this->form->addItem($details);
1641 $section->setTitle($this->lng->txt(
'event_tutor_data'));
1645 $tutor_name =
new ilTextInputGUI($this->lng->txt(
'tutor_name'),
'tutor_name');
1646 $tutor_name->
setValue($this->object->getName());
1647 $tutor_name->setSize(20);
1648 $tutor_name->setMaxLength(70);
1649 $this->form->addItem($tutor_name);
1652 $tutor_email =
new ilTextInputGUI($this->lng->txt(
'tutor_email'),
'tutor_email');
1653 $tutor_email->
setValue($this->object->getEmail());
1654 $tutor_email->setSize(20);
1655 $tutor_email->setMaxLength(70);
1656 $this->form->addItem($tutor_email);
1659 $tutor_phone =
new ilTextInputGUI($this->lng->txt(
'tutor_phone'),
'tutor_phone');
1660 $tutor_phone->
setValue($this->object->getPhone());
1661 $tutor_phone->setSize(20);
1662 $tutor_phone->setMaxLength(70);
1663 $this->form->addItem($tutor_phone);
1666 $section->setTitle($this->lng->txt(
'crs_further_settings'));
1671 $reg->
setChecked($this->object->enabledRegistration() ?
true :
false);
1672 $reg->setOptionTitle($this->lng->txt(
'event_registration_info'));
1673 $this->form->addItem($reg);
1677 $section->setTitle($this->lng->txt(
'event_assign_files'));
1681 $files->setFilenames(array(0 =>
''));
1682 $this->form->addItem(
$files);
1687 $this->form->setTitle($this->lng->txt(
'event_table_create'));
1690 $this->form->addCommandButton(
'save',$this->lng->txt(
'event_btn_add'));
1691 $this->form->addCommandButton(
'saveAndAssignMaterials',$this->lng->txt(
'event_btn_add_edit'));
1692 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1697 $this->form->setTitle($this->lng->txt(
'event_table_update'));
1700 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
1701 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1719 $this->
object->getFirstAppointment()->setStartingTime($this->
__toUnix(
$_POST[
'event'][
'start'][
'date'],
$_POST[
'event'][
'start'][
'time']));
1720 $this->
object->getFirstAppointment()->setEndingTime($this->
__toUnix(
$_POST[
'event'][
'end'][
'date'],
$_POST[
'event'][
'end'][
'time']));
1721 $this->
object->getFirstAppointment()->toggleFullTime((
bool)
$_POST[
'event'][
'fulltime']);
1723 include_once(
'./Services/Calendar/classes/class.ilDate.php');
1724 if($this->object->getFirstAppointment()->isFullday())
1726 $start =
new ilDate($_POST[
'event'][
'start'][
'date'][
'y'].
'-'.$_POST[
'event'][
'start'][
'date'][
'm'].
'-'.$_POST[
'event'][
'start'][
'date'][
'd'],
1728 $this->
object->getFirstAppointment()->setStart($start);
1730 $end =
new ilDate($_POST[
'event'][
'end'][
'date'][
'y'].
'-'.$_POST[
'event'][
'end'][
'date'][
'm'].
'-'.$_POST[
'event'][
'end'][
'date'][
'd'],
1732 $this->
object->getFirstAppointment()->setEnd($end);
1736 $start_dt[
'year'] = (int) $_POST[
'event'][
'start'][
'date'][
'y'];
1737 $start_dt[
'mon'] = (int) $_POST[
'event'][
'start'][
'date'][
'm'];
1738 $start_dt[
'mday'] = (int) $_POST[
'event'][
'start'][
'date'][
'd'];
1739 $start_dt[
'hours'] = (int) $_POST[
'event'][
'start'][
'time'][
'h'];
1740 $start_dt[
'minutes'] = (int) $_POST[
'event'][
'start'][
'time'][
'm'];
1743 $this->
object->getFirstAppointment()->setStart($start);
1745 $end_dt[
'year'] = (int) $_POST[
'event'][
'end'][
'date'][
'y'];
1746 $end_dt[
'mon'] = (int) $_POST[
'event'][
'end'][
'date'][
'm'];
1747 $end_dt[
'mday'] = (int) $_POST[
'event'][
'end'][
'date'][
'd'];
1748 $end_dt[
'hours'] = (int) $_POST[
'event'][
'end'][
'time'][
'h'];
1749 $end_dt[
'minutes'] = (int) $_POST[
'event'][
'end'][
'time'][
'm'];
1751 $this->
object->getFirstAppointment()->setEnd($end);
1761 $this->
object->enableRegistration((
int) $_POST[
'registration']);
1772 include_once(
'./Modules/Session/classes/class.ilSessionRecurrence.php');
1775 switch(
$_POST[
'frequence'])
1778 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1779 $this->rec->setInterval((
int)
$_POST[
'count_DAILY']);
1783 $this->rec->setFrequenceType($_POST[
'frequence']);
1784 $this->rec->setInterval((
int) $_POST[
'count_WEEKLY']);
1785 if(is_array($_POST[
'byday_WEEKLY']))
1792 $this->rec->setFrequenceType($_POST[
'frequence']);
1793 $this->rec->setInterval((
int) $_POST[
'count_MONTHLY']);
1794 switch((
int) $_POST[
'subtype_MONTHLY'])
1801 switch((
int) $_POST[
'monthly_byday_day'])
1805 $this->rec->setBYSETPOS((
int) $_POST[
'monthly_byday_num']);
1806 $this->rec->setBYDAY(
'MO,TU,WE,TH,FR');
1811 $this->rec->setBYMONTHDAY((
int) $_POST[
'monthly_byday_num']);
1815 $this->rec->setBYDAY((
int) $_POST[
'monthly_byday_num'].$_POST[
'monthly_byday_day']);
1821 $this->rec->setBYMONTHDAY((
int) $_POST[
'monthly_bymonthday']);
1827 $this->rec->setFrequenceType($_POST[
'frequence']);
1828 $this->rec->setInterval((
int) $_POST[
'count_YEARLY']);
1829 switch((
int) $_POST[
'subtype_YEARLY'])
1836 $this->rec->setBYMONTH((
int) $_POST[
'yearly_bymonth_byday']);
1837 $this->rec->setBYDAY((
int) $_POST[
'yearly_byday_num'].$_POST[
'yearly_byday']);
1841 $this->rec->setBYMONTH((
int) $_POST[
'yearly_bymonth_by_monthday']);
1842 $this->rec->setBYMONTHDAY((
int) $_POST[
'yearly_bymonthday']);
1849 switch((
int)
$_POST[
'until_type'])
1852 $this->rec->setFrequenceUntilDate(null);
1857 $this->rec->setFrequenceUntilDate(null);
1858 $this->rec->setFrequenceUntilCount((
int) $_POST[
'count']);
1862 $end_dt[
'year'] = (int) $_POST[
'until_end'][
'date'][
'y'];
1863 $end_dt[
'mon'] = (int) $_POST[
'until_end'][
'date'][
'm'];
1864 $end_dt[
'mday'] = (int) $_POST[
'until_end'][
'date'][
'd'];
1866 $this->rec->setFrequenceUntilCount(0);
1882 return mktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
1895 $path = $this->lng->txt(
'path') .
': ';
1897 foreach($tree->getPathFull($a_ref_id,$this->course_ref_id) as $node)
1899 if($node[
'ref_id'] != $a_ref_id)
1906 $path .= $node[
'title'];
1922 if (is_object($this->
object))
1924 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1936 global $ilAccess,$ilTabs,
$tree;
1938 $parent_id = $tree->getParentId($this->object->getRefId());
1940 $tabs_gui->setBackTarget($this->lng->txt(
'back_to_crs_content'),
'repository.php?ref_id='.$parent_id);
1941 $tabs_gui->addTarget(
'info_short',
1942 $this->ctrl->getLinkTarget($this,
'infoScreen'));
1944 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1946 $tabs_gui->addTarget(
'edit_properties',
1947 $this->ctrl->getLinkTarget($this,
'edit'));
1948 $tabs_gui->addTarget(
'crs_materials',
1949 $this->ctrl->getLinkTarget($this,
'materials'));
1950 $tabs_gui->addTarget(
'event_edit_members',
1951 $this->ctrl->getLinkTarget($this,
'members'));
1955 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1957 $ilTabs->addTarget(
"export",
1958 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
"",
"ilexportgui");
1963 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId()))
1965 $tabs_gui->addTarget(
"perm_settings",
1966 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');