From 75160b12821f7f4299cce7f0b69c83c1502ae071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:08:29 +0200 Subject: 2024-02-19 upstream --- .../survey/classes/class.SurveyStatusProfiles.php | 412 +++++++++++---------- 1 file changed, 220 insertions(+), 192 deletions(-) (limited to 'admin/survey/classes/class.SurveyStatusProfiles.php') diff --git a/admin/survey/classes/class.SurveyStatusProfiles.php b/admin/survey/classes/class.SurveyStatusProfiles.php index 11946a3..1563ddd 100644 --- a/admin/survey/classes/class.SurveyStatusProfiles.php +++ b/admin/survey/classes/class.SurveyStatusProfiles.php @@ -7,7 +7,8 @@ */ session_start(); -DEFINE (STR_DLMT, "|"); +if (!defined(STR_DLMT)) define(STR_DLMT, "|"); + class SurveyStatusProfiles { @@ -133,16 +134,18 @@ class SurveyStatusProfiles } # če smo v vpogledu pohandlammo posebej - if (($_podstran == A_COLLECT_DATA && $_GET['m'] == 'quick_edit') || $_POST['podstran'] == 'quick_edit') { + if (($_podstran == A_COLLECT_DATA && isset($_GET['m']) && $_GET['m'] == 'quick_edit') || (isset($_POST['podstran']) && $_POST['podstran'] == 'quick_edit')) { $_podstran = 'vpogled'; } + + self::$currentProfileId = SurveyUserSetting :: getInstance()->getSettings('default_status_profile_'.$_podstran); if (!self::$currentProfileId) { - #self::$currentProfileId = 2; self::$currentProfileId = self::$survayDefaultUstrezni; # je lahko 2 ali 3 } + # ustrezni je lahko samo če so kakšni ustrezni zapisi v bazi ob pogoju da pa neustrezni obstajajao if (self::$allValidCount == 0 && self::$allUserCount > 0) { if (self::$currentProfileId == 2 || self::$currentProfileId == 3 ) { @@ -153,16 +156,18 @@ class SurveyStatusProfiles # ce imamo nastavljen curent pid in profil z tem pid ne obstaja nastavomo na privzet profil if (self::$currentProfileId != 1) { + if (!isset(self::$profiles[self::$currentProfileId])) { self::$currentProfileId = 1; - } + } } # ce ne obstajajo podatki za cpid damo error if (!isset(self::$profiles[self::$currentProfileId])) { die("Profile data is missing!"); return false; - } else { + } + else { return true; } } @@ -186,7 +191,7 @@ class SurveyStatusProfiles static function DisplayProfile( $pid = null) { global $lang; - + if ($pid == null ) { $pid = self::$currentProfileId; } @@ -197,29 +202,46 @@ class SurveyStatusProfiles #vsebino shranimo v buffer ob_start(); - if ( self::$currentProfileId != SSP_DEFAULT_PROFILE ) { - echo '
'; + + echo ''; + + + if ( self::$currentProfileId != SSP_DEFAULT_PROFILE ) { + echo '
'; + echo '
'; } - echo ''; - echo '
'; + echo '