24 include_once
"./Services/Object/classes/class.ilObjectAccess.php";
25 include_once
'./Services/Conditions/interfaces/interface.ilConditionHandling.php';
67 $this->
user = $DIC->user();
68 $this->lng = $DIC->language();
69 $this->rbacsystem = $DIC->rbac()->system();
70 $this->access = $DIC->access();
79 include_once
'./Services/Conditions/classes/class.ilConditionHandler.php';
94 public static function checkCondition($a_svy_id, $a_operator, $a_value, $a_usr_id)
96 switch ($a_operator) {
98 include_once(
"./Modules/Survey/classes/class.ilObjSurveyAccess.php");
127 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
134 if ($a_user_id ==
"") {
138 $is_admin =
$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id);
140 switch ($a_permission) {
192 array(
"permission" =>
"read",
"cmd" =>
"infoScreen",
"lang_var" =>
"svy_run",
"default" =>
true),
193 array(
"permission" =>
"write",
"cmd" =>
"questionsrepo",
"lang_var" =>
"edit_questions"),
194 array(
"permission" =>
"write",
"cmd" =>
"properties",
"lang_var" =>
"settings"),
195 array(
"permission" =>
"read",
"cmd" =>
"evaluation",
"lang_var" =>
"svy_results")
212 $ilDB = $DIC->database();
215 "SELECT * FROM svy_svy WHERE obj_fi=%s",
223 if (!
$row[
"complete"]) {
236 $ilDB = $DIC->database();
239 "SELECT * FROM svy_svy WHERE obj_fi=%s",
247 return $row[
"evaluation_access"];
254 $ilDB = $DIC->database();
257 "SELECT finished_id FROM svy_finished WHERE user_fi = %s AND survey_fi = %s",
258 array(
'integer',
'integer'),
259 array($user_id, $survey_id)
261 return (
$result->numRows() == 1) ?
true :
false;
268 $ilDB = $DIC->database();
271 "SELECT anonymize FROM svy_svy WHERE obj_fi = %s",
277 return $row[
"anonymize"];
286 switch ($evaluation_access) {
293 if (($user_id > 0) && ($user_id != ANONYMOUS_USER_ID)) {
300 $svy_mode = self::_lookupMode($a_obj_id);
303 include_once
"Modules/Survey/classes/class.ilObjSurvey.php";
306 switch ($svy->get360Results()) {
311 return $svy->isAppraiseeClosed($user_id);
314 return $svy->isAppraisee($user_id);
319 include_once
"Modules/Survey/classes/class.ilObjSurvey.php";
322 switch ($svy->getSelfEvaluationResults()) {
342 $ilDB = $DIC->database();
344 "SELECT survey_id FROM svy_svy WHERE obj_fi = %s",
372 $ilDB = $DIC->database();
376 if (!strlen($a_user_id)) {
381 "SELECT * FROM svy_svy WHERE obj_fi = %s",
387 if (
$row->anonymize == 1) {
389 "SELECT * FROM svy_finished, svy_anonymous WHERE svy_finished.survey_fi = %s " .
390 "AND svy_finished.survey_fi = svy_anonymous.survey_fi AND svy_anonymous.user_key = %s " .
391 "AND svy_anonymous.survey_key = svy_finished.anonymous_id",
392 array(
'integer',
'text'),
393 array(
$row->survey_id, md5($a_user_id))
397 "SELECT * FROM svy_finished WHERE survey_fi = %s AND user_fi = %s",
398 array(
'integer',
'integer'),
399 array(
$row->survey_id, $a_user_id)
404 $finished = (int) $foundrow[
"state"];
419 $ilDB = $DIC->database();
422 "SELECT mode FROM svy_svy" .
423 " WHERE obj_fi = %s",
439 $ilDB = $DIC->database();
442 "SELECT mode FROM svy_svy" .
443 " WHERE obj_fi = %s AND mode = %s",
444 array(
'integer',
'integer'),
457 $ilAccess = $DIC->access();
459 $t_arr = explode(
"_", $a_target);
461 if ($t_arr[0] !=
"svy" || ((
int) $t_arr[1]) <= 0) {
466 if (
$_GET[
"accesscode"]) {
467 include_once
"Modules/Survey/classes/class.ilObjSurvey.php";
473 if ($ilAccess->checkAccess(
"visible",
"", $t_arr[1]) ||
474 $ilAccess->checkAccess(
"read",
"", $t_arr[1])) {
static _getCommands()
get commands
static _isSurveyParticipant($user_id, $survey_id)
static _lookupEvaluationAccess($a_obj_id)
get evaluation access
static validateExternalRaterCode($a_ref_id, $a_code)
const IL_NO_OBJECT_ACCESS
static _lookupAnonymize($a_obj_id)
Interface for condition handling.
static getConditionOperators()
Get possible conditions operators.
__construct()
Constructor.
_checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAcce...
static checkCondition($a_svy_id, $a_operator, $a_value, $a_usr_id)
check condition
static _lookupMode($a_obj_id)
Get survey mode.
static _lookupFinished($a_obj_id, $a_user_id="")
get finished status
static _hasEvaluationAccess($a_obj_id, $user_id)
static _lookup360Mode($a_obj_id)
const RESULTS_SELF_EVAL_NONE
static _checkGoto($a_target)
check whether goto script will succeed
static _lookupCreationComplete($a_obj_id)
checks wether all necessary parts of the survey are given