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)) {
    79         switch ($permission) {
    82                 if (!self::_lookupCreationComplete($obj_id) &&
    92                 if (!self::_lookupCreationComplete($obj_id) &&
   100                 if (!self::_lookupCreationComplete($obj_id)) {
   104                 if ($rbacsystem->
checkAccess(
"write", $ref_id) || self::_hasEvaluationAccess($obj_id, 
$user_id)) {
   119             array(
"permission" => 
"read", 
"cmd" => 
"run", 
"lang_var" => 
"svy_run", 
"default" => 
true),
   120             array(
"permission" => 
"write", 
"cmd" => 
"questions", 
"lang_var" => 
"edit_questions"),
   121             array(
"permission" => 
"write", 
"cmd" => 
"properties", 
"lang_var" => 
"settings"),
   122             array(
"permission" => 
"read", 
"cmd" => 
"evaluation", 
"lang_var" => 
"svy_results")
   139         $ilDB = $DIC->database();
   141         $result = 
$ilDB->queryF(
   142             "SELECT * FROM svy_svy WHERE obj_fi=%s",
   148         if ($result->numRows() === 1) {
   149             $row = 
$ilDB->fetchAssoc($result);
   151         if (is_null($row) || !$row[
"complete"]) {
   164         $ilDB = $DIC->database();
   166         $result = 
$ilDB->queryF(
   167             "SELECT * FROM svy_svy WHERE obj_fi=%s",
   171         if ($result->numRows() === 1) {
   172             $row = 
$ilDB->fetchAssoc($result);
   173             return (
int) $row[
"evaluation_access"];
   184         $ilDB = $DIC->database();
   186         $result = 
$ilDB->queryF(
   187             "SELECT finished_id FROM svy_finished WHERE user_fi = %s AND survey_fi = %s",
   188             array(
'integer',
'integer'),
   189             array($user_id, $survey_id)
   191         return $result->numRows() === 1;
   199         $ilDB = $DIC->database();
   201         $result = 
$ilDB->queryF(
   202             "SELECT anonymize FROM svy_svy WHERE obj_fi = %s",
   206         if ($result->numRows() === 1) {
   207             $row = 
$ilDB->fetchAssoc($result);
   208             return (
bool) $row[
"anonymize"];
   218         $evaluation_access = self::_lookupEvaluationAccess($a_obj_id);
   219         $svy_mode = self::_lookupMode($a_obj_id);
   223             switch ($svy->get360Results()) {
   235         switch ($evaluation_access) {
   247                         switch ($svy->get360Results()) {
   252                                 return $svy->isAppraiseeClosed($user_id);
   255                                 return $svy->isAppraisee($user_id);
   262                         switch ($svy->get360Results()) {
   270                                 return $svy->isAppraisee($user_id);
   277                         switch ($svy->getSelfEvaluationResults()) {
   282                                 $run_manager = $DIC->survey()->internal()->domain()
   283                                                    ->execution()->run($svy, $user_id);
   284                                 return $run_manager->hasFinished();
   294                         if (self::_lookupAnonymize($a_obj_id)) {
   300                         $ilDB = $DIC->database();
   301                         $result = 
$ilDB->queryF(
   302                             "SELECT survey_id FROM svy_svy WHERE obj_fi = %s",
   306                         if ($result->numRows() === 1) {
   307                             $row = 
$ilDB->fetchAssoc($result);
   309                             if (self::_isSurveyParticipant($user_id, $row[
"survey_id"])) {
   311                                 $run_manager = $DIC->survey()->internal()->domain()
   312                                     ->execution()->run($survey, $user_id);
   313                                 return $run_manager->hasFinished();
   334         $ilDB = $DIC->database();
   335         $ilUser = $DIC->user();
   338         if ($a_user_id === 0) {
   339             $a_user_id = $ilUser->getId();
   342         $result = 
$ilDB->queryF(
   343             "SELECT * FROM svy_svy WHERE obj_fi = %s",
   347         if ($result->numRows() === 1) {
   348             $row = 
$ilDB->fetchObject($result);
   349             if ((
int) $row->anonymize === 1) {
   350                 $result = 
$ilDB->queryF(
   351                     "SELECT * FROM svy_finished, svy_anonymous WHERE svy_finished.survey_fi = %s " .
   352                     "AND svy_finished.survey_fi = svy_anonymous.survey_fi AND svy_anonymous.user_key = %s " .
   353                     "AND svy_anonymous.survey_key = svy_finished.anonymous_id",
   354                     array(
'integer',
'text'),
   355                     array($row->survey_id, md5($a_user_id))
   358                 $result = 
$ilDB->queryF(
   359                     "SELECT * FROM svy_finished WHERE survey_fi = %s AND user_fi = %s",
   360                     array(
'integer',
'integer'),
   361                     array($row->survey_id, $a_user_id)
   364             if ($result->numRows() === 1) {
   365                 $foundrow = 
$ilDB->fetchAssoc($result);
   366                 $finished = (
int) $foundrow[
"state"];
   380         $ilDB = $DIC->database();
   382         $result = 
$ilDB->queryF(
   383             "SELECT mode FROM svy_svy" .
   384             " WHERE obj_fi = %s",
   389         if ($result->numRows() === 1) {
   390             $row = 
$ilDB->fetchAssoc($result);
   391             return (
int) $row[
"mode"];
   402         $ilDB = $DIC->database();
   404         $result = 
$ilDB->queryF(
   405             "SELECT mode FROM svy_svy" .
   406             " WHERE obj_fi = %s AND mode = %s",
   407             array(
'integer',
'integer'),
   410         return (
bool) 
$ilDB->numRows($result);
   420         $request = $DIC->survey()
   426         $ilAccess = $DIC->access();
   428         $t_arr = explode(
"_", $target);
   429         if ($t_arr[0] !== 
"svy" || ((
int) $t_arr[1]) <= 0) {
   434         $access_code = ($request->getAccessCode() !== 
"")
   435             ? $request->getAccessCode()
   437         if ($access_code !== 
"") {
   439             $run_manager = $DIC->survey()->internal()->domain()->execution()->run($survey, $DIC->user()->getId());
   441                 $run_manager->initSession($access_code);
   445             if (ilObjSurvey::validateExternalRaterCode((
int) $t_arr[1], $access_code)) {
   450         if ($ilAccess->checkAccess(
"visible", 
"", $t_arr[1]) ||
   451             $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)