24 include_once
"./Services/Object/classes/class.ilObjectAccess.php";
25 include_once
'./Services/AccessControl/interfaces/interface.ilConditionHandling.php';
45 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
60 public static function checkCondition($a_svy_id,$a_operator,$a_value,$a_usr_id)
66 include_once(
"./Modules/Survey/classes/class.ilObjSurveyAccess.php");
98 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
102 if ($a_user_id ==
"")
104 $a_user_id = $ilUser->getId();
107 $is_admin = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
110 if(!self::_lookupOnline($a_obj_id) && !$is_admin)
116 switch ($a_permission)
178 array(
"permission" =>
"read",
"cmd" =>
"infoScreen",
"lang_var" =>
"svy_run",
"default" =>
true),
179 array(
"permission" =>
"write",
"cmd" =>
"questionsrepo",
"lang_var" =>
"edit_questions"),
180 array(
"permission" =>
"write",
"cmd" =>
"properties",
"lang_var" =>
"settings"),
181 array(
"permission" =>
"read",
"cmd" =>
"evaluation",
"lang_var" =>
"svy_results")
198 $result = $ilDB->queryF(
"SELECT * FROM svy_svy WHERE obj_fi=%s",
207 if (!
$row[
"complete"])
221 $result = $ilDB->queryF(
"SELECT * FROM svy_svy WHERE obj_fi=%s",
230 return $row[
"evaluation_access"];
237 $result = $ilDB->queryF(
"SELECT finished_id FROM svy_finished WHERE user_fi = %s AND survey_fi = %s",
238 array(
'integer',
'integer'),
239 array($user_id, $survey_id)
241 return (
$result->numRows() == 1) ?
true :
false;
248 $result = $ilDB->queryF(
"SELECT anonymize FROM svy_svy WHERE obj_fi = %s",
255 return $row[
"anonymize"];
266 switch ($evaluation_access)
274 if (($user_id > 0) && ($user_id != ANONYMOUS_USER_ID))
284 if(!self::_lookup360Mode($a_obj_id))
294 $result = $ilDB->queryF(
"SELECT survey_id FROM svy_svy WHERE obj_fi = %s",
312 include_once
"Modules/Survey/classes/class.ilObjSurvey.php";
315 switch($svy->get360Results())
321 return $svy->isAppraiseeClosed($user_id);
324 return $svy->isAppraisee($user_id);
338 $result = $ilDB->queryF(
"SELECT * FROM svy_svy WHERE obj_fi=%s",
346 return $row[
"status"];
359 if (!strlen($a_user_id)) $a_user_id = $ilUser->getId();
361 $result = $ilDB->queryF(
"SELECT * FROM svy_svy WHERE obj_fi = %s",
368 if (
$row->anonymize == 1)
370 $result = $ilDB->queryF(
"SELECT * FROM svy_finished, svy_anonymous WHERE svy_finished.survey_fi = %s ".
371 "AND svy_finished.survey_fi = svy_anonymous.survey_fi AND svy_anonymous.user_key = %s ".
372 "AND svy_anonymous.survey_key = svy_finished.anonymous_id",
373 array(
'integer',
'text'),
374 array(
$row->survey_id, md5($a_user_id))
379 $result = $ilDB->queryF(
"SELECT * FROM svy_finished WHERE survey_fi = %s AND user_fi = %s",
380 array(
'integer',
'integer'),
381 array(
$row->survey_id, $a_user_id)
386 $foundrow = $ilDB->fetchAssoc(
$result);
387 $finished = (int)$foundrow[
"state"];
398 $result = $ilDB->queryF(
"SELECT mode_360 FROM svy_svy".
399 " WHERE obj_fi = %s AND mode_360 = %s",
400 array(
'integer',
'integer'),
403 return (
bool)$ilDB->numRows(
$result);
413 $t_arr = explode(
"_", $a_target);
415 if ($t_arr[0] !=
"svy" || ((
int) $t_arr[1]) <= 0)
421 if (
$_GET[
"accesscode"])
423 include_once
"Modules/Survey/classes/class.ilObjSurvey.php";
430 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]))