ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilAppointmentPresentationGroupGUI.php
Go to the documentation of this file.
1<?php
2include_once './Services/Calendar/interfaces/interface.ilCalendarAppointmentPresentation.php';
3include_once './Services/Calendar/classes/AppointmentPresentation/class.ilAppointmentPresentationGUI.php';
4
15{
17 {
18 global $DIC;
19
20 include_once "./Modules/Group/classes/class.ilObjGroup.php";
21
23 $user = $DIC->user();
24
26
27 $this->lng->loadLanguageModule("grp");
28
29 $cat_info = $this->getCatInfo();
30
31 $grp = new ilObjGroup($cat_info['obj_id'], false);
32
33 $refs = ilObject::_getAllReferences($cat_info['obj_id']);
34 $grp_ref_id = current($refs);
35
36 // add common section (title, description, object/calendar, location)
37 $this->addCommonSection($app, $cat_info['obj_id']);
38
39 if ($app['event']->isAutogenerated() && $grp->getInformation()) {
40 $this->addInfoSection($this->lng->txt("cal_grp_info"));
41 $this->addInfoProperty($this->lng->txt("grp_information"), ilUtil::makeClickable(nl2br($grp->getInformation())));
42 }
43
44 // last edited
45 $this->addLastUpdate($app);
46
47 $this->addAction($this->lng->txt("grp_grp_open"), ilLink::_getStaticLink($grp_ref_id, "grp"));
48
49 // register/unregister to appointment
50 if ($settings->isCGRegistrationEnabled()) {
51 if (!$app['event']->isAutoGenerated()) {
52 include_once './Services/Calendar/classes/class.ilCalendarRegistration.php';
53 $reg = new ilCalendarRegistration($app['event']->getEntryId());
54
55 if ($reg->isRegistered($user->getId(), new ilDateTime($app['dstart'], IL_CAL_UNIX), new ilDateTime($app['dend'], IL_CAL_UNIX))) {
56 //$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE));
57 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $app['event']->getEntryId());
58 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $app['dstart']);
59 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $app['dend']);
60
61 $this->addAction($this->lng->txt('cal_reg_unregister'), $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmUnregister'));
62 } else {
63 //$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE));
64 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $app['event']->getEntryId());
65 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $app['dstart']);
66 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $app['dend']);
67
68 $this->addAction($this->lng->txt('cal_reg_register'), $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmRegister'));
69 }
70 $registered = $reg->getRegisteredUsers(
71 new \ilDateTime($app['dstart'], IL_CAL_UNIX),
72 new \ilDateTime($app['dend'], IL_CAL_UNIX)
73 );
74
75 $users = "";
76 foreach ($registered as $user) {
77 $users .= $this->getUserName($user) . '<br />';
78 }
79 if ($users != "") {
80 $this->addInfoProperty($this->lng->txt("cal_reg_registered_users"), $users);
81 }
82 }
83 }
84 }
85}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
getUserName($a_user_id, $a_force_name=false)
Get (linked if possible) user name.
addCommonSection($a_app, $a_obj_id=0, $cat_info=null, $a_container_info=false)
Add common section.
addInfoProperty($a_txt, $a_val)
Add info property.
collectPropertiesAndActions()
Collect properties and actions.
registration for calendar appointments
static _getInstance()
get singleton instance
@classDescription Date and time handling
Class ilObjGroup.
static _getAllReferences($a_id)
get all reference ids of object
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
$app
Definition: cli.php:38
$DIC
Definition: xapitoken.php:46