ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
24include_once("Services/Table/classes/class.ilTable2GUI.php");
25
26
36{
37
38 function ilMilestoneResponsiblesTableGUI($a_parent_obj, $a_parent_cmd = "",
39 $a_grp_id, $a_app_id)
40 {
41 global $ilCtrl, $lng;
42
43 parent::__construct($a_parent_obj, $a_parent_cmd);
44
45 $this->grp_id = $a_grp_id;
46 $this->app_id = $a_app_id;
47
48 $this->addColumn("", "", "1");
49 $this->addColumn($lng->txt("user"), "", "100%");
50 $this->setRowTemplate("tpl.ms_responsible_users_row.html",
51 "Services/Calendar");
52 $this->setEnableHeader(true);
53 $this->setDefaultOrderField("lastname");
54 $this->setMaxCount(9999);
55 $ilCtrl->setParameter($a_parent_obj, "app_id", $this->app_id);
56 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
58 $this->setTitle($lng->txt("cal_ms_users_responsible"));
59 $this->addMultiCommand(
60 "saveMilestoneResponsibleUsers", $lng->txt("cal_save_responsible_users"));
61 }
62
67 {
68 $participants = array();
69 if ($this->app_id > 0)
70 {
71 include_once("./Services/Calendar/classes/class.ilCalendarEntry.php");
72 $app = new ilCalendarEntry($this->app_id);
73 $resp_users = $app->readResponsibleUsers();
74 foreach($resp_users as $v)
75 {
76 $n = ilObjUser::_lookupName($v["user_id"]);
77 $participants[$v["user_id"]] = array_merge($n, array("type" => "non-member"));
78 $this->resp_users[] = $v["user_id"];
79 }
80 }
81
82 include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
83 $part = ilGroupParticipants::_getInstanceByObjId($this->grp_id);
84 $admins = $part->getAdmins();
85 $members = $part->getMembers();
86 foreach($members as $v)
87 {
89 $participants[$v] = array_merge($n, array("type" => "member"));
90 }
91 foreach($admins as $v)
92 {
94 $participants[$v] = array_merge($n, array("type" => "admin"));
95 }
96 $this->setData($participants);
97 }
98
103 protected function fillRow($a_set)
104 {
105 global $lng, $ilCtrl;
106
107 if (is_array($this->resp_users) && in_array($a_set["user_id"], $this->resp_users))
108 {
109 $this->tpl->setVariable("CHECKED", ' checked="checked" ');
110 }
111 $this->tpl->setVariable("USER_ID", $a_set["user_id"]);
112 $this->tpl->setVariable("TXT_FIRSTNAME", $a_set["firstname"]);
113 $this->tpl->setVariable("TXT_LASTNAME", $a_set["lastname"]);
114 $this->tpl->setVariable("TXT_LOGIN", ilObjUser::_lookupLogin($a_set["user_id"]));
115 }
116
117}
118?>
$n
Definition: RandomTest.php:80
Model for a calendar entry.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
TableGUI class for selection of milestone responsibles.
getParticipantsAndResponsibles()
Get participants and responsible users.
fillRow($a_set)
Standard Version of Fill Row.
ilMilestoneResponsiblesTableGUI($a_parent_obj, $a_parent_cmd="", $a_grp_id, $a_app_id)
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
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.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setMaxCount($a_max_count)
set max.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40