ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
24include_once('./Services/Table/classes/class.ilTable2GUI.php');
25
35{
36 protected $raters_mode; // [bool]
37 protected $fallback_url; // [string]
38
46 public function __construct($a_parent_obj, $a_parent_cmd, $a_raters_mode = false, $a_may_delete_rater = false, $a_fallback_url = null)
47 {
48 parent::__construct($a_parent_obj, $a_parent_cmd);
49
50 global $lng, $ilCtrl;
51
52 $this->raters_mode = (bool)$a_raters_mode;
53 $this->fallback_url = trim($a_fallback_url);
54
55 $this->lng = $lng;
56 $this->ctrl = $ilCtrl;
57
58 $this->setFormName('apprform');
59
60 $this->addColumn('','','1%');
61 $this->addColumn($this->lng->txt("name"),'name', '');
62 $this->addColumn($this->lng->txt("login"),'login', '');
63 $this->addColumn($this->lng->txt("email"),'email', '');
64
65 if(!$this->raters_mode)
66 {
67 $this->addColumn($this->lng->txt("survey_360_raters_finished"), "finished");
68 $this->addColumn($this->lng->txt("survey_360_appraisee_close_table"), "closed");
69 $this->addColumn($this->lng->txt("actions"));
70
71 $this->setTitle($this->lng->txt("survey_360_appraisees"));
72 }
73 else
74 {
75 $this->addColumn($this->lng->txt("survey_360_rater_finished"), "finished");
76 $this->addColumn($this->lng->txt("survey_code_url"));
77 $this->addColumn($this->lng->txt("survey_360_rater_mail_sent"), "sent");
78
79 include_once "Services/User/classes/class.ilUserUtil.php";
80 $this->setTitle($this->lng->txt("survey_360_edit_raters")." : ".
82 }
83
84 $this->setRowTemplate("tpl.il_svy_svy_appraisees_row.html", "Modules/Survey");
85
86 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
87
88 $this->setDefaultOrderField("last_name");
89 $this->setDefaultOrderDirection("asc");
90
91 if(!$this->raters_mode)
92 {
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("NAME", $data['name']);
126
127 if(!$this->raters_mode)
128 {
129 $this->tpl->setVariable("FINISHED", $data['finished']);
130 $this->tpl->setVariable("CLOSED", $data['closed'] ?
132 : "");
133
134 $this->ctrl->setParameter($this->getParentObject(), "appr_id", $data["user_id"]);
135 $this->tpl->setVariable("URL", $lng->txt("survey_360_edit_raters"));
136 $this->tpl->setVariable("HREF", $this->ctrl->getLinkTarget($this->getParentObject(), "editRaters"));
137 $this->ctrl->setParameter($this->getParentObject(), "appr_id", "");
138 }
139 else
140 {
141 $this->tpl->setVariable("FINISHED", $data['finished'] ? $lng->txt("yes") : $lng->txt("no"));
142
143 $sent = "";
144 if($data["sent"])
145 {
147 }
148 $this->tpl->setVariable("MAIL_SENT", $sent);
149
150 if($data["href"] || $this->fallback_url)
151 {
152 if($data["href"])
153 {
154 $this->tpl->setVariable("DIRECT_HREF", $data["href"]);
155 }
156 else
157 {
158 $this->tpl->setVariable("DIRECT_HREF", $this->fallback_url);
159 }
160 }
161 else
162 {
163 $this->tpl->setVariable("NO_HREF", "");
164 }
165 }
166 }
167}
168?>
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
__construct($a_parent_obj, $a_parent_cmd, $a_raters_mode=false, $a_may_delete_rater=false, $a_fallback_url=null)
Constructor.
Class ilTable2GUI.
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.
getParentObject()
Get parent object.
setPrefix($a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setFormName($a_formname)
Set Form name.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7