ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjSurveyListGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12{
16 protected $rbacsystem;
17
22 public function __construct()
23 {
24 global $DIC;
25
26 $this->lng = $DIC->language();
27 $this->lng->loadLanguageModule("survey");
28 $this->user = $DIC->user();
29 $this->rbacsystem = $DIC->rbac()->system();
31 $this->info_screen_enabled = true;
32 }
33
37 public function init()
38 {
39 $this->static_link_enabled = true;
40 $this->delete_enabled = true;
41 $this->cut_enabled = true;
42 $this->copy_enabled = true;
43 $this->subscribe_enabled = true;
44 $this->link_enabled = true;
45 $this->type = "svy";
46 $this->gui_class_name = "ilobjsurveygui";
47
48 // general commands array
49 $this->commands = ilObjSurveyAccess::_getCommands();
50 }
51
52
53
61 public function getCommandFrame($a_cmd)
62 {
63 switch ($a_cmd) {
64 case "":
65 case "infoScreen":
66 case "evaluation":
67 $frame = ilFrameTargetInfo::_getFrame("MainContent");
68 break;
69
70 default:
71 }
72
73 return $frame;
74 }
75
76
77
86 public function getProperties()
87 {
91
92 $props = [];
93
94 if (!$rbacsystem->checkAccess("visible,read", $this->ref_id)) {
95 return $props;
96 }
97
98 $props = parent::getProperties();
99
100 if (!ilObject::lookupOfflineStatus($this->obj_id)) {
101 // BEGIN Usability Distinguish between status and participation
102 if (!ilObjSurveyAccess::_lookupCreationComplete($this->obj_id)) {
103 // no completion
104 $props[] = array("alert" => true,
105 "property" => $lng->txt("svy_participation"),
106 "value" => $lng->txt("svy_warning_survey_not_complete"),
107 'propertyNameVisible' => false);
108 } else {
109 if ($ilUser->getId() != ANONYMOUS_USER_ID) {
110 $mode = ilObjSurveyAccess::_lookupMode($this->obj_id);
111 if ($mode == ilObjSurvey::MODE_360) {
112 $props[] = array("alert" => false, "property" => $lng->txt("type"),
113 "value" => $lng->txt("survey_360_mode"), 'propertyNameVisible' => true);
114 } elseif ($mode == ilObjSurvey::MODE_SELF_EVAL) {
115 $props[] = array("alert" => false, "property" => $lng->txt("type"),
116 "value" => $lng->txt("survey_360_self_evaluation"), 'propertyNameVisible' => true);
117 } else {
118 $finished = ilObjSurveyAccess::_lookupFinished($this->obj_id, $ilUser->id);
119
120 // finished
121 if ($finished === 1) {
122 $stat = $this->lng->txt("svy_finished");
123 }
124 // not finished
125 elseif ($finished === 0) {
126 $stat = $this->lng->txt("svy_not_finished");
127 }
128 // not started
129 else {
130 $stat = $this->lng->txt("svy_not_started");
131 }
132 $props[] = array("alert" => false, "property" => $lng->txt("svy_participation"),
133 "value" => $stat, 'propertyNameVisible' => true);
134 }
135 }
136 }
137 // END Usability Distinguish between status and participation
138 }
139
140 return $props;
141 }
142
143
151 public function getCommandLink($a_cmd)
152 {
153 $cmd_link = "";
154 switch ($a_cmd) {
155 default:
156 $cmd_link = "ilias.php?baseClass=ilObjSurveyGUI&amp;ref_id=" . $this->ref_id .
157 "&amp;cmd=$a_cmd";
158 break;
159 }
160 // separate method for this line
161 return $cmd_link;
162 }
163} // END class.ilObjTestListGUI
user()
Definition: user.php:4
An exception for terminatinating execution or to throw for unit testing.
static _getFrame($a_class, $a_type='')
Get content frame name.
static _getCommands()
get commands
static _lookupMode($a_obj_id)
Get survey mode.
static _lookupFinished($a_obj_id, $a_user_id="")
get finished status
static _lookupCreationComplete($a_obj_id)
checks wether all necessary parts of the survey are given
Class ilObjSurveyListGUI.
getCommandLink($a_cmd)
Get command link url.
getProperties()
Get item properties.
getCommandFrame($a_cmd)
Get command target frame.
Class ilObjectListGUI.
static lookupOfflineStatus($a_obj_id)
Lookup offline status using objectDataCache.
const ANONYMOUS_USER_ID
Definition: constants.php:25
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc