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