ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 include_once "./Modules/Survey/classes/inc.SurveyConstants.php";
27 
39 {
44  function ilObjSurveyListGUI()
45  {
46  $this->ilObjectListGUI();
47  $this->info_screen_enabled = true;
48  }
49 
53  function init()
54  {
55  $this->static_link_enabled = true;
56  $this->delete_enabled = true;
57  $this->cut_enabled = true;
58  $this->copy_enabled = true;
59  $this->subscribe_enabled = true;
60  $this->link_enabled = true;
61  $this->payment_enabled = false;
62  $this->type = "svy";
63  $this->gui_class_name = "ilobjsurveygui";
64 
65  // general commands array
66  include_once('./Modules/Survey/classes/class.ilObjSurveyAccess.php');
67  $this->commands = ilObjSurveyAccess::_getCommands();
68  }
69 
70 
79  function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
80  {
81  parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
82  }
83 
84 
92  function getCommandFrame($a_cmd)
93  {
94  switch($a_cmd)
95  {
96  case "":
97  case "infoScreen":
98  case "evaluation":
99  include_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
100  $frame = ilFrameTargetInfo::_getFrame("MainContent");
101  break;
102 
103  default:
104  }
105 
106  return $frame;
107  }
108 
109 
110 
119  function getProperties()
120  {
121  global $lng, $ilUser, $rbacsystem;
122 
123  $props = array();
124 
125  if (!$rbacsystem->checkAccess("visible,read", $this->ref_id))
126  {
127  return $props;
128  }
129 
130  include_once("./Modules/Survey/classes/class.ilObjSurveyAccess.php");
131  if (!ilObjSurveyAccess::_lookupOnline($this->obj_id))
132  {
133  $props[] = array("alert" => true, "property" => $lng->txt("status"),
134  "value" => $lng->txt("offline"));
135  }
136  else
137  {
138  // BEGIN Usability Distinguish between status and participation
139  if (!ilObjSurveyAccess::_lookupCreationComplete($this->obj_id))
140  {
141  // no completion
142  $props[] = array("alert" => true,
143  "property" => $lng->txt("svy_participation"),
144  "value" => $lng->txt("svy_warning_survey_not_complete"),
145  'propertyNameVisible' => false);
146  }
147  else
148  {
149  if ($ilUser->getId() != ANONYMOUS_USER_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  }
172  // END Usability Distinguish between status and participation
173  }
174 
175  return $props;
176  }
177 
178 
186  function getCommandLink($a_cmd)
187  {
188  $cmd_link = "";
189  switch ($a_cmd)
190  {
191  default:
192  $cmd_link = "ilias.php?baseClass=ilObjSurveyGUI&amp;ref_id=" . $this->ref_id .
193  "&amp;cmd=$a_cmd";
194  break;
195  }
196  // separate method for this line
197  return $cmd_link;
198  }
199 
200 
201 
202 } // END class.ilObjTestListGUI
203 ?>