ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCalendarInboxSharedTableGUI.php
Go to the documentation of this file.
1<?php
25{
26 protected array $cal_data = array();
27
28 protected ilObjUser $user;
29
33 public function __construct(object $a_parent_obj, string $a_parent_cmd)
34 {
35 global $DIC;
36
37 $this->user = $DIC->user();
38
39 parent::__construct($a_parent_obj, $a_parent_cmd);
40
41 $this->setRowTemplate('tpl.calendar_inbox_shared_row.html', 'components/ILIAS/Calendar');
42
43 $this->addColumn('', 'cal_ids', '1px');
44 $this->addColumn($this->lng->txt('name'), 'title', '50%');
45 $this->addColumn($this->lng->txt('cal_apps'), 'apps', '20%');
46 $this->addColumn($this->lng->txt('create_date'), 'create_date', '20%');
47 $this->addColumn($this->lng->txt('cal_accepted'), 'accepted', '5%');
48
49 $this->addMultiCommand('acceptShared', $this->lng->txt('cal_share_accept'));
50 $this->addMultiCommand('declineShared', $this->lng->txt('cal_share_decline'));
51 $this->setSelectAllCheckbox('cal_ids');
52 $this->setPrefix('shared');
53
54 $this->setFormAction($this->ctrl->getFormActionByClass(get_class($this->getParentObject())));
55 $this->setTitle($this->lng->txt('cal_shared_calendars'));
56 $this->parse();
57 }
58
59 protected function fillRow(array $a_set): void
60 {
61 $this->tpl->setVariable('VAL_ID', $a_set['cal_id']);
62 $this->tpl->setVariable('CALENDAR_NAME', $a_set['name']);
63 $this->tpl->setVariable('TXT_FROM', $this->lng->txt('owner'));
64
65 $name = ilObjUser::_lookupName($a_set['owner']);
66 $this->tpl->setVariable('LASTNAME', $name['lastname']);
67 $this->tpl->setVariable('FIRSTNAME', $name['firstname']);
68
69 $this->tpl->setVariable('APPS_COUNT', $a_set['apps']);
70 $this->tpl->setVariable(
71 'CREATE_DATE',
73 );
74
75 if ($a_set['accepted']) {
76 $this->tpl->setVariable('ACC_IMG', ilUtil::getImagePath('standard/icon_ok.svg'));
77 $this->tpl->setVariable('ALT_ACC', $this->lng->txt('cal_accepted'));
78 }
79 if ($a_set['declined']) {
80 $this->tpl->setVariable('DEC_IMG', ilUtil::getImagePath('standard/icon_ok.svg'));
81 $this->tpl->setVariable('ALT_DEC', $this->lng->txt('cal_declined'));
82 }
83 }
84
85 public function setCalendars(array $a_calendars): void
86 {
87 $this->cal_data = $a_calendars;
88 }
89
90 public function parse(): bool
91 {
92 $status = new ilCalendarSharedStatus($this->user->getId());
93 $calendars = $status->getOpenInvitations();
94 $this->setData($calendars);
95 return (bool) count($calendars);
96 }
97}
const IL_CAL_DATETIME
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRow(array $a_set)
Standard Version of Fill Row.
__construct(object $a_parent_obj, string $a_parent_cmd)
@inheritDoc
Stores status (accepted/declined) of shared calendars.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
User class.
static _lookupName(int $a_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addMultiCommand(string $a_cmd, string $a_text)
setPrefix(string $a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26