ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilObjSessionGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once('./Services/Object/classes/class.ilObjectGUI.php');
5include_once('./Modules/Session/classes/class.ilObjSession.php');
6include_once('./Modules/Session/classes/class.ilSessionFile.php');
7include_once './Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
8
21{
25 protected $logger = null;
26
27
28 public $lng;
29 public $ctrl;
30 public $tpl;
31
32 protected $container_ref_id = 0;
33 protected $container_obj_id = 0;
34
35 protected $files = array();
36
44 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output = true)
45 {
46 global $DIC;
47
48 $ilCtrl = $DIC['ilCtrl'];
49 $lng = $DIC['lng'];
50 $tpl = $DIC['tpl'];
51
52 $this->type = "sess";
53 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
54
55 $this->lng = $lng;
56 $this->lng->loadLanguageModule("event");
57 $this->lng->loadLanguageModule('crs');
58 $this->lng->loadLanguageModule('trac');
59 $this->lng->loadLanguageModule('sess');
60
61
62 $this->tpl = $tpl;
63 $this->ctrl = $ilCtrl;
64
65 $this->logger = $GLOBALS['DIC']->logger()->sess();
66 }
67
68
75 public function executeCommand()
76 {
77 global $DIC;
78
79 $ilUser = $DIC['ilUser'];
80 $ilCtrl = $DIC['ilCtrl'];
81
82 $next_class = $this->ctrl->getNextClass($this);
83 $cmd = $this->ctrl->getCmd();
84
85 if (
86 !$this->getCreationMode() &&
87 $GLOBALS['DIC']->access()->checkAccess('read', '', $_GET['ref_id'])
88 ) {
89 $GLOBALS['DIC']['ilNavigationHistory']->addItem(
90 (int) $_GET['ref_id'],
91 ilLink::_getLink((int) $_GET['ref_id'], 'sess'),
92 'sess'
93 );
94 }
95
96 $this->prepareOutput();
97 switch ($next_class) {
98 case 'ilsessionmembershipgui':
99 $this->tabs_gui->activateTab('members');
100 include_once './Modules/Session/classes/class.ilSessionMembershipGUI.php';
101 $mem_gui = new ilSessionMembershipGUI($this, $this->object);
102 $this->ctrl->forwardCommand($mem_gui);
103 break;
104
105 case "ilinfoscreengui":
106 $this->checkPermission("visible");
107 $this->infoScreen(); // forwards command
108 break;
109
110 case 'ilobjectmetadatagui':
111 $this->checkPermission('edit_metadata');
112 $this->tabs_gui->activateTab('metadata');
113 $md_gui = new ilObjectMetaDataGUI($this->object);
114 $this->ctrl->forwardCommand($md_gui);
115 break;
116
117
118 case 'ilpermissiongui':
119 $this->tabs_gui->setTabActive('perm_settings');
120 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
121 $perm_gui = new ilPermissionGUI($this);
122 $ret = $this->ctrl->forwardCommand($perm_gui);
123 break;
124
125 case 'ilobjectcopygui':
126 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
127 $cp = new ilObjectCopyGUI($this);
128 $cp->setType('sess');
129 $this->ctrl->forwardCommand($cp);
130 break;
131
132 case "ilexportgui":
133// $this->prepareOutput();
134 $this->tabs_gui->setTabActive("export");
135 include_once("./Services/Export/classes/class.ilExportGUI.php");
136 $exp_gui = new ilExportGUI($this);
137 $exp_gui->addFormat("xml");
138 $ret = $this->ctrl->forwardCommand($exp_gui);
139// $this->tpl->show();
140 break;
141
142 case "ilcommonactiondispatchergui":
143 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
145 $this->ctrl->forwardCommand($gui);
146 break;
147
148 case 'ilmembershipgui':
149 $this->ctrl->setReturn($this, 'members');
150 include_once './Services/Membership/classes/class.ilMembershipMailGUI.php';
151 $mem = new ilMembershipMailGUI($this);
152 $this->ctrl->forwardCommand($mem);
153 break;
154
155 case "illearningprogressgui":
156 include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
157 $new_gui = new ilLearningProgressGUI(
159 $this->object->getRefId(),
160 $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()
161 );
162 $this->ctrl->forwardCommand($new_gui);
163 $this->tabs_gui->setTabActive('learning_progress');
164 break;
165
166 case "ilpropertyformgui":
167 // only case is currently adv metadata internal link in info settings, see #24497
168 if (!is_object($this->object)) {
169 $form = $this->initCreateForm("sess");
170 } else {
171 $form = $this->initForm("edit");
172 if ($form === true) {
174 }
175 }
176 $ilCtrl->forwardCommand($form);
177 break;
178
179 default:
180 if ($cmd == "applyFilter") {
181 $cmd == "applyFilter";
182 $this->$cmd();
183 } elseif ($cmd == "resetFilter") {
184 $cmd == "resetFilter";
185 $this->$cmd();
186 }
187 if (!$cmd) {
188 $cmd = "infoScreen";
189 }
190 $cmd .= "Object";
191 $this->$cmd();
192
193 break;
194 }
195
196 $this->addHeaderAction();
197
198 return true;
199 }
200
201
205 protected function membersObject()
206 {
207 $this->ctrl->redirectByClass('ilSessionMembershipGUI', 'participants');
208 }
209
214 public function getCurrentObject()
215 {
216 return $this->object;
217 }
218
222 public function prepareOutput($a_show_subobjects = true)
223 {
224 parent::prepareOutput($a_show_subobjects);
225
226 if (!$this->getCreationMode()) {
227 $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
228
229 include_once './Modules/Session/classes/class.ilSessionAppointment.php';
230 $this->tpl->setTitle(
231 $this->object->getFirstAppointment()->appointmentToString() . $title
232 );
233 }
234 }
235
243 public function registerObject()
244 {
245 global $DIC;
246
247 $ilUser = $DIC['ilUser'];
248
249 $this->checkPermission('visible');
250
251 include_once './Services/Membership/classes/class.ilParticipants.php';
252 $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
253
254 include_once './Modules/Session/classes/class.ilEventParticipants.php';
255 $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
256 if (
257 $this->getCurrentObject()->isRegistrationUserLimitEnabled() and
258 $this->getCurrentObject()->getRegistrationMaxUsers() and
259 (count($event_part->getRegistered()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
260 ) {
261 include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
262 $wait = new ilSessionWaitingList($this->getCurrentObject()->getId());
263 $wait->addToList($ilUser->getId());
264 ilUtil::sendInfo($this->lng->txt('sess_reg_added_to_wl'), true);
265 $this->ctrl->redirect($this, 'infoScreen');
266 return true;
267 }
268
269
270 switch ($this->getCurrentObject()->getRegistrationType()) {
272 $this->ctrl->redirect($this, 'info');
273 break;
274
276 $part->register($ilUser->getId());
277 ilUtil::sendSuccess($this->lng->txt('event_registered'), true);
278 $this->ctrl->redirect($this, 'infoScreen');
279 break;
280
282 ilUtil::sendSuccess($this->lng->txt('sess_registered_confirm'), true);
283 $part->addSubscriber($ilUser->getId());
284 $this->ctrl->redirect($this, 'infoScreen');
285 break;
286 }
287 }
288
293 public function joinObject()
294 {
295 global $DIC;
296
297 $ilUser = $DIC['ilUser'];
298
299 $this->checkPermission('read');
300
301 if ($ilUser->isAnonymous()) {
302 $this->ctrl->redirect($this, 'infoScreen');
303 }
304
305 include_once './Modules/Session/classes/class.ilEventParticipants.php';
306
307 if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->object->getId())) {
308 $_SESSION['sess_hide_info'] = true;
309 ilEventParticipants::_unregister($ilUser->getId(), $this->object->getId());
310 ilUtil::sendSuccess($this->lng->txt('event_unregistered'), true);
311 } else {
312 ilEventParticipants::_register($ilUser->getId(), $this->object->getId());
313 ilUtil::sendSuccess($this->lng->txt('event_registered'), true);
314 }
315
316 $this->ctrl->redirect($this, 'infoScreen');
317 }
318
325 public function unregisterObject()
326 {
327 global $DIC;
328
329 $ilUser = $DIC['ilUser'];
330
331 include_once './Modules/Session/classes/class.ilSessionParticipants.php';
332 $part = ilSessionParticipants::getInstance($this->object->getRefId());
333 if ($part->isSubscriber($ilUser->getId())) {
334 $part->deleteSubscriber($ilUser->getId());
335 }
336
337 $part->unregister($ilUser->getId());
338
339 include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
340 ilSessionWaitingList::deleteUserEntry($ilUser->getId(), $this->getCurrentObject()->getId());
341
342 // check for visible permission of user
344 $GLOBALS['DIC']->access()->clear();
345 $has_access = $GLOBALS['DIC']->access()->checkAccessOfUser(
346 $GLOBALS['DIC']->user()->getId(),
347 'visible',
348 '',
349 $this->object->getRefId()
350 );
351 if (!$has_access) {
352 $parent = $GLOBALS['DIC']->repositoryTree()->getParentId($this->object->getRefId());
353 $this->redirectToRefId($parent);
354 return;
355 }
356
357 ilUtil::sendSuccess($this->lng->txt('event_unregistered'), true);
358 $this->ctrl->returnToParent($this);
359 }
360
369 public static function _goto($a_target)
370 {
371 global $DIC;
372
373 $ilAccess = $DIC->access();
374 $ilErr = $DIC["ilErr"];
375 $lng = $DIC->language();
376
377 if ($ilAccess->checkAccess('visible', "", $a_target)) {
378 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
379 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
381 sprintf(
382 $lng->txt("msg_no_perm_read_item"),
384 ),
385 true
386 );
388 }
389 }
390
394 public function addToDeskObject()
395 {
396 include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
398 $this->infoScreenObject();
399 }
400
404 public function removeFromDeskObject()
405 {
406 include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
408 $this->infoScreenObject();
409 }
410
411
417 public function infoScreenObject()
418 {
419 $this->ctrl->setCmd("showSummary");
420 $this->ctrl->setCmdClass("ilinfoscreengui");
421 $this->infoScreen();
422 }
423
431 public function modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
432 {
433 global $DIC;
434
435 $tree = $DIC['tree'];
436
437 // if folder is in a course, modify item list gui according to course requirements
438 if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs')) {
439 // #10611
440 include_once "Services/Object/classes/class.ilObjectActivation.php";
441 ilObjectActivation::addListGUIActivationProperty($a_item_list_gui, $a_item_data);
442
443 include_once("./Modules/Course/classes/class.ilObjCourse.php");
444 include_once("./Modules/Course/classes/class.ilObjCourseGUI.php");
445 $course_obj_id = ilObject::_lookupObjId($course_ref_id);
447 $a_item_list_gui,
448 get_class($this),
449 $a_item_data,
450 $a_show_path,
451 ilObjCourse::_lookupAboStatus($course_obj_id),
452 $course_ref_id,
453 $course_obj_id,
454 $this->object->getRefId()
455 );
456 }
457 }
458
464 public function showJoinRequestButtonInCalendar(ilToolbarGUI $a_ilToolbar)
465 {
466 $this->showJoinRequestButton($a_ilToolbar);
467 }
468
473 protected function showJoinRequestButton(ilToolbarGUI $ilToolbar = null)
474 {
475 global $DIC;
476
477 $ilUser = $DIC['ilUser'];
478
479 if (!$ilToolbar) {
480 global $DIC;
481
482 $ilToolbar = $DIC['ilToolbar'];
483 }
484
485 if (!$this->getCurrentObject()->enabledRegistration() || $ilUser->isAnonymous()) {
486 return false;
487 }
488
489 include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
490
491 include_once './Services/Membership/classes/class.ilParticipants.php';
492 $part = ilParticipants::getInstance($this->getCurrentObject()->getRefId());
493
494 include_once './Modules/Session/classes/class.ilEventParticipants.php';
495
496 $btn_attend = ilLinkButton::getInstance();
497 $btn_attend->addCSSClass("btn-primary");
498 $this->ctrl->setParameter($this, "ref_id", $this->getCurrentObject()->getRefId());
499
500 if (ilEventParticipants::_isRegistered($ilUser->getId(), $this->getCurrentObject()->getId())) {
501 $btn_attend->setCaption($this->lng->txt("event_unregister"), false);
502 $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "unregister"));
503 $ilToolbar->addButtonInstance($btn_attend);
504 return true;
505 } elseif ($part->isSubscriber($ilUser->getId())) {
506 $btn_attend->setCaption($this->lng->txt("event_unregister"), false);
507 $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "unregister"));
508 $ilToolbar->addButtonInstance($btn_attend);
509 return true;
510 } elseif (ilSessionWaitingList::_isOnList($ilUser->getId(), $this->getCurrentObject()->getId())) {
511 $btn_attend->setCaption($this->lng->txt("leave_waiting_list"), false);
512 $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "unregister"));
513 $ilToolbar->addButtonInstance($btn_attend);
514 return true;
515 }
516
517 $event_part = new ilEventParticipants($this->getCurrentObject()->getId());
518
519 if (
520 $this->getCurrentObject()->isRegistrationUserLimitEnabled() and
521 $this->getCurrentObject()->getRegistrationMaxUsers() and
522 (count($event_part->getRegistered()) >= $this->getCurrentObject()->getRegistrationMaxUsers())
523 ) {
524 if ($this->getCurrentObject()->isRegistrationWaitingListEnabled()) {
525 ilUtil::sendInfo($this->lng->txt('sess_reg_max_users_exceeded_wl'));
526 $btn_attend->setCaption($this->lng->txt("mem_add_to_wl"), false);
527 $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register"));
528 $ilToolbar->addButtonInstance($btn_attend);
529 return true;
530 } else {
531 ilUtil::sendInfo($this->lng->txt('sess_reg_max_users_exceeded'));
532 return true;
533 }
534 } else {
535 if (!isset($_SESSION['sess_hide_info'])) {
536 ilUtil::sendInfo($this->lng->txt('sess_join_info'));
537 $btn_attend->setCaption($this->lng->txt("join_session"), false);
538 $btn_attend->setUrl($this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjSessionGUI"), "register"));
539 $ilToolbar->addButtonInstance($btn_attend);
540 return true;
541 }
542 }
543 }
544
545
546
554 public function infoScreen()
555 {
556 global $DIC;
557
558 $ilAccess = $DIC['ilAccess'];
559 $ilUser = $DIC['ilUser'];
560 $ilCtrl = $DIC['ilCtrl'];
561 $tree = $DIC['tree'];
562 $ilToolbar = $DIC['ilToolbar'];
563 $lng = $DIC['lng'];
564
565 $this->checkPermission('visible');
566 $this->tabs_gui->setTabActive('info_short');
567
568 $this->showJoinRequestButton();
569
570 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
571 $info = new ilInfoScreenGUI($this);
572
573
574 $eventItems = ilObjectActivation::getItemsByEvent($this->object->getId());
575 $parent_id = $tree->getParentId($this->object->getRefId());
576 $parent_id = ilObject::_lookupObjId($parent_id);
577 $eventItems = ilContainerSorting::_getInstance($parent_id)->sortSubItems(
578 'sess',
579 $this->object->getId(),
580 $eventItems
581 );
582
583 $lng->loadLanguageModule("cntr");// #14158
584
585 $html = '';
586 foreach ($eventItems as $item) {
587 $list_gui = ilSessionObjectListGUIFactory::factory($item['type']);
588 $list_gui->setContainerObject($this);
589
590 $this->modifyItemGUI($list_gui, $item, false);
591
592 $html .= $list_gui->getListItemHTML(
593 $item['ref_id'],
594 $item['obj_id'],
595 $item['title'],
596 $item['description']
597 );
598 }
599
600 if (strlen($html)) {
601 $info->addSection($this->lng->txt('event_materials'));
602 $info->addProperty(
603 '&nbsp;',
604 $html
605 );
606 }
607
608
609
610 // Session information
611 if (strlen($this->object->getLocation()) or strlen($this->object->getDetails())) {
612 $info->addSection($this->lng->txt('event_section_information'));
613 }
614 if (strlen($location = $this->object->getLocation())) {
615 $info->addProperty(
616 $this->lng->txt('event_location'),
617 ilUtil::makeClickable(nl2br($this->object->getLocation()), true)
618 );
619 }
620 if (strlen($this->object->getDetails())) {
621 $info->addProperty(
622 $this->lng->txt('event_details_workflow'),
623 ilUtil::makeClickable(nl2br($this->object->getDetails()), true)
624 );
625 }
626
627 $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'sess', $this->object->getId());
628 $record_gui->setInfoObject($info);
629 $record_gui->parse();
630
631 // meta data
632 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
633
634
635 // Tutor information
636 if ($this->object->hasTutorSettings()) {
637 $info->addSection($this->lng->txt('event_tutor_data'));
638 if (strlen($fullname = $this->object->getName())) {
639 $info->addProperty(
640 $this->lng->txt('event_lecturer'),
641 $fullname
642 );
643 }
644 if (strlen($email = $this->object->getEmail())) {
645 $info->addProperty(
646 $this->lng->txt('tutor_email'),
647 $email
648 );
649 }
650 if (strlen($phone = $this->object->getPhone())) {
651 $info->addProperty(
652 $this->lng->txt('tutor_phone'),
653 $phone
654 );
655 }
656 }
657
658 // support contacts
659 $parts = ilParticipants::getInstance($this->object->getRefId());
660 $contacts = $parts->getContacts();
661 if (count($contacts) > 0) {
662 $info->addSection($this->lng->txt("crs_mem_contacts"));
663 foreach ($contacts as $contact) {
664 $pgui = new ilPublicUserProfileGUI($contact);
665 $pgui->setBackUrl($this->ctrl->getLinkTargetByClass("ilinfoscreengui"));
666 $pgui->setEmbedded(true);
667 $info->addProperty("", $pgui->getHTML());
668 }
669 }
670
671 // forward the command
672 $this->ctrl->forwardCommand($info);
673
674 // store read event
675 require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
677 $this->object->getType(),
678 $this->object->getRefId(),
679 $this->object->getId(),
680 $ilUser->getId()
681 );
682 }
683
689 public function sendFileObject()
690 {
691 $file = new ilSessionFile((int) $_GET['file_id']);
692
693 ilUtil::deliverFile($file->getAbsolutePath(), $file->getFileName(), $file->getFileType());
694 return true;
695 }
696
697 protected function initCreateForm($a_new_type)
698 {
699 if (!is_object($this->object)) {
700 $this->object = new ilObjSession();
701 }
702 $this->initForm('create');
703 return $this->form;
704 }
705
712 {
713 $this->saveObject(false);
714
715 $this->ctrl->setParameter($this, 'ref_id', $this->object->getRefId());
716 $this->ctrl->setParameter($this, 'new_type', '');
717 $this->ctrl->redirect($this, 'materials');
718 }
719
727 public function saveObject($a_redirect_on_success = true)
728 {
729 global $DIC;
730
731 $ilErr = $DIC['ilErr'];
732 $ilUser = $DIC['ilUser'];
733
734 $this->object = new ilObjSession();
735
736 $this->ctrl->saveParameter($this, "new_type");
737
738 $this->initForm('create');
739 $ilErr->setMessage('');
740 if (!$this->form->checkInput()) {
741 $ilErr->setMessage($this->lng->txt('err_check_input'));
742 }
743
744 if (
745 $this->record_gui instanceof \ilAdvancedMDRecordGUI &&
746 !$this->record_gui->importEditFormPostValues()
747 ) {
748 $ilErr->setMessage($this->lng->txt('err_check_input'));
749 }
750
751 $this->load();
752 $this->loadRecurrenceSettings();
753
754 $this->object->validate();
755 $this->object->getFirstAppointment()->validate();
756
757 if (strlen($ilErr->getMessage())) {
758 ilUtil::sendFailure($ilErr->getMessage());
759 $this->form->setValuesByPost();
760 $this->createObject();
761 return false;
762 }
763 // Create session
764 $this->object->create();
765 $this->object->createReference();
766 $this->object->putInTree($_GET["ref_id"]);
767 $this->object->setPermissions($_GET["ref_id"]);
768
770 $this->object->getId(),
771 $this->form,
772 array(
774 )
775 );
776 if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
777 $this->record_gui->writeEditForm($this->object->getId());
778 }
779
780
781 // apply didactic template?
782 $dtpl = $this->getDidacticTemplateVar("dtpl");
783 if ($dtpl) {
784 $this->object->applyDidacticTemplate($dtpl);
785 }
786
787 // #14547 - active is default
788 if (!$this->form->getInput("lp_preset")) {
789 include_once "Services/Tracking/classes/class.ilLPObjSettings.php";
790 $lp_obj_settings = new ilLPObjSettings($this->object->getId());
791 $lp_obj_settings->setMode(ilLPObjSettings::LP_MODE_DEACTIVATED);
792 $lp_obj_settings->update(false);
793 }
794
795 // create appointment
796 $this->object->getFirstAppointment()->setSessionId($this->object->getId());
797 $this->object->getFirstAppointment()->create();
798
799 $this->handleFileUpload();
800
801 $this->createRecurringSessions($this->form->getInput("lp_preset"));
802
803 if ($a_redirect_on_success) {
804 ilUtil::sendInfo($this->lng->txt('event_add_new_event'), true);
805 $this->ctrl->returnToParent($this);
806 }
807
808 return true;
809 }
810
811 public function handleFileUpload()
812 {
813 global $DIC;
814
815 $tree = $DIC['tree'];
816
817 include_once './Modules/Session/classes/class.ilEventItems.php';
818 $ev = new ilEventItems($this->object->getId());
819 $items = $ev->getItems();
820
821 $counter = 0;
822 while (true) {
823 if (!isset($_FILES['files']['name'][$counter])) {
824 break;
825 }
826 if (!strlen($_FILES['files']['name'][$counter])) {
827 $counter++;
828 continue;
829 }
830
831 include_once './Modules/File/classes/class.ilObjFile.php';
832 $file = new ilObjFile();
833 $file->setTitle(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
834 $file->setDescription('');
835 $file->setFileName(ilUtil::stripSlashes($_FILES['files']['name'][$counter]));
836 $file->setFileType($_FILES['files']['type'][$counter]);
837 $file->setFileSize($_FILES['files']['size'][$counter]);
838 $file->create();
839 $new_ref_id = $file->createReference();
840 $file->putInTree($tree->getParentId($this->object->getRefId()));
841 $file->setPermissions($tree->getParentId($this->object->getRefId()));
842 $file->createDirectory();
843
844 $upload = $DIC->upload();
845 if (!$upload->hasBeenProcessed()) {
846 $upload->process();
847 }
848 $file->getUploadFile(
849 $_FILES['files']['tmp_name'][$counter],
850 $_FILES['files']['name'][$counter]
851 );
852
853 $items[] = $new_ref_id;
854 $counter++;
855 }
856
857 $ev->setItems($items);
858 $ev->update();
859 }
860
861
862
870 protected function createRecurringSessions($a_activate_lp = true)
871 {
872 global $DIC;
873
874 $tree = $DIC['tree'];
875
876 if (!$this->rec->getFrequenceType()) {
877 return true;
878 }
879 include_once('./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php');
880 $calc = new ilCalendarRecurrenceCalculator($this->object->getFirstAppointment(), $this->rec);
881
882 $period_start = clone $this->object->getFirstAppointment()->getStart();
883
884
885 $period_end = clone $this->object->getFirstAppointment()->getStart();
886 $period_end->increment(IL_CAL_YEAR, 5);
887 $date_list = $calc->calculateDateList($period_start, $period_end);
888
889 $period_diff = $this->object->getFirstAppointment()->getEnd()->get(IL_CAL_UNIX) -
890 $this->object->getFirstAppointment()->getStart()->get(IL_CAL_UNIX);
891 $parent_id = $tree->getParentId($this->object->getRefId());
892
893 include_once './Modules/Session/classes/class.ilEventItems.php';
894 $evi = new ilEventItems($this->object->getId());
895 $eitems = $evi->getItems();
896
897 $counter = 0;
898 foreach ($date_list->get() as $date) {
899 if (!$counter++) {
900 continue;
901 }
902
903 $new_obj = $this->object->cloneObject($parent_id);
904
905 // apply didactic template?
906 $dtpl = $this->getDidacticTemplateVar("dtpl");
907 if ($dtpl) {
908 $new_obj->applyDidacticTemplate($dtpl);
909 }
910
911 $new_obj->read();
912 $new_obj->getFirstAppointment()->setStartingTime($date->get(IL_CAL_UNIX));
913 $new_obj->getFirstAppointment()->setEndingTime($date->get(IL_CAL_UNIX) + $period_diff);
914 $new_obj->getFirstAppointment()->update();
915 $new_obj->update(true);
916
917 // #14547 - active is default
918 if (!$a_activate_lp) {
919 include_once "Services/Tracking/classes/class.ilLPObjSettings.php";
920 $lp_obj_settings = new ilLPObjSettings($new_obj->getId());
921 $lp_obj_settings->setMode(ilLPObjSettings::LP_MODE_DEACTIVATED);
922 $lp_obj_settings->update(false);
923 }
924
925 $new_evi = new ilEventItems($new_obj->getId());
926 $new_evi->setItems($eitems);
927 $new_evi->update();
928 }
929 }
930
931
939 public function editObject()
940 {
941 $this->tabs_gui->setTabActive('settings');
942
943 $this->initForm('edit');
944 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit.html', 'Modules/Session');
945 $this->tpl->setVariable('EVENT_EDIT_TABLE', $this->form->getHTML());
946
947 if (!count($this->object->getFiles())) {
948 return true;
949 }
950 $rows = array();
951 foreach ($this->object->getFiles() as $file) {
952 $table_data['id'] = $file->getFileId();
953 $table_data['filename'] = $file->getFileName();
954 $table_data['filetype'] = $file->getFileType();
955 $table_data['filesize'] = $file->getFileSize();
956
957 $rows[] = $table_data;
958 }
959
960 include_once("./Modules/Session/classes/class.ilSessionFileTableGUI.php");
961 $table_gui = new ilSessionFileTableGUI($this, "edit");
962 $table_gui->setTitle($this->lng->txt("event_files"));
963 $table_gui->setData($rows);
964 $table_gui->addCommandButton("cancel", $this->lng->txt("cancel"));
965 $table_gui->addMultiCommand("confirmDeleteFiles", $this->lng->txt("delete"));
966 $table_gui->setSelectAllCheckbox("file_id");
967 $this->tpl->setVariable('EVENT_FILE_TABLE', $table_gui->getHTML());
968
969 return true;
970 }
971
979 public function updateObject()
980 {
981 global $DIC;
982
983 $ilErr = $DIC['ilErr'];
984
985 $old_autofill = $this->object->hasWaitingListAutoFill();
986
987 $this->initForm('edit');
988 $ilErr->setMessage('');
989 if (!$this->form->checkInput()) {
990 $ilErr->setMessage($this->lng->txt('err_check_input'));
991 }
992
993 if (
994 $this->record_gui instanceof \ilAdvancedMDRecordGUI &&
995 !$this->record_gui->importEditFormPostValues()
996 ) {
997 $ilErr->setMessage($this->lng->txt('err_check_input'));
998 }
999
1000 $this->load();
1001
1002 $this->object->validate();
1003 $this->object->getFirstAppointment()->validate();
1004
1005 if (strlen($ilErr->getMessage())) {
1006 ilUtil::sendFailure($ilErr->getMessage());
1007 $this->editObject();
1008 return false;
1009 }
1010 // Update event
1011 $this->object->update();
1012 $this->object->getFirstAppointment()->update();
1013
1015 $this->object->getId(),
1016 $this->form,
1017 array(
1019 )
1020 );
1021 if ($this->record_gui instanceof \ilAdvancedMDRecordGUI) {
1022 $this->record_gui->writeEditForm();
1023 }
1024 $this->handleFileUpload();
1025
1026 // if autofill has been activated trigger process
1027 if (!$old_autofill &&
1028 $this->object->hasWaitingListAutoFill()) {
1029 $this->object->handleAutoFill();
1030 }
1031
1032 ilUtil::sendSuccess($this->lng->txt('event_updated'), true);
1033 $this->ctrl->redirect($this, 'edit');
1034 #$this->object->initFiles();
1035 #$this->editObject();
1036 return true;
1037 }
1038
1047 {
1048 $this->tabs_gui->setTabActive('settings');
1049
1050 if (!count($_POST['file_id'])) {
1051 ilUtil::sendFailure($this->lng->txt('select_one'));
1052 $this->editObject();
1053 return false;
1054 }
1055
1056 include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1057 $c_gui = new ilConfirmationGUI();
1058
1059 // set confirm/cancel commands
1060 $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteFiles"));
1061 $c_gui->setHeaderText($this->lng->txt("info_delete_sure"));
1062 $c_gui->setCancel($this->lng->txt("cancel"), "edit");
1063 $c_gui->setConfirm($this->lng->txt("confirm"), "deleteFiles");
1064
1065 // add items to delete
1066 foreach ($_POST["file_id"] as $file_id) {
1067 $file = new ilSessionFile($file_id);
1068 if ($file->getSessionId() != $this->object->getEventId()) {
1069 ilUtil::sendFailure($this->lng->txt('select_one'));
1070 $this->edit();
1071 return false;
1072 }
1073 $c_gui->addItem("file_id[]", $file_id, $file->getFileName());
1074 }
1075
1076 $this->tpl->setContent($c_gui->getHTML());
1077 return true;
1078 }
1079
1087 public function deleteFilesObject()
1088 {
1089 if (!count($_POST['file_id'])) {
1090 ilUtil::sendFailure($this->lng->txt('select_one'));
1091 $this->editObject();
1092 return false;
1093 }
1094 foreach ($_POST['file_id'] as $id) {
1095 $file = new ilSessionFile($id);
1096 $file->delete();
1097 }
1098 $this->object->initFiles();
1099 $this->editObject();
1100 return true;
1101 }
1102
1103 protected function initContainer($a_init_participants = false)
1104 {
1105 global $DIC;
1106
1107 $tree = $DIC['tree'];
1108
1109 $is_course = $is_group = false;
1110
1111 // #13178
1112 $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
1113 if ($this->container_ref_id) {
1114 $is_group = true;
1115 }
1116 if (!$this->container_ref_id) {
1117 $this->container_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1118 if ($this->container_ref_id) {
1119 $is_course = true;
1120 }
1121 }
1122 if (!$this->container_ref_id) {
1123 ilUtil::sendFailure('No container object found. Aborting');
1124 return true;
1125 }
1126 $this->container_obj_id = ilObject::_lookupObjId($this->container_ref_id);
1127
1128 if ($a_init_participants && $this->container_obj_id) {
1129 if ($is_course) {
1130 include_once './Modules/Course/classes/class.ilCourseParticipants.php';
1131 return ilCourseParticipants::_getInstanceByObjId($this->container_obj_id);
1132 } elseif ($is_group) {
1133 include_once './Modules/Group/classes/class.ilGroupParticipants.php';
1134 return ilGroupParticipants::_getInstanceByObjId($this->container_obj_id);
1135 }
1136 }
1137 }
1138
1142 public function materialsObject()
1143 {
1144 global $DIC;
1145
1146 $tree = $DIC['tree'];
1147 $objDefinition = $DIC['objDefinition'];
1148
1149 $this->tabs_gui->activateTab('materials');
1150
1151 // #11337 - support ANY parent container (crs, grp, fld)
1152 $parent_ref_id = $tree->getParentId($this->object->getRefId());
1153
1154 include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
1155 $gui = new ilObjectAddNewItemGUI($parent_ref_id);
1156 $gui->setDisabledObjectTypes(
1157 array_merge(
1158 [
1159 'itgr', 'sess'
1160 ],
1161 $objDefinition->getSideBlockTypes()
1162 )
1163 );
1164 $gui->setAfterCreationCallback($this->ref_id);
1165 $gui->render();
1166
1167 include_once 'Modules/Session/classes/class.ilEventItems.php';
1168 $this->event_items = new ilEventItems($this->object->getId());
1169
1170 include_once 'Modules/Session/classes/class.ilSessionMaterialsTableGUI.php';
1171 $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1172
1173 $tbl->setDisableFilterHiding(true);
1174
1175 $tbl->addMultiCommand('saveMaterials', $this->lng->txt('sess_assign'));
1176 $tbl->addMultiCommand("removeMaterials", $this->lng->txt("remove"));
1177
1178 $tbl->setTitle($this->lng->txt("event_assign_materials_table"));
1179 $tbl->setDescription($this->lng->txt('event_assign_materials_info'));
1180
1181 $tbl->setMaterialItems($this->event_items->getItems());
1182 $tbl->setContainerRefId($this->getContainerRefId());
1183 $data = $tbl->getDataFromDb();
1184 $tbl->setMaterials($data);
1185
1186 $this->tpl->setContent($tbl->getHTML());
1187 }
1188
1192 public function applyFilter()
1193 {
1194 $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1195 $tbl->writeFilterToSession(); // writes filter to session
1196 $tbl->resetOffset(); // sets record offest to 0 (first page)
1197 $this->ctrl->redirect($this, "materials");
1198 }
1199
1203 public function resetFilter()
1204 {
1205 $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1206 $tbl->resetOffset(); // sets record offest to 0 (first page)
1207 $tbl->resetFilter(); // clears filter
1208 $this->ctrl->redirect($this, "materials");
1209 }
1210
1214 public function removeMaterialsObject()
1215 {
1216 $items_checked = is_array($_POST['items']) ? $_POST['items'] : array();
1217
1218 $this->event_items = new ilEventItems($this->object->getId());
1219 $this->event_items->removeItems($items_checked);
1220
1221 $this->postUpdateMaterials();
1222 }
1223
1224
1230 public function saveMaterialsObject()
1231 {
1232 include_once './Modules/Session/classes/class.ilEventItems.php';
1233
1234 $this->event_items = new ilEventItems($this->object->getId());
1235 $db_items = $this->event_items->getItems();
1236
1237 $list_items_checked = is_array($_POST['items']) ? $_POST['items'] : array();
1238 $list_items_checked = array_map('intval', $list_items_checked);
1239
1240 $items_to_save = array_merge($db_items, $list_items_checked);
1241 $items_to_save = array_unique($items_to_save);
1242
1243 $this->event_items->setItems($items_to_save);
1244 $this->event_items->update();
1245 $this->postUpdateMaterials();
1246 }
1247
1251 public function postUpdateMaterials()
1252 {
1253 include_once 'Modules/Session/classes/class.ilSessionMaterialsTableGUI.php';
1254 $tbl = new ilSessionMaterialsTableGUI($this, "materials");
1255 $tbl->setOffset(0);
1256 $tbl->storeNavParameter();//remove offset and go to page 1
1257
1258 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1259 $this->ctrl->redirect($this, 'materials');
1260 }
1261
1262
1269 public function attendanceListObject()
1270 {
1271 global $DIC;
1272
1273 $tpl = $DIC['tpl'];
1274 $ilTabs = $DIC['ilTabs'];
1275
1276 $this->checkPermission('manage_members');
1277 $ilTabs->setTabActive('event_edit_members');
1278
1279 $list = $this->initAttendanceList();
1280 $form = $list->initForm('printAttendanceList');
1281 $tpl->setContent($form->getHTML());
1282 }
1283
1289 protected function initAttendanceList()
1290 {
1291 $members_obj = $this->initContainer(true);
1292
1293 include_once 'Services/Membership/classes/class.ilAttendanceList.php';
1294 $list = new ilAttendanceList(
1295 $this,
1296 $this->object,
1297 $members_obj
1298 );
1299 $list->setId('sessattlst');
1300
1301 $event_app = $this->object->getFirstAppointment();
1303 $desc = ilDatePresentation::formatPeriod($event_app->getStart(), $event_app->getEnd());
1305 $desc .= " " . $this->object->getTitle();
1306 $list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
1307
1308 $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
1309 $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
1310 if ($this->object->enabledRegistration()) {
1311 $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
1312 }
1313 $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1314 $list->addBlank($this->lng->txt('sess_signature'));
1315
1316 $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1317
1318 return $list;
1319 }
1320
1326 protected function printAttendanceListObject()
1327 {
1328 $this->checkPermission('manage_members');
1329
1330 $list = $this->initAttendanceList();
1331 $list->initFromForm();
1332 $list->setCallback(array($this, 'getAttendanceListUserData'));
1333
1334 include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1335 $this->event_part = new ilEventParticipants($this->object->getId());
1336
1337 echo $list->getFullscreenHTML();
1338 exit();
1339 }
1340
1350 public function getAttendanceListUserData($a_user_id, $a_filters)
1351 {
1352 $data = $this->event_part->getUser($a_user_id);
1353
1354 if ($a_filters && $a_filters["registered"] && !$data["registered"]) {
1355 return;
1356 }
1357
1358 $data['registered'] = $data['registered'] ?
1359 $this->lng->txt('yes') :
1360 $this->lng->txt('no');
1361 $data['participated'] = $data['participated'] ?
1362 $this->lng->txt('yes') :
1363 $this->lng->txt('no');
1364
1365 return $data;
1366 }
1367
1375 public function eventsListObject()
1376 {
1377 global $DIC;
1378
1379 $ilErr = $DIC['ilErr'];
1380 $ilAccess = $DIC['ilAccess'];
1381 $ilUser = $DIC['ilUser'];
1382 $tree = $DIC['tree'];
1383
1384 if (!$ilAccess->checkAccess('manage_members', '', $this->object->getRefId())) {
1385 $ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $ilErr->MESSAGE);
1386 }
1387
1388 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_list.html', 'Modules/Session');
1389 $this->__showButton($this->ctrl->getLinkTarget($this, 'exportCSV'), $this->lng->txt('event_csv_export'));
1390
1391 include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1392
1393 $this->tpl->addBlockfile("EVENTS_TABLE", "events_table", "tpl.table.html");
1394 $this->tpl->addBlockfile('TBL_CONTENT', 'tbl_content', 'tpl.sess_list_row.html', 'Modules/Session');
1395
1396 $members_obj = $this->initContainer(true);
1397 $members = $members_obj->getParticipants();
1398 $members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
1399
1400 // Table
1401 $tbl = new ilTableGUI();
1402 $tbl->setTitle(
1403 $this->lng->txt("event_overview"),
1404 'icon_usr.svg',
1405 $this->lng->txt('obj_usr')
1406 );
1407 $this->ctrl->setParameter($this, 'offset', (int) $_GET['offset']);
1408
1409 $course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
1410 $events = array();
1411 foreach ($tree->getSubtree($tree->getNodeData($course_ref_id), false, 'sess') as $event_id) {
1412 $tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
1413 if (!is_object($tmp_event) or $tmp_event->getType() != 'sess') {
1414 continue;
1415 }
1416 $events[] = $tmp_event;
1417 }
1418
1419 $headerNames = array();
1420 $headerVars = array();
1421 $colWidth = array();
1422
1423 $headerNames[] = $this->lng->txt('name');
1424 $headerVars[] = "name";
1425 $colWidth[] = '20%';
1426
1427 for ($i = 1; $i <= count($events); $i++) {
1428 $headerNames[] = $i;
1429 $headerVars[] = "event_" . $i;
1430 $colWidth[] = 80 / count($events) . "%";
1431 }
1432
1433 $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1434 $tbl->setHeaderNames($headerNames);
1435 $tbl->setHeaderVars($headerVars, $this->ctrl->getParameterArray($this, 'eventsList'));
1436 $tbl->setColumnWidth($colWidth);
1437
1438 $tbl->setOrderColumn($_GET["sort_by"]);
1439 $tbl->setOrderDirection($_GET["sort_order"]);
1440 $tbl->setOffset($_GET["offset"]);
1441 $tbl->setLimit($ilUser->getPref("hits_per_page"));
1442 $tbl->setMaxCount(count($members));
1443 $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
1444
1445 $sliced_users = array_slice($members, $_GET['offset'], $_SESSION['tbl_limit']);
1446 $tbl->disable('sort');
1447 $tbl->render();
1448
1449 $counter = 0;
1450 foreach ($sliced_users as $user_id) {
1451 foreach ($events as $event_obj) {
1452 $this->tpl->setCurrentBlock("eventcols");
1453
1454 $event_part = new ilEventParticipants($this->object->getId());
1455
1456 {
1457 $this->tpl->setVariable("IMAGE_PARTICIPATED", $event_part->hasParticipated($user_id) ?
1458 ilUtil::getImagePath('icon_ok.svg') :
1459 ilUtil::getImagePath('icon_not_ok.svg'));
1460
1461 $this->tpl->setVariable("PARTICIPATED", $event_part->hasParticipated($user_id) ?
1462 $this->lng->txt('event_participated') :
1463 $this->lng->txt('event_not_participated'));
1464 }
1465
1466 $this->tpl->parseCurrentBlock();
1467 }
1468
1469 $this->tpl->setCurrentBlock("tbl_content");
1470 $name = ilObjUser::_lookupName($user_id);
1471 $this->tpl->setVariable("CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
1472 $this->tpl->setVariable("LASTNAME", $name['lastname']);
1473 $this->tpl->setVariable("FIRSTNAME", $name['firstname']);
1474 $this->tpl->setVariable("LOGIN", ilObjUser::_lookupLogin($user_id));
1475 $this->tpl->parseCurrentBlock();
1476 }
1477
1478 $this->tpl->setVariable("HEAD_TXT_LEGEND", $this->lng->txt("legend"));
1479 $this->tpl->setVariable("HEAD_TXT_DIGIT", $this->lng->txt("event_digit"));
1480 $this->tpl->setVariable("HEAD_TXT_EVENT", $this->lng->txt("event"));
1481 $this->tpl->setVariable("HEAD_TXT_LOCATION", $this->lng->txt("event_location"));
1482 $this->tpl->setVariable("HEAD_TXT_DATE_TIME", $this->lng->txt("event_date_time"));
1483 $i = 1;
1484 foreach ($events as $event_obj) {
1485 $this->tpl->setCurrentBlock("legend_loop");
1486 $this->tpl->setVariable("LEGEND_CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2'));
1487 $this->tpl->setVariable("LEGEND_DIGIT", $i++);
1488 $this->tpl->setVariable("LEGEND_EVENT_TITLE", $event_obj->getTitle());
1489 $this->tpl->setVariable("LEGEND_EVENT_DESCRIPTION", $event_obj->getDescription());
1490 $this->tpl->setVariable("LEGEND_EVENT_LOCATION", $event_obj->getLocation());
1491 $this->tpl->setVariable("LEGEND_EVENT_APPOINTMENT", $event_obj->getFirstAppointment()->appointmentToString());
1492 $this->tpl->parseCurrentBlock();
1493 }
1494 }
1495
1501 protected function initForm($a_mode)
1502 {
1503 global $DIC;
1504
1505 $ilUser = $DIC['ilUser'];
1506
1507 if (is_object($this->form)) {
1508 return true;
1509 }
1510
1511 $this->lng->loadLanguageModule('dateplaner');
1512
1513 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1514
1515 include_once('./Services/YUI/classes/class.ilYuiUtil.php');
1517
1518 $this->form = new ilPropertyFormGUI();
1519 $this->form->setMultipart(true);
1520 $this->form->setTableWidth('600px');
1521 $this->form->setFormAction($this->ctrl->getFormAction($this));
1522 $this->form->setMultipart(true);
1523
1524 if ($a_mode == 'create') {
1525 $this->form = $this->initDidacticTemplate($this->form);
1526 }
1527
1528 $this->lng->loadLanguageModule('dateplaner');
1529 include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
1530 $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
1531 $dur->setRequired(true);
1532 $dur->enableToggleFullTime(
1533 $this->lng->txt('event_fulltime_info'),
1534 $this->object->getFirstAppointment()->enabledFulltime() ? true : false
1535 );
1536 $dur->setShowTime(true);
1537 $dur->setStart($this->object->getFirstAppointment()->getStart());
1538 $dur->setEnd($this->object->getFirstAppointment()->getEnd());
1539
1540 $this->form->addItem($dur);
1541
1542
1543 // Recurrence
1544 if ($a_mode == 'create') {
1545 if (!is_object($this->rec)) {
1546 include_once('./Modules/Session/classes/class.ilEventRecurrence.php');
1547 $this->rec = new ilEventRecurrence();
1548 }
1549 include_once('./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
1550 $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
1551 $rec->allowUnlimitedRecurrences(false);
1552 $rec->setRecurrence($this->rec);
1553 $this->form->addItem($rec);
1554
1555 // #14547
1556 $lp = new ilCheckboxInputGUI($this->lng->txt("sess_lp_preset"), "lp_preset");
1557 $lp->setInfo($this->lng->txt("sess_lp_preset_info"));
1558 $lp->setChecked(true);
1559 $this->form->addItem($lp);
1560 }
1561
1563 $section->setTitle($this->lng->txt('event_section_information'));
1564 $this->form->addItem($section);
1565
1566 // title
1567 $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title');
1568 $title->setValue($this->object->getTitle());
1569 $title->setSize(50);
1570 $title->setMaxLength(70);
1571 $this->form->addItem($title);
1572
1573 // desc
1574 $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc');
1575 $desc->setValue($this->object->getLongDescription());
1576 $desc->setRows(4);
1577 $desc->setCols(50);
1578 $this->form->addItem($desc);
1579
1580 // location
1581 $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location');
1582 $desc->setValue($this->object->getLocation());
1583 $desc->setRows(4);
1584 $desc->setCols(50);
1585 $this->form->addItem($desc);
1586
1587 // workflow
1588 $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details');
1589 $details->setValue($this->object->getDetails());
1590 $details->setCols(50);
1591 $details->setRows(4);
1592 $this->form->addItem($details);
1593
1594 if ($a_mode == 'create') {
1595 $this->record_gui = new ilAdvancedMDRecordGUI(
1597 'sess'
1598 );
1599 $this->record_gui->setRefId((int) $_GET['ref_id']);
1600 $this->record_gui->setPropertyForm($this->form);
1601 $this->record_gui->parse();
1602 } elseif ($this->checkPermissionBool('edit_metadata')) {
1603 $this->record_gui = new ilAdvancedMDRecordGUI(
1605 'sess',
1606 $this->object->getId()
1607 );
1608 $this->record_gui->setPropertyForm($this->form);
1609 $this->record_gui->parse();
1610 }
1611
1612
1613 // section
1615 $section->setTitle($this->lng->txt('event_tutor_data'));
1616 $this->form->addItem($section);
1617
1618 // name
1619 $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name');
1620 $tutor_name->setValue($this->object->getName());
1621 $tutor_name->setSize(20);
1622 $tutor_name->setMaxLength(70);
1623 $this->form->addItem($tutor_name);
1624
1625 // email
1626 $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email');
1627 $tutor_email->setValue($this->object->getEmail());
1628 $tutor_email->setSize(20);
1629 $tutor_email->setMaxLength(70);
1630 $this->form->addItem($tutor_email);
1631
1632 // phone
1633 $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone');
1634 $tutor_phone->setValue($this->object->getPhone());
1635 $tutor_phone->setSize(20);
1636 $tutor_phone->setMaxLength(70);
1637 $this->form->addItem($tutor_phone);
1638
1640 $section->setTitle($this->lng->txt('sess_section_reg'));
1641 $this->form->addItem($section);
1642
1643 include_once './Modules/Session/classes/class.ilSessionMembershipRegistrationSettingsGUI.php';
1644 include_once './Services/Membership/classes/class.ilMembershipRegistrationSettings.php';
1646 $this,
1647 $this->object,
1648 array(
1653 )
1654 );
1655 $reg_settings->addMembershipFormElements($this->form, '');
1656
1657
1659 $section->setTitle($this->lng->txt('event_assign_files'));
1660 $this->form->addItem($section);
1661
1662 $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
1663 $files->setFilenames(array(0 => ''));
1664 $this->form->addItem($files);
1665
1666 $features = new ilFormSectionHeaderGUI();
1667 $features->setTitle($this->lng->txt('obj_features'));
1668 $this->form->addItem($features);
1670 $this->object->getId(),
1671 $this->form,
1672 array(
1674 )
1675 );
1676
1677 $gallery = new ilCheckboxInputGUI($this->lng->txt('sess_show_members'), 'show_members');
1678 $gallery->setChecked($this->object->getShowMembers());
1679 $gallery->setInfo($this->lng->txt('sess_show_participants_info'));
1680 $this->form->addItem($gallery);
1681
1682
1683 // Show mail to members type
1684 $mail_type = new ilRadioGroupInputGUI($this->lng->txt('sess_mail_type'), 'mail_type');
1685 $mail_type->setValue($this->object->getMailToMembersType());
1686
1687 $mail_tutors = new ilRadioOption(
1688 $this->lng->txt('sess_mail_admins_only'),
1690 $this->lng->txt('sess_mail_admins_only_info')
1691 );
1692 $mail_type->addOption($mail_tutors);
1693
1694 $mail_all = new ilRadioOption(
1695 $this->lng->txt('sess_mail_all'),
1697 $this->lng->txt('sess_mail_all_info')
1698 );
1699 $mail_type->addOption($mail_all);
1700 $this->form->addItem($mail_type);
1701
1702
1703
1704 switch ($a_mode) {
1705 case 'create':
1706 $this->form->setTitle($this->lng->txt('event_table_create'));
1707
1708 $this->form->addCommandButton('save', $this->lng->txt('event_btn_add'));
1709 $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit'));
1710 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
1711
1712 return true;
1713
1714 case 'edit':
1715 $this->form->setTitle($this->lng->txt('event_table_update'));
1716
1717 $this->form->addCommandButton('update', $this->lng->txt('save'));
1718 $this->form->addCommandButton('cancelEdit', $this->lng->txt('cancel'));
1719
1720 return true;
1721 }
1722 return true;
1723 }
1724
1732 protected function load()
1733 {
1734 $event = $this->form->getItemByPostVar('event');
1735 if ($event->getStart() && $event->getEnd()) {
1736 $this->object->getFirstAppointment()->setStartingTime($event->getStart()->get(IL_CAL_UNIX));
1737 $this->object->getFirstAppointment()->setEndingTime($event->getStart()->get(IL_CAL_UNIX));
1738 $this->object->getFirstAppointment()->setStart($event->getStart());
1739 $this->object->getFirstAppointment()->setEnd($event->getEnd());
1740 $this->object->getFirstAppointment()->toggleFulltime($event->getStart() instanceof ilDate);
1741 }
1742
1743 $this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
1744 $this->object->setDescription(ilUtil::stripSlashes($_POST['desc']));
1745 $this->object->setLocation(ilUtil::stripSlashes($_POST['location']));
1746 $this->object->setName(ilUtil::stripSlashes($_POST['tutor_name']));
1747 $this->object->setPhone(ilUtil::stripSlashes($_POST['tutor_phone']));
1748 $this->object->setEmail(ilUtil::stripSlashes($_POST['tutor_email']));
1749 $this->object->setDetails(ilUtil::stripSlashes($_POST['details']));
1750
1751 $this->object->setRegistrationType((int) $_POST['registration_type']);
1752 // $this->object->setRegistrationMinUsers((int) $_POST['registration_min_members']);
1753 $this->object->setRegistrationMaxUsers((int) $_POST['registration_max_members']);
1754 $this->object->enableRegistrationUserLimit((int) $_POST['registration_membership_limited']);
1755 $this->object->setShowMembers((int) $_POST['show_members']);
1756 $this->object->setMailToMembersType((int) $_POST['mail_type']);
1757
1758 switch ((int) $_POST['waiting_list']) {
1759 case 2:
1760 $this->object->enableRegistrationWaitingList(true);
1761 $this->object->setWaitingListAutoFill(true);
1762 break;
1763
1764 case 1:
1765 $this->object->enableRegistrationWaitingList(true);
1766 $this->object->setWaitingListAutoFill(false);
1767 break;
1768
1769 default:
1770 $this->object->enableRegistrationWaitingList(false);
1771 $this->object->setWaitingListAutoFill(false);
1772 break;
1773 }
1774 }
1775
1782 protected function loadRecurrenceSettings()
1783 {
1784 include_once('./Modules/Session/classes/class.ilSessionRecurrence.php');
1785 $this->rec = new ilSessionRecurrence();
1786
1787 switch ($_POST['frequence']) {
1788 case IL_CAL_FREQ_DAILY:
1789 $this->rec->setFrequenceType($_POST['frequence']);
1790 $this->rec->setInterval((int) $_POST['count_DAILY']);
1791 break;
1792
1793 case IL_CAL_FREQ_WEEKLY:
1794 $this->rec->setFrequenceType($_POST['frequence']);
1795 $this->rec->setInterval((int) $_POST['count_WEEKLY']);
1796 if (is_array($_POST['byday_WEEKLY'])) {
1797 $this->rec->setBYDAY(ilUtil::stripSlashes(implode(',', $_POST['byday_WEEKLY'])));
1798 }
1799 break;
1800
1802 $this->rec->setFrequenceType($_POST['frequence']);
1803 $this->rec->setInterval((int) $_POST['count_MONTHLY']);
1804 switch ((int) $_POST['subtype_MONTHLY']) {
1805 case 0:
1806 // nothing to do;
1807 break;
1808
1809 case 1:
1810 switch ((int) $_POST['monthly_byday_day']) {
1811 case 8:
1812 // Weekday
1813 $this->rec->setBYSETPOS((int) $_POST['monthly_byday_num']);
1814 $this->rec->setBYDAY('MO,TU,WE,TH,FR');
1815 break;
1816
1817 case 9:
1818 // Day of month
1819 $this->rec->setBYMONTHDAY((int) $_POST['monthly_byday_num']);
1820 break;
1821
1822 default:
1823 $this->rec->setBYDAY((int) $_POST['monthly_byday_num'] . $_POST['monthly_byday_day']);
1824 break;
1825 }
1826 break;
1827
1828 case 2:
1829 $this->rec->setBYMONTHDAY((int) $_POST['monthly_bymonthday']);
1830 break;
1831 }
1832 break;
1833
1834 case IL_CAL_FREQ_YEARLY:
1835 $this->rec->setFrequenceType($_POST['frequence']);
1836 $this->rec->setInterval((int) $_POST['count_YEARLY']);
1837 switch ((int) $_POST['subtype_YEARLY']) {
1838 case 0:
1839 // nothing to do;
1840 break;
1841
1842 case 1:
1843 $this->rec->setBYMONTH((int) $_POST['yearly_bymonth_byday']);
1844 $this->rec->setBYDAY((int) $_POST['yearly_byday_num'] . $_POST['yearly_byday']);
1845 break;
1846
1847 case 2:
1848 $this->rec->setBYMONTH((int) $_POST['yearly_bymonth_by_monthday']);
1849 $this->rec->setBYMONTHDAY((int) $_POST['yearly_bymonthday']);
1850 break;
1851 }
1852 break;
1853 }
1854
1855 // UNTIL
1856 switch ((int) $_POST['until_type']) {
1857 case 1:
1858 $this->rec->setFrequenceUntilDate(null);
1859 // nothing to do
1860 break;
1861
1862 case 2:
1863 $this->rec->setFrequenceUntilDate(null);
1864 $this->rec->setFrequenceUntilCount((int) $_POST['count']);
1865 break;
1866
1867 case 3:
1868 $frequence = $this->form->getItemByPostVar('frequence');
1869 $end = $frequence->getRecurrence()->getFrequenceUntilDate();
1870 $this->rec->setFrequenceUntilCount(0);
1871 $this->rec->setFrequenceUntilDate($end);
1872 break;
1873 }
1874 }
1875
1876
1884 protected function __toUnix($date, $time)
1885 {
1886 return mktime($time['h'], $time['m'], 0, $date['m'], $date['d'], $date['y']);
1887 }
1888
1895 public function addLocatorItems()
1896 {
1897 global $DIC;
1898
1899 $ilLocator = $DIC['ilLocator'];
1900
1901 if (!$this->getCreationMode()) {
1902 // see prepareOutput()
1903 include_once './Modules/Session/classes/class.ilSessionAppointment.php';
1904 $title = strlen($this->object->getTitle()) ? (': ' . $this->object->getTitle()) : '';
1905 $title = $this->object->getFirstAppointment()->appointmentToString() . $title;
1906
1907 $ilLocator->addItem($title, $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
1908 }
1909 }
1910
1911
1916 {
1917 global $DIC;
1918
1919 $objDefinition = $DIC['objDefinition'];
1920
1921 $tree = $DIC->repositoryTree();
1922 $ctrl = $DIC->ctrl();
1923
1924 $parent_id = $tree->getParentId($this->object->getRefId());
1925
1926 // #11650
1927 $parent_type = ilObject::_lookupType($parent_id, true);
1928
1929 $parent_class = $objDefinition->getClassName($parent_type);
1930 $parent_class = 'ilObj' . $parent_class . 'GUI';
1931
1932 $ctrl->setParameterByClass($parent_class, "ref_id", $parent_id);
1933 $ctrl->redirectByClass($parent_class, "view");
1934 }
1935
1936
1943 public function getTabs()
1944 {
1945 global $DIC;
1946
1947 $ilAccess = $DIC['ilAccess'];
1948 $ilTabs = $DIC['ilTabs'];
1949 $tree = $DIC['tree'];
1950 $ilCtrl = $DIC['ilCtrl'];
1951 $ilHelp = $DIC['ilHelp'];
1952 $ilUser = $DIC->user();
1953
1954 $ilHelp->setScreenIdComponent("sess");
1955
1956 $parent_id = $tree->getParentId($this->object->getRefId());
1957
1958 // #11650
1959 $parent_type = ilObject::_lookupType($parent_id, true);
1960
1961 $this->tabs_gui->setBackTarget(
1962 $this->lng->txt('back_to_' . $parent_type . '_content'),
1963 $ilCtrl->getLinkTarget($this, "redirectToParentContentPage")
1964 );
1965
1966 $this->tabs_gui->addTarget(
1967 'info_short',
1968 $this->ctrl->getLinkTarget($this, 'infoScreen')
1969 );
1970
1971 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1972 $this->tabs_gui->addTarget(
1973 'settings',
1974 $this->ctrl->getLinkTarget($this, 'edit')
1975 );
1976 }
1977 if ($ilAccess->checkAccess('manage_materials', '', $this->object->getRefId())) {
1978 $this->tabs_gui->addTab(
1979 'materials',
1980 $this->lng->txt('crs_materials'),
1981 $this->ctrl->getLinkTarget($this, 'materials')
1982 );
1983 }
1984
1985
1986 // member tab
1987 $is_participant = $this->object->getMembersObject()->isAssigned($ilUser->getId());
1988 $membership_gui = new ilSessionMembershipGUI($this, $this->object);
1989 $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
1990
1991
1992 // learning progress
1993 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
1994 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1995 $this->tabs_gui->addTarget(
1996 'learning_progress',
1997 $this->ctrl->getLinkTargetByClass(array('ilobjsessiongui','illearningprogressgui'), ''),
1998 '',
1999 array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
2000 );
2001 }
2002
2003 // meta data
2004 if ($ilAccess->checkAccess('edit_metadata', '', $this->ref_id)) {
2005 $mdgui = new ilObjectMetaDataGUI($this->object);
2006 $mdtab = $mdgui->getTab();
2007 if ($mdtab) {
2008 $this->tabs_gui->addTab(
2009 "metadata",
2010 $this->lng->txt('meta_data'),
2011 $mdtab
2012 );
2013 }
2014 }
2015
2016 // export
2017 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
2018 $this->tabs_gui->addTarget(
2019 "export",
2020 $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
2021 "",
2022 "ilexportgui"
2023 );
2024 }
2025
2026
2027 // edit permissions
2028 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
2029 $this->tabs_gui->addTarget(
2030 "perm_settings",
2031 $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"),
2032 array("perm","info","owner"),
2033 'ilpermissiongui'
2034 );
2035 }
2036 }
2037
2043 public function afterSaveCallback(ilObject $a_obj)
2044 {
2045 // add new object to materials
2046 include_once './Modules/Session/classes/class.ilEventItems.php';
2047 $event_items = new ilEventItems($this->object->getId());
2048 $event_items->addItem($a_obj->getRefId());
2049 $event_items->update();
2050
2051 /*
2052 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
2053 $this->ctrl->redirect($this, "materials");
2054 */
2055 }
2056
2057
2061 public function readMemberData($a_usr_ids)
2062 {
2063 $tmp_data = array();
2064 foreach ($a_usr_ids as $usr_id) {
2065 $tmp_data[$usr_id] = array();
2066 }
2067 return $tmp_data;
2068 }
2069
2070
2071
2076 public function getContainerRefId()
2077 {
2078 if (!$this->container_ref_id) {
2079 $this->initContainer();
2080 }
2082 }
2083
2084
2090 protected function cancelEditObject()
2091 {
2092 global $DIC;
2093
2094 $ilCtrl = $DIC['ilCtrl'];
2095 $tree = $DIC['tree'];
2096
2097 $parent_id = $tree->getParentId((int) $_REQUEST['ref_id']);
2098
2099 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $parent_id);
2100
2101 $ilCtrl->redirectByClass("ilrepositorygui", "");
2102 }
2103
2104
2109 public function getDefaultMemberRole()
2110 {
2111 $local_roles = $GLOBALS['DIC']->rbac()->review()->getRolesOfRoleFolder($this->object->getRefId(), false);
2112
2113 foreach ($local_roles as $role_id) {
2114 $title = ilObject::_lookupTitle($role_id);
2115 if (substr($title, 0, 19) == 'il_sess_participant') {
2116 return $role_id;
2117 }
2118 }
2119 return 0;
2120 }
2121
2122
2127 public function getLocalRoles()
2128 {
2129 return $GLOBALS['DIC']->rbac()->review()->getRolesOfRoleFolder($this->object->getRefId(), false);
2130 }
2131
2132
2137 public function createMailSignature()
2138 {
2139 $link = chr(13) . chr(10) . chr(13) . chr(10);
2140 $link .= $this->lng->txt('sess_mail_permanent_link');
2141 $link .= chr(13) . chr(10) . chr(13) . chr(10);
2142 include_once './Services/Link/classes/class.ilLink.php';
2143 $link .= ilLink::_getLink($this->object->getRefId());
2144 return rawurlencode(base64_encode($link));
2145 }
2146
2150 protected function importFileObject($parent_id = null, $a_catch_errors = true)
2151 {
2153 $tpl = $this->tpl;
2155
2156 if (!$parent_id) {
2157 $parent_id = $_GET["ref_id"];
2158 }
2159 $new_type = $_REQUEST["new_type"];
2160
2161 // create permission is already checked in createObject. This check here is done to prevent hacking attempts
2162 if (!$this->checkPermissionBool("create", "", $new_type)) {
2163 $ilErr->raiseError($this->lng->txt("no_create_permission"));
2164 }
2165
2166 $this->lng->loadLanguageModule($new_type);
2167 $this->ctrl->setParameter($this, "new_type", $new_type);
2168
2169 $form = $this->initImportForm($new_type);
2170 if ($form->checkInput()) {
2171 // :todo: make some check on manifest file
2172 include_once("./Services/Export/classes/class.ilImport.php");
2173 $imp = new ilImport((int) $parent_id);
2174 try {
2175 $new_id = $imp->importObject(
2176 null,
2177 $_FILES["importfile"]["tmp_name"],
2178 $_FILES["importfile"]["name"],
2179 $new_type
2180 );
2181 } catch (ilException $e) {
2182 $this->tmp_import_dir = $imp->getTemporaryImportDir();
2183 if (!$a_catch_errors) {
2184 throw $e;
2185 }
2186 // display message and form again
2187 ilUtil::sendFailure($this->lng->txt("obj_import_file_error") . " <br />" . $e->getMessage());
2188 $form->setValuesByPost();
2189 $tpl->setContent($form->getHtml());
2190 return;
2191 }
2192
2193 if ($new_id > 0) {
2194 $this->ctrl->setParameter($this, "new_type", "");
2195 $newObj = ilObjectFactory::getInstanceByObjId($new_id);
2196 $this->afterImport($newObj);
2197 }
2198 // import failed
2199 else {
2200 if ($objDefinition->isContainer($new_type)) {
2201 ilUtil::sendFailure($this->lng->txt("container_import_zip_file_invalid"));
2202 } else {
2203 // not enough information here...
2204 return;
2205 }
2206 }
2207 }
2208
2209 // display form to correct errors
2210 $form->setValuesByPost();
2211 $tpl->setContent($form->getHtml());
2212 }
2213}
user()
Definition: user.php:4
$section
Definition: Utf8Test.php:83
exit
Definition: backend.php:16
$location
Definition: buildRTE.php:44
$_GET["client_id"]
$_POST["username"]
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_FREQ_YEARLY
const IL_CAL_FREQ_MONTHLY
const IL_CAL_FREQ_WEEKLY
const IL_CAL_UNIX
const IL_CAL_YEAR
importEditFormPostValues()
Load edit form values from post.
Base class for attendance lists.
Calculates an ilDateList for a given calendar entry and recurrence rule.
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
This class represents a checkbox property in a property form.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
static _getInstance($a_obj_id)
get instance by obj_id
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
input GUI for a time span (start and end date)
static setUseRelativeDates($a_status)
set use relative dates
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
Class for single dates.
static addToDesktop()
Add desktop item @access public.
static removeFromDesktop()
Remove item from personal desktop @access public.
class ilEvent
static _isRegistered($a_usr_id, $a_event_id)
static _register($a_usr_id, $a_event_id)
static _unregister($a_usr_id, $a_event_id)
Base class for ILIAS Exception handling.
Export User Interface Class.
This class represents a file wizard property in a property form.
This class represents a section header in a property form.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Import class.
Class ilInfoScreenGUI.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
Class ilObjUserTrackingGUI.
static getInstance()
Factory.
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 _lookupAboStatus($a_id)
Class ilObjFile.
unregisterObject()
unregister from session
materialsObject()
show material assignment
addLocatorItems()
Add session locator.
cancelEditObject()
Cancel editigin @global type $ilCtrl @global type $tree.
executeCommand()
execute command
importFileObject($parent_id=null, $a_catch_errors=true)
Import.
prepareOutput($a_show_subobjects=true)
initContainer($a_init_participants=false)
applyFilter()
Apply filter.
showJoinRequestButtonInCalendar(ilToolbarGUI $a_ilToolbar)
saveMaterialsObject()
save material assignment
readMemberData($a_usr_ids)
Used for waiting list.
loadRecurrenceSettings()
load recurrence settings
redirectToParentContentPageObject()
Redirect to parent content page.
getAttendanceListUserData($a_user_id, $a_filters)
Get user data for attendance list.
confirmDeleteFilesObject()
confirm delete files
attendanceListObject()
show attendance list selection
updateObject()
update object
static _goto($a_target)
goto
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
resetFilter()
Reset filter.
modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
Modify Item ListGUI for presentation in container @global type $tree.
removeMaterialsObject()
Remove materials from the current object.
saveAndAssignMaterialsObject()
Save and assign sessoin materials.
saveObject($a_redirect_on_success=true)
save object
membersObject()
Redirect to member adminsitration.
getCurrentObject()
Get session object.
printAttendanceListObject()
print attendance list
__toUnix($date, $time)
@access protected
getLocalRoles()
get all local roles
afterSaveCallback(ilObject $a_obj)
Custom callback after object is created (in parent containert.
getDefaultMemberRole()
Get default member role.
initCreateForm($a_new_type)
Init object creation form.
joinObject()
Called from info screen.
createRecurringSessions($a_activate_lp=true)
create recurring sessions
deleteFilesObject()
delete files
initAttendanceList()
Init attendance list object.
showJoinRequestButton(ilToolbarGUI $ilToolbar=null)
createMailSignature()
Create a course mail signature.
initForm($a_mode)
Init Form.
registerObject()
register to session
eventsListObject()
list sessions of all user
postUpdateMaterials()
redirect to list of materials without offset/page.
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor.
getContainerRefId()
container ref id
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
static getItemsByEvent($a_event_id)
Get session material / event items.
Render add new item selector.
GUI class for the workflow of copying objects.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObjectGUI Basic methods of all Output classes.
__showButton($a_cmd, $a_text, $a_target='')
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
initImportForm($a_new_type)
Init object import form.
afterImport(ilObject $a_new_object)
Post (successful) object import hook.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
saveObject()
save object
initDidacticTemplate(ilPropertyFormGUI $form)
Show didactic template types.
addHeaderAction()
Add header action menu.
createObject()
create new object form
redirectToRefId($a_ref_id, $a_cmd="")
redirects to (repository) view per ref id usually to a container and usually used at the end of a sav...
Class ilObjectMetaDataGUI.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance($a_ref_id)
Get instance by ref_id.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents a property form user interface.
GUI class for public user profile presentation.
This class represents a property in a property form.
This class represents an option in a radio group.
static resetCaches()
Reset internal caches.
This class represents an input GUI for recurring events/appointments (course events or calendar appoi...
GUI class for membership features.
static factory($a_type)
Get list gui by type This method caches all the returned list guis.
static getInstance($a_ref_id)
Get instance.
Class ilTableGUI.
This class represents a text area property in a property form.
This class represents a text property in a property form.
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,...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
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 deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static deleteUserEntry($a_usr_id, $a_obj_id)
Delete one user entry.
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
static initDomEvent()
Init YUI DomEvent.
$i
Definition: disco.tpl.php:19
$html
Definition: example_001.php:87
$tbl
Definition: example_048.php:81
if(!array_key_exists('StateId', $_REQUEST)) $id
if($argc< 2) $events
const IL_CAL_FREQ_DAILY
Model of calendar entry recurrcences.
global $ilCtrl
Definition: ilias.php:18
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
$time
Definition: cron.php:21
if( $orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:201
$info
Definition: index.php:5
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
$ret
Definition: parser.php:6
if(isset($_POST['submit'])) $form
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
$rows
Definition: xhr_table.php:10