ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMilestoneResponsiblesTableGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 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 
24 include_once("Services/Table/classes/class.ilTable2GUI.php");
25 
26 
36 {
37  public function __construct(
38  $a_parent_obj,
39  $a_parent_cmd = "",
40  $a_grp_id,
41  $a_app_id
42  ) {
43  global $DIC;
44 
45  $ilCtrl = $DIC['ilCtrl'];
46  $lng = $DIC['lng'];
47 
48  parent::__construct($a_parent_obj, $a_parent_cmd);
49 
50  $this->grp_id = $a_grp_id;
51  $this->app_id = $a_app_id;
52 
53  $this->addColumn("", "", "1");
54  $this->addColumn($lng->txt("user"), "", "100%");
55  $this->setRowTemplate(
56  "tpl.ms_responsible_users_row.html",
57  "Services/Calendar"
58  );
59  $this->setEnableHeader(true);
60  $this->setDefaultOrderField("lastname");
61  $this->setMaxCount(9999);
62  $ilCtrl->setParameter($a_parent_obj, "app_id", $this->app_id);
63  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
65  $this->setTitle($lng->txt("cal_ms_users_responsible"));
66  $this->addMultiCommand(
67  "saveMilestoneResponsibleUsers",
68  $lng->txt("cal_save_responsible_users")
69  );
70  }
71 
76  {
77  $participants = array();
78  if ($this->app_id > 0) {
79  include_once("./Services/Calendar/classes/class.ilCalendarEntry.php");
80  $app = new ilCalendarEntry($this->app_id);
81  $resp_users = $app->readResponsibleUsers();
82  foreach ($resp_users as $v) {
83  $n = ilObjUser::_lookupName($v["user_id"]);
84  $participants[$v["user_id"]] = array_merge($n, array("type" => "non-member"));
85  $this->resp_users[] = $v["user_id"];
86  }
87  }
88 
89  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
90  $part = ilGroupParticipants::_getInstanceByObjId($this->grp_id);
91  $admins = $part->getAdmins();
92  $members = $part->getMembers();
93  foreach ($members as $v) {
95  $participants[$v] = array_merge($n, array("type" => "member"));
96  }
97  foreach ($admins as $v) {
99  $participants[$v] = array_merge($n, array("type" => "admin"));
100  }
101  $this->setData($participants);
102  }
103 
108  protected function fillRow($a_set)
109  {
110  global $DIC;
111 
112  $lng = $DIC['lng'];
113  $ilCtrl = $DIC['ilCtrl'];
114 
115  if (is_array($this->resp_users) && in_array($a_set["user_id"], $this->resp_users)) {
116  $this->tpl->setVariable("CHECKED", ' checked="checked" ');
117  }
118  $this->tpl->setVariable("USER_ID", $a_set["user_id"]);
119  $this->tpl->setVariable("TXT_FIRSTNAME", $a_set["firstname"]);
120  $this->tpl->setVariable("TXT_LASTNAME", $a_set["lastname"]);
121  $this->tpl->setVariable("TXT_LOGIN", ilObjUser::_lookupLogin($a_set["user_id"]));
122  }
123 }
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
Model for a calendar entry.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
global $DIC
Definition: saml.php:7
__construct( $a_parent_obj, $a_parent_cmd="", $a_grp_id, $a_app_id)
TableGUI class for selection of milestone responsibles.
fillRow($a_set)
Standard Version of Fill Row.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
getParticipantsAndResponsibles()
Get participants and responsible users.
addMultiCommand($a_cmd, $a_text)
Add Command button.
$n
Definition: RandomTest.php:85
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setEnableHeader($a_enableheader)
Set Enable Header.
setMaxCount($a_max_count)
set max.