ILIAS  release_8 Revision v8.24
class.ilCalendarInboxSharedTableGUI.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
31{
32 protected array $cal_data = array();
33
34 protected ilObjUser $user;
35
39 public function __construct(object $a_parent_obj, string $a_parent_cmd)
40 {
41 global $DIC;
42
43 $this->user = $DIC->user();
44
45 parent::__construct($a_parent_obj, $a_parent_cmd);
46
47 $this->setRowTemplate('tpl.calendar_inbox_shared_row.html', 'Services/Calendar');
48
49 $this->addColumn('', 'cal_ids', '1px');
50 $this->addColumn($this->lng->txt('name'), 'title', '50%');
51 $this->addColumn($this->lng->txt('cal_apps'), 'apps', '20%');
52 $this->addColumn($this->lng->txt('create_date'), 'create_date', '20%');
53 $this->addColumn($this->lng->txt('cal_accepted'), 'accepted', '5%');
54
55 $this->addMultiCommand('acceptShared', $this->lng->txt('cal_share_accept'));
56 $this->addMultiCommand('declineShared', $this->lng->txt('cal_share_decline'));
57 $this->setSelectAllCheckbox('cal_ids');
58 $this->setPrefix('shared');
59
60 $this->setFormAction($this->ctrl->getFormActionByClass(get_class($this->getParentObject())));
61 $this->setTitle($this->lng->txt('cal_shared_calendars'));
62 $this->parse();
63 }
64
65 protected function fillRow(array $a_set): void
66 {
67 $this->tpl->setVariable('VAL_ID', $a_set['cal_id']);
68 $this->tpl->setVariable('CALENDAR_NAME', $a_set['name']);
69 $this->tpl->setVariable('TXT_FROM', $this->lng->txt('owner'));
70
71 $name = ilObjUser::_lookupName($a_set['owner']);
72 $this->tpl->setVariable('LASTNAME', $name['lastname']);
73 $this->tpl->setVariable('FIRSTNAME', $name['firstname']);
74
75 $this->tpl->setVariable('APPS_COUNT', $a_set['apps']);
76 $this->tpl->setVariable(
77 'CREATE_DATE',
79 );
80
81 if ($a_set['accepted']) {
82 $this->tpl->setVariable('ACC_IMG', ilUtil::getImagePath('icon_ok.svg'));
83 $this->tpl->setVariable('ALT_ACC', $this->lng->txt('cal_accepted'));
84 }
85 if ($a_set['declined']) {
86 $this->tpl->setVariable('DEC_IMG', ilUtil::getImagePath('icon_ok.svg'));
87 $this->tpl->setVariable('ALT_DEC', $this->lng->txt('cal_declined'));
88 }
89 }
90
91 public function setCalendars(array $a_calendars): void
92 {
93 $this->cal_data = $a_calendars;
94 }
95
96 public function parse(): bool
97 {
98 $status = new ilCalendarSharedStatus($this->user->getId());
99 $calendars = $status->getOpenInvitations();
100 $this->setData($calendars);
101 return (bool) count($calendars);
102 }
103}
const IL_CAL_DATETIME
Show shared calendars for a specific user.
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)
@classDescription Date and time handling
User class.
static _lookupName(int $a_user_id)
lookup user name
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 $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc