ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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->lng->loadLanguageModule("survey");
54  $this->user = $DIC->user();
55  $this->rbacsystem = $DIC->rbac()->system();
56  parent::__construct();
57  $this->info_screen_enabled = true;
58  }
59 
63  public function init()
64  {
65  $this->static_link_enabled = true;
66  $this->delete_enabled = true;
67  $this->cut_enabled = true;
68  $this->copy_enabled = true;
69  $this->subscribe_enabled = true;
70  $this->link_enabled = true;
71  $this->type = "svy";
72  $this->gui_class_name = "ilobjsurveygui";
73 
74  // general commands array
75  include_once('./Modules/Survey/classes/class.ilObjSurveyAccess.php');
76  $this->commands = ilObjSurveyAccess::_getCommands();
77  }
78 
79 
88  public function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
89  {
90  parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
91  }
92 
93 
101  public function getCommandFrame($a_cmd)
102  {
103  switch ($a_cmd) {
104  case "":
105  case "infoScreen":
106  case "evaluation":
107  include_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
108  $frame = ilFrameTargetInfo::_getFrame("MainContent");
109  break;
110 
111  default:
112  }
113 
114  return $frame;
115  }
116 
117 
118 
127  public function getProperties()
128  {
129  $lng = $this->lng;
132 
133  $props = [];
134 
135  if (!$rbacsystem->checkAccess("visible,read", $this->ref_id)) {
136  return $props;
137  }
138 
139  $props = parent::getProperties();
140 
141  include_once("./Modules/Survey/classes/class.ilObjSurveyAccess.php");
142  if (!ilObject::lookupOfflineStatus($this->obj_id)) {
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("svy_participation"),
168  "value" => $stat, 'propertyNameVisible' => false);
169  } else {
170  $props[] = array("alert" => false, "property" => "",
171  "value" => $lng->txt("survey_360_list_title"), 'propertyNameVisible' => false);
172  }
173  }
174  }
175  // END Usability Distinguish between status and participation
176  }
177 
178  return $props;
179  }
180 
181 
189  public function getCommandLink($a_cmd)
190  {
191  $cmd_link = "";
192  switch ($a_cmd) {
193  default:
194  $cmd_link = "ilias.php?baseClass=ilObjSurveyGUI&amp;ref_id=" . $this->ref_id .
195  "&amp;cmd=$a_cmd";
196  break;
197  }
198  // separate method for this line
199  return $cmd_link;
200  }
201 } // 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.
static lookupOfflineStatus($a_obj_id)
Lookup offline status using objectDataCache.
Class ilObjectListGUI.
$ilUser
Definition: imgupload.php:18
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.