ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $ilCtrl, $lng;
44 
45  parent::__construct($a_parent_obj, $a_parent_cmd);
46 
47  $this->grp_id = $a_grp_id;
48  $this->app_id = $a_app_id;
49 
50  $this->addColumn("", "", "1");
51  $this->addColumn($lng->txt("user"), "", "100%");
52  $this->setRowTemplate(
53  "tpl.ms_responsible_users_row.html",
54  "Services/Calendar"
55  );
56  $this->setEnableHeader(true);
57  $this->setDefaultOrderField("lastname");
58  $this->setMaxCount(9999);
59  $ilCtrl->setParameter($a_parent_obj, "app_id", $this->app_id);
60  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
62  $this->setTitle($lng->txt("cal_ms_users_responsible"));
63  $this->addMultiCommand(
64  "saveMilestoneResponsibleUsers",
65  $lng->txt("cal_save_responsible_users")
66  );
67  }
68 
73  {
74  $participants = array();
75  if ($this->app_id > 0) {
76  include_once("./Services/Calendar/classes/class.ilCalendarEntry.php");
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  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
87  $part = ilGroupParticipants::_getInstanceByObjId($this->grp_id);
88  $admins = $part->getAdmins();
89  $members = $part->getMembers();
90  foreach ($members as $v) {
92  $participants[$v] = array_merge($n, array("type" => "member"));
93  }
94  foreach ($admins as $v) {
96  $participants[$v] = array_merge($n, array("type" => "admin"));
97  }
98  $this->setData($participants);
99  }
100 
105  protected function fillRow($a_set)
106  {
107  global $lng, $ilCtrl;
108 
109  if (is_array($this->resp_users) && in_array($a_set["user_id"], $this->resp_users)) {
110  $this->tpl->setVariable("CHECKED", ' checked="checked" ');
111  }
112  $this->tpl->setVariable("USER_ID", $a_set["user_id"]);
113  $this->tpl->setVariable("TXT_FIRSTNAME", $a_set["firstname"]);
114  $this->tpl->setVariable("TXT_LASTNAME", $a_set["lastname"]);
115  $this->tpl->setVariable("TXT_LOGIN", ilObjUser::_lookupLogin($a_set["user_id"]));
116  }
117 }
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.
__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.
Create styles array
The data for the language used.
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.