ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjSurveyListGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 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 
25 include_once "Services/Object/classes/class.ilObjectListGUI.php";
26 
38 {
43  function __construct()
44  {
45  parent::__construct();
46  $this->info_screen_enabled = true;
47  }
48 
52  function init()
53  {
54  $this->static_link_enabled = true;
55  $this->delete_enabled = true;
56  $this->cut_enabled = true;
57  $this->copy_enabled = true;
58  $this->subscribe_enabled = true;
59  $this->link_enabled = true;
60  $this->type = "svy";
61  $this->gui_class_name = "ilobjsurveygui";
62 
63  // general commands array
64  include_once('./Modules/Survey/classes/class.ilObjSurveyAccess.php');
65  $this->commands = ilObjSurveyAccess::_getCommands();
66  }
67 
68 
77  function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
78  {
79  parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
80  }
81 
82 
90  function getCommandFrame($a_cmd)
91  {
92  switch($a_cmd)
93  {
94  case "":
95  case "infoScreen":
96  case "evaluation":
97  include_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
98  $frame = ilFrameTargetInfo::_getFrame("MainContent");
99  break;
100 
101  default:
102  }
103 
104  return $frame;
105  }
106 
107 
108 
117  function getProperties()
118  {
119  global $lng, $ilUser, $rbacsystem;
120 
121  $props = array();
122 
123  if (!$rbacsystem->checkAccess("visible,read", $this->ref_id))
124  {
125  return $props;
126  }
127 
128  include_once("./Modules/Survey/classes/class.ilObjSurveyAccess.php");
129  if (!ilObjSurveyAccess::_lookupOnline($this->obj_id))
130  {
131  $props[] = array("alert" => true, "property" => $lng->txt("status"),
132  "value" => $lng->txt("offline"));
133  }
134  else
135  {
136  // BEGIN Usability Distinguish between status and participation
137  if (!ilObjSurveyAccess::_lookupCreationComplete($this->obj_id))
138  {
139  // no completion
140  $props[] = array("alert" => true,
141  "property" => $lng->txt("svy_participation"),
142  "value" => $lng->txt("svy_warning_survey_not_complete"),
143  'propertyNameVisible' => false);
144  }
145  else
146  {
147  if ($ilUser->getId() != ANONYMOUS_USER_ID)
148  {
149  if(!ilObjSurveyAccess::_lookup360Mode($this->obj_id))
150  {
151  $finished = ilObjSurveyAccess::_lookupFinished($this->obj_id, $ilUser->id);
152 
153  // finished
154  if ($finished === 1)
155  {
156  $stat = $this->lng->txt("svy_finished");
157  }
158  // not finished
159  else if ($finished === 0)
160  {
161  $stat = $this->lng->txt("svy_not_finished");
162  }
163  // not started
164  else
165  {
166  $stat = $this->lng->txt("svy_not_started");
167  }
168  $props[] = array("alert" => false, "property" => $lng->txt("participation"),
169  "value" => $stat, 'propertyNameVisible' => false);
170  }
171  else
172  {
173  $lng->loadLanguageModule("survey");
174  $props[] = array("alert" => false, "property" => "",
175  "value" => $lng->txt("survey_360_list_title"), 'propertyNameVisible' => false);
176  }
177  }
178  }
179  // END Usability Distinguish between status and participation
180  }
181 
182  return $props;
183  }
184 
185 
193  function getCommandLink($a_cmd)
194  {
195  $cmd_link = "";
196  switch ($a_cmd)
197  {
198  default:
199  $cmd_link = "ilias.php?baseClass=ilObjSurveyGUI&amp;ref_id=" . $this->ref_id .
200  "&amp;cmd=$a_cmd";
201  break;
202  }
203  // separate method for this line
204  return $cmd_link;
205  }
206 
207 
208 
209 } // END class.ilObjTestListGUI
210 ?>
static _getCommands()
get commands
getCommandLink($a_cmd)
Get command link url.
initItem($a_ref_id, $a_obj_id, $a_title="", $a_description="")
inititialize new item
getCommandFrame($a_cmd)
Get command target frame.
getProperties()
Get item properties.
Class ilObjectListGUI.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static _lookupFinished($a_obj_id, $a_user_id="")
get finished status
static _getFrame($a_class, $a_type='')
Get content frame name.
global $lng
Definition: privfeed.php:17
static _lookup360Mode($a_obj_id)
static _lookupCreationComplete($a_obj_id)
checks wether all necessary parts of the survey are given
Class ilObjSurveyListGUI.
static _lookupOnline($a_obj_id)
get status