ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAppointmentPresentationCourseGUI Class Reference
+ Inheritance diagram for ilAppointmentPresentationCourseGUI:
+ Collaboration diagram for ilAppointmentPresentationCourseGUI:

Public Member Functions

 collectPropertiesAndActions ()
 Collect properties and actions. More...
 
- Public Member Functions inherited from ilAppointmentPresentationGUI
 __construct (array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
 
 getObjIdForAppointment ()
 
 getToolbar ()
 
 getListItem ()
 Get list item. More...
 
 getInfoScreen ()
 
 getCatId (int $a_entry_id)
 
 getCatInfo ()
 
 executeCommand ()
 
 getHTML ()
 
 addContainerInfo (int $a_obj_id)
 Add course/group container info. More...
 
 addInfoSection (string $a_txt)
 Add info section. More...
 
 addInfoProperty (string $a_txt, string $a_val)
 Add info property. More...
 
 addListItemProperty (string $a_txt, string $a_val)
 Add list item property. More...
 
 addAction (string $a_txt, string $a_link)
 Add action. More...
 
 collectPropertiesAndActions ()
 Collect properties and actions. More...
 
 collectStandardPropertiesAndActions ()
 Collect standard properties and actions. More...
 
 addObjectLinks (int $obj_id, ?array $a_appointment=null)
 Add object link. More...
 
 getReadableRefIds (int $a_obj_id)
 
 addEventDescription (array $a_app)
 Add event description. More...
 
 addEventLocation (array $a_app)
 Add event location. More...
 
 addLastUpdate (array $a_app)
 Add last update. More...
 
 addCalendarInfo (array $cat_info)
 
 addCommonSection (array $a_app, int $a_obj_id=0, ?array $cat_info=null, bool $a_container_info=false)
 
 addMetaData (string $a_obj_type, int $a_obj_id, ?string $a_sub_obj_type=null, ?int $a_sub_obj_id=null)
 
 getUserName (int $a_user_id, bool $a_force_name=false)
 Get (linked if possible) user name. More...
 
 downloadFiles ()
 Download files from an appointment ( Modals ) More...
 
 getToolbar ()
 
 getInfoScreen ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilAppointmentPresentationGUI
static getInstance (array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
 
- Protected Member Functions inherited from ilAppointmentPresentationGUI
 readObjIdForAppointment ()
 read obj_id for appointment More...
 
 buildDirectLinkForAppointment (int $a_ref_id, ?array $a_appointment=null)
 Build direct link for appointment. More...
 
- Protected Attributes inherited from ilAppointmentPresentationGUI
array $appointment
 
ilToolbarGUI $toolbar
 
ilInfoScreenGUI $infoscreen
 
ilLanguage $lng
 
ilTree $tree
 
UIServices $ui
 
ilCtrlInterface $ctrl
 
ilAccessHandler $access
 
ilRbacSystem $rbacsystem
 
ilObjUser $user
 
RefineryFactory $refinery
 
HttpServices $http
 
Item $list_item = null
 
array $info_items = []
 
array $list_properties = []
 
array $actions = []
 
array $readable_ref_ids
 
bool $has_files = false
 
int $obj_id = 0
 
- Static Protected Attributes inherited from ilAppointmentPresentationGUI
static self $instance
 

Detailed Description

Member Function Documentation

◆ collectPropertiesAndActions()

ilAppointmentPresentationCourseGUI::collectPropertiesAndActions ( )

Collect properties and actions.

Reimplemented from ilAppointmentPresentationGUI.

Definition at line 28 of file class.ilAppointmentPresentationCourseGUI.php.

28 : void
29 {
31 $this->lng->loadLanguageModule("crs");
32
33 $app = $this->appointment;
34
35 $cat_info = $this->getCatInfo();
36
37 $crs = new ilObjCourse($cat_info['obj_id'], false);
38 $files = ilCourseFile::_readFilesByCourse($cat_info['obj_id']);
39
40 // get course ref id (this is possible, since courses only have one ref id)
41 $refs = ilObject::_getAllReferences($cat_info['obj_id']);
42 $crs_ref_id = current($refs);
43
44 // add common section (title, description, object/calendar, location)
45 $this->addCommonSection($app, $cat_info['obj_id']);
46
47 // add specific section only if the event is autogenerated.
48 if ($app['event']->isAutoGenerated()) {
49 //count number of files
50 if (count($files)) {
51 $this->has_files = true;
52 }
53
54 $this->addInfoSection($this->lng->txt("cal_crs_info"));
55
56 if ($crs->getImportantInformation()) {
57 $this->addInfoProperty(
58 $this->lng->txt("crs_important_info"),
59 ilUtil::makeClickable(nl2br($crs->getImportantInformation()))
60 );
61 }
62
63 if ($crs->getSyllabus()) {
64 $this->addInfoProperty(
65 $this->lng->txt("crs_syllabus"),
66 ilUtil::makeClickable(nl2br($crs->getSyllabus()))
67 );
68 }
69
70 if ($this->has_files) {
71 $links = array();
72 foreach ($files as $file) {
73 $this->ctrl->setParameter($this, 'file_id', $file->getFileId());
74 $this->ctrl->setParameterByClass('ilobjcoursegui', 'file_id', $file->getFileId());
75 $this->ctrl->setParameterByClass('ilobjcoursegui', 'ref_id', $crs_ref_id);
76
77 $file_name = $file->getFileName();
78 $links[$file_name] = $this->ui->renderer()->render(($this->ui->factory()->button()->shy(
79 $file_name,
80 $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilobjcoursegui"), 'sendfile')
81 )));
82
83 $this->ctrl->setParameterByClass('ilobjcoursegui', 'ref_id', '');
84 }
85 ksort($links, SORT_NATURAL | SORT_FLAG_CASE);
86
87 $this->addInfoProperty($this->lng->txt("files"), implode("<br>", $links));
88 $this->addListItemProperty($this->lng->txt("files"), implode(", ", $links));
89 }
90
91 // tutorial support members
92 $parts = ilParticipants::getInstanceByObjId($cat_info['obj_id']);
93 //contacts is an array of user ids.
94 $contacts = $parts->getContacts();
95 $sorted_ids = ilUtil::_sortIds($contacts, 'usr_data', 'lastname', 'usr_id');
96
97 $names = [];
98 foreach ($sorted_ids as $usr_id) {
99 $name_presentation = $this->getUserName((int) $usr_id, true);
100 if (strlen($name_presentation)) {
101 $names[] = $name_presentation;
102 }
103 }
104 if (count($names)) {
105 $this->addInfoProperty($this->lng->txt('crs_mem_contacts'), implode('<br/>', $names));
106 $this->addListItemProperty($this->lng->txt('crs_mem_contacts'), implode('<br />', $names));
107 }
108
109 //course contact
110 $contact_info = [];
111 if ($crs->getContactName()) {
112 $contact_info[] = [
113 'name' => $this->lng->txt('crs_contact_name'),
114 'value' => $crs->getContactName()
115 ];
116 }
117
118 if ($crs->getContactEmail()) {
119 //TODO: optimize this
120 //$courseGUI = new ilObjCourseGUI("", $crs_ref_id);
121 $emails = explode(",", $crs->getContactEmail());
122 foreach ($emails as $email) {
123 $email = trim($email);
124 $etpl = new ilTemplate("tpl.crs_contact_email.html", true, true, 'components/ILIAS/Course');
125 $etpl->setVariable(
126 "EMAIL_LINK",
128 $this->getInfoScreen(),
129 'showSummary',
130 array(),
131 array(
132 'type' => 'new',
133 'rcp_to' => $email,
134 //'sig' => $courseGUI->createMailSignature()
135 ),
136 array(
138 'ref_id' => $crs->getRefId(),
139 'ts' => time()
140 )
141 )
142 );
143 $etpl->setVariable("CONTACT_EMAIL", $email);
144 $contact_info[] = [
145 'name' => $this->lng->txt('crs_contact_email'),
146 'value' => $etpl->get()
147 ];
148 }
149 }
150
151 if ($crs->getContactPhone()) {
152 $contact_info[] = [
153 'name' => $this->lng->txt('crs_contact_phone'),
154 'value' => $crs->getContactPhone()
155 ];
156 }
157 if ($crs->getContactResponsibility()) {
158 $contact_info[] = [
159 'name' => $this->lng->txt('crs_contact_responsibility'),
160 'value' => $crs->getContactResponsibility()
161 ];
162 }
163 if ($crs->getContactConsultation()) {
164 $contact_info[] = [
165 'name' => $this->lng->txt('crs_contact_consultation'),
166 'value' => nl2br($crs->getContactConsultation())
167 ];
168 }
169 if ($contact_info !== []) {
170 $this->addInfoSection($this->lng->txt('crs_contact'));
171 foreach ($contact_info as $info) {
172 $this->addInfoProperty(
173 $info['name'],
174 $info['value']
175 );
176 }
177 }
178 $this->addMetaData('crs', $cat_info['obj_id']);
179
180 // last edited
181 $this->addLastUpdate($app);
182 }
183
184 $this->addAction($this->lng->txt("crs_open"), ilLink::_getStaticLink($crs_ref_id, "crs"));
185
186 // register/unregister to appointment
187 if ($settings->isCGRegistrationEnabled()) {
188 if (!$app['event']->isAutoGenerated()) {
189 $reg = new ilCalendarRegistration($app['event']->getEntryId());
190
191 if ($reg->isRegistered(
192 $this->user->getId(),
193 new ilDateTime($app['dstart'], IL_CAL_UNIX),
194 new ilDateTime($app['dend'], IL_CAL_UNIX)
195 )) {
196 //$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE));
197 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $app['event']->getEntryId());
198 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $app['dstart']);
199 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $app['dend']);
200
201 $this->addAction(
202 $this->lng->txt('cal_reg_unregister'),
203 $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmUnregister')
204 );
205 } else {
206 //$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE));
207 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $app['event']->getEntryId());
208 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $app['dstart']);
209 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $app['dend']);
210
211 $this->addAction(
212 $this->lng->txt('cal_reg_register'),
213 $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmRegister')
214 );
215 }
216
217 $registered = $reg->getRegisteredUsers(
218 new \ilDateTime($app['dstart'], IL_CAL_UNIX),
219 new \ilDateTime($app['dend'], IL_CAL_UNIX)
220 );
221
222 $users = "";
223 foreach ($registered as $user) {
224 $users .= $this->getUserName($user) . '<br />';
225 }
226 if ($users != "") {
227 $this->addInfoProperty($this->lng->txt("cal_reg_registered_users"), $users);
228 }
229 }
230 }
231 }
const IL_CAL_UNIX
addInfoProperty(string $a_txt, string $a_val)
Add info property.
addMetaData(string $a_obj_type, int $a_obj_id, ?string $a_sub_obj_type=null, ?int $a_sub_obj_id=null)
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.
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
registration for calendar appointments
static _readFilesByCourse(int $a_course_id)
@classDescription Date and time handling
static getLinkTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
final const string CONTEXT_KEY
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllReferences(int $id)
get all reference ids for object ID
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
special template class to simplify handling of ITX/PEAR
static makeClickable(string $a_text, bool $detectGotoLinks=false, ?string $ilias_http_path=null)
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
$info
Definition: entry_point.php:21
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61

References ilAppointmentPresentationGUI\$appointment, $info, $parts, ilAppointmentPresentationGUI\$user, ilObject\_getAllReferences(), ilCalendarSettings\_getInstance(), ilLink\_getStaticLink(), ilCourseFile\_readFilesByCourse(), ilUtil\_sortIds(), ilAppointmentPresentationGUI\addAction(), ilAppointmentPresentationGUI\addCommonSection(), ilAppointmentPresentationGUI\addInfoProperty(), ilAppointmentPresentationGUI\addInfoSection(), ilAppointmentPresentationGUI\addLastUpdate(), ilAppointmentPresentationGUI\addListItemProperty(), ilAppointmentPresentationGUI\addMetaData(), ilMailFormCall\CONTEXT_KEY, ILIAS\Repository\ctrl(), ilAppointmentPresentationGUI\getCatInfo(), ilAppointmentPresentationGUI\getInfoScreen(), ilParticipants\getInstanceByObjId(), ilMailFormCall\getLinkTarget(), ilAppointmentPresentationGUI\getUserName(), ilCourseMailTemplateMemberContext\ID, IL_CAL_UNIX, ILIAS\Repository\lng(), ilUtil\makeClickable(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: