24 include_once
"./Services/Object/classes/class.ilObjectAccess.php";
53 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
59 $a_user_id = $ilUser->getId();
62 $is_admin = $rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id);
65 if(!self::_lookupOnline($a_obj_id) && !$is_admin)
71 switch ($a_permission)
133 array(
"permission" =>
"read",
"cmd" =>
"infoScreen",
"lang_var" =>
"svy_run",
"default" =>
true),
134 array(
"permission" =>
"write",
"cmd" =>
"questionsrepo",
"lang_var" =>
"edit_questions"),
135 array(
"permission" =>
"write",
"cmd" =>
"properties",
"lang_var" =>
"settings"),
136 array(
"permission" =>
"read",
"cmd" =>
"evaluation",
"lang_var" =>
"svy_results")
153 $result = $ilDB->queryF(
"SELECT * FROM svy_svy WHERE obj_fi=%s",
162 if (!
$row[
"complete"])
176 $result = $ilDB->queryF(
"SELECT * FROM svy_svy WHERE obj_fi=%s",
185 return $row[
"evaluation_access"];
192 $result = $ilDB->queryF(
"SELECT finished_id FROM svy_finished WHERE user_fi = %s AND survey_fi = %s",
193 array(
'integer',
'integer'),
194 array($user_id, $survey_id)
196 return (
$result->numRows() == 1) ?
true :
false;
203 $result = $ilDB->queryF(
"SELECT anonymize FROM svy_svy WHERE obj_fi = %s",
210 return $row[
"anonymize"];
221 switch ($evaluation_access)
229 if (($user_id > 0) && ($user_id != ANONYMOUS_USER_ID))
239 if(!self::_lookup360Mode($a_obj_id))
249 $result = $ilDB->queryF(
"SELECT survey_id FROM svy_svy WHERE obj_fi = %s",
267 include_once
"Modules/Survey/classes/class.ilObjSurvey.php";
270 switch($svy->get360Results())
276 return $svy->isAppraiseeClosed($user_id);
279 return $svy->isAppraisee($user_id);
293 $result = $ilDB->queryF(
"SELECT * FROM svy_svy WHERE obj_fi=%s",
301 return $row[
"status"];
314 if (!strlen($a_user_id)) $a_user_id = $ilUser->getId();
316 $result = $ilDB->queryF(
"SELECT * FROM svy_svy WHERE obj_fi = %s",
323 if (
$row->anonymize == 1)
325 $result = $ilDB->queryF(
"SELECT * FROM svy_finished, svy_anonymous WHERE svy_finished.survey_fi = %s ".
326 "AND svy_finished.survey_fi = svy_anonymous.survey_fi AND svy_anonymous.user_key = %s ".
327 "AND svy_anonymous.survey_key = svy_finished.anonymous_id",
328 array(
'integer',
'text'),
329 array(
$row->survey_id, md5($a_user_id))
334 $result = $ilDB->queryF(
"SELECT * FROM svy_finished WHERE survey_fi = %s AND user_fi = %s",
335 array(
'integer',
'integer'),
336 array(
$row->survey_id, $a_user_id)
341 $foundrow = $ilDB->fetchAssoc(
$result);
342 $finished = (int)$foundrow[
"state"];
353 $result = $ilDB->queryF(
"SELECT mode_360 FROM svy_svy".
354 " WHERE obj_fi = %s AND mode_360 = %s",
355 array(
'integer',
'integer'),
358 return (
bool)$ilDB->numRows(
$result);
368 $t_arr = explode(
"_", $a_target);
370 if ($t_arr[0] !=
"svy" || ((
int) $t_arr[1]) <= 0)
376 if (
$_GET[
"accesscode"])
378 include_once
"Modules/Survey/classes/class.ilObjSurvey.php";
385 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]))