ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 {
42  protected $rbacsystem;
43 
48  public function __construct()
49  {
50  global $DIC;
51 
52  $this->lng = $DIC->language();
53  $this->user = $DIC->user();
54  $this->rbacsystem = $DIC->rbac()->system();
55  parent::__construct();
56  $this->info_screen_enabled = true;
57  }
58 
62  public function init()
63  {
64  $this->static_link_enabled = true;
65  $this->delete_enabled = true;
66  $this->cut_enabled = true;
67  $this->copy_enabled = true;
68  $this->subscribe_enabled = true;
69  $this->link_enabled = true;
70  $this->type = "svy";
71  $this->gui_class_name = "ilobjsurveygui";
72 
73  // general commands array
74  include_once('./Modules/Survey/classes/class.ilObjSurveyAccess.php');
75  $this->commands = ilObjSurveyAccess::_getCommands();
76  }
77 
78 
87  public function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
88  {
89  parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
90  }
91 
92 
100  public function getCommandFrame($a_cmd)
101  {
102  switch ($a_cmd) {
103  case "":
104  case "infoScreen":
105  case "evaluation":
106  include_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
107  $frame = ilFrameTargetInfo::_getFrame("MainContent");
108  break;
109 
110  default:
111  }
112 
113  return $frame;
114  }
115 
116 
117 
126  public function getProperties()
127  {
128  $lng = $this->lng;
131 
132  $props = array();
133 
134  if (!$rbacsystem->checkAccess("visible,read", $this->ref_id)) {
135  return $props;
136  }
137 
138  include_once("./Modules/Survey/classes/class.ilObjSurveyAccess.php");
139  if (!ilObjSurveyAccess::_lookupOnline($this->obj_id)) {
140  $props[] = array("alert" => true, "property" => $lng->txt("status"),
141  "value" => $lng->txt("offline"));
142  } else {
143  // BEGIN Usability Distinguish between status and participation
144  if (!ilObjSurveyAccess::_lookupCreationComplete($this->obj_id)) {
145  // no completion
146  $props[] = array("alert" => true,
147  "property" => $lng->txt("svy_participation"),
148  "value" => $lng->txt("svy_warning_survey_not_complete"),
149  'propertyNameVisible' => false);
150  } else {
151  if ($ilUser->getId() != ANONYMOUS_USER_ID) {
152  if (!ilObjSurveyAccess::_lookup360Mode($this->obj_id)) {
153  $finished = ilObjSurveyAccess::_lookupFinished($this->obj_id, $ilUser->id);
154 
155  // finished
156  if ($finished === 1) {
157  $stat = $this->lng->txt("svy_finished");
158  }
159  // not finished
160  elseif ($finished === 0) {
161  $stat = $this->lng->txt("svy_not_finished");
162  }
163  // not started
164  else {
165  $stat = $this->lng->txt("svy_not_started");
166  }
167  $props[] = array("alert" => false, "property" => $lng->txt("participation"),
168  "value" => $stat, 'propertyNameVisible' => false);
169  } else {
170  $lng->loadLanguageModule("survey");
171  $props[] = array("alert" => false, "property" => "",
172  "value" => $lng->txt("survey_360_list_title"), 'propertyNameVisible' => false);
173  }
174  }
175  }
176  // END Usability Distinguish between status and participation
177  }
178 
179  return $props;
180  }
181 
182 
190  public function getCommandLink($a_cmd)
191  {
192  $cmd_link = "";
193  switch ($a_cmd) {
194  default:
195  $cmd_link = "ilias.php?baseClass=ilObjSurveyGUI&amp;ref_id=" . $this->ref_id .
196  "&amp;cmd=$a_cmd";
197  break;
198  }
199  // separate method for this line
200  return $cmd_link;
201  }
202 } // END class.ilObjTestListGUI
static _getCommands()
get commands
getCommandLink($a_cmd)
Get command link url.
global $DIC
Definition: saml.php:7
initItem($a_ref_id, $a_obj_id, $a_title="", $a_description="")
inititialize new item
getCommandFrame($a_cmd)
Get command target frame.
user()
Definition: user.php:4
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.
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