ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAppointmentPresentationGroupGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
29 public function collectPropertiesAndActions(): void
30 {
32 $app = $this->appointment;
33
34 $this->lng->loadLanguageModule("grp");
35
36 $cat_info = $this->getCatInfo();
37 $grp = new ilObjGroup($cat_info['obj_id'], false);
38
39 $refs = ilObject::_getAllReferences($cat_info['obj_id']);
40 $grp_ref_id = current($refs);
41
42 // add common section (title, description, object/calendar, location)
43 $this->addCommonSection($app, $cat_info['obj_id']);
44
45 if ($app['event']->isAutogenerated() && $grp->getInformation()) {
46 $this->addInfoSection($this->lng->txt("cal_grp_info"));
47 $this->addInfoProperty(
48 $this->lng->txt("grp_information"),
49 ilUtil::makeClickable(nl2br($grp->getInformation()))
50 );
51 }
52
53 // last edited
54 $this->addLastUpdate($app);
55
56 $this->addAction($this->lng->txt("grp_grp_open"), ilLink::_getStaticLink($grp_ref_id, "grp"));
57
58 // register/unregister to appointment
59 if ($settings->isCGRegistrationEnabled()) {
60 if (!$app['event']->isAutoGenerated()) {
61 $reg = new ilCalendarRegistration($app['event']->getEntryId());
62
63 if ($reg->isRegistered(
64 $this->user->getId(),
65 new ilDateTime($app['dstart'], IL_CAL_UNIX),
66 new ilDateTime($app['dend'], IL_CAL_UNIX)
67 )) {
68 //$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE));
69 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $app['event']->getEntryId());
70 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $app['dstart']);
71 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $app['dend']);
72
73 $this->addAction(
74 $this->lng->txt('cal_reg_unregister'),
75 $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmUnregister')
76 );
77 } else {
78 //$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE));
79 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $app['event']->getEntryId());
80 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $app['dstart']);
81 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $app['dend']);
82
83 $this->addAction(
84 $this->lng->txt('cal_reg_register'),
85 $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmRegister')
86 );
87 }
88 $registered = $reg->getRegisteredUsers(
89 new \ilDateTime($app['dstart'], IL_CAL_UNIX),
90 new \ilDateTime($app['dend'], IL_CAL_UNIX)
91 );
92
93 $users = "";
94 foreach ($registered as $user) {
95 $users .= $this->getUserName($user) . '<br />';
96 }
97 if ($users != "") {
98 $this->addInfoProperty($this->lng->txt("cal_reg_registered_users"), $users);
99 }
100 }
101 }
102 }
103}
const IL_CAL_UNIX
addInfoProperty(string $a_txt, string $a_val)
Add info property.
addCommonSection(array $a_app, int $a_obj_id=0, ?array $cat_info=null, bool $a_container_info=false)
addAction(string $a_txt, string $a_link)
Add action.
getUserName(int $a_user_id, bool $a_force_name=false)
Get (linked if possible) user name.
addInfoSection(string $a_txt)
Add info section.
collectPropertiesAndActions()
Collect properties and actions.
registration for calendar appointments
@classDescription Date and time handling
Class ilObjGroup.
static _getAllReferences(int $id)
get all reference ids for object ID
static makeClickable(string $a_text, bool $detectGotoLinks=false, ?string $ilias_http_path=null)