Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00036 include_once "classes/class.ilObjectListGUI.php";
00037 include_once "./survey/classes/inc.SurveyConstants.php";
00038
00039 class ilObjSurveyListGUI extends ilObjectListGUI
00040 {
00045 function ilObjSurveyListGUI()
00046 {
00047 $this->ilObjectListGUI();
00048 $this->info_screen_enabled = true;
00049 }
00050
00054 function init()
00055 {
00056 $this->delete_enabled = true;
00057 $this->cut_enabled = true;
00058 $this->subscribe_enabled = true;
00059 $this->link_enabled = true;
00060 $this->payment_enabled = false;
00061 $this->type = "svy";
00062 $this->gui_class_name = "ilobjsurveygui";
00063
00064
00065 include_once('./survey/classes/class.ilObjSurveyAccess.php');
00066 $this->commands = ilObjSurveyAccess::_getCommands();
00067 }
00068
00069
00078 function initItem($a_ref_id, $a_obj_id, $a_title = "", $a_description = "")
00079 {
00080 parent::initItem($a_ref_id, $a_obj_id, $a_title, $a_description);
00081 }
00082
00083
00091 function getCommandFrame($a_cmd)
00092 {
00093 switch($a_cmd)
00094 {
00095 case "":
00096 case "infoScreen":
00097 case "evaluation":
00098 include_once "./classes/class.ilFrameTargetInfo.php";
00099 $frame = ilFrameTargetInfo::_getFrame("MainContent");
00100 break;
00101
00102 default:
00103 }
00104
00105 return $frame;
00106 }
00107
00108
00109
00118 function getProperties()
00119 {
00120 global $lng, $ilUser, $rbacsystem;
00121
00122 $props = array();
00123
00124 if (!$rbacsystem->checkAccess("participate", $this->ref_id))
00125 {
00126 return $props;
00127 }
00128
00129 include_once("./survey/classes/class.ilObjSurveyAccess.php");
00130 if (!ilObjSurveyAccess::_lookupOnline($this->obj_id))
00131 {
00132 $props[] = array("alert" => true, "property" => $lng->txt("status"),
00133 "value" => $lng->txt("offline"));
00134 }
00135 else
00136 {
00137 if (!ilObjSurveyAccess::_lookupCreationComplete($this->obj_id))
00138 {
00139
00140 $props[] = array("alert" => true, "property" => $lng->txt("status"),
00141 "value" => $lng->txt("svy_warning_survey_not_complete"));
00142 }
00143 else
00144 {
00145 if ($ilUser->getId() != ANONYMOUS_USER_ID)
00146 {
00147 $finished = ilObjSurveyAccess::_lookupFinished($this->obj_id, $ilUser->id);
00148
00149
00150 if ($finished === 1)
00151 {
00152 $stat = $this->lng->txt("svy_finished");
00153 }
00154
00155 else if ($finished === 0)
00156 {
00157 $stat = $this->lng->txt("svy_not_finished");
00158 }
00159
00160 else
00161 {
00162 $stat = $this->lng->txt("svy_not_started");
00163 }
00164 $props[] = array("alert" => false, "property" => $lng->txt("status"),
00165 "value" => $stat);
00166 }
00167 }
00168 }
00169
00170 return $props;
00171 }
00172
00173
00181 function getCommandLink($a_cmd)
00182 {
00183 $cmd_link = "";
00184 switch ($a_cmd)
00185 {
00186 default:
00187 $cmd_link = "ilias.php?baseClass=ilObjSurveyGUI&ref_id=" . $this->ref_id .
00188 "&cmd=$a_cmd";
00189 break;
00190 }
00191
00192 return $cmd_link;
00193 }
00194
00195
00196
00197 }
00198 ?>