ILIAS  release_8 Revision v8.24
class.ilMilestoneResponsiblesTableGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4/*
5 +-----------------------------------------------------------------------------+
6 | ILIAS open source |
7 +-----------------------------------------------------------------------------+
8 | Copyright (c) 1998-2008 ILIAS open source, University of Cologne |
9 | |
10 | This program is free software; you can redistribute it and/or |
11 | modify it under the terms of the GNU General Public License |
12 | as published by the Free Software Foundation; either version 2 |
13 | of the License, or (at your option) any later version. |
14 | |
15 | This program is distributed in the hope that it will be useful, |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | GNU General Public License for more details. |
19 | |
20 | You should have received a copy of the GNU General Public License |
21 | along with this program; if not, write to the Free Software |
22 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23 +-----------------------------------------------------------------------------+
24*/
25
32{
33 protected int $grp_id;
34 protected int $app_id;
35
36 private array $resp_users = [];
37
38 public function __construct(
39 object $a_parent_obj,
40 string $a_parent_cmd,
41 int $a_grp_id,
42 int $a_app_id
43 ) {
44 global $DIC;
45
46 parent::__construct($a_parent_obj, $a_parent_cmd);
47
48 $this->grp_id = $a_grp_id;
49 $this->app_id = $a_app_id;
50
51 $this->addColumn("", "", "1");
52 $this->addColumn($this->lng->txt("user"), "", "100%");
53 $this->setRowTemplate(
54 "tpl.ms_responsible_users_row.html",
55 "Services/Calendar"
56 );
57 $this->setEnableHeader(true);
58 $this->setDefaultOrderField("lastname");
59 $this->setMaxCount(9999);
60 $this->ctrl->setParameter($a_parent_obj, "app_id", $this->app_id);
61 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
63 $this->setTitle($this->lng->txt("cal_ms_users_responsible"));
64 $this->addMultiCommand(
65 "saveMilestoneResponsibleUsers",
66 $this->lng->txt("cal_save_responsible_users")
67 );
68 }
69
74 {
75 $participants = array();
76 if ($this->app_id > 0) {
77 $app = new ilCalendarEntry($this->app_id);
78 $resp_users = $app->readResponsibleUsers();
79 foreach ($resp_users as $v) {
80 $n = ilObjUser::_lookupName($v["user_id"]);
81 $participants[$v["user_id"]] = array_merge($n, array("type" => "non-member"));
82 $this->resp_users[] = $v["user_id"];
83 }
84 }
85
86 $part = ilGroupParticipants::_getInstanceByObjId($this->grp_id);
87 $admins = $part->getAdmins();
88 $members = $part->getMembers();
89 foreach ($members as $v) {
91 $participants[$v] = array_merge($n, array("type" => "member"));
92 }
93 foreach ($admins as $v) {
95 $participants[$v] = array_merge($n, array("type" => "admin"));
96 }
97 $this->setData($participants);
98 }
99
104 protected function fillRow(array $a_set): void
105 {
106 if (is_array($this->resp_users) && in_array($a_set["user_id"], $this->resp_users)) {
107 $this->tpl->setVariable("CHECKED", ' checked="checked" ');
108 }
109 $this->tpl->setVariable("USER_ID", $a_set["user_id"]);
110 $this->tpl->setVariable("TXT_FIRSTNAME", $a_set["firstname"]);
111 $this->tpl->setVariable("TXT_LASTNAME", $a_set["lastname"]);
112 $this->tpl->setVariable("TXT_LOGIN", ilObjUser::_lookupLogin($a_set["user_id"]));
113 }
114}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
TableGUI class for selection of milestone responsibles.
getParticipantsAndResponsibles()
Get participants and responsible users.
fillRow(array $a_set)
Standard Version of Fill Row.
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_grp_id, int $a_app_id)
static _lookupName(int $a_user_id)
lookup user name
static _lookupLogin(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)
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)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
setMaxCount(int $a_max_count)
set max.
$app
Definition: cli.php:39
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc