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);
108 if (
$cmd !=
"infoScreenObject")
132 $title = strlen($this->object->getTitle()) ? (
': '.$this->object->getTitle()) :
'';
134 include_once
'./Modules/Session/classes/class.ilSessionAppointment.php';
135 $this->tpl->setTitle(
136 $this->object->getFirstAppointment()->appointmentToString().$title);
151 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
155 $this->ctrl->returnToParent($this);
168 include_once
'./Modules/Session/classes/class.ilEventParticipants.php';
182 $this->ctrl->redirect($this,
'infoScreen');
195 include_once
'./Modules/Session/classes/class.ilEventParticipants.php';
199 $this->ctrl->returnToParent($this);
210 public static function _goto($a_target)
214 if($ilAccess->checkAccess(
'visible',
"", $a_target))
216 $_GET[
"cmd"] =
"infoScreen";
217 $_GET[
"ref_id"] = $a_target;
218 include(
"repository.php");
221 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
229 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
239 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
252 $this->ctrl->setCmd(
"showSummary");
253 $this->ctrl->setCmdClass(
"ilinfoscreengui");
265 if (
$course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs'))
267 include_once(
"./Modules/Course/classes/class.ilObjCourse.php");
268 include_once(
"./Modules/Course/classes/class.ilObjCourseGUI.php");
278 $this->object->getRefId());
294 $this->tabs_gui->setTabActive(
'info_short');
296 $appointment_obj = $this->
object->getFirstAppointment();
298 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
301 if($this->object->enabledRegistration())
303 include_once
'./Modules/Session/classes/class.ilEventParticipants.php';
306 $ilToolbar->addFormButton($this->lng->txt(
'event_unregister'),
'join');
314 $ilToolbar->addFormButton($this->lng->txt(
'join_session'),
'join');
316 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
320 if(strlen($this->object->getLocation()) or strlen($this->object->getDetails()))
322 $info->addSection($this->lng->txt(
'event_section_information'));
324 if(strlen(
$location = $this->object->getLocation()))
326 $info->addProperty($this->lng->txt(
'event_location'),
327 nl2br($this->object->getLocation()));
329 if(strlen($this->object->getDetails()))
331 $info->addProperty($this->lng->txt(
'event_details_workflow'),
332 nl2br($this->object->getDetails()));
336 if($this->object->hasTutorSettings())
338 $info->addSection($this->lng->txt(
'event_tutor_data'));
339 if(strlen($fullname = $this->object->getName()))
341 $info->addProperty($this->lng->txt(
'event_lecturer'),
344 if(strlen($email = $this->object->getEmail()))
346 $info->addProperty($this->lng->txt(
'tutor_email'),
349 if(strlen($phone = $this->object->getPhone()))
351 $info->addProperty($this->lng->txt(
'tutor_phone'),
356 include_once
'./Modules/Session/classes/class.ilSessionObjectListGUIFactory.php';
357 include_once
'./Modules/Session/classes/class.ilEventItems.php';
358 include_once
'./Modules/Course/classes/class.ilCourseItems.php';
362 foreach($eventItems->getItems() as $item_id)
369 $list_gui->setContainerObject($this);
372 $html .= $list_gui->getListItemHTML(
382 $info->addSection($this->lng->txt(
'event_materials'));
389 $this->ctrl->forwardCommand($info);
416 if(!is_object($this->
object))
420 $this->ctrl->setParameter($this,
'new_type',
'sess');
422 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_create.html',
'Modules/Session');
423 $this->tpl->setVariable(
'EVENT_ADD_TABLE',$this->form->getHTML());
438 $this->ctrl->setParameter($this,
'ref_id',$this->object->getRefId());
439 $target = $this->ctrl->getLinkTarget($this,
'materials');
440 $target = str_replace(
'new_type=',
'nt=',$target);
462 $ilErr->setMessage(
'');
463 if(!$this->form->checkInput()) {
464 $ilErr->setMessage($this->lng->txt(
'err_check_input'));
467 $this->
object->validate();
468 $this->
object->getFirstAppointment()->validate();
470 if(strlen($ilErr->getMessage()))
477 $this->
object->create();
478 $this->
object->createReference();
479 $this->
object->putInTree(
$_GET[
"ref_id"]);
480 $this->
object->setPermissions(
$_GET[
"ref_id"]);
483 $this->
object->getFirstAppointment()->setSessionId($this->object->getId());
484 $this->
object->getFirstAppointment()->create();
502 include_once
'./Modules/Course/classes/class.ilCourseItems.php';
506 if($a_redirect_on_success)
509 $this->ctrl->returnToParent($this);
520 include_once
'./Modules/Session/classes/class.ilEventItems.php';
527 if(!isset($_FILES[
'files'][
'name'][$counter]))
531 if(!strlen($_FILES[
'files'][
'name'][$counter]))
537 include_once
'./Modules/File/classes/class.ilObjFile.php';
540 $file->setDescription(
'');
542 $file->setFileType($_FILES[
'files'][
'type'][$counter]);
543 $file->setFileSize($_FILES[
'files'][
'size'][$counter]);
545 $new_ref_id =
$file->createReference();
546 $file->putInTree($tree->getParentId($this->object->getRefId()));
547 $file->setPermissions($tree->getParentId($this->object->getRefId()));
548 $file->createDirectory();
549 $file->getUploadFile(
550 $_FILES[
'files'][
'tmp_name'][$counter],
551 $_FILES[
'files'][
'name'][$counter]
554 $items[] = $new_ref_id;
576 if(!$this->rec->getFrequenceType())
580 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php');
583 $period_start = clone $this->
object->getFirstAppointment()->getStart();
586 $period_end = clone $this->
object->getFirstAppointment()->getStart();
590 $period_diff = $this->
object->getFirstAppointment()->getEnd()->get(
IL_CAL_UNIX) -
591 $this->
object->getFirstAppointment()->getStart()->get(
IL_CAL_UNIX);
592 $parent_id = $tree->getParentId($this->object->getRefId());
594 include_once
'./Modules/Session/classes/class.ilEventItems.php';
599 foreach($date_list->get() as $date)
606 $new_obj = $this->
object->cloneObject($parent_id);
608 $new_obj->getFirstAppointment()->setStartingTime($date->get(
IL_CAL_UNIX));
609 $new_obj->getFirstAppointment()->setEndingTime($date->get(
IL_CAL_UNIX) + $period_diff);
610 $new_obj->getFirstAppointment()->update();
629 $this->tabs_gui->setTabActive(
'edit_properties');
632 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_edit.html',
'Modules/Session');
633 $this->tpl->setVariable(
'EVENT_EDIT_TABLE',$this->form->getHTML());
635 if(!count($this->object->getFiles()))
640 foreach($this->object->getFiles() as
$file)
642 $table_data[
'id'] =
$file->getFileId();
643 $table_data[
'filename'] =
$file->getFileName();
644 $table_data[
'filetype'] =
$file->getFileType();
645 $table_data[
'filesize'] =
$file->getFileSize();
647 $rows[] = $table_data;
650 include_once(
"./Modules/Session/classes/class.ilSessionFileTableGUI.php");
652 $table_gui->setTitle($this->lng->txt(
"event_files"));
653 $table_gui->setData($rows);
654 $table_gui->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
655 $table_gui->addMultiCommand(
"confirmDeleteFiles", $this->lng->txt(
"delete"));
656 $table_gui->setSelectAllCheckbox(
"file_id");
657 $this->tpl->setVariable(
'EVENT_FILE_TABLE',$table_gui->getHTML());
676 $ilErr->setMessage(
'');
677 if(!$this->form->checkInput())
679 $ilErr->setMessage($this->lng->txt(
'err_check_input'));
681 $this->
object->validate();
682 $this->
object->getFirstAppointment()->validate();
684 if(strlen($ilErr->getMessage()))
691 $this->
object->update();
692 $this->
object->getFirstAppointment()->update();
694 foreach($this->files as $file_obj)
696 $file_obj->setSessionId($this->object->getEventId());
703 $this->ctrl->redirect($this,
'edit');
704 #$this->object->initFiles();
705 #$this->editObject();
718 $this->tabs_gui->setTabActive(
'edit_properties');
720 if(!count(
$_POST[
'file_id']))
727 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
731 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteFiles"));
732 $c_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
733 $c_gui->setCancel($this->lng->txt(
"cancel"),
"edit");
734 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteFiles");
737 foreach(
$_POST[
"file_id"] as $file_id)
740 if(
$file->getSessionId() != $this->
object->getEventId())
746 $c_gui->addItem(
"file_id[]", $file_id,
$file->getFileName());
749 $this->tpl->setContent($c_gui->getHTML());
762 if(!count(
$_POST[
'file_id']))
768 foreach(
$_POST[
'file_id'] as $id)
773 $this->
object->initFiles();
789 $this->tabs_gui->setTabActive(
'crs_materials');
791 include_once
'Modules/Session/classes/class.ilEventItems.php';
792 $this->event_items =
new ilEventItems($this->object->getId());
793 $items = $this->event_items->
getItems();
795 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_materials.html',
'Modules/Session');
796 #$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
798 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this,
'materials'));
800 $this->tpl->setVariable(
"COLL_TITLE_IMG_ALT",$this->lng->txt(
'events'));
801 $this->tpl->setVariable(
"TABLE_TITLE",$this->lng->txt(
'event_assign_materials_table'));
802 $this->tpl->setVariable(
"TABLE_INFO",$this->lng->txt(
'event_assign_materials_info'));
804 $this->course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
805 if(!$this->course_ref_id)
810 $nodes = $tree->getSubTree($tree->getNodeData($this->course_ref_id));
812 foreach($nodes as $node)
815 if ($objDefinition->isSideBlock($node[
'type']) or $node[
'type'] ==
'sess')
820 if($node[
'type'] ==
'rolf')
828 $this->tpl->setCurrentBlock(
"material_row");
831 $this->tpl->setVariable(
'IMG_ALT',$this->lng->txt(
'obj_'.$node[
'type']));
833 $this->tpl->setVariable(
"CHECK_COLL",
ilUtil::formCheckbox(in_array($node[
'ref_id'],$items) ? 1 : 0,
834 'items[]',$node[
'ref_id']));
835 $this->tpl->setVariable(
"COLL_TITLE",$node[
'title']);
837 if(strlen($node[
'description']))
839 $this->tpl->setVariable(
"COLL_DESC",$node[
'description']);
841 $this->tpl->setVariable(
"ASSIGNED_IMG_OK",in_array($node[
'ref_id'],$items) ?
844 $this->tpl->setVariable(
"ASSIGNED_STATUS",$this->lng->txt(
'event_material_assigned'));
845 $this->tpl->setVariable(
"COLL_PATH",$this->
formatPath($node[
'ref_id']));
846 $this->tpl->parseCurrentBlock();
850 $this->tpl->setVariable(
"SELECT_ALL",$this->lng->txt(
'select_all'));
852 $this->tpl->setVariable(
"BTN_SAVE",$this->lng->txt(
'save'));
864 include_once
'./Modules/Session/classes/class.ilEventItems.php';
866 $this->event_items =
new ilEventItems($this->object->getId());
868 $this->event_items->update();
880 global
$tree,$ilUser;
883 $this->tabs_gui->setTabActive(
'event_edit_members');
885 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_members.html',
'Modules/Session');
887 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
890 $this->lng->txt(
'print'),
891 $this->ctrl->getLinkTarget($this,
'printViewMembers'),
893 $toolbar->addButton($this->lng->txt(
'sess_gen_attendance_list'),
894 $this->ctrl->getLinkTarget($this,
'attendanceList'));
896 $this->tpl->setVariable(
'ACTION_BUTTONS',$toolbar->getHTML());
898 $this->course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
900 if(!$this->course_ref_id)
906 include_once
'./Modules/Course/classes/class.ilCourseParticipants.php';
907 include_once
'./Modules/Session/classes/class.ilEventParticipants.php';
916 if(count($admins = $members_obj->getAdmins()))
918 include_once(
'./Modules/Session/classes/class.ilSessionParticipantsTableGUI.php');
919 if($ilUser->getPref(
'sess_admin_hide'))
922 $this->ctrl->setParameter($this,
'admin_hide',0);
923 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
924 $this->lng->txt(
'show'),
927 $this->ctrl->clearParameters($this);
932 $this->ctrl->setParameter($this,
'admin_hide',1);
933 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
934 $this->lng->txt(
'hide'),
937 $this->ctrl->clearParameters($this);
940 $table->addCommandButton(
'updateMembers',$this->lng->txt(
'save'));
941 $table->setTitle($this->lng->txt(
'event_tbl_admins'),
'icon_usr.gif',$this->lng->txt(
'event_tbl_admins'));
942 $table->enableRegistration($this->object->enabledRegistration());
943 $table->setParticipants($admins);
945 $this->tpl->setVariable(
'ADMINS',$table->getHTML());
949 if(count($tutors = $members_obj->getTutors()))
951 include_once(
'./Modules/Session/classes/class.ilSessionParticipantsTableGUI.php');
952 if($ilUser->getPref(
'sess_tutor_hide'))
955 $this->ctrl->setParameter($this,
'tutor_hide',0);
956 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
957 $this->lng->txt(
'show'),
960 $this->ctrl->clearParameters($this);
965 $this->ctrl->setParameter($this,
'tutor_hide',1);
966 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
967 $this->lng->txt(
'hide'),
970 $this->ctrl->clearParameters($this);
972 $table->addCommandButton(
'updateMembers',$this->lng->txt(
'save'));
973 $table->setTitle($this->lng->txt(
'event_tbl_tutors'),
'icon_usr.gif',$this->lng->txt(
'event_tbl_admins'));
974 $table->enableRegistration($this->object->enabledRegistration());
975 $table->setParticipants($tutors);
977 $this->tpl->setVariable(
'TUTORS',$table->getHTML());
981 if(count($members = $members_obj->getMembers()))
983 include_once(
'./Modules/Session/classes/class.ilSessionParticipantsTableGUI.php');
984 if($ilUser->getPref(
'sess_member_hide'))
987 $this->ctrl->setParameter($this,
'member_hide',0);
988 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
989 $this->lng->txt(
'show'),
992 $this->ctrl->clearParameters($this);
997 $this->ctrl->setParameter($this,
'member_hide',1);
998 $table->addHeaderCommand($this->ctrl->getLinkTarget($this,
'members'),
999 $this->lng->txt(
'hide'),
1002 $this->ctrl->clearParameters($this);
1004 $table->addCommandButton(
'updateMembers',$this->lng->txt(
'save'));
1005 $table->setTitle($this->lng->txt(
'event_tbl_members'),
'icon_usr.gif',$this->lng->txt(
'event_tbl_admins'));
1006 $table->enableRegistration($this->object->enabledRegistration());
1007 $table->setParticipants($members);
1009 $this->tpl->setVariable(
'MEMBERS',$table->getHTML());
1028 if(isset(
$_GET[
'admin_hide']))
1030 $ilUser->writePref(
'sess_admin_hide',(
int)
$_GET[
'admin_hide']);
1032 if(isset(
$_GET[
'tutor_hide']))
1034 $ilUser->writePref(
'sess_tutor_hide',(
int)
$_GET[
'tutor_hide']);
1036 if(isset(
$_GET[
'member_hide']))
1038 $ilUser->writePref(
'sess_member_hide',(
int)
$_GET[
'member_hide']);
1055 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
1056 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
1058 $this->course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
1060 if(!$this->course_ref_id)
1066 $_POST[
'participants'] = is_array(
$_POST[
'participants']) ?
$_POST[
'participants'] : array();
1071 $visible =
$_POST[
'visible_participants'] ?
$_POST[
'visible_participants'] : array();
1072 foreach($visible as
$user)
1078 $part->setParticipated(isset(
$_POST[
'participants'][$user]) ?
true :
false);
1080 $part->updateUser();
1094 global
$tpl,$ilTabs;
1098 $ilTabs->setTabActive(
'event_edit_members');
1101 $tpl->setContent($this->form->getHTML());
1113 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1116 $this->form->setFormAction($this->ctrl->getFormAction($this));
1117 $this->form->setTarget(
'_blank');
1118 $this->form->setTitle($this->lng->txt(
'sess_gen_attendance_list'));
1123 $this->form->addItem($mark);
1126 $comment->setOptionTitle($this->lng->txt(
'sess_gen_comment'));
1130 $signature =
new ilCheckboxInputGUI($this->lng->txt(
'sess_signature'),
'show_signature');
1131 $signature->
setOptionTitle($this->lng->txt(
'sess_gen_signature'));
1132 $signature->setValue(1);
1133 $this->form->addItem($signature);
1136 $part->setTitle($this->lng->txt(
'event_participant_selection'));
1137 $this->form->addItem($part);
1142 $admin->setValue(1);
1143 $this->form->addItem($admin);
1148 $tutor->setValue(1);
1149 $this->form->addItem($tutor);
1152 $member =
new ilCheckboxInputGUI($this->lng->txt(
'event_tbl_members'),
'show_members');
1154 $member->setValue(1);
1155 $member->setChecked(
true);
1156 $this->form->addItem($member);
1158 $this->form->addCommandButton(
'printAttendanceList',$this->lng->txt(
'sess_print_attendance_list'));
1159 #$this->form->addCommandButton('members', $this->lng->txt('cancel'));
1172 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
1173 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
1177 $this->course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
1179 if(!$this->course_ref_id)
1186 $event_app = $this->
object->getFirstAppointment();
1190 $this->tpl =
new ilTemplate(
'tpl.main.html',
true,
true);
1193 $this->tpl->setVariable(
"LOCATION_STYLESHEET",$location_stylesheet);
1195 $tpl =
new ilTemplate(
'tpl.sess_attendance_list_print.html',
true,
true,
'Modules/Session');
1197 $tpl->setVariable(
"ATTENDANCE_LIST",$this->lng->txt(
'sess_attendance_list'));
1198 $tpl->setVariable(
"EVENT_NAME",$this->object->getTitle() ?
': '.$this->object->getTitle() :
'');
1203 $tpl->setVariable(
"TXT_NAME",$this->lng->txt(
'name'));
1206 $tpl->setVariable(
"TXT_MARK",$this->lng->txt(
'trac_mark'));
1208 if(
$_POST[
'show_comment'])
1210 $tpl->setVariable(
"TXT_COMMENT",$this->lng->txt(
'trac_comment'));
1212 if(
$_POST[
'show_signature'])
1214 $tpl->setVariable(
"TXT_SIGNATURE",$this->lng->txt(
'sess_signature'));
1217 if(
$_POST[
'show_admins'])
1219 $members = array_merge((array) $members,$members_obj->getAdmins());
1221 if(
$_POST[
'show_tutors'])
1223 $members = array_merge((array) $members,$members_obj->getTutors());
1225 if(
$_POST[
'show_members'])
1227 $members = array_merge((array) $members,$members_obj->getMembers());
1229 $members =
ilUtil::_sortIds((array) $members,
'usr_data',
'lastname',
'usr_id');
1231 foreach($members as $user_id)
1233 $user_data = $event_part->getUser($user_id);
1237 $tpl->setVariable(
"MARK",$user_data[
'mark'] ? $user_data[
'mark'] :
' ');
1239 if(
$_POST[
'show_comment'])
1241 $tpl->setVariable(
"COMMENT",$user_data[
'comment'] ? $user_data[
'comment'] :
' ');
1243 if(
$_POST[
'show_signature'])
1245 $tpl->touchBlock(
'row_signature');
1248 $tpl->setCurrentBlock(
"member_row");
1250 $tpl->setVariable(
"LASTNAME",
$name[
'lastname']);
1251 $tpl->setVariable(
"FIRSTNAME",
$name[
'firstname']);
1253 $tpl->parseCurrentBlock();
1256 $this->tpl->setVariable(
"CONTENT",
$tpl->get());
1257 $this->tpl->setVariable(
"BODY_ATTRIBUTES",
'onload="window.print()"');
1272 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
1273 include_once(
'./Modules/Course/classes/class.ilCourseParticipants.php');
1277 $this->course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
1279 if(!$this->course_ref_id)
1286 $event_app = $this->
object->getFirstAppointment();
1289 $this->tpl =
new ilTemplate(
'tpl.main.html',
true,
true);
1292 $this->tpl->setVariable(
"LOCATION_STYLESHEET",$location_stylesheet);
1294 $tpl =
new ilTemplate(
'tpl.sess_members_print.html',
true,
true,
'Modules/Session');
1296 #$tpl->setVariable("EVENT",$this->lng->txt('event'));
1297 $tpl->setVariable(
"EVENT_NAME",$this->object->getTitle() ?
': '.$this->object->getTitle() : $this->
object->getTitle());
1303 if(!$ilUser->getPref(
'sess_admin_hide') and count($members_obj->getAdmins()))
1305 $tmp[
'txt'] = $this->lng->txt(
'event_tbl_admins');
1306 $tmp[
'users'] = $members_obj->getAdmins();
1308 $participants[] = $tmp;
1310 if(!$ilUser->getPref(
'sess_tutor_hide') and count($members_obj->getTutors()))
1312 $tmp[
'txt'] = $this->lng->txt(
'event_tbl_tutors');
1313 $tmp[
'users'] = $members_obj->getTutors();
1315 $participants[] = $tmp;
1317 if(!$ilUser->getPref(
'sess_member_hide') and count($members_obj->getMembers()))
1319 $tmp[
'txt'] = $this->lng->txt(
'event_tbl_members');
1320 $tmp[
'users'] = $members_obj->getMembers();
1322 $participants[] = $tmp;
1325 foreach((array) $participants as $participants_data)
1327 $members =
ilUtil::_sortIds($participants_data[
'users'],
'usr_data',
'lastname',
'usr_id');
1328 foreach($members as $user_id)
1331 $user_data = $event_part->getUser($user_id);
1333 if($this->object->enabledRegistration())
1335 $tpl->setCurrentBlock(
"reg_col");
1336 $tpl->setVariable(
"REGISTERED",$event_part->isRegistered($user_id) ?
"X" :
"");
1337 $tpl->parseCurrentBlock();
1339 $tpl->setVariable(
"COMMENT",$user_data[
'comment']);
1341 $tpl->setCurrentBlock(
"member_row");
1343 $tpl->setVariable(
"LASTNAME",
$name[
'lastname']);
1344 $tpl->setVariable(
"FIRSTNAME",
$name[
'firstname']);
1346 $tpl->setVariable(
"MARK",$user_data[
'mark']);
1347 $tpl->setVariable(
"PARTICIPATED",$event_part->hasParticipated($user_id) ?
"X" :
"");
1348 $tpl->parseCurrentBlock();
1351 $tpl->setCurrentBlock(
'part_group');
1352 $tpl->setVariable(
'GROUP_NAME',$participants_data[
'txt']);
1353 $tpl->setVariable(
"TXT_NAME",$this->lng->txt(
'name'));
1354 $tpl->setVariable(
"TXT_MARK",$this->lng->txt(
'trac_mark'));
1355 $tpl->setVariable(
"TXT_COMMENT",$this->lng->txt(
'trac_comment'));
1356 $tpl->setVariable(
"TXT_PARTICIPATED",$this->lng->txt(
'event_tbl_participated'));
1357 if($this->object->enabledRegistration())
1359 $tpl->setVariable(
"TXT_REGISTERED",$this->lng->txt(
'event_tbl_registered'));
1361 $tpl->parseCurrentBlock();
1365 $this->tpl->setVariable(
"CONTENT",
$tpl->get());
1366 $this->tpl->setVariable(
"BODY_ATTRIBUTES",
'onload="window.print()"');
1383 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1385 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->MESSAGE);
1388 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.sess_list.html',
'Modules/Session');
1389 $this->
__showButton($this->ctrl->getLinkTarget($this,
'exportCSV'),$this->lng->txt(
'event_csv_export'));
1391 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
1392 include_once
'Modules/Session/classes/class.ilEventParticipants.php';
1394 $this->tpl->addBlockfile(
"EVENTS_TABLE",
"events_table",
"tpl.table.html");
1395 $this->tpl->addBlockfile(
'TBL_CONTENT',
'tbl_content',
'tpl.sess_list_row.html',
'Modules/Session');
1398 $members = $members_obj->getParticipants();
1403 $tbl->setTitle($this->lng->txt(
"event_overview"),
1405 $this->lng->txt(
'obj_usr'));
1406 $this->ctrl->setParameter($this,
'offset',(
int)
$_GET[
'offset']);
1408 $course_ref_id = $tree->checkForParentType($this->object->getRefId(),
'crs');
1410 foreach($tree->getSubtree($tree->getNodeData(
$course_ref_id),
false,
'sess') as $event_id)
1413 if(!is_object($tmp_event) or $tmp_event->getType() !=
'sess')
1417 $events[] = $tmp_event;
1420 $headerNames = array();
1421 $headerVars = array();
1422 $colWidth = array();
1424 $headerNames[] = $this->lng->txt(
'name');
1425 $headerVars[] =
"name";
1426 $colWidth[] =
'20%';
1428 for ($i = 1; $i <= count($events); $i++)
1430 $headerNames[] = $i;
1431 $headerVars[] =
"event_".$i;
1432 $colWidth[] = 80/count($events).
"%";
1435 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1436 $tbl->setHeaderNames($headerNames);
1437 $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this,
'eventsList'));
1438 $tbl->setColumnWidth($colWidth);
1440 $tbl->setOrderColumn($_GET[
"sort_by"]);
1441 $tbl->setOrderDirection($_GET[
"sort_order"]);
1442 $tbl->setOffset($_GET[
"offset"]);
1443 $tbl->setLimit($ilUser->getPref(
"hits_per_page"));
1444 $tbl->setMaxCount(count($members));
1445 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1447 $sliced_users = array_slice($members,$_GET[
'offset'],
$_SESSION[
'tbl_limit']);
1448 $tbl->disable(
'sort');
1452 foreach($sliced_users as $user_id)
1454 foreach($events as $event_obj)
1456 $this->tpl->setCurrentBlock(
"eventcols");
1461 $this->tpl->setVariable(
"IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1465 $this->tpl->setVariable(
"PARTICIPATED", $event_part->hasParticipated($user_id) ?
1466 $this->lng->txt(
'event_participated') :
1467 $this->lng->txt(
'event_not_participated'));
1470 $this->tpl->parseCurrentBlock();
1473 $this->tpl->setCurrentBlock(
"tbl_content");
1476 $this->tpl->setVariable(
"LASTNAME",
$name[
'lastname']);
1477 $this->tpl->setVariable(
"FIRSTNAME",
$name[
'firstname']);
1479 $this->tpl->parseCurrentBlock();
1482 $this->tpl->setVariable(
"HEAD_TXT_LEGEND", $this->lng->txt(
"legend"));
1483 $this->tpl->setVariable(
"HEAD_TXT_DIGIT", $this->lng->txt(
"event_digit"));
1484 $this->tpl->setVariable(
"HEAD_TXT_EVENT", $this->lng->txt(
"event"));
1485 $this->tpl->setVariable(
"HEAD_TXT_LOCATION", $this->lng->txt(
"event_location"));
1486 $this->tpl->setVariable(
"HEAD_TXT_DATE_TIME",$this->lng->txt(
"event_date_time"));
1488 foreach($events as $event_obj)
1490 $this->tpl->setCurrentBlock(
"legend_loop");
1491 $this->tpl->setVariable(
"LEGEND_CSS_ROW",
ilUtil::switchColor($counter++,
'tblrow1',
'tblrow2'));
1492 $this->tpl->setVariable(
"LEGEND_DIGIT", $i++);
1493 $this->tpl->setVariable(
"LEGEND_EVENT_TITLE", $event_obj->getTitle());
1494 $this->tpl->setVariable(
"LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1495 $this->tpl->setVariable(
"LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1496 $this->tpl->setVariable(
"LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1497 $this->tpl->parseCurrentBlock();
1511 if(is_object($this->form))
1516 $this->lng->loadLanguageModule(
'dateplaner');
1518 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1520 include_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
1524 $this->form->setMultipart(
true);
1525 $this->form->setTableWidth(
'60%');
1526 $this->form->setFormAction($this->ctrl->getFormAction($this));
1527 $this->form->setMultipart(
true);
1537 $this->lng->loadLanguageModule(
'dateplaner');
1538 include_once
'./Services/Form/classes/class.ilDateDurationInputGUI.php';
1539 #$this->tpl->addJavaScript('./Modules/Session/js/toggle_session_time.js');
1540 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
1542 $dur->
setStartText($this->lng->txt(
'event_start_date'));
1543 $dur->setEndText($this->lng->txt(
'event_end_date'));
1544 $dur->enableToggleFullTime(
1545 $this->lng->txt(
'event_fulltime_info'),
1546 $this->
object->getFirstAppointment()->enabledFulltime() ?
true : false
1548 $dur->setMinuteStepSize(5);
1549 $dur->setShowTime(
true);
1550 $dur->setShowDate(
true);
1551 $dur->setStart($this->object->getFirstAppointment()->getStart());
1552 $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1554 $this->form->addItem($dur);
1573 if($a_mode ==
'create')
1575 if(!is_object($this->rec))
1577 include_once(
'./Modules/Session/classes/class.ilEventRecurrence.php');
1580 include_once(
'./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
1583 $rec->setRecurrence($this->rec);
1584 $this->form->addItem($rec);
1588 $section->setTitle($this->lng->txt(
'event_section_information'));
1593 $title->setValue($this->object->getTitle());
1595 $title->setMaxLength(70);
1596 $this->form->addItem(
$title);
1600 $desc->setValue($this->object->getLongDescription());
1603 $this->form->addItem(
$desc);
1607 $desc->setValue($this->object->getLocation());
1610 $this->form->addItem(
$desc);
1613 $details =
new ilTextAreaInputGUI($this->lng->txt(
'event_details_workflow'),
'details');
1614 $details->
setValue($this->object->getDetails());
1615 $details->setCols(50);
1616 $details->setRows(4);
1617 $this->form->addItem($details);
1621 $section->setTitle($this->lng->txt(
'event_tutor_data'));
1625 $tutor_name =
new ilTextInputGUI($this->lng->txt(
'tutor_name'),
'tutor_name');
1626 $tutor_name->
setValue($this->object->getName());
1627 $tutor_name->setSize(20);
1628 $tutor_name->setMaxLength(70);
1629 $this->form->addItem($tutor_name);
1632 $tutor_email =
new ilTextInputGUI($this->lng->txt(
'tutor_email'),
'tutor_email');
1633 $tutor_email->
setValue($this->object->getEmail());
1634 $tutor_email->setSize(20);
1635 $tutor_email->setMaxLength(70);
1636 $this->form->addItem($tutor_email);
1639 $tutor_phone =
new ilTextInputGUI($this->lng->txt(
'tutor_phone'),
'tutor_phone');
1640 $tutor_phone->
setValue($this->object->getPhone());
1641 $tutor_phone->setSize(20);
1642 $tutor_phone->setMaxLength(70);
1643 $this->form->addItem($tutor_phone);
1646 $section->setTitle($this->lng->txt(
'crs_further_settings'));
1651 $reg->
setChecked($this->object->enabledRegistration() ?
true :
false);
1652 $reg->setOptionTitle($this->lng->txt(
'event_registration_info'));
1653 $this->form->addItem($reg);
1657 $section->setTitle($this->lng->txt(
'event_assign_files'));
1661 $files->setFilenames(array(0 =>
''));
1662 $this->form->addItem(
$files);
1667 $this->form->setTitle($this->lng->txt(
'event_table_create'));
1670 $this->form->addCommandButton(
'save',$this->lng->txt(
'event_btn_add'));
1671 $this->form->addCommandButton(
'saveAndAssignMaterials',$this->lng->txt(
'event_btn_add_edit'));
1672 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1677 $this->form->setTitle($this->lng->txt(
'event_table_update'));
1680 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
1681 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1699 $this->
object->getFirstAppointment()->setStartingTime($this->
__toUnix(
$_POST[
'event'][
'start'][
'date'],
$_POST[
'event'][
'start'][
'time']));
1700 $this->
object->getFirstAppointment()->setEndingTime($this->
__toUnix(
$_POST[
'event'][
'end'][
'date'],
$_POST[
'event'][
'end'][
'time']));
1701 $this->
object->getFirstAppointment()->toggleFullTime((
bool)
$_POST[
'event'][
'fulltime']);
1703 include_once(
'./Services/Calendar/classes/class.ilDate.php');
1704 if($this->object->getFirstAppointment()->isFullday())
1706 $start =
new ilDate($_POST[
'event'][
'start'][
'date'][
'y'].
'-'.$_POST[
'event'][
'start'][
'date'][
'm'].
'-'.$_POST[
'event'][
'start'][
'date'][
'd'],
1708 $this->
object->getFirstAppointment()->setStart(
$start);
1710 $end =
new ilDate($_POST[
'event'][
'end'][
'date'][
'y'].
'-'.$_POST[
'event'][
'end'][
'date'][
'm'].
'-'.$_POST[
'event'][
'end'][
'date'][
'd'],
1712 $this->
object->getFirstAppointment()->setEnd($end);
1716 $start_dt[
'year'] = (int) $_POST[
'event'][
'start'][
'date'][
'y'];
1717 $start_dt[
'mon'] = (int) $_POST[
'event'][
'start'][
'date'][
'm'];
1718 $start_dt[
'mday'] = (int) $_POST[
'event'][
'start'][
'date'][
'd'];
1719 $start_dt[
'hours'] = (int) $_POST[
'event'][
'start'][
'time'][
'h'];
1720 $start_dt[
'minutes'] = (int) $_POST[
'event'][
'start'][
'time'][
'm'];
1723 $this->
object->getFirstAppointment()->setStart(
$start);
1725 $end_dt[
'year'] = (int) $_POST[
'event'][
'end'][
'date'][
'y'];
1726 $end_dt[
'mon'] = (int) $_POST[
'event'][
'end'][
'date'][
'm'];
1727 $end_dt[
'mday'] = (int) $_POST[
'event'][
'end'][
'date'][
'd'];
1728 $end_dt[
'hours'] = (int) $_POST[
'event'][
'end'][
'time'][
'h'];
1729 $end_dt[
'minutes'] = (int) $_POST[
'event'][
'end'][
'time'][
'm'];
1731 $this->
object->getFirstAppointment()->setEnd($end);
1735 $this->files = array();
1739 if(!strlen(
$data[
'tmp_name']))
1744 $filename = strlen($_POST[
'file_name'.$counter]) ?
1745 $_POST[
'file_name'.$counter] :
1754 $this->files[] =
$file;
1765 $this->
object->enableRegistration((
int) $_POST[
'registration']);
1776 include_once(
'./Modules/Session/classes/class.ilSessionRecurrence.php');
1779 switch(
$_POST[
'frequence'])
1782 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1783 $this->rec->setInterval((
int)
$_POST[
'count_DAILY']);
1787 $this->rec->setFrequenceType($_POST[
'frequence']);
1788 $this->rec->setInterval((
int) $_POST[
'count_WEEKLY']);
1789 if(is_array($_POST[
'byday_WEEKLY']))
1796 $this->rec->setFrequenceType($_POST[
'frequence']);
1797 $this->rec->setInterval((
int) $_POST[
'count_MONTHLY']);
1798 switch((
int) $_POST[
'subtype_MONTHLY'])
1805 switch((
int) $_POST[
'monthly_byday_day'])
1809 $this->rec->setBYSETPOS((
int) $_POST[
'monthly_byday_num']);
1810 $this->rec->setBYDAY(
'MO,TU,WE,TH,FR');
1815 $this->rec->setBYMONTHDAY((
int) $_POST[
'monthly_byday_num']);
1819 $this->rec->setBYDAY((
int) $_POST[
'monthly_byday_num'].$_POST[
'monthly_byday_day']);
1825 $this->rec->setBYMONTHDAY((
int) $_POST[
'monthly_bymonthday']);
1831 $this->rec->setFrequenceType($_POST[
'frequence']);
1832 $this->rec->setInterval((
int) $_POST[
'count_YEARLY']);
1833 switch((
int) $_POST[
'subtype_YEARLY'])
1840 $this->rec->setBYMONTH((
int) $_POST[
'yearly_bymonth_byday']);
1841 $this->rec->setBYDAY((
int) $_POST[
'yearly_byday_num'].$_POST[
'yearly_byday']);
1845 $this->rec->setBYMONTH((
int) $_POST[
'yearly_bymonth_by_monthday']);
1846 $this->rec->setBYMONTHDAY((
int) $_POST[
'yearly_bymonthday']);
1853 $this->rec->setFrequenceUntilCount((
int)
$_POST[
'count']);
1866 return mktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
1879 $path = $this->lng->txt(
'path') .
': ';
1881 foreach($tree->getPathFull($a_ref_id,$this->course_ref_id) as $node)
1883 if($node[
'ref_id'] != $a_ref_id)
1890 $path .= $node[
'title'];
1906 if (is_object($this->
object))
1908 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1920 global $ilAccess,$ilTabs,
$tree;
1922 $parent_id = $tree->getParentId($this->object->getRefId());
1924 $tabs_gui->setBackTarget($this->lng->txt(
'back_to_crs_content'),
'repository.php?ref_id='.$parent_id);
1925 $tabs_gui->addTarget(
'info_short',
1926 $this->ctrl->getLinkTarget($this,
'infoScreen'));
1928 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1930 $tabs_gui->addTarget(
'edit_properties',
1931 $this->ctrl->getLinkTarget($this,
'edit'));
1932 $tabs_gui->addTarget(
'crs_materials',
1933 $this->ctrl->getLinkTarget($this,
'materials'));
1934 $tabs_gui->addTarget(
'event_edit_members',
1935 $this->ctrl->getLinkTarget($this,
'members'));
1938 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId()))
1940 $tabs_gui->addTarget(
"perm_settings",
1941 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');