diff --git a/admin/survey/classes/surveyData/class.SurveyDataDisplay.php b/admin/survey/classes/surveyData/class.SurveyDataDisplay.php
index 14637c15b..4adb5b641 100644
--- a/admin/survey/classes/surveyData/class.SurveyDataDisplay.php
+++ b/admin/survey/classes/surveyData/class.SurveyDataDisplay.php
@@ -508,299 +508,303 @@ class SurveyDataDisplay{
static public function setUpFilter() {
# nastavimo filter po statusih
-
if (self::$headFileName != null && self::$headFileName != '' && file_exists(self::$headFileName)) {
- # kadar zbiramo sistemske, moramo obvezno zbirati tudi podatke, ne smemo pa full meta
- if (self::$_VARS[VAR_SHOW_SYSTEM]){
- self::$_VARS[VAR_DATA] = true;
- self::$_VARS[VAR_META] = true;
- self::$_VARS[VAR_METAFULL] = false;
- self::$_VARS[VAR_SHOW_DATE] = false;
- }
- # filtriranje po statusih
- self::$_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString();
-
- if (self::$dataFileStatus >= 0) {
- self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
-
- # ali imamo filter na testne podatke
- if (isset(self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence']) && (int)self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'] > 0) {
- $test_data_sequence = self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'];
- $filter_testdata = SurveyStatusProfiles :: getStatusTestAsAWKString($test_data_sequence);
- }
- # filtriranje po časih
- $_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK(self::$_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
-
- # ali imamo filter na uporabnost
- if (isset(self::$_HEADERS['usability']['variables'][0]['sequence']) && (int)self::$_HEADERS['usability']['variables'][0]['sequence'] > 0) {
- $usability_data_sequence = self::$_HEADERS['usability']['variables'][0]['sequence'];
- $filter_usability = SurveyStatusProfiles :: getStatusUsableAsAWKString($usability_data_sequence);
- }
-
- # če nismo v indikatorjih (sistemske)
- if (self::$_VARS[VAR_SHOW_SYSTEM] == false) {
- # dodamo še ife
- SurveyConditionProfiles :: setHeader(self::$_HEADERS);
- $_condition_profile_AWK = SurveyConditionProfiles:: getAwkConditionString();
-
- # dodamo še ife za inspect
- $SI = new SurveyInspect(self::$sid);
- $_inspect_condition_awk = $SI->generateAwkCondition();
- }
-
- # dodamo pogoj za filter prepoznave uporabnika iz cms
- # vklopljeno more bit prepoznava userja iz cms
- if (self::$doCMSUserFilter == true) {
- $CMSUserCondition = self::createCMSUserFilter();
- }
+ # kadar zbiramo sistemske, moramo obvezno zbirati tudi podatke, ne smemo pa full meta
+ if (self::$_VARS[VAR_SHOW_SYSTEM]){
+ self::$_VARS[VAR_DATA] = true;
+ self::$_VARS[VAR_META] = true;
+ self::$_VARS[VAR_METAFULL] = false;
+ self::$_VARS[VAR_SHOW_DATE] = false;
+ }
- if (($_condition_profile_AWK != "" && $_condition_profile_AWK != null )
- || ($_inspect_condition_awk != "" && $_inspect_condition_awk != null)
- || ($_time_profile_awk != "" && $_time_profile_awk != null)
- || ($CMSUserCondition != "" && $CMSUserCondition != null)
- || ($filter_testdata != null)
- || ($filter_usability != null)) {
- self::$_CURRENT_STATUS_FILTER = '('.self::$_CURRENT_STATUS_FILTER;
- if ($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) {
- self::$_CURRENT_STATUS_FILTER .= '&&'.$_condition_profile_AWK;
- }
- if ($_inspect_condition_awk != "" && $_inspect_condition_awk != null ) {
- self::$_CURRENT_STATUS_FILTER .= ' && '.$_inspect_condition_awk;
- }
- if ($_time_profile_awk != "" && $_time_profile_awk != null) {
- self::$_CURRENT_STATUS_FILTER .= '&&'.$_time_profile_awk;
- }
- if ($CMSUserCondition != "" && $CMSUserCondition != null) {
- self::$_CURRENT_STATUS_FILTER .= '&&'.$CMSUserCondition;
- }
- if ($filter_testdata != null ) {
- self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_testdata.')';
- }
- if ($filter_usability != null ) {
- self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_usability.')';
- }
- self::$_CURRENT_STATUS_FILTER .= ')';
- }
-
- # preštejemo vse zapise ki ustrezajo filtru po statusu
- if (IS_WINDOWS) {
- $awk_string = 'awk -F"'.STR_DLMT.'" "'.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}" '.self::$dataFileName;
- $recCount = shell_exec($awk_string);
- if ($_GET['debug'] == 1) {
- print_r('
'.$awk_string);
- }
-
- } else {
- $awk_string = 'awk -F"'.STR_DLMT.'" \''.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
- $recCount = shell_exec($awk_string);
- if ($_GET['debug'] == 1) {
- print_r('
'.$awk_string);
- }
- }
- if ((int)$recCount > 0 ) {
- self::$_RECORD_COUNT = (int)$recCount;
- }
+ # filtriranje po statusih
+ self::$_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString();
+
+ if (self::$dataFileStatus >= 0) {
+ self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
+
+ # ali imamo filter na testne podatke
+ if (isset(self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence']) && (int)self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'] > 0) {
+ $test_data_sequence = self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'];
+ $filter_testdata = SurveyStatusProfiles :: getStatusTestAsAWKString($test_data_sequence);
+ }
+ # filtriranje po časih
+ $_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK(self::$_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
+
+ # ali imamo filter na uporabnost
+ if (isset(self::$_HEADERS['usability']['variables'][0]['sequence']) && (int)self::$_HEADERS['usability']['variables'][0]['sequence'] > 0) {
+ $usability_data_sequence = self::$_HEADERS['usability']['variables'][0]['sequence'];
+ $filter_usability = SurveyStatusProfiles :: getStatusUsableAsAWKString($usability_data_sequence);
+ }
+
+ # če nismo v indikatorjih (sistemske)
+ if (self::$_VARS[VAR_SHOW_SYSTEM] == false) {
+ # dodamo še ife
+ SurveyConditionProfiles :: setHeader(self::$_HEADERS);
+ $_condition_profile_AWK = SurveyConditionProfiles:: getAwkConditionString();
+
+ # dodamo še ife za inspect
+ $SI = new SurveyInspect(self::$sid);
+ $_inspect_condition_awk = $SI->generateAwkCondition();
+ }
+
+ # dodamo pogoj za filter prepoznave uporabnika iz cms
+ # vklopljeno more bit prepoznava userja iz cms
+ if (self::$doCMSUserFilter == true) {
+ $CMSUserCondition = self::createCMSUserFilter();
+ }
-
- if (self::$_VARS[VAR_REC_ON_PAGE] != 'all') {
- self::$_TOTAL_PAGES = bcdiv(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]);
-
- if (bcmod(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]) > 0)
- self::$_TOTAL_PAGES += 1;
- if (self::$_VARS[VAR_CUR_REC_PAGE] > self::$_TOTAL_PAGES ) {
- self::$_VARS[VAR_CUR_REC_PAGE] = self::$_TOTAL_PAGES;
- } elseif (self::$_VARS[VAR_CUR_REC_PAGE] < 1 ) {
- self::$_VARS[VAR_CUR_REC_PAGE] = 1;
- }
-
- # nastavimo limit za datoteko
-
- $up = self::$_VARS[VAR_REC_ON_PAGE] * self::$_VARS[VAR_CUR_REC_PAGE];
- $low = $up - self::$_VARS[VAR_REC_ON_PAGE]+1;
-
- self::$_REC_LIMIT = ' NR=='.$low.',NR=='.$up.'';
- } else {
- # nastavimo limit za datoteko
- self::$_REC_LIMIT = '';
- }
- }
- if (self::$_VARS[VAR_DATA]) {
- $tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables(self::$_PROFILE_ID_VARIABLE );
-
- # če je $svp_pv = null potem prikazujemo vse variable
- # oziroma če je sistemski dodamo tudi vse, ker drugače lahko filter skrije telefon in email
- if (count($tmp_svp_pv) == 0 || self::$_VARS[VAR_SHOW_SYSTEM] == true ) {
-
- $_sv = self::$SDF->getSurveyVariables();
- if (count($_sv) > 0) {
- foreach ( $_sv as $vid => $variable) {
- $tmp_svp_pv[$vid] = $vid;
- }
- }
- }
- }
- self::$lineoffset=1;
- # če prikazujemo sistemske ne prikazujemo recnumber
- if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL]) {
- $svp_pv['recnum'] = 'recnum';
- #$svp_pv['code'] = 'code';
- self::$lineoffset++;
- # za code ni ofseta
- #self::$lineoffset++;
- }
-
- if (self::$_VARS[VAR_DATA] && count($tmp_svp_pv) > 0) {
- foreach ($tmp_svp_pv AS $_svp_pv) {
+ if (($_condition_profile_AWK != "" && $_condition_profile_AWK != null )
+ || ($_inspect_condition_awk != "" && $_inspect_condition_awk != null)
+ || ($_time_profile_awk != "" && $_time_profile_awk != null)
+ || ($CMSUserCondition != "" && $CMSUserCondition != null)
+ || ($filter_testdata != null)
+ || ($filter_usability != null)) {
+ self::$_CURRENT_STATUS_FILTER = '('.self::$_CURRENT_STATUS_FILTER;
+ if ($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) {
+ self::$_CURRENT_STATUS_FILTER .= '&&'.$_condition_profile_AWK;
+ }
+ if ($_inspect_condition_awk != "" && $_inspect_condition_awk != null ) {
+ self::$_CURRENT_STATUS_FILTER .= ' && '.$_inspect_condition_awk;
+ }
+ if ($_time_profile_awk != "" && $_time_profile_awk != null) {
+ self::$_CURRENT_STATUS_FILTER .= '&&'.$_time_profile_awk;
+ }
+ if ($CMSUserCondition != "" && $CMSUserCondition != null) {
+ self::$_CURRENT_STATUS_FILTER .= '&&'.$CMSUserCondition;
+ }
+ if ($filter_testdata != null ) {
+ self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_testdata.')';
+ }
+ if ($filter_usability != null ) {
+ self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_usability.')';
+ }
+ self::$_CURRENT_STATUS_FILTER .= ')';
+ }
+
+ # preštejemo vse zapise ki ustrezajo filtru po statusu
+ if (IS_WINDOWS) {
+ $awk_string = 'awk -F"'.STR_DLMT.'" "'.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}" '.self::$dataFileName;
+ $recCount = shell_exec($awk_string);
+ if ($_GET['debug'] == 1) {
+ print_r('
'.$awk_string);
+ }
+
+ } else {
+ $awk_string = 'awk -F"'.STR_DLMT.'" \''.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
+ $recCount = shell_exec($awk_string);
+ if ($_GET['debug'] == 1) {
+ print_r('
'.$awk_string);
+ }
+ }
+ if ((int)$recCount > 0 ) {
+ self::$_RECORD_COUNT = (int)$recCount;
+ }
- # če imamo sistemski email ali telefon, ime, priimek (v header je nastavljno "hide_system" = 1)
- # potem v odvisnosti od nastavitve prikazujemo samo navadne podatke ali pa samo te sistemske, zaradizaščite podatkov
- $_sistemski = false;
- if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_HEADERS[$_svp_pv]['hide_system'] == '1') {
- # prikazujemo samo nesistemske (nezaščitene)
- unset(self::$_HEADERS[$_svp_pv]);
- } else if (self::$_VARS[VAR_SHOW_SYSTEM] && self::$_HEADERS[$_svp_pv]['hide_system'] !== '1') {
- # prikazujemo samo sistemske (zaščitene) podatke
- unset(self::$_HEADERS[$_svp_pv]);
- } else {
- # če ne dodamo
- $svp_pv[$_svp_pv] = $_svp_pv;
- }
- }
- }
+
+ if (self::$_VARS[VAR_REC_ON_PAGE] != 'all') {
+ self::$_TOTAL_PAGES = bcdiv(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]);
+
+ if (bcmod(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]) > 0)
+ self::$_TOTAL_PAGES += 1;
+ if (self::$_VARS[VAR_CUR_REC_PAGE] > self::$_TOTAL_PAGES ) {
+ self::$_VARS[VAR_CUR_REC_PAGE] = self::$_TOTAL_PAGES;
+ } elseif (self::$_VARS[VAR_CUR_REC_PAGE] < 1 ) {
+ self::$_VARS[VAR_CUR_REC_PAGE] = 1;
+ }
+
+ # nastavimo limit za datoteko
+
+ $up = self::$_VARS[VAR_REC_ON_PAGE] * self::$_VARS[VAR_CUR_REC_PAGE];
+ $low = $up - self::$_VARS[VAR_REC_ON_PAGE]+1;
+
+ self::$_REC_LIMIT = ' NR=='.$low.',NR=='.$up.'';
+ } else {
+ # nastavimo limit za datoteko
+ self::$_REC_LIMIT = '';
+ }
+ }
- #status - če smo v meta ali imamo profil vse enote
- if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
- || ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 )) {
- $svp_pv['status'] = 'status';
- self::$lineoffset++;
- }
-
- #lurker
- if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
- || ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 )) {
- // dodamo v array da se prikazujejo tudi ti stolpci
- $svp_pv['lurker'] = 'lurker';
- self::$lineoffset++;
- }
- # ustreznost
- if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
- // dodamo v array da se prikazujejo tudi ti stolpci
- $svp_pv['relevance'] = 'relevance';
- self::$lineoffset++;
- }
-
- # email tion
- #email prikazujemo skupaj z ustreznostjo
- if ( self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- // dodamo v array da se prikazujejo tudi ti stolpci
- $svp_pv['invitation'] = 'invitation';
- self::$lineoffset++;
- }
+ if (self::$_VARS[VAR_DATA]) {
+ $tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables(self::$_PROFILE_ID_VARIABLE );
+
+ # če je $svp_pv = null potem prikazujemo vse variable
+ # oziroma če je sistemski dodamo tudi vse, ker drugače lahko filter skrije telefon in email
+ if (count($tmp_svp_pv) == 0 || self::$_VARS[VAR_SHOW_SYSTEM] == true ) {
+
+ $_sv = self::$SDF->getSurveyVariables();
+ if (count($_sv) > 0) {
+ foreach ( $_sv as $vid => $variable) {
+ $tmp_svp_pv[$vid] = $vid;
+ }
+ }
+ }
+ }
- if (isset(self::$_HEADERS['testdata'])) {
- self::$_HAS_TEST_DATA = true;
- $svp_pv['testdata'] = 'testdata';
- self::$lineoffset++;
- }
- # $svp_pv['unx_ins_date'] = 'unx_ins_date';
+ self::$lineoffset=1;
- if (self::$_VARS[VAR_METAFULL] && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
- # dodamo tudi special meta
- $svp_pv['meta'] = 'meta';
- }
-
- if (self::$showItime == true) {
- $svp_pv['itime'] = 'itime';
- self::$lineoffset++;
- }
-
- // ce imamo vklopljene sistemske ne smemo povezovat podatkov in zato urejamo po abecedi
- if(self::$_VARS[VAR_SHOW_SYSTEM]){
-
- $hasEmail = false;
-
- // Poiscemo sekvenco sistemske spremenljivke
- foreach (self::$_HEADERS AS $spr => $spremenljivka) {
- if (isset($spremenljivka['sistem']) && $spremenljivka['sistem'] == 1 && $spremenljivka['variable'] == 'email') {
- $sequence = $spremenljivka['sequences'];
- $hasEmail = true;
- }
- }
-
- if($hasEmail){
- # sortiramo
- self::$do_sort = true;
-
- # nastavimo po kateri sekvenci / stolpcu sortiramo
- self::$sort_seq = $sequence;
-
- self::$sort_type = 'sort_asc';
- }
- }
-
- self::getQuestionCount();
- if (self::$_VARS[VAR_SPR_LIMIT] > self::$_ALL_QUESTION_COUNT) {
- self::$_VARS[VAR_SPR_LIMIT] = 'all';
- }
-
- $spr_cont = 0; // za paginacijo spremenljivk
-
- if(self::$_VARS['spr_limit'] == 'all'){
- $_spr_on_pages_start = 0;
- $_spr_on_pages_stop = self::$_VARS['spr_page'];
- }
- else{
- $_spr_on_pages_start = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'] - self::$_VARS['spr_limit'];
- $_spr_on_pages_stop = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'];
- }
+ # če prikazujemo sistemske ne prikazujemo recnumber
+ if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL]) {
+ $svp_pv['recnum'] = 'recnum';
+ self::$lineoffset++;
+ }
- # skreiramo filter variabel za podatke
- if (count(self::$_HEADERS) > 0) {
- // zloopamo skozi spremenljivke in sestavimo filter po stolpcih
- $_tmp_filter = '';
- foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (isset($svp_pv[$spid])) {
- // paginacija spremenljivk
- if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
- if (count($spremenljivka['grids']) > 0 ) {
- foreach ($spremenljivka['grids'] AS $gid => $grid) {
- if (count ($grid['variables']) > 0) {
- foreach ($grid['variables'] AS $vid => $variable ){
- $_tmp_filter .= $_prfx.$variable['sequence'];
- $_prfx = ',';
- }
- }
- }
- }
- } // end: paginacija spremenljivk
- $spr_cont++;
- } else
- # če prikazujemo samo sistemske
- if ( self::$_VARS[VAR_SHOW_SYSTEM] && in_array($spremenljivka['variable'], array('email','ime','priimek','telefon','naziv','drugo','odnos'))) {
- if (count($spremenljivka['grids']) > 0 ) {
- foreach ($spremenljivka['grids'] AS $gid => $grid) {
- if (count ($grid['variables']) > 0) {
- foreach ($grid['variables'] AS $vid => $variable ){
- $_tmp_filter .= $_prfx.$variable['sequence'];
- $_prfx = ',';
- }
- }
- }
- }
- $svp_pv[$spid] = $spid;
- }
- }
- }
+ if (self::$_VARS[VAR_META]) {
+ $svp_pv['code'] = 'code';
+ self::$lineoffset++;
+ }
+
+ if (self::$_VARS[VAR_DATA] && count($tmp_svp_pv) > 0) {
+
+ foreach ($tmp_svp_pv AS $_svp_pv) {
- # prilagodimo array profilov variabel
- self::$_SVP_PV = $svp_pv;
- if ($_tmp_filter != '')
- {
+ # če imamo sistemski email ali telefon, ime, priimek (v header je nastavljno "hide_system" = 1)
+ # potem v odvisnosti od nastavitve prikazujemo samo navadne podatke ali pa samo te sistemske, zaradizaščite podatkov
+ $_sistemski = false;
+ if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_HEADERS[$_svp_pv]['hide_system'] == '1') {
+ # prikazujemo samo nesistemske (nezaščitene)
+ unset(self::$_HEADERS[$_svp_pv]);
+ } else if (self::$_VARS[VAR_SHOW_SYSTEM] && self::$_HEADERS[$_svp_pv]['hide_system'] !== '1') {
+ # prikazujemo samo sistemske (zaščitene) podatke
+ unset(self::$_HEADERS[$_svp_pv]);
+ } else {
+ # če ne dodamo
+ $svp_pv[$_svp_pv] = $_svp_pv;
+ }
+ }
+ }
+
+ #status - če smo v meta ali imamo profil vse enote
+ if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
+ || ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 )) {
+ $svp_pv['status'] = 'status';
+ self::$lineoffset++;
+ }
+
+ #lurker
+ if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
+ || ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 )) {
+ // dodamo v array da se prikazujejo tudi ti stolpci
+ $svp_pv['lurker'] = 'lurker';
+ self::$lineoffset++;
+ }
+ # ustreznost
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
+ // dodamo v array da se prikazujejo tudi ti stolpci
+ $svp_pv['relevance'] = 'relevance';
+ self::$lineoffset++;
+ }
+
+ # email tion
+ #email prikazujemo skupaj z ustreznostjo
+ if ( self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ // dodamo v array da se prikazujejo tudi ti stolpci
+ $svp_pv['invitation'] = 'invitation';
+ self::$lineoffset++;
+ }
+
+ if (isset(self::$_HEADERS['testdata'])) {
+ self::$_HAS_TEST_DATA = true;
+ $svp_pv['testdata'] = 'testdata';
+ self::$lineoffset++;
+ }
+ # $svp_pv['unx_ins_date'] = 'unx_ins_date';
+
+ if (self::$_VARS[VAR_METAFULL] && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
+ # dodamo tudi special meta
+ $svp_pv['meta'] = 'meta';
+ }
+
+ if (self::$showItime == true) {
+ $svp_pv['itime'] = 'itime';
+ self::$lineoffset++;
+ }
+
+ // ce imamo vklopljene sistemske ne smemo povezovat podatkov in zato urejamo po abecedi
+ if(self::$_VARS[VAR_SHOW_SYSTEM]){
+
+ $hasEmail = false;
+
+ // Poiscemo sekvenco sistemske spremenljivke
+ foreach (self::$_HEADERS AS $spr => $spremenljivka) {
+ if (isset($spremenljivka['sistem']) && $spremenljivka['sistem'] == 1 && $spremenljivka['variable'] == 'email') {
+ $sequence = $spremenljivka['sequences'];
+ $hasEmail = true;
+ }
+ }
+
+ if($hasEmail){
+ # sortiramo
+ self::$do_sort = true;
+
+ # nastavimo po kateri sekvenci / stolpcu sortiramo
+ self::$sort_seq = $sequence;
+
+ self::$sort_type = 'sort_asc';
+ }
+ }
+
+ self::getQuestionCount();
+ if (self::$_VARS[VAR_SPR_LIMIT] > self::$_ALL_QUESTION_COUNT) {
+ self::$_VARS[VAR_SPR_LIMIT] = 'all';
+ }
+
+ $spr_cont = 0; // za paginacijo spremenljivk
+
+ if(self::$_VARS['spr_limit'] == 'all'){
+ $_spr_on_pages_start = 0;
+ $_spr_on_pages_stop = self::$_VARS['spr_page'];
+ }
+ else{
+ $_spr_on_pages_start = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'] - self::$_VARS['spr_limit'];
+ $_spr_on_pages_stop = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'];
+ }
+
+ # skreiramo filter variabel za podatke
+ if (count(self::$_HEADERS) > 0) {
+ // zloopamo skozi spremenljivke in sestavimo filter po stolpcih
+ $_tmp_filter = '';
+ foreach (self::$_HEADERS AS $spid => $spremenljivka) {
+ if (isset($svp_pv[$spid])) {
+ // paginacija spremenljivk
+ if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
+ if (count($spremenljivka['grids']) > 0 ) {
+ foreach ($spremenljivka['grids'] AS $gid => $grid) {
+ if (count ($grid['variables']) > 0) {
+ foreach ($grid['variables'] AS $vid => $variable ){
+ $_tmp_filter .= $_prfx.$variable['sequence'];
+ $_prfx = ',';
+ }
+ }
+ }
+ }
+ } // end: paginacija spremenljivk
+ $spr_cont++;
+ } else
+ # če prikazujemo samo sistemske
+ if ( self::$_VARS[VAR_SHOW_SYSTEM] && in_array($spremenljivka['variable'], array('email','ime','priimek','telefon','naziv','drugo','odnos'))) {
+ if (count($spremenljivka['grids']) > 0 ) {
+ foreach ($spremenljivka['grids'] AS $gid => $grid) {
+ if (count ($grid['variables']) > 0) {
+ foreach ($grid['variables'] AS $vid => $variable ){
+ $_tmp_filter .= $_prfx.$variable['sequence'];
+ $_prfx = ',';
+ }
+ }
+ }
+ }
+ $svp_pv[$spid] = $spid;
+ }
+ }
+ }
+
+ # prilagodimo array profilov variabel
+ self::$_SVP_PV = $svp_pv;
+ if ($_tmp_filter != ''){
self::$_VARIABLE_FILTER = $_tmp_filter;
}
}
-
}
/** Prikaže filtre za število podatkov....