ILIAS  release_8 Revision v8.24
class.ilAppointmentPresentationGroupGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
12{
13 public function collectPropertiesAndActions(): void
14 {
17
18 $this->lng->loadLanguageModule("grp");
19
20 $cat_info = $this->getCatInfo();
21 $grp = new ilObjGroup($cat_info['obj_id'], false);
22
23 $refs = ilObject::_getAllReferences($cat_info['obj_id']);
24 $grp_ref_id = current($refs);
25
26 // add common section (title, description, object/calendar, location)
27 $this->addCommonSection($app, $cat_info['obj_id']);
28
29 if ($app['event']->isAutogenerated() && $grp->getInformation()) {
30 $this->addInfoSection($this->lng->txt("cal_grp_info"));
31 $this->addInfoProperty(
32 $this->lng->txt("grp_information"),
33 ilUtil::makeClickable(nl2br($grp->getInformation()))
34 );
35 }
36
37 // last edited
38 $this->addLastUpdate($app);
39
40 $this->addAction($this->lng->txt("grp_grp_open"), ilLink::_getStaticLink($grp_ref_id, "grp"));
41
42 // register/unregister to appointment
43 if ($settings->isCGRegistrationEnabled()) {
44 if (!$app['event']->isAutoGenerated()) {
45 $reg = new ilCalendarRegistration($app['event']->getEntryId());
46
47 if ($reg->isRegistered(
48 $this->user->getId(),
49 new ilDateTime($app['dstart'], IL_CAL_UNIX),
50 new ilDateTime($app['dend'], IL_CAL_UNIX)
51 )) {
52 //$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE));
53 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $app['event']->getEntryId());
54 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $app['dstart']);
55 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $app['dend']);
56
57 $this->addAction(
58 $this->lng->txt('cal_reg_unregister'),
59 $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmUnregister')
60 );
61 } else {
62 //$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE));
63 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $app['event']->getEntryId());
64 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $app['dstart']);
65 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $app['dend']);
66
67 $this->addAction(
68 $this->lng->txt('cal_reg_register'),
69 $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmRegister')
70 );
71 }
72 $registered = $reg->getRegisteredUsers(
73 new \ilDateTime($app['dstart'], IL_CAL_UNIX),
74 new \ilDateTime($app['dend'], IL_CAL_UNIX)
75 );
76
77 $users = "";
78 foreach ($registered as $user) {
79 $users .= $this->getUserName($user) . '<br />';
80 }
81 if ($users != "") {
82 $this->addInfoProperty($this->lng->txt("cal_reg_registered_users"), $users);
83 }
84 }
85 }
86 }
87}
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)
$app
Definition: cli.php:39
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200