36         $this->
user = $DIC->user();
    37         $this->
lng = $DIC->language();
    38         $this->rbacsystem = $DIC->rbac()->system();
    39         $this->
access = $DIC->access();
    50     public static function checkCondition(
int $a_trigger_obj_id, 
string $a_operator, 
string $a_value, 
int $a_usr_id): bool
    52         switch ($a_operator) {
    54                 if (self::_lookupFinished($a_trigger_obj_id, $a_usr_id)) {
    66     public function _checkAccess(
string $cmd, 
string $permission, 
int $ref_id, 
int $obj_id, ?
int $user_id = null): bool
    73         if (is_null($user_id)) {
    74             $user_id = $ilUser->getId();
    79         switch ($permission) {
    82                 if (!self::_lookupCreationComplete($obj_id) &&
    92                 if (!self::_lookupCreationComplete($obj_id)) {
    99                 if (!self::_lookupCreationComplete($obj_id)) {
   103                 if ($rbacsystem->
checkAccess(
"write", $ref_id) || self::_hasEvaluationAccess($obj_id, $user_id)) {
   118             array(
"permission" => 
"read", 
"cmd" => 
"infoScreen", 
"lang_var" => 
"svy_run", 
"default" => 
true),
   119             array(
"permission" => 
"write", 
"cmd" => 
"questions", 
"lang_var" => 
"edit_questions"),
   120             array(
"permission" => 
"write", 
"cmd" => 
"properties", 
"lang_var" => 
"settings"),
   121             array(
"permission" => 
"read", 
"cmd" => 
"evaluation", 
"lang_var" => 
"svy_results")
   138         $ilDB = $DIC->database();
   140         $result = 
$ilDB->queryF(
   141             "SELECT * FROM svy_svy WHERE obj_fi=%s",
   147         if ($result->numRows() === 1) {
   148             $row = 
$ilDB->fetchAssoc($result);
   150         if (is_null($row) || !$row[
"complete"]) {
   163         $ilDB = $DIC->database();
   165         $result = 
$ilDB->queryF(
   166             "SELECT * FROM svy_svy WHERE obj_fi=%s",
   170         if ($result->numRows() === 1) {
   171             $row = 
$ilDB->fetchAssoc($result);
   172             return (
int) $row[
"evaluation_access"];
   183         $ilDB = $DIC->database();
   185         $result = 
$ilDB->queryF(
   186             "SELECT finished_id FROM svy_finished WHERE user_fi = %s AND survey_fi = %s",
   187             array(
'integer',
'integer'),
   188             array($user_id, $survey_id)
   190         return $result->numRows() === 1;
   198         $ilDB = $DIC->database();
   200         $result = 
$ilDB->queryF(
   201             "SELECT anonymize FROM svy_svy WHERE obj_fi = %s",
   205         if ($result->numRows() === 1) {
   206             $row = 
$ilDB->fetchAssoc($result);
   207             return (
bool) $row[
"anonymize"];
   217         $evaluation_access = self::_lookupEvaluationAccess($a_obj_id);
   218         $svy_mode = self::_lookupMode($a_obj_id);
   222             switch ($svy->get360Results()) {
   234         switch ($evaluation_access) {
   246                         switch ($svy->get360Results()) {
   251                                 return $svy->isAppraiseeClosed($user_id);
   254                                 return $svy->isAppraisee($user_id);
   261                         switch ($svy->get360Results()) {
   269                                 return $svy->isAppraisee($user_id);
   276                         switch ($svy->getSelfEvaluationResults()) {
   281                                 $run_manager = $DIC->survey()->internal()->domain()
   282                                                    ->execution()->run($svy, $user_id);
   283                                 return $run_manager->hasFinished();
   293                         if (self::_lookupAnonymize($a_obj_id)) {
   299                         $ilDB = $DIC->database();
   300                         $result = 
$ilDB->queryF(
   301                             "SELECT survey_id FROM svy_svy WHERE obj_fi = %s",
   305                         if ($result->numRows() === 1) {
   306                             $row = 
$ilDB->fetchAssoc($result);
   308                             if (self::_isSurveyParticipant($user_id, $row[
"survey_id"])) {
   310                                 $run_manager = $DIC->survey()->internal()->domain()
   311                                     ->execution()->run($survey, $user_id);
   312                                 return $run_manager->hasFinished();
   333         $ilDB = $DIC->database();
   334         $ilUser = $DIC->user();
   337         if ($a_user_id === 0) {
   338             $a_user_id = $ilUser->getId();
   341         $result = 
$ilDB->queryF(
   342             "SELECT * FROM svy_svy WHERE obj_fi = %s",
   346         if ($result->numRows() === 1) {
   347             $row = 
$ilDB->fetchObject($result);
   348             if ((
int) $row->anonymize === 1) {
   349                 $result = 
$ilDB->queryF(
   350                     "SELECT * FROM svy_finished, svy_anonymous WHERE svy_finished.survey_fi = %s " .
   351                     "AND svy_finished.survey_fi = svy_anonymous.survey_fi AND svy_anonymous.user_key = %s " .
   352                     "AND svy_anonymous.survey_key = svy_finished.anonymous_id",
   353                     array(
'integer',
'text'),
   354                     array($row->survey_id, md5($a_user_id))
   357                 $result = 
$ilDB->queryF(
   358                     "SELECT * FROM svy_finished WHERE survey_fi = %s AND user_fi = %s",
   359                     array(
'integer',
'integer'),
   360                     array($row->survey_id, $a_user_id)
   363             if ($result->numRows() === 1) {
   364                 $foundrow = 
$ilDB->fetchAssoc($result);
   365                 $finished = (
int) $foundrow[
"state"];
   379         $ilDB = $DIC->database();
   381         $result = 
$ilDB->queryF(
   382             "SELECT mode FROM svy_svy" .
   383             " WHERE obj_fi = %s",
   388         if ($result->numRows() === 1) {
   389             $row = 
$ilDB->fetchAssoc($result);
   390             return (
int) $row[
"mode"];
   401         $ilDB = $DIC->database();
   403         $result = 
$ilDB->queryF(
   404             "SELECT mode FROM svy_svy" .
   405             " WHERE obj_fi = %s AND mode = %s",
   406             array(
'integer',
'integer'),
   409         return (
bool) 
$ilDB->numRows($result);
   419         $request = $DIC->survey()
   425         $ilAccess = $DIC->access();
   427         $t_arr = explode(
"_", $target);
   428         if ($t_arr[0] !== 
"svy" || ((
int) $t_arr[1]) <= 0) {
   433         $access_code = ($request->getAccessCode() !== 
"")
   434             ? $request->getAccessCode()
   436         if ($access_code !== 
"") {
   438             $run_manager = $DIC->survey()->internal()->domain()->execution()->run($survey, $DIC->user()->getId());
   440                 $run_manager->initSession($access_code);
   444             if (ilObjSurvey::validateExternalRaterCode((
int) $t_arr[1], $access_code)) {
   449         if ($ilAccess->checkAccess(
"visible", 
"", $t_arr[1]) ||
   450             $ilAccess->checkAccess(
"read", 
"", $t_arr[1])) {
 
static _lookupEvaluationAccess(int $a_obj_id)
get evaluation access 
 
const IL_NO_OBJECT_ACCESS
 
static _isSurveyParticipant(int $user_id, int $survey_id)
 
static checkCondition(int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
check condition for a specific user and object 
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
static _checkGoto(string $target)
check whether goto script will succeed 
 
static _lookupAnonymize(int $a_obj_id)
 
static _lookupFinished(int $a_obj_id, int $a_user_id=0)
get finished status 
 
Interface for condition handling. 
 
static getConditionOperators()
Returns an array with valid operators for the specific object type. 
 
checkAccessOfUser(int $a_user_id, string $a_operations, int $a_ref_id, string $a_type="")
 
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
 
static _lookupMode(int $a_obj_id)
Get survey mode (see ilObjSurvey::MODE_... 
 
_checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 
static _hasEvaluationAccess(int $a_obj_id, int $user_id)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
const RESULTS_SELF_EVAL_NONE
 
static _lookupCreationComplete(int $a_obj_id)
checks whether all necessary parts of the survey are given 
 
static _lookup360Mode(int $a_obj_id)