ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSurveyAppraiseesTableGUI.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 
24 include_once('./Services/Table/classes/class.ilTable2GUI.php');
25 
35 {
36  protected $raters_mode; // [bool]
37 
45  public function __construct($a_parent_obj, $a_parent_cmd, $a_raters_mode = false, $a_may_delete_rater = false)
46  {
47  parent::__construct($a_parent_obj, $a_parent_cmd);
48 
49  global $lng, $ilCtrl;
50 
51  $this->raters_mode = (bool)$a_raters_mode;
52 
53  $this->lng = $lng;
54  $this->ctrl = $ilCtrl;
55 
56  $this->setFormName('apprform');
57 
58  $this->addColumn('','','1%');
59  $this->addColumn($this->lng->txt("lastname"),'lastname', '');
60  $this->addColumn($this->lng->txt("firstname"),'firstname', '');
61  $this->addColumn($this->lng->txt("email"),'email', '');
62  $this->addColumn($this->lng->txt("login"),'login', '');
63 
64  if(!$this->raters_mode)
65  {
66  $this->addColumn($this->lng->txt("survey_360_raters_finished"), "finished");
67  $this->addColumn($this->lng->txt("survey_360_appraisee_close_table"), "closed");
68  $this->addColumn($this->lng->txt("actions"));
69 
70  $this->setTitle($this->lng->txt("survey_360_appraisees"));
71  }
72  else
73  {
74  $this->addColumn($this->lng->txt("survey_360_rater_finished"), "finished");
75  $this->addColumn($this->lng->txt("survey_code_url"));
76  $this->addColumn($this->lng->txt("survey_360_rater_mail_sent"), "sent");
77 
78  include_once "Services/User/classes/class.ilUserUtil.php";
79  $this->setTitle($this->lng->txt("survey_360_edit_raters")." : ".
81  }
82 
83  $this->setRowTemplate("tpl.il_svy_svy_appraisees_row.html", "Modules/Survey");
84 
85  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
86 
87  $this->setDefaultOrderField("last_name");
88  $this->setDefaultOrderDirection("asc");
89 
90  if(!$this->raters_mode)
91  {
92  $this->addCommandButton('deleteAllUserData', $this->lng->txt('svy_delete_all_user_data'));
93  $this->addMultiCommand('confirmAdminAppraiseesClose', $this->lng->txt('survey_360_appraisee_close_action'));
94  $this->addMultiCommand('confirmDeleteAppraisees', $this->lng->txt('survey_360_remove_appraisees'));
95  $this->setPrefix('appr_id');
96  $this->setSelectAllCheckbox('appr_id');
97  }
98  else
99  {
100  $this->addMultiCommand('mailRaters', $this->lng->txt('mail'));
101  if($a_may_delete_rater)
102  {
103  $this->addMultiCommand('confirmDeleteRaters', $this->lng->txt('remove'));
104  }
105  $this->setPrefix('rtr_id');
106  $this->setSelectAllCheckbox('rtr_id');
107  }
108  }
109 
117  public function fillRow($data)
118  {
119  global $lng;
120 
121  $this->tpl->setVariable('MODE', $this->raters_mode ? "rtr" : "appr");
122  $this->tpl->setVariable('ID', $data['user_id']);
123  $this->tpl->setVariable("LOGIN", $data['login']);
124  $this->tpl->setVariable("EMAIL", $data['email']);
125  $this->tpl->setVariable("LAST_NAME", $data['lastname']);
126  $this->tpl->setVariable("FIRST_NAME", $data['firstname']);
127 
128  if(!$this->raters_mode)
129  {
130  $this->tpl->setVariable("FINISHED", $data['finished']);
131  $this->tpl->setVariable("CLOSED", $data['closed'] ?
133  : "");
134 
135  $this->ctrl->setParameter($this->getParentObject(), "appr_id", $data["user_id"]);
136  $this->tpl->setVariable("URL", $lng->txt("survey_360_edit_raters"));
137  $this->tpl->setVariable("HREF", $this->ctrl->getLinkTarget($this->getParentObject(), "editRaters"));
138  $this->ctrl->setParameter($this->getParentObject(), "appr_id", "");
139  }
140  else
141  {
142  $this->tpl->setVariable("FINISHED", $data['finished'] ? $lng->txt("yes") : $lng->txt("no"));
143 
144  $sent = "";
145  if($data["sent"])
146  {
148  }
149  $this->tpl->setVariable("MAIL_SENT", $sent);
150 
151  if($data["href"])
152  {
153  $this->tpl->setVariable("DIRECT_HREF", $data["href"]."");
154  }
155  else
156  {
157  $this->tpl->setVariable("NO_HREF", "");
158  }
159  }
160  }
161 }
162 ?>