diff options
Diffstat (limited to '')
-rw-r--r-- | admin/survey/classes/surveyData/class.SurveyDataDisplay.php | 2106 |
1 files changed, 1150 insertions, 956 deletions
diff --git a/admin/survey/classes/surveyData/class.SurveyDataDisplay.php b/admin/survey/classes/surveyData/class.SurveyDataDisplay.php index bc50f46..982aa68 100644 --- a/admin/survey/classes/surveyData/class.SurveyDataDisplay.php +++ b/admin/survey/classes/surveyData/class.SurveyDataDisplay.php @@ -30,6 +30,7 @@ define('VAR_SORT_SEQ', 'sort_seq'); define('VAR_SORT_TYPE', 'sort_type');
define('VAR_PDF_TYPE', 'type');
define('VAR_RELEVANCE', 'view_relevance');
+define('VAR_STATUS', 'view_status');
define('VAR_SHOW_DATE', 'view_date', false);
define('VAR_SHOW_NO', 'view_no', false);
define('VAR_EMAIL', 'email');
@@ -90,10 +91,14 @@ class SurveyDataDisplay{ 'dataIcons_write'=>false); #ali prikazujemo ikone za urejanje
static private $displayEditIconsSettings = false; # ali prikazujemo okno s checkboxi za nastavitve tabele s podatki
+
+ static private $displayDataFullscreen = false; # ali prikazujemo podatke v fullscreen pogledu
static private $printPreview = false; # ali prikazujemo podatke kot print preview;
static private $canDisplayRelevance = true; # ali prikazujemo ustreznost - relevance;
+
+ static private $canDisplayStatus = true; # ali prikazujemo status;
static private $quickEdit_recnum = array(); # array z prejsnjim in naslednjim recnumom (za vpogled - puscici naprej,nazaj)
@@ -114,7 +119,9 @@ class SurveyDataDisplay{ VAR_PDF_TYPE => 0, # tip izpisa pdf (0 -> kratek, 1 -> dolg, 2 -> zelo kratek)
VAR_SORT_SEQ => '', # po kateri sekvenci sortiramo
VAR_SORT_TYPE => '', # način sortiranja (naraščajoče, padajoče)
- VAR_RELEVANCE => 1, # ali prikazujemo ustreznost
+ // VAR_RELEVANCE je po novem podrobnosti stausa (leva stran)
+ VAR_RELEVANCE => 0, # ali prikazujemo ustreznost
+ VAR_STATUS => 1, # ali prikazujemo status (in vabila)
VAR_EMAIL => 1, # ali prikazujemo email status
VAR_CIRCLES => 0, # ali prikazujemo kroge antonučija
VAR_SHOW_DATE => 0, # ali prikazujemo kroge antonučija
@@ -165,8 +172,7 @@ class SurveyDataDisplay{ self::$survey = SurveyInfo::getInstance()->getSurveyRow();
# aktivne tabele
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
- self::$db_table = '_active';
+ self::$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# ali je anketa tipa SN - social network
self::$is_social_network = (SurveyInfo::getInstance()->checkSurveyModule('social_network')) ? true : false;
@@ -177,8 +183,7 @@ class SurveyDataDisplay{ }
# ali prikazujemo datum na začetku ankete (Če smo v identifikatorjih ne smemo zaradi povezovanja)
- if ( (self::$_VARS[VAR_SHOW_DATE] == true || (int)SurveyInfo :: getInstance()->getSurveyColumn('showItime') == 1) && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- //if (self::$_VARS[VAR_SHOW_DATE] == true && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
+ if ( self::$_VARS[VAR_SHOW_DATE] == true && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
self::$showItime = true;
}
else {
@@ -186,8 +191,7 @@ class SurveyDataDisplay{ }
# ali prikazujemo zaporedno številko. (Če smo v identifikatorjih ne smemo zaradi povezovanja)
- if ( (self::$_VARS[VAR_SHOW_NO] == true || (int)SurveyInfo :: getInstance()->getSurveyColumn('showLineNumber') == 1) && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- //if (self::$_VARS[VAR_SHOW_NO] == true) {
+ if ( self::$_VARS[VAR_SHOW_NO] == true && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
self::$showLineNumber = true;
}
else {
@@ -216,10 +220,13 @@ class SurveyDataDisplay{ if(isset($_SESSION['sid_'.self::$sid]['dataIcons_settings']))
self::$displayEditIconsSettings = ($_SESSION['sid_'.self::$sid]['dataIcons_settings']);
+
+ if(isset($_SESSION['sid_'.self::$sid]['data_fullscreen']))
+ self::$displayDataFullscreen = ($_SESSION['sid_'.self::$sid]['data_fullscreen']);
# ali filtriramo cms usejreve datotekoe
session_start();
- self::$doCMSUserFilter = $_SESSION['sid_'.$sid]['doCMSUserFilter'];
+ self::$doCMSUserFilter = isset($_SESSION['sid_'.$sid]['doCMSUserFilter']) ? $_SESSION['sid_'.$sid]['doCMSUserFilter'] : false;
session_commit();
@@ -230,7 +237,7 @@ class SurveyDataDisplay{ // Ce imamo urlhash gre za javno povezavo in nikoli ne prikazemo loading okna
$show_loading = (isset($_GET['urlhash'])) ? false : true;
- self::$SDF->prepareFiles($show_loading);
+ self::$SDF->prepareFiles();
self::$headFileName = self::$SDF->getHeaderFileName();
self::$dataFileName = self::$SDF->getDataFileName();
@@ -296,13 +303,13 @@ class SurveyDataDisplay{ $awk_cnt_str = 'awk -F"'.STR_DLMT.'" \''.EMAIL_FIELD.'~/1/'.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
}
- $emailCount = shell_exec($awk_cnt_str);
-
+ //$emailCount = shell_exec($awk_cnt_str);
+
#self::$_VARS[VAR_EMAIL] = self::$_VARS[VAR_RELEVANCE] && ((int)self::$survey['email'] == 1 && (int)self::$survey['user_base'] == 1);
- if (((int)self::$survey['email'] == 0 && (int)self::$survey['user_base'] == 0) ) {
+ if (!SurveyInfo::getInstance()->checkSurveyModule('email') || !isset(self::$survey['user_base']) || (int)self::$survey['user_base'] == 0 ) {
self::$_VARS[VAR_EMAIL] = 0;
}
-
+
# nastavimo način sortiranja
self::setUpSort();
@@ -506,299 +513,314 @@ 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;
+ self::$_VARS[VAR_RELEVANCE] = false;
+ self::$_VARS[VAR_STATUS] = 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('<br>'.$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('<br>'.$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));
+ $filter_testdata = null;
+
+ # 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
+ $filter_usability = null;
+ 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();
+ }
-
- 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) {
-
- # č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;
- }
- }
- }
+ # dodamo pogoj za filter prepoznave uporabnika iz cms
+ # vklopljeno more bit prepoznava userja iz cms
+ $CMSUserCondition = null;
+ if (self::$doCMSUserFilter == true) {
+ $CMSUserCondition = self::createCMSUserFilter();
+ }
- #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($_condition_profile_AWK) && $_condition_profile_AWK != "" && $_condition_profile_AWK != null )
+ || (isset($_inspect_condition_awk) && $_inspect_condition_awk != "" && $_inspect_condition_awk != null)
+ || (isset($_time_profile_awk) && $_time_profile_awk != "" && $_time_profile_awk != null)
+ || (isset($CMSUserCondition) && $CMSUserCondition != "" && $CMSUserCondition != null)
+ || (isset($filter_testdata) && $filter_testdata != null)
+ || (isset($filter_usability) && $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 (isset($_GET['debug']) && $_GET['debug'] == 1) {
+ print_r('<br>'.$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 (isset($_GET['debug']) && $_GET['debug'] == 1) {
+ print_r('<br>'.$awk_string);
+ }
+ }
+ if ((int)$recCount > 0 ) {
+ self::$_RECORD_COUNT = (int)$recCount;
+ }
- 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_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_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'];
- }
+ $tmp_svp_pv = array();
+ $svp_pv = array();
+ 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;
+ }
+ }
+ }
+ }
- # 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 = ',';
- }
- }
- }
+ self::$lineoffset=1;
+
+ # če prikazujemo sistemske ne prikazujemo recnumber
+ if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_VARS[VAR_RELEVANCE] /* self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL] */) {
+ $svp_pv['recnum'] = 'recnum';
+ self::$lineoffset++;
+ }
+
+ if (self::$_VARS[VAR_DATA] && count($tmp_svp_pv) > 0) {
+
+ foreach ($tmp_svp_pv AS $_svp_pv) {
+
+ # č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] && isset(self::$_HEADERS[$_svp_pv]['hide_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] && (!isset(self::$_HEADERS[$_svp_pv]['hide_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_STATUS] /* || ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 ) */ ) {
+ $svp_pv['status'] = 'status';
+ self::$lineoffset++;
+
+ # email tion
+ 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++;
}
- $svp_pv[$spid] = $spid;
- }
- }
- }
+ }
- # prilagodimo array profilov variabel
- self::$_SVP_PV = $svp_pv;
- if ($_tmp_filter != '')
- {
+ #geslo vabil
+ if ( self::$_VARS[VAR_EMAIL] && (self::$_VARS[VAR_SHOW_SYSTEM] == true || self::$survey['show_email'] == '1') ) {
+ // dodamo v array da se prikazujejo tudi ti stolpci
+ $svp_pv['code'] = 'code';
+ self::$lineoffset++;
+ }
+ #lurker
+ if ( self::$_VARS[VAR_RELEVANCE] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ // 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++;
+ }
+
+ if (isset(self::$_HEADERS['testdata'])) {
+ self::$_HAS_TEST_DATA = true;
+
+ if(self::$_VARS[VAR_RELEVANCE]){
+ $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::$_VARS[VAR_RELEVANCE] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ $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 = '';
+ $_prfx = '';
+ 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 (isset($grid['variables']) && count($grid['variables']) > 0) {
+ foreach ($grid['variables'] AS $vid => $variable ){
+ $_tmp_filter .= $_prfx.$variable['sequence'];
+ $_prfx = ',';
+ }
+ }
+ }
+ }
+ } // end: paginacija spremenljivk
+
+ if($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm')
+ $spr_cont++;
+ } else
+ # če prikazujemo samo sistemske
+ if ( isset($spremenljivka['variable']) && 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....
@@ -815,99 +837,7 @@ class SurveyDataDisplay{ }
# če imamo podatke
- if (self::$dataFileStatus != FILE_STATUS_SRV_DELETED) {
-
- echo '<div id="dataSettingsCheckboxes" '.(self::$displayEditIconsSettings ? '' : ' style="display:none;"').'>';
-
- echo '<div id="toggleDataCheckboxes2" onClick="toggleDataCheckboxes(\'data\');"><span class="faicon close icon-orange" style="padding-bottom:2px;"></span> '.$lang['srv_data_settings_checkboxes2'].'</div>';
-
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
- echo '<div id="dataSetingsLinks" class="data noBorder">';
- self::displayLeftFilters();
- echo '</div>'; // konec diva za paginacijo
- }
-
- if (self :: $is_social_network == false || self::$_VARS[VAR_CIRCLES] == 0) {
-
- echo '<div class="clr" id="dataIconSetingsLinks" >'.$lang['srv_dataIcons_note'].' ';
-
- if (self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- echo '<input type="checkbox" id="dataIcons_quick_view" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_quick_view'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_quick_view">'.$lang['srv_dataIcons_quick_view'].'</label>';
- echo ' ';
- /*echo '<input type="checkbox" id="dataIcons_edit" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_edit'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_edit">'.$lang['srv_dataIcons_edit'].'</label>';
- if (self::$displayEditIcons['dataIcons_edit'] == true) {
- echo ' '.Help::display('srv_podatki_urejanje_inline');
- }
- echo ' ';
- echo '<input type="checkbox" id="dataIcons_write" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_write">'.$lang['srv_dataIcons_write'].'</label>';
- echo ' ';*/
- echo '<input type="checkbox" id="dataIcons_labels" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_labels'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_labels">'.$lang['srv_dataIcons_labels'].'</label>';
-
- if ( self::showMultiple() ) {
- echo ' ';
- echo '<input type="checkbox" id="dataIcons_multiple" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_multiple'] == true ? ' checked="checekd"' : '').' /><label for="dataIcons_multiple">'.$lang['srv_dataIcons_multiple'].'</label>';
- }
- } else {
- echo '<input type="checkbox" id="dataIcons_quick_view" disabled="disabled" /><label for="dataIcons_quick_view" class="gray">'.$lang['srv_dataIcons_quick_view'].'</label>';
- echo ' ';
- /*echo '<input type="checkbox" id="dataIcons_edit" disabled="disabled" /><label for="dataIcons_edit" class="gray">'.$lang['srv_dataIcons_edit'].'</label>';
- if (self::$displayEditIcons['dataIcons_edit'] == true) {
- echo ' '.Help::display('srv_podatki_urejanje_inline');
- }
- echo ' ';
- echo '<input type="checkbox" id="dataIcons_write" disabled="disabled" /><label for="dataIcons_write" class="gray">'.$lang['srv_dataIcons_write'].'</label>';
- echo ' ';*/
- echo '<input type="checkbox" id="dataIcons_labels" disabled="disabled" /><label for="dataIcons_labels" class="gray">'.$lang['srv_dataIcons_labels'].'</label>';
-
- if ( self::showMultiple() ) {
- echo ' ';
- echo '<input type="checkbox" id="dataIcons_multiple" disabled="disabled" /><label for="dataIcons_multiple" class="gray">'.$lang['srv_dataIcons_multiple'].'</label>';
- }
- }
-
- # preverimo koliko anket je dejansko uporbaniških
- # za potrebne statuse
- $statuses = SurveyStatusProfiles :: getStatusAsArrayString();
-
- $lurkers = false;
- if (is_array($statuses) && count($statuses) > 0) {
- # najprej preverimo ali filtriramo lurkereje
- if (isset($statuses['lurker'])) {
- $lurkers = true;
- unset($statuses['lurker']);
- }
-
- if (count($statuses) > 0) {
- $sstring = ' AND last_status IN (';
- foreach ($statuses AS $skey => $status) {
- if (is_numeric($skey)) {
- $sstring.=$prefix.$skey;
- } else if($skey == 'null') {
- $sstring.=$prefix.'-1';
- }
- $prefix = ',';
- }
- $sstring .=')';
-
- }
- }
-
- $q = sisplet_query("SELECT count(*) FROM srv_user WHERE ank_id = '".self::$sid."' AND user_id > 0 AND deleted='0' ".$sstring);
- list($cnt) = mysqli_fetch_row($q);
-
- if ($cnt > 0) {
- echo '<span class="spaceLeft">';
- self::displayOnlyCMS();
- echo '</span>';
- }
-
- echo '</div>';
- echo '<div class="clr"></div>';
- }
-
- echo '</div>';
-
-
+ if (self::$dataFileStatus != FILE_STATUS_SRV_DELETED) {
# ali imamo testne podatke
if (self::$_HAS_TEST_DATA) {
# izrišemo bar za testne podatke
@@ -936,7 +866,7 @@ class SurveyDataDisplay{ //$_tmp_limit = array(10,50,100,250,500,1000,2500,5000,10000);
$_tmp_limit = array(10,50,100,250,500);
- $_select_records = '<select id="rec_on_page'.$position.'" onchange="setDataView(\''.VAR_REC_ON_PAGE.'\',$(\'select#rec_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_on_page'].'">';
+ $_select_records = '<select id="rec_on_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_REC_ON_PAGE.'\',$(\'select#rec_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_on_page'].'">';
foreach ($_tmp_limit AS $limit) {
if ($limit < self::$_RECORD_COUNT) {
$_select_records .= '<option '.(self::$_VARS[VAR_REC_ON_PAGE] == $limit ? ' selected="selected"' : '').' value="'.$limit.'">';
@@ -947,7 +877,7 @@ class SurveyDataDisplay{ // Opcija "vsi" - ni na voljo ce je vec kot 1000 responsov (drugace lahko vse zasteka)
if(self::$_RECORD_COUNT <= 1000){
$_select_records .= '<option '.(self::$_VARS[VAR_REC_ON_PAGE] == 'all' ? ' selected="selected"' : '').' value="all">';
- $_select_records .= $lang['srv_vsi'];
+ $_select_records .= $lang['all2'];
$_select_records .= '</option>';
}
@@ -960,7 +890,7 @@ class SurveyDataDisplay{ if (self::$_VARS[VAR_REC_ON_PAGE] != 'all' && self::$_TOTAL_PAGES > 1) {
echo '<label>';
- echo $lang['page'];
+ echo $lang['page'].':';
echo '</label>';
// puscica levo
@@ -968,7 +898,7 @@ class SurveyDataDisplay{ echo '<a title="'.$lang['previous_page'].'" href="#" onclick="setDataView(\''.VAR_CUR_REC_PAGE.'\',\''.(self::$_VARS[VAR_CUR_REC_PAGE]-1).'\');"><span class="faicon arrow2_l"></span></a>';
}
- $_records_page = '<select id="cur_rec_page'.$position.'" onchange="setDataView(\''.VAR_CUR_REC_PAGE.'\',$(\'select#cur_rec_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_current_page'].'">';
+ $_records_page = '<select id="cur_rec_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_CUR_REC_PAGE.'\',$(\'select#cur_rec_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_current_page'].'">';
for ($i=1; $i<=self::$_TOTAL_PAGES; $i++) {
$_records_page .= '<option'.(self::$_VARS[VAR_CUR_REC_PAGE]==$i ? ' selected="selected"' : '' )
. ' value="'.$i.'" >';
@@ -999,7 +929,7 @@ class SurveyDataDisplay{ //$_spr_limit = array(5=>'5',10=>'10',20=>'20',30=>'30',50=>'50',100=>'100','all'=>$lang['hour_all2']);
$_spr_limit = array(5=>'5',10=>'10',20=>'20',30=>'30',50=>'50');
- $_spr_on_page = '<select id="spr_on_page'.$position.'" onchange="setDataView(\''.VAR_SPR_LIMIT.'\',$(\'select#spr_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_on_page'].'">';
+ $_spr_on_page = '<select id="spr_on_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_SPR_LIMIT.'\',$(\'select#spr_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_on_page'].'">';
foreach ($_spr_limit AS $key => $label) {
if ($key < self::$_ALL_QUESTION_COUNT) {
$_spr_on_page .= '<option '.(self::$_VARS[VAR_SPR_LIMIT] == $key ? ' selected="selected"' : '').' value="'.$key.'">';
@@ -1010,7 +940,7 @@ class SurveyDataDisplay{ // Opcija "vsi" - ni na voljo ce je vec kot 50 vprasanj (drugace lahko vse zasteka)
if(self::$_ALL_QUESTION_COUNT <= 50){
$_spr_on_page .= '<option '.(self::$_VARS[VAR_SPR_LIMIT] == 'all' ? ' selected="selected"' : '').' value="all">';
- $_spr_on_page .= $lang['hour_all2'];
+ $_spr_on_page .= $lang['srv_block_random_all'];
$_spr_on_page .= '</option>';
}
@@ -1021,7 +951,7 @@ class SurveyDataDisplay{ # KATERA STRAN
// prestejemo stevilo vprasanj
- $questions = count(self::$_SVP_PV);
+ $questions = (self::$_SVP_PV !== null) ? count(self::$_SVP_PV) : 0;
if (self::$_VARS[VAR_SPR_LIMIT] != 'all') {
$spr_pages = bcdiv($questions, self::$_VARS[VAR_SPR_LIMIT]);
@@ -1031,9 +961,9 @@ class SurveyDataDisplay{ if ($spr_pages > 1) {
- $_spr_page = '<select id="cur_spr_page'.$position.'" onchange="setDataView(\''.VAR_SPR_PAGE.'\',$(\'select#cur_spr_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_current_page'].'">';
+ $_spr_page = '<select id="cur_spr_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_SPR_PAGE.'\',$(\'select#cur_spr_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_current_page'].'">';
echo '<label>';
- echo $lang['page'];
+ echo $lang['page'].':';
echo '</label>';
// puscica levo
@@ -1064,82 +994,100 @@ class SurveyDataDisplay{ public static function displayLeftFilters() {
global $lang, $site_url;
-
- // število zapisov na stran
- echo '<ul class="">';
-
- echo '<li>'.$lang['srv_show'].':</li>';
-
+
// ustreznost
- if (self::$canDisplayRelevance) {
+ /* if (self::$canDisplayRelevance) {
- echo '<li>';
+ echo '<div class="setting_line">';
if (self::$_VARS[VAR_SHOW_SYSTEM] != true) {
- echo '<label for="var_relevance"><input type="checkbox" onchange="setDataView(\''. VAR_RELEVANCE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_RELEVANCE] ? ' checked="checked"' : '').' id="var_relevance" />'.$lang['srv_displaydata_relevance'].'</label>';
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_RELEVANCE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_RELEVANCE] ? ' checked="checked"' : '').' id="var_relevance" /><label for="var_relevance">'.$lang['srv_displaydata_relevance'].'</label>';
}
else {
- echo '<label for="var_relevance" class="gray"><input type="checkbox" disabled="disabled" />'.$lang['srv_displaydata_relevance'].'</label>';
+ echo '<input type="checkbox" disabled="disabled" /><label for="var_relevance" class="gray">'.$lang['srv_displaydata_relevance'].'</label>';
}
- echo '</li>';
- }
+ echo '</div>';
+ } */
+
+ // podrobnosti statusa (novo - po starem levi parapodatki + datum + ustreznost)
+ echo '<div class="setting_line">';
+ if (self::$_VARS[VAR_SHOW_SYSTEM] != true) {
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_STATUS.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_STATUS] ? ' checked="checked"' : '').' id="var_status" /><label for="var_status">'.$lang['srv_displaydata_status'].'</label>';
+ }
+ else {
+ echo '<input type="checkbox" disabled="disabled" /><label for="var_status" class="gray">'.$lang['srv_displaydata_status'].'</label>';
+ }
+ echo '</div>';
+
+ // podrobnosti statusa (novo - po starem levi parapodatki + datum + ustreznost)
+ echo '<div class="setting_line">';
+ if (self::$_VARS[VAR_SHOW_SYSTEM] != true) {
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_RELEVANCE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_RELEVANCE] ? ' checked="checked"' : '').' id="var_relevance" /><label for="var_relevance">'.$lang['srv_displaydata_status_details'].'</label>';
+ }
+ else {
+ echo '<input type="checkbox" disabled="disabled" /><label for="var_relevance" class="gray">'.$lang['srv_displaydata_status_details'].'</label>';
+ }
+ echo '</div>';
- // email prikazujemo skupaj z ustreznost
- if ((int)self::$survey['email'] == 1 && (int)self::$survey['user_base'] == 1) {
+ // email prikazujemo skupaj z status
+ /* if (SurveyInfo::getInstance()->checkSurveyModule('email') && isset(self::$survey['user_base']) && (int)self::$survey['user_base'] == 1) {
- echo '<li>';
+ echo '<div class="setting_line">';
if (self::$_VARS[VAR_SHOW_SYSTEM] != true ) {
- echo '<label for="var_email"><input type="checkbox" onchange="setDataView(\''. VAR_EMAIL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_EMAIL] ? ' checked="checked"' : '').' id="var_email" />'.$lang['srv_displaydata_invitation'].'</label>';
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_EMAIL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_EMAIL] ? ' checked="checked"' : '').' id="var_email" /><label for="var_email">'.$lang['srv_displaydata_invitation'].'</label>';
}
else {
- echo '<label for="var_email" class="gray"><input type="checkbox" disabled="disabled" id="var_email" />'.$lang['srv_displaydata_invitation'].'</label>';
+ echo '<input type="checkbox" disabled="disabled" id="var_email" /><label for="var_email" class="gray">'.$lang['srv_displaydata_invitation'].'</label>';
}
- echo '</li>';
- }
+ echo '</div>';
+ } */
// podatki
- echo '<li>';
- echo ' <input type="checkbox" onclick="setDataView(\''.VAR_DATA.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_DATA] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="data" /><label for="data" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_data'].'</label>';
- echo '</li>';
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_DATA.'\',$(this).is(\':checked\'))" '.( (self::$_VARS[VAR_DATA] && !self::$_VARS[VAR_SHOW_SYSTEM]) ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="data" /><label for="data" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_data'].'</label>';
+ echo '</div>';
+
+ // Labela
+ if(self::$_VARS[VAR_DATA]){
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" '.((self::$_VARS[VAR_DATA] && !self::$_VARS[VAR_SHOW_SYSTEM])?'':' disabled').' id="dataIcons_labels" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_labels'] == true ? ' checked="checekd"' : '').'/><label '.((self::$_VARS[VAR_DATA] && !self::$_VARS[VAR_SHOW_SYSTEM])?'':' class="gray"').' for="dataIcons_labels">'.$lang['srv_dataIcons_labels'].'</label>';
+ echo '</div>';
+ }
// Preverimo ce je vklopljen modul za volitve - potem nimamo identifikatorjev
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
// Parapodatki
- echo '<li>';
- echo ' <input type="checkbox" onclick="setDataView(\''.VAR_METAFULL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_METAFULL] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="fullmeta" /><label for="fullmeta" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_meta'].'</label>';
- echo '</li>';
-
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_METAFULL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_METAFULL] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="fullmeta" /><label for="fullmeta" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_meta2'].'</label>';
+ echo '</div>';
+
// če imamo sistemske podatke katere moramo prikazovati ločeno - IDENTIFIKATORJI
if(!isset(self::$_HEADERS['_settings']['count_system_data_variables']) || (isset(self::$_HEADERS['_settings']['count_system_data_variables']) && (int)self::$_HEADERS['_settings']['count_system_data_variables'] > 0)) {
- echo '<li>';
- echo ' <label><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_SYSTEM.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_SYSTEM] ? ' checked="checked"' : '').' id="showsystem" />'.$lang['srv_displaydata_system_data'].'</label>';
- echo '</li>';
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_SHOW_SYSTEM.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_SYSTEM] ? ' checked="checked"' : '').' id="showsystem" /><label for="showsystem">'.$lang['srv_displaydata_system_data'].'</label>';
+ echo '</div>';
}
// Po novem vedno prikazemo checkbox identifikatorji - samo je odkljukan in disablan
- else{
- echo '<li>';
- echo ' <label class="gray"><input type="checkbox" checked="checked" disabled="disabled" id="showsystem" />'.$lang['srv_displaydata_system_data'].'</label>';
- echo '</li>';
- }
+ /* else{
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" checked="checked" disabled="disabled" id="showsystem" /><label for="showsystem" class="gray">'.$lang['srv_displaydata_system_data'].'</label>';
+ echo '</div>';
+ } */
// datum
- echo '<li>';
- echo '<label '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_DATE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_DATE] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showdate" />'.$lang['srv_data_date'].'</label>';
- echo '</li>';
+ /* echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_SHOW_DATE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_DATE] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showdate" /><label for="showdate" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_data_date2'].'</label>';
+ echo '</div>'; */
}
// zaporedna številka
- echo '<li>';
- echo '<label '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_NO.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_NO] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showno" />'.$lang['srv_recnum'].'</label>';
- echo '</li>';
-
- // pomoč - ?
- echo '<li>'.Help :: display('displaydata_checkboxes').'</li>';
- echo '</ul>';
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_SHOW_NO.'\',$(this).is(\':checked\'))" '.( (self::$_VARS[VAR_SHOW_NO] && !self::$_VARS[VAR_SHOW_SYSTEM]) ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showno" /><label for="showno" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_recnum_long'].'</label>';
+ echo '</div>';
}
// Search po tabeli s podatki
@@ -1148,13 +1096,24 @@ class SurveyDataDisplay{ $search = isset($_SESSION['sid_'.self::$sid]['data_search_filter']) ? $_SESSION['sid_'.self::$sid]['data_search_filter'] : '';
- echo '<div id="data_search_filter">';
-
- echo '<label>'.$lang['srv_find'].':</label> <input id="data_search_value" type="text" onchange="data_search_filter(); return false;" value="'.$search.'">';
- if($search != ''){
- echo '<span class="bold red spaceLeft">'.$lang['srv_displayData_search'].' "'.$search.'"!</span>';
- }
+ echo '<div class="data_search_holder">';
+ echo '<div id="data_search_filter" class="setting_box '.($search != '' ? 'active':'').'">';
+
+ echo '<a '.($search != '' ? '':'onclick="showDataTableSearch();"').'><span class="faicon search pointer"></span></a> ';
+ echo '<input id="data_search_value" style="display:'.($search != '' ? "inline-block":"none").';" type="text" onchange="data_search_filter(); return false;" value="'.$search.'" placeholder="'.$lang['search'].'">';
+ echo '<input type="button" style="display: none;" value="' . $lang['s_search'] . '" />';
+
+ //X za pocisti search
+ if($search != '')
+ echo '<a onclick="clearDataTableSearch();"><span class="faicon xmark pointer"></span></a> ';
+
+ echo '</div>';
+
+ /* if($search != ''){
+ echo '<span class="search_filtered">'.$lang['srv_displayData_search'].' "'.$search.'"!</span>';
+ } */
+
echo '</div>';
}
@@ -1163,7 +1122,8 @@ class SurveyDataDisplay{ session_start();
- $search = (isset($_POST['value']) && $_POST['value'] != '') ? trim($_POST['value']) : '';
+ $search = (isset($_POST['value']) && $_POST['value'] != '') ? trim($_POST['value']) : '';
+
if($search != ''){
$_SESSION['sid_'.self::$sid]['data_search_filter'] = $search;
}
@@ -1181,17 +1141,17 @@ class SurveyDataDisplay{ }
- // Prikazemo editiranje na dnu (brisanje vecih hkrati...)
- public static function displayBottomEdit(){
+ // Prikazemo brisanje vecih hkrati
+ public static function displayMassDelete(){
global $lang;
+
if ((int)self::$_RECORD_COUNT > 0){
- echo '<div id="bottom_edit" class="floatLeft'.( self::$displayEditIcons['dataIcons_quick_view'] == true ? '' : ' shifted').'">';
+ echo '<div class="mass_delete">';
- echo '<span class="faicon arrow_up"></span> ';
- echo '<span id="switch_on"><a href="javascript:selectAll(1);">'.$lang['srv_select_all'].'</a></span>';
- echo '<span id="switch_off" style="display:none;"><a href="javascript:selectAll(0);">'.$lang['srv_deselect_all'].'</a></span>';
- echo ' <a href="#" onClick="deleteMultipleData();"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_delete_data_multirow'].'"/></span> '.$lang['srv_delete_selected'].'</a>';
- echo '<p>'.$lang['srv_delete_infotext'].' '.Help::display('srv_delete_infotext').'</p>';
+ echo '<span id="switch_on" class="faicon checkbox-empty" onClick="selectAll(1);" title="'.$lang['srv_select_all'].'"></span>';
+ echo '<span id="switch_off" class="faicon minus_square" onClick="selectAll(0);" title="'.$lang['srv_deselect_all'].'" style="display:none;"></span>';
+
+ echo '<button id="mass_delete_button" class="white-black small" onClick="deleteMultipleData();" style="display:none;"><span class="faicon delete" title="'.$lang['srv_delete_data_multirow'].'"/></span>'.$lang['srv_delete_selected'].'</button>';
echo '</div>';
}
@@ -1203,41 +1163,171 @@ class SurveyDataDisplay{ public static function displayVnosiHTML() {
global $lang;
global $site_path;
+ global $site_url;
global $global_user_id;
+
// na vrhu in na dnu izrisemo paginacijo
if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$_RECORD_COUNT > 0) {
- echo '<div id="vnosi_paginacija" class="top_paginacija">';
- self::displayPaginacija($position='_top');
- echo '</div>';
- // Izrisemo search
- if(!self::$_VARS[VAR_CODING])
- self::displayDataSearch();
-
+ // Zgornje nastavitve nad tabelo
+ echo '<div class="data_table_top_holder">';
+
+
+ // SN preklop - ego alter (ce je vklopljen modul)
+ if(self::$is_social_network){
+ echo '<div class="dataFullscreen">';
+
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '0').'"><button id="data_fullscreen_0" class="small white-blue '.((int)self::$_VARS[VAR_CIRCLES]==0 ? 'active' : '').'">'.$lang['srv_lnk_ego'].'</button></a>';
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '1').'"><button id="data_fullscreen_1" class="small white-blue '.((int)self::$_VARS[VAR_CIRCLES]==1 ? 'active' : '').'">'.$lang['srv_lnk_alter'].'</button></a>';
+
+ echo '</div>';
+ }
+
+
+ // Navaden pogled / fullscreen
+ echo '<div class="dataFullscreen">';
+
+ echo ' <button id="data_fullscreen_0" class="small white-blue '.(!self::$displayDataFullscreen ? 'active' : '').'" onClick="data_fullscreen(\'0\');">'.$lang['srv_displaydata_fullscreen_0'].'</button>';
+ echo ' <button id="data_fullscreen_1" class="small white-blue '.(self::$displayDataFullscreen ? 'active' : '').'" onClick="data_fullscreen(\'1\');">'.$lang['srv_displaydata_fullscreen_1'].'</button>';
+
+ echo '</div>';
+
// Checkboxa za urejanje in izpise podatkov ter razpiranje dodatnih nastavitev
- echo '<div class="dataSettingsBasic">';
+ echo '<div class="dataSettingsBasic">';
+ echo ' <button id="toggleDataCheckboxes" class="small white-blue '.(self::$displayEditIconsSettings ? 'active' : '').'" onClick="toggleDataCheckboxes(\'data\');"><span class="faicon plus"></span>'.$lang['srv_displaydata_columns'].'</button>';
+ echo '</div>';
- echo '<input type="checkbox" id="dataIcons_edit" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_edit'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_edit">'.$lang['srv_dataIcons_edit'].'</label>';
- if (self::$displayEditIcons['dataIcons_edit'] == true) {
- echo ' '.Help::display('srv_podatki_urejanje_inline');
+
+ // Search
+ if(!self::$_VARS[VAR_CODING])
+ self::displayDataSearch();
+
+ //icons and export checkbox
+ if (self :: $is_social_network == false || self::$_VARS[VAR_CIRCLES] == 0) {
+
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_edit" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_edit'] == true ? ' checked="checekd"' : '').'/>';
+ echo ' <label for="dataIcons_edit">'.$lang['srv_dataIcons_edit'].'</label>';
+ echo '</div>';
+
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+ $userAccess = UserAccess::getInstance($global_user_id);
+ if(!$userAccess->checkUserAccess($what='data_export')) {
+
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_write" onclick="popupUserAccess(\'data_export\'); return false;" '.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checked"' : '').'>';
+ echo ' <label for="dataIcons_write" '.(!$userAccess->checkUserAccess($what='data_export') ? 'class="user_access_locked"' : '').'>'.$lang['srv_dataIcons_write'].'</label>';
+ echo '</div>';
+ }
+ else {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_write" onchange="changeDataIcons(); return false;" '.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checked"' : '').'>';
+ echo ' <label for="dataIcons_write">'.$lang['srv_dataIcons_write'].'</label>';
+ echo '</div>';
+ }
}
- echo ' ';
-
- // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
- $userAccess = UserAccess::getInstance($global_user_id);
- echo '<input type="checkbox" id="dataIcons_write" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checked"' : '').' '.(!$userAccess->checkUserAccess($what='data_export') ? 'disabled="disabled"' : '').' /><label for="dataIcons_write" '.(!$userAccess->checkUserAccess($what='data_export') ? 'class="user_access_locked"' : '').'>'.$lang['srv_dataIcons_write'].'</label>';
- $arrow = (isset($_SESSION['sid_' . self::$sid]['dataIcons_settings'])) ? $_SESSION['sid_' . self::$sid]['dataIcons_settings'] : 0;
- echo '<div id="toggleDataCheckboxes" ' . $borderLeft . ' onClick="toggleDataCheckboxes(\'data\');"><span class="faicon ' . ($arrow == 1 ? ' dropup_blue' : 'dropdown_blue') . '"></span> ' . $lang['srv_extra_settings'] . '</div>';
+ // Paginacija
+ echo '<div id="vnosi_paginacija" class="top_paginacija">';
+ self::displayPaginacija($position='_top');
echo '</div>';
+
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes" '.(self::$displayEditIconsSettings ? '' : ' style="display:none;"').'>';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
+ echo '<div class="setting_line title">';
+ echo $lang['srv_dataTable_settings_show'];
+ echo '</div>';
+
+ self::displayLeftFilters();
+ }
+
+ if (self :: $is_social_network == false || self::$_VARS[VAR_CIRCLES] == 0) {
+
+ echo '<div class="setting_line title">';
+ echo $lang['srv_dataTable_settings_shortcuts'];
+ echo '</div>';
+
+ if (self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_quick_view" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_quick_view'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_quick_view">'.$lang['srv_dataIcons_quick_view'].'</label>';
+ echo '</div>';
+
+ if ( self::showMultiple() ) {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_multiple" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_multiple'] == true ? ' checked="checekd"' : '').' /><label for="dataIcons_multiple">'.$lang['srv_dataIcons_multiple'].'</label>';
+ echo '</div>';
+ }
+ }
+ else {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_quick_view" disabled="disabled" /><label for="dataIcons_quick_view" class="gray">'.$lang['srv_dataIcons_quick_view'].'</label>';
+ echo '</div>';
+
+ if ( self::showMultiple() ) {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_multiple" disabled="disabled" /><label for="dataIcons_multiple" class="gray">'.$lang['srv_dataIcons_multiple'].'</label>';
+ echo '</div>';
+ }
+ }
+
+ # preverimo koliko anket je dejansko uporbaniških
+ # za potrebne statuse
+ $statuses = SurveyStatusProfiles :: getStatusAsArrayString();
+
+ $lurkers = false;
+ if (is_array($statuses) && count($statuses) > 0) {
+ # najprej preverimo ali filtriramo lurkereje
+ if (isset($statuses['lurker'])) {
+ $lurkers = true;
+ unset($statuses['lurker']);
+ }
+
+ if (count($statuses) > 0) {
+ $prefix = '';
+ $sstring = ' AND last_status IN (';
+ foreach ($statuses AS $skey => $status) {
+ if (is_numeric($skey)) {
+ $sstring.=$prefix.$skey;
+ } else if($skey == 'null') {
+ $sstring.=$prefix.'-1';
+ }
+ $prefix = ',';
+ }
+ $sstring .=')';
+ }
+ }
+
+ $q = sisplet_query("SELECT count(*) FROM srv_user WHERE ank_id = '".self::$sid."' AND user_id > 0 AND deleted='0' ".$sstring);
+ list($cnt) = mysqli_fetch_row($q);
+
+ if ($cnt > 0) {
+ echo '<span class="spaceLeft">';
+ self::displayOnlyCMS();
+ echo '</span>';
+ }
+ }
+
+ // Gumb zapri dodatne nastavitve
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="toggleDataCheckboxes(\'data\');">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+
+ echo ' </div>';
+ echo '</div>';
+
+
+ echo '</div>';
}
- echo '<br class="clr" />';
-
+ // Vklopljeni filtri
echo '<div id="displayFilterNotes">';
# če ne uporabljamo privzetega časovnega profila izpišemo opozorilo
@@ -1265,12 +1355,7 @@ class SurveyDataDisplay{ echo '</div>';
-
-
-
-
- $folder = $site_path . EXPORT_FOLDER.'/';
-
+ // Div s tabelo
echo '<div id="div_vnosi_data">';
if ((self::$dataFileStatus == 1 || self::$dataFileStatus == 0) && self::$dataFileName !== null) {
@@ -1289,8 +1374,7 @@ class SurveyDataDisplay{ else {
# imamo SN omrežje
if (self::$_VARS[VAR_CIRCLES] == 0) {
- self::DisplaySnLinks();
- self::DisplayDataTable();
+ self::DisplayDataTable();
}
}
}
@@ -1300,35 +1384,37 @@ class SurveyDataDisplay{ }
}
else {
- echo '<br /><div style="margin: 0 0 40px 0;">Ni podatkov za prikaz. Preverite filtre (Podatki, Para podatki, Polni para podatki)</div>';
+ echo 'Ni podatkov za prikaz. Preverite filtre (Podatki, Para podatki, Polni para podatki)';
}
}
if (self :: $is_social_network ) {
if (self::$SSNDF != null && self::$_VARS[VAR_CIRCLES] == 1) {
- self::DisplaySnLinks();
self::$SSNDF->outputSNDataFile();
}
}
echo '</div>'; // id="div_vnosi_data">';
-
+
+ // Spodnje nastavitve pod tabelo
+ echo '<div class="data_table_bottom_holder">';
+
#izrišemo legendo statusov
self::displayStatusLegend();
self::displayMetaStatusLegend();
self::displayTestLegend();
-
// na vrhu in na dnu izrisemo paginacijo
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
+ /*if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
echo '<div id="vnosi_paginacija" class="bottom_paginacija">';
self::displayPaginacija($position='_bottom');
echo '</div>';
-
- echo '<div class="clr"></div>';
- }
+ }*/
+ echo '</div>';
+
+
// osvetlimo stolpec s spremenljivko
if (isset($_GET['highlight_spr'])) {
?><script>
@@ -1379,16 +1465,13 @@ class SurveyDataDisplay{ //self::$_SVP_PV = array_merge($_svp_pv, self::$_SVP_PV);
- #izpišemo tabelo
- echo '<div style="padding-top:0px; height:5px;" class="clr"> </div>';
-
+ #izpišemo tabelo
echo '<div id="tableContainer" class="tableContainer">';
# div v katerem po potrebi prikazujemo gumbe za skrolanje levo in desno
echo '<div id="dataTableScroller">';
- echo '<span class="faicon arrow_large2_l icon-as_link pointer" onclick="dataTableScroll(\'left\');return false;"></span>';
- echo ' ';
- echo '<span class="faicon arrow_large2_r icon-as_link pointer" onclick="dataTableScroll(\'right\');return false;"></span>';
+ echo ' <div class="dataTable_arrow left" onclick="dataTableScroll(\'left\'); return false;"><span class="faicon arrow_large2_l"></span></div>';
+ echo ' <div class="dataTable_arrow right" onclick="dataTableScroll(\'right\'); return false;"><span class="faicon arrow_large2_r"></span></div>';
echo '</div>';
$display1kaIcon = self::$displayEditIcons['dataIcons_quick_view'] ;
@@ -1419,48 +1502,14 @@ class SurveyDataDisplay{ # ali smo v edit načinu ali monitoringu
$cssEdit = (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING]?' editData':'');
- echo '<table id="dataTable" class="scrollTable no_wrap_td'.$cssEdit.'" '.(self::$_VARS[VAR_EDIT]?' title="'.$lang['srv_edit_data_title'].'"':'').'>';
-
- // Nastavimo colgroup, da na njega vezemo vse sirine v tabeli, zaradi resizinga stolpcev
- echo '<colgroup>';
- # colspan za ikonce
- if ($stolpci > 0) {
- echo '<col class="data_edit"'.($stolpci > 1 ? (' span="'.$stolpci.'"') : '').'>';
- }
- $spr_cont = 0;
- foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<col>';
- }
-
- // paginacija spremenljivk
- if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
- foreach ($spremenljivka['grids'] AS $gid => $grid) {
- if (count ($grid['variables']) > 0) {
- foreach ($grid['variables'] AS $vid => $variable ){
- echo '<col seq="'.$variable['sequence'].'"';
-
- if ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
- echo ' spr_id="'.substr($spid, 0, strpos($spid, '_')).'"';
- } else {
- echo ' spr_id="'.$spid.'"';
- }
-
- echo '>';
- }
- }
- }
- }
- $spr_cont++;
- }
-
- }
- echo '</colgroup>';
+
+ echo '<table id="dataTable" class="scrollTable no_wrap_td'.$cssEdit.'" '.(self::$_VARS[VAR_EDIT]?' title="'.$lang['srv_edit_data_title'].'"':'').'>';
+
echo '<thead class="fixedHeader">';
- echo '<tr>';
+
+ echo '<tr class="row1">';
# colspan za ikonce
if ($stolpci > 0) {
@@ -1468,29 +1517,120 @@ class SurveyDataDisplay{ }
# dodamo skrit stolpec uid
- echo '<th class="data_uid"> </th>';
+ echo '<th class="data_uid"></th>';
+
+ // vedno na prvo mesto prikazi line number, ce je vklucen
+ if(self::$showLineNumber/* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th class="cell_info" title="'.$lang['srv_line_number'].'">';
+ echo ' <div class="headerCell">'. $lang['srv_line_number'] .'</div>';
+ echo '</th>';
+ }
$spr_cont = 0;
+ //stej info_cols
+ $info_cnt = 0;
+ //ce je info_cols true, jih samo stej in jih na koncu izrisi
+ $info_cols = false;
+
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (isset(self::$_SVP_PV[$spid])) {
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
+ $spremenljivka['tip'] = isset($spremenljivka['tip']) ? $spremenljivka['tip'] : '';
+ $spremenljivka['variable'] = isset($spremenljivka['variable']) ? $spremenljivka['variable'] : '';
+
+ if($spremenljivka['tip'] == 'm'){
+ $class = 'cell_info';
+ $info_cols = true;
+
+ if (isset(self::$_SVP_PV[$spid])){
+ //$spr_cont++;
+
+ if($spid != 'status' && $spid != 'invitation')
+ $info_cnt++;
}
+ }
+ elseif($spremenljivka['tip'] == 'sm'){
+ $class = 'cell_paradata';
+ $info_cols = false;
+ }
+ else{
+ $class = 'cell_data';
+ $info_cols = false;
+ }
+
+ $cnt_all = $spremenljivka['cnt_all'] ?? 1;
+
+ $var_code = ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') ? '('.$spremenljivka['variable'].') ' : '';
+
+ //v stolpcih, kjer je druga vrstica glave prazna, omogoci sortiranje v prvi
+ $sortable = (in_array($spremenljivka['tip'], array('1','3','7','8','21')) || $spid == 'status' || $spid == 'invitation') ? 'sortable' : '';
+
+ //za delovanje sortinga
+ $class_sorting = '';
+ if (self::$sort_seq != null && isset($spremenljivka['grids'][0]['variables'][0]['sequence']) && $spremenljivka['grids'][0]['variables'][0]['sequence'] == self::$sort_seq) {
+ $class_sorting = self::$sort_type !== null ? self::$sort_type : '' ;
+ }
+
+ if (isset(self::$_SVP_PV[$spid])) {
+
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
- echo '<th colspan="'.$spremenljivka['cnt_all'].'" title="'.$spremenljivka['naslov'].'">';
- echo '<div class="headerCell">'.$spremenljivka['naslov'].'</div>';
- echo '</th>';
+
+ // status in vabila so posebej na zacetku
+ if(isset(self::$_SVP_PV[$spid]) && ($spid == 'status' || $spid == 'invitation')){
+ echo '<th class="'.$class.' '.$sortable.' '.$class_sorting.'" title="'.$spremenljivka['naslov'].'"
+ seq="'.$spremenljivka["grids"][0]["variables"][0]["sequence"].'">';
+ echo ' <div class="headerCell">';
+ if ($spremenljivka['grids'][0]['variables'][0]['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ $img_src = self::$sort_type == 'sort_dsc' ? 'sort_descending' : 'sort_ascending' ;
+ echo '<span class="sort_holder"><span class="faicon '.$img_src.'" title=""></span></span>';
+ }
+ echo '<span>'.$spremenljivka['naslov'].'</span></div>';
+ echo '</th>';
+ }
+
+ //razpotegnjena prazna celica za vse info stolpce (ce trenutno ni vec info col, ampak prestelo pa jih je prej)
+ if($info_cols == false && $info_cnt > 0 && (self::$_VARS['spr_limit'] == 'all' || self::$_VARS['spr_page'] == 1)){
+ echo '<th class="cell_info" colspan="'.$info_cnt.'" title="'.$lang['srv_displaydata_status_details'].'">';
+ echo ' <div class="headerCell">'.$lang['srv_displaydata_status_details'].'</div>';
+ echo '</th>';
+
+ //reset stevec za info col
+ $info_cnt = 0;
+ }
+
+ //ce trenutno ni info col in jih tudi ne steje, potem normalno izrisi stolpec
+ if(($info_cols == false && $info_cnt == 0) || self::$_VARS['spr_page'] > 1){
+ echo '<th class="'.$class.' '.$sortable.' '.$class_sorting.'" colspan="'.$cnt_all.'" title="'.$var_code.''.$spremenljivka['naslov'].'"
+ seq="'.$spremenljivka["grids"][0]["variables"][0]["sequence"].'">';
+ echo ' <div class="headerCell">';
+ if ($spremenljivka['grids'][0]['variables'][0]['sequence'] == self::$sort_seq && self::$sort_seq != null && $sortable !== '') {
+ $img_src = self::$sort_type == 'sort_dsc' ? 'sort_descending' : 'sort_ascending' ;
+ echo '<span class="sort_holder"><span class="faicon '.$img_src.'" title=""></span></span>';
+ }
+ echo '<span style="font-weight:400">'.$var_code.'</span><span> '.$spremenljivka['naslov'].'</span></div>';
+ echo '</th>';
+ }
}
- $spr_cont++;
-
+
+ if($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm')
+ $spr_cont++;
}
}
- echo '</tr><tr>';
+ //ce od podrobnosti statusa naprej ni vec celic, zakljuzi celico
+ //razpotegnjena prazna celica za vse info stolpce (ce trenutno ni vec info col, ampak prestelo pa jih je prej)
+ //prikazi podrobnosti statusa samo na prvi strani
+ if($info_cnt > 0 && self::$_VARS[VAR_SPR_PAGE] == 1){
+ echo '<th class="cell_info" colspan="'.$info_cnt.'" title="'.$lang['srv_displaydata_status_details'].'">';
+ echo ' <div class="headerCell">'.$lang['srv_displaydata_status_details'].'</div>';
+ echo '</th>';
+ }
+
+ echo '</tr>';
+
+
+ /* po novem izkljucimo drugo vrstico v headerju
+ echo '<tr class="row2">';
# colspan za ikonce
if ($stolpci > 0) {
@@ -1502,10 +1642,18 @@ class SurveyDataDisplay{ $spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
+
+ if($spremenljivka['tip'] == 'm')
+ $class = 'cell_info';
+ elseif($spremenljivka['tip'] == 'sm')
+ $class = 'cell_paradata';
+ else
+ $class = 'cell_data';
+
if (isset(self::$_SVP_PV[$spid]) && (count($spremenljivka['grids']) > 0 )) {
if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<th class="'.$class.'" title="'.$lang['srv_line_number'].'" >';
echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
echo '</th>';
}
@@ -1515,70 +1663,130 @@ class SurveyDataDisplay{ foreach ($spremenljivka['grids'] AS $gid => $grid) {
if($spremenljivka['tip'] == 16 || $spremenljivka['tip'] == 19 || $spremenljivka['tip'] == 20){
- echo '<th colspan="'.$grid['cnt_vars'].'" title="'.$grid['variable'].'">';
- echo '<div class="headerCell">'.$grid['variable'].'</div>';
+ echo '<th class="'.$class.'" colspan="'.$grid['cnt_vars'].'" title="'.$grid['variable'].'">';
+ echo ' <div class="headerCell">'.$grid['variable'].'</div>';
echo '</th>';
}
else{
- echo '<th colspan="'.$grid['cnt_vars'].'" title="'.$grid['naslov'].'">';
- echo '<div class="headerCell">'.$grid['naslov'].'</div>';
+ echo '<th class="'.$class.'" colspan="'.$grid['cnt_vars'].'" title="'.$grid['naslov'].'">';
+ echo ' <div class="headerCell">'.$grid['naslov'].'</div>';
echo '</th>';
}
}
}
$spr_cont++;
}
-
}
- echo '</tr><tr>';
+ echo '</tr>'; */
+
+
+ echo '<tr class="row3">';
# colspan za ikonce
if ($stolpci > 0) {
- echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'> </td>';
+
+ $show_mass_delete = (self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1) ? true : false;
+
+ echo '<th class="data_edit" '.($stolpci > 1 ? ('colspan="'.$stolpci.'"') : '').' '/* .($show_mass_delete ? 'style="min-width:190px"' : '') */.'>';
+
+ // Editiranje na dnu - brisanje vec userjev hkrati...
+ if($show_mass_delete){
+ self::displayMassDelete();
+ }
+
+ echo '</th>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid"> </th>';
+ // vedno na prvo mesto prikazi line number, ce je vklucen
+ if(self::$showLineNumber/* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th class="cell_info" title="'.$lang['srv_line_number'].'" spr_id="lineNo">';
+ echo ' <div class="dataCell">'./* $lang['srv_line_number']. */'</div>';
+ echo '</th>';
+ }
+
$spr_cont = 0;
$system_columns = array();
+
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
+
+ $spremenljivka['tip'] = isset($spremenljivka['tip']) ? $spremenljivka['tip'] : '';
+
+ if($spremenljivka['tip'] == 'm')
+ $class = 'cell_info';
+ elseif($spremenljivka['tip'] == 'sm')
+ $class = 'cell_paradata';
+ else
+ $class = 'cell_data';
+
if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" spr_id="lineNo">';
- echo '<div class="dataCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
-
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
- if (count ($grid['variables']) > 0) {
+ if (isset($grid['variables']) && count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
- echo '<th title="'.$variable['naslov'].($variable['other'] ? ' (text)' : '').'"'
+
+ //koda, ki se bo prikazala v oklepaju pred naslovom
+ $var_code = ($spremenljivka['tip'] == 16 || $spremenljivka['tip'] == 19 || $spremenljivka['tip'] == 20) ?
+ $grid['variable'] : $variable['variable'];
+
+ //text naslova po novem
+ $title_text = $variable['naslov'];
+ //za posebne tipe info in parapodatke prilagodi text naslova
+ if($spremenljivka['tip'] == 'm' || $spremenljivka['tip'] == 'sm'){
+ //status se prikaze v zgornjem header
+ if($var_code == 'status' || $var_code == 'invitation')
+ $title_text = '';
+ if($var_code == 'recnum')
+ $title_text = $variable['naslov'].' ('.$grid['naslov'].')';
+ //datum zacetek in konec
+ if($var_code == 't_insert' || $var_code == 't_edit')
+ $title_text = $grid['naslov'].' '.$variable['naslov'];
+ //datum glede na stran
+ if(substr($var_code, 0, 5) === "date_")
+ $title_text = $grid['naslov'].' ('.$variable['naslov'].')';
+ }
+
+ //za info in parapodatke ne prikazi kode
+ $var_code = ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') ? '('.$var_code.') ' : '';
+
+ //za delovanje sortinga
+ $class_sorting = '';
+ if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ $class_sorting = self::$sort_type !== null ? self::$sort_type : '' ;
+ }
+
+ //v stolpcih, kjer je druga vrstica glave prazna, onemogoci sortiranje (sortira se v prvi glavi)
+ $sortable = (!in_array($spremenljivka['tip'], array(1,3,7,8,21)) && $spid != 'status' && $spid != 'invitation') ? 'sortable' : '';
+
+ echo '<th class="'.$class.' '.$sortable.' '.$class_sorting.'" title="'.$var_code.''.$title_text.(isset($variable['other']) && $variable['other'] == '1' ? ' (text)' : '').'"'
.' seq="'.$variable['sequence'].'"';
-
+
if ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
echo ' spr_id="'.substr($spid, 0, strpos($spid, '_')).'"';
} else {
echo ' spr_id="'.$spid.'"';
}
- echo ($spremenljivka['inline_edit']?' inline_edit=1':'')
+ echo (isset($spremenljivka['inline_edit']) && $spremenljivka['inline_edit'] == '1' ? ' inline_edit=1' : '')
// .' inline_edit='.($spremenljivka['inline_edit']?$spremenljivka['inline_edit']:'0')
.($variable['sequence'] == self::$sort_seq && self::$sort_seq != null ? ' class="hover '.self::$sort_type.'"': '')
.'>';
+
+ // Zabelezimo sekvenco sistemskih identifikatorjev da jih pobarvamo
+ if(isset($spremenljivka['is_system']) && $spremenljivka['is_system'] == 1)
+ $system_columns[] = $spremenljivka['sequences'];
- if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ echo '<div class="dataCell">';
+ if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null && $sortable !== '') {
$img_src = self::$sort_type == 'sort_dsc' ? 'sort_descending' : 'sort_ascending' ;
echo '<span class="sort_holder"><span class="faicon '.$img_src.'" title=""></span></span>';
}
+ echo '<span style="font-weight:400">'.(!in_array($spremenljivka['tip'], array(1,3,7,8,21)) ? $var_code : '').'</span>'.
+ (!in_array($spremenljivka['tip'], array(1,3,7,8,21)) ? $title_text : '');
- // Zabelezimo sekvenco sistemskih identifikatorjev da jih pobarvamo
- if($spremenljivka['is_system'] == 1)
- $system_columns[] = $spremenljivka['sequences'];
-
- echo '<div class="dataCell">'.$variable['naslov'];
- if ($variable['other'] == 1) {
+ if (isset($variable['other']) && $variable['other'] == 1) {
echo ' (text)';
}
@@ -1594,11 +1802,15 @@ class SurveyDataDisplay{ }
}
}
- $spr_cont++;
+
+ if($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm')
+ $spr_cont++;
}
}
+
echo'</tr>';
+
echo '</thead>';
@@ -1619,20 +1831,20 @@ class SurveyDataDisplay{ //$sort_numeric = '-n ';
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (count($spremenljivka['grids']) > 0 ) {
+ if (isset($spremenljivka['grids']) && count($spremenljivka['grids']) > 0 ) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
if (count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
if (self::$sort_seq == $variable['sequence']) {
// za datumska polja je potrebno malo potelovadit
- if ($variable['spss'] == 'DATETIMEw' || $variable['sortType'] == 'date') {
+ if (isset($variable['spss']) && $variable['spss'] == 'DATETIMEw' || isset($variable['sortType']) && $variable['sortType'] == 'date') {
#12.09.2011
$sortString = '-k '.self::$sort_seq.'.7,'.self::$sort_seq.'.10 -k'.self::$sort_seq.'.4,'.self::$sort_seq.'.5 -k'.self::$sort_seq.'.1,'.self::$sort_seq.'.2';
}
// za numericne spremenljivke in recnum uporabimo parameter -n da ne sortira po stringu
- if ($variable['sortType'] == 'number') {
+ if (isset($variable['sortType']) && $variable['sortType'] == 'number') {
$sort_numeric = '-n ';
}
}
@@ -1655,82 +1867,65 @@ class SurveyDataDisplay{ }
// polovimo vrstice z statusom 5,6 in jih damo v začasno datoteko
if (IS_WINDOWS) {
- #$cmdLn1 = 'awk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName.' > '.$tmp_files['filtred_status'];
- #$out1 = shell_exec($cmdLn1);
- # če smo predhodno sortirali
- if (self::$do_sort == true)
- {
+
+ if (self::$do_sort == true){
$_command .= ' | gawk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" ';
#$_command = 'awk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName;
}
- else
- {
+ else{
$_command = 'gawk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName;
}
+ }
+ else {
- } else {
- #$cmdLn1 = 'awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' '.self::$dataFileName.' > '.$tmp_files['filtred_status'];
- #$out1 = shell_exec($cmdLn1);
# če smo predhodno sortirali
- if (self::$do_sort)
- {
+ if (self::$do_sort){
$_command .= ' | awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' ';
}
- else
- {
+ else{
$_command = 'awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' '.self::$dataFileName;
}
-
}
// pobrisemo vrstice ki ne vsebujejo iskalnega stringa (ce searchamo) in rdece boldamo rezultat
$search = isset($_SESSION['sid_'.self::$sid]['data_search_filter']) ? $_SESSION['sid_'.self::$sid]['data_search_filter'] : '';
if($search != ''){
if (IS_WINDOWS) {
- $_command .= ' | sed "/'.$search.'/!d"';
- $_command .= ' | sed "s*'.$search.'*<span class=\"highlighted\">'.$search.'</strong>*g"';
- } else {
- $_command .= ' | sed \'/'.$search.'/!d\'';
- $_command .= ' | sed \'s*'.$search.'*<span class=\"highlighted\">'.$search.'</strong>*g\'';
+ $_command .= ' | sed "/'.$search.'/I!d"';
+ $_command .= ' | sed "s*'.$search.'*<span class=\"highlighted\">&</span>*Ig"';
+
+ }
+ else {
+ $_command .= ' | sed \'/'.$search.'/I!d\'';
+ $_command .= ' | sed "s*'.$search.'*<span class=\"highlighted\">&</span>*Ig"';
+
}
}
-
+
// paginacija po stolpcih (spremenljivkah)
if (IS_WINDOWS) {
- #$cmdLn1_1 = 'cut -d "|" -f 1,'.self::$_VARIABLE_FILTER.' '.$tmp_files['filtred_status'].' > '.$tmp_files['filtred_spr_pagination'];
- #$out1 = shell_exec($cmdLn1_1);
$_command .= ' | cut -d "|" -f 1,'.self::$_VARIABLE_FILTER;
- } else {
- #$cmdLn1_1 = 'cut -d \'|\' -f 1,'.self::$_VARIABLE_FILTER.' '.$tmp_files['filtred_status'].' > '.$tmp_files['filtred_spr_pagination'];
- #$out1 = shell_exec($cmdLn1_1);
+ }
+ else {
$_command .= ' | cut -d \'|\' -f 1,'.self::$_VARIABLE_FILTER;
}
if (self::$_REC_LIMIT != '') {
- #paginating
+
+ #paginating
if (IS_WINDOWS) {
- #$cmdLn2 = 'awk '.self::$_REC_LIMIT.' '.$tmp_files['filtred_spr_pagination'].' > '.$tmp_files['filtred_pagination'];
- #$out2 = shell_exec($cmdLn2);
- $_command .= ' | awk '.self::$_REC_LIMIT;
- } else {
- #$cmdLn2 = 'awk '.self::$_REC_LIMIT.' '.$tmp_files['filtred_spr_pagination'].' > '.$tmp_files['filtred_pagination'];
- #$out2 = shell_exec($cmdLn2);
- $_command .= ' | awk '.self::$_REC_LIMIT;
- }
- #$file_sufix = 'filtred_pagination';
- } else {
- #$file_sufix = 'filtred_spr_pagination';
+ $_command .= ' | awk '.self::$_REC_LIMIT;
+ }
+ else {
+ $_command .= ' | awk '.self::$_REC_LIMIT;
+ }
}
// zamenjamo | z </td><td>
if (IS_WINDOWS) {
- #$cmdLn3 = 'sed "s*'.STR_DLMT.'*</td><td>*g" '.$tmp_files[$file_sufix].' > '.$tmp_files['filtred_sed'];
- #$out3 = shell_exec($cmdLn3);
$_command .= ' | sed "s*'.STR_DLMT.'*'.STR_LESS_THEN.'/td'.STR_GREATER_THEN.STR_LESS_THEN.'td'.STR_GREATER_THEN.'*g" >> '.$folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
-
- } else {
- #$cmdLn3 = 'sed \'s*'.STR_DLMT.'*</td><td>*g\' '.$tmp_files[$file_sufix].' > '.$tmp_files['filtred_sed'];
- #$out3 = shell_exec($cmdLn3);
+ }
+ else {
$_command .= ' | sed \'s*'.STR_DLMT.'*</td><td>*g\' >> '
.$folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
}
@@ -1742,12 +1937,14 @@ class SurveyDataDisplay{ fclose($file_handler);
$out_command = shell_exec($folder.'cmd_'.self::$sid.'_to_run.bat');
unlink($folder.'cmd_'.self::$sid.'_to_run.bat');
- } else {
+ }
+ else {
$out_command = shell_exec($_command);
}
+
echo '<tbody class="scrollContent'.(self::$_VARS[VAR_CODING]?' coding':'').'">';
- #$f = fopen ($tmp_files['filtred_sed'], 'r');
+
if (file_exists($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT)) {
if(self::$_VARS[VAR_REC_ON_PAGE] == 'all'){
@@ -1763,22 +1960,26 @@ class SurveyDataDisplay{ $f = fopen ($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT, 'r');
while ($line = fgets ($f)) {
- echo '<tr>';
+ echo '<tr class="row_data">';
+ if ($stolpci > 0 ) {
+ if (self::$displayEditIcons['dataIcons_edit'] == true) {
+ // checkbox za brisanje vecih vrstic hkrati
+ echo '<td class="data_edit delete_checkbox" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" id="delete_data_row_'.$cntLines.'" class="delete_data_row" /><label for="delete_data_row_'.$cntLines.'"></label></td>';
+ }
+ }
if ((int)$display1kaIcon == 1) {
- echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon quick_view icon-as_link"></span></td>';
+ echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon monitor blue"></span></td>';
}
if ($stolpci > 0 ) {
if (self::$displayEditIcons['dataIcons_edit'] == true) {
- // checkbox za brisanje vecih vrstic hkrati
- echo '<td class="data_edit" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" class="delete_data_row" /></td>';
- echo '<td class="data_edit"><span class="faicon delete_circle icon-orange_link" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
- echo '<td class="data_edit"><span class="faicon edit_square icon-as_link" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
- echo '<td class="data_edit"><span class="faicon edit smaller icon-as_link" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon delete" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
}
if (self::$displayEditIcons['dataIcons_write'] == true) {
- echo '<td class="data_edit"><span class="faicon pdf icon-as_link" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
- echo '<td class="data_edit"><span class="faicon rtf icon-as_link" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon pdf" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon rtf" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
// Evoli ikona (ce je vklopljen modul)
if(SurveyInfo::getInstance()->checkSurveyModule('evoli')) {
@@ -1818,14 +2019,18 @@ class SurveyDataDisplay{ echo '</tr>';
$cntLines++;
}
- } else {
+ }
+ else {
echo 'File does not exist (err.No.1)! :'.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
- #echo $folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
}
+
echo '</tbody>';
+
echo '</table>';
+
echo '</div>'; // end div tableContainer
+
/**
* kliki na ikonice za urejanje in izpis so definirane v script_analiza.js, analiza_init();
*/
@@ -1833,74 +2038,71 @@ class SurveyDataDisplay{ // JS za urejanje vnosov (click in hover) (funkciji sta definirani v postProcess.js)
?>
<script>
- $('#dataTableScroller').followTo($("#dataTable").position().top - $("#dataTableScroller").height()-25);
- dataTableResize(<?=self::$sid?>);
- $('#dataTable').bind('contextmenu', function (event) { data_preview_content(event); return false; } );
- <?php
- if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING])
- {
- ?>
- $('#dataTable td').click( function (event) { edit_data(event); } );
- $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
- edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- } elseif (self::$_VARS[VAR_CODING]) {
- ?>
- $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
-
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- } else {
- ?>
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- }
-
- ?>
- $('#dataTable td.enkaIcon span.quick_view').click( function (event) { showSurveyAnswers(event); } );
- var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
- <?php
- if (self::$_VARS[VAR_META]) {
- echo "postProcessAddLurkerTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? (4+(int)self::$_VARS[VAR_EMAIL]) : (3+(int)self::$_VARS[VAR_EMAIL])).");\n";
- }
-
- # pobarvamo celice in dodamo title za statuse
- echo "postProcessAddTitles();\n";
- echo "postProcessAddMetaTitles();\n";
-
- // Pobarvamo sistemske identifikatorje
- if(self::$_HEADERS['_settings']['force_show_hiden_system'] == '1')
- echo "postProcessAddSystem(".json_encode($system_columns).");\n";
-
- if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
- echo "postProcessAddRelevanceTitles();\n";
- }
- if (self::$_VARS[VAR_EMAIL]) {
- echo "postProcessAddEmailTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? 3 : 2).");\n";
- }
-
- ?>
+
+ <?php
+ if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING]){
+ ?>
+ $('#dataTable td').click( function (event) { edit_data(event); } );
+ $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
+ edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
+
+ <?php
+ } elseif (self::$_VARS[VAR_CODING]) {
+ ?>
+ $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
+ <?php
+ }
+ ?>
+
+ $('#dataTable tr th.sortable').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
+ $('#dataTable tr th.sortable').on('click', function(event) { data_header_click(event); } );
+ $('#dataTable tr th.sortable div span').on('click', function(event) { event.stopPropagation(); $(this).closest('th').click() } );
+
+ $('#dataTable td.enkaIcon span.monitor').click( function (event) { showSurveyAnswers(event); } );
+ var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
+ <?php
+
+ if (self::$_VARS[VAR_RELEVANCE]) {
+ $column = 1;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ if(self::$canDisplayRelevance) $column ++;
+ echo "postProcessAddLurkerTitles(".$column.");\n";
+ }
+
+ # pobarvamo celice in dodamo title za statuse
+ echo "postProcessAddTitles();\n";
+ echo "postProcessAddMetaTitles();\n";
+
+ // Pobarvamo sistemske identifikatorje
+ if(self::$_HEADERS['_settings']['force_show_hiden_system'] == '1')
+ echo "postProcessAddSystem(".json_encode($system_columns).");\n";
+
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
+ $column = 1;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ echo "postProcessAddRelevanceTitles(".$column.");\n";
+ }
+ if (self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) {
+ echo "postProcessAddEmailTitles(".(self::$showLineNumber ? 3 : 2).");\n";
+ }
+
+ ?>
</script>
<?php
+
if ($f) {
fclose($f);
}
if (file_exists($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT)) {
unlink($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT);
}
- if ($_GET['debug'] == 1) {
+ if (isset($_GET['debug']) && $_GET['debug'] == 1) {
print_r("<pre>".$_command."</pre>");
}
-
- // Editiranje na dnu - brisanje vec userjev hkrati...
-
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1){
- self::displayBottomEdit();
- }
}
static public function DisplayDataMultipleTable() {
@@ -1936,8 +2138,7 @@ class SurveyDataDisplay{ foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if ( isset(self::$_SVP_PV[$spid]) && is_numeric($spremenljivka['tip']) ) {
-
- //$spr_id = explode('_', $spid)[0]; // PHP 5.4
+
$spr_id = explode('_', $spid);
$spr_id = $spr_id[0];
@@ -1957,23 +2158,18 @@ class SurveyDataDisplay{ $sequences[$spr] = explode('_', $multiple[$spr]['sequences'] ); // vsi stolpci trenutne spremenljivke (4 - 12)
$subseq[$spr] = count($multiple[$spr]['grids']); // stevilo vrstic v vprasanju (4 - 4) (to je za vsa vprasanja enako)
$cols[$spr] = round(count($sequences[$spr])/$subseq[$spr], 0); // koliko stolpcev zasede enkratna ponovitev vprasanja (1 - 3)
-
- #echo "\n\r vars: ".count($sequences[$spr]).' '.$subseq[$spr].' '.$cols[$spr].' '.$dataoffset."\n\r";
-
}
-
$_svp_pv['uid'] = 'uid';
- //self::$_SVP_PV = array_merge($_svp_pv, self::$_SVP_PV);
+
+
#izpišemo tabelo
- echo '<br/>';
echo '<div id="tableContainer" class="tableContainer">';
# div v katerem po potrebi prikazujemo gumbe za skrolanje levo in desno
echo '<div id="dataTableScroller">';
- echo '<span class="pointer halfCircleLeft" onclick="dataTableScroll(\'left\');return false;"><</span>';
- echo ' ';
- echo '<span class="pointer halfCircleRight" onclick="dataTableScroll(\'right\');return false;">></span>';
+ echo ' <div class="dataTable_arrow left" onclick="dataTableScroll(\'left\'); return false;"><span class="faicon arrow_large2_l"></span></div>';
+ echo ' <div class="dataTable_arrow right" onclick="dataTableScroll(\'right\'); return false;"><span class="faicon arrow_large2_r"></span></div>';
echo '</div>';
$display1kaIcon = self::$displayEditIcons['dataIcons_quick_view'] ;
@@ -2002,6 +2198,10 @@ class SurveyDataDisplay{ echo '<col class="data_edit"'.($stolpci > 1 ? (' span="'.$stolpci.'"') : '').'>';
}
+ if (self::$showLineNumber /* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<col>';
+ }
+
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
@@ -2013,11 +2213,7 @@ class SurveyDataDisplay{ $repeat = false;
else
$repeat = true;
-
- if (self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<col>';
- }
-
+
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
@@ -2054,6 +2250,12 @@ class SurveyDataDisplay{ # dodamo skrit stolpec uid
echo '<th class="data_uid"> </th>';
+
+ if (self::$showLineNumber/* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
+ echo '</th>';
+ }
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
@@ -2069,11 +2271,6 @@ class SurveyDataDisplay{ $colspan = $spremenljivka['cnt_all'];
}
- if (self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
echo '<th colspan="'.$colspan.'" title="'.$spremenljivka['naslov'].'">';
@@ -2095,6 +2292,12 @@ class SurveyDataDisplay{ # dodamo skrit stolpec uid
echo '<th class="data_uid"> </th>';
+ if(self::$showLineNumber /* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
+ echo '</th>';
+ }
+
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && (count($spremenljivka['grids']) > 0 )) {
@@ -2107,12 +2310,6 @@ class SurveyDataDisplay{ else
$repeat = true;
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
-
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
@@ -2132,14 +2329,28 @@ class SurveyDataDisplay{ # colspan za ikonce
if ($stolpci > 0) {
- //for ($i=0; $i<$stolpci; $i++)
- // echo '<th class="data_edit"> </th>';
- echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'> </th>';
+
+ $show_mass_delete = (self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1) ? true : false;
+
+ echo '<th class="data_edit" '.($stolpci > 1 ? ('colspan="'.$stolpci.'"') : '').' '/* .($show_mass_delete ? 'style="min-width:190px"' : '') */.'>';
+
+ // Editiranje na dnu - brisanje vec userjev hkrati...
+ if($show_mass_delete){
+ self::displayMassDelete();
+ }
+
+ echo '</th>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid"> </th>';
+ if (self::$showLineNumber /* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
+ echo '</th>';
+ }
+
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
@@ -2152,18 +2363,19 @@ class SurveyDataDisplay{ else
$repeat = true;
- if (self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
-
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
if (count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
- echo '<th title="'.$variable['naslov'].($variable['other'] ? ' (text)' : '').'"'
+
+ //za delovanje sortinga
+ $class_sorting = '';
+ if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ $class_sorting = self::$sort_type !== null ? self::$sort_type : '' ;
+ }
+
+ echo '<th class="'.$class_sorting.'" title="'.$variable['naslov'].($variable['other'] ? ' (text)' : '').'"'
.' seq="'.$variable['sequence'].'"';
if ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
@@ -2435,21 +2647,24 @@ class SurveyDataDisplay{ echo '<tr>';
-
+ if ($stolpci > 0 ) {
+ if (self::$displayEditIcons['dataIcons_edit'] == true) {
+ // checkbox za brisanje vecih vrstic hkrati
+ echo '<td class="data_edit delete_checkbox" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" id="delete_data_row_'.$cntLines.'" class="delete_data_row" /><label for="delete_data_row_'.$cntLines.'"></label></td>';
+ }
+ }
if ((int)$display1kaIcon == 1) {
- echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon quick_view icon-as_link"></span></td>';
+ echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon monitor"></span></td>';
}
if ($stolpci > 0 ) {
if (self::$displayEditIcons['dataIcons_edit'] == true) {
- // checkbox za brisanje vecih vrstic hkrati
- echo '<td class="data_edit" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" class="delete_data_row" /></td>';
- echo '<td class="data_edit"><span class="faicon delete_circle icon-orange_link" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
- echo '<td class="data_edit"><span class="faicon edit_square icon-as_link" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
- echo '<td class="data_edit"><span class="faicon edit smaller icon-as_link" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon delete" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
}
if (self::$displayEditIcons['dataIcons_write'] == true) {
- echo '<td class="data_edit"><span class="faicon pdf icon-as_link" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
- echo '<td class="data_edit"><span class="faicon rtf icon-as_link" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon pdf" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon rtf" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
}
}
@@ -2481,51 +2696,62 @@ class SurveyDataDisplay{ // JS za urejanje vnosov (click in hover) (funkciji sta definirani v postProcess.js)
?>
- <script>
- $('#dataTableScroller').followTo($("#dataTable").position().top - $("#dataTableScroller").height()-25);
- dataTableResize(<?=self::$sid?>);
- $('#dataTable').bind('contextmenu', function (event) { data_preview_content(event); return false; } );
- <?php
- if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING])
- {
- ?>
- $('#dataTable td').click( function (event) { edit_data(event); } );
- $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
- edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- } elseif (self::$_VARS[VAR_CODING]) {
- ?>
- $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
- <?php
- } else {
- ?>
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- }
-
- ?>
- $('#dataTable td.enkaIcon span.quick_view').click( function (event) { showSurveyAnswers(event); } );
- var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
- <?php
- if (self::$_VARS[VAR_META]) {
- echo "postProcessAddLurkerTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? (4+(int)self::$_VARS[VAR_EMAIL]) : (3+(int)self::$_VARS[VAR_EMAIL])).");\n";
- }
-
- # pobarvamo celice in dodamo title za statuse
- echo "postProcessAddMetaTitles();\n";
-
- if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
- echo "postProcessAddRelevanceTitles();\n";
- }
- if (self::$_VARS[VAR_EMAIL]) {
- echo "postProcessAddEmailTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? 3 : 2).");\n";
- }
- ?>
+ <script>
+
+ <?php
+ if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING]){
+ ?>
+ $('#dataTable td').click( function (event) { edit_data(event); } );
+ $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
+ edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
+ $('#dataTable tr th.sortable').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
+ $('#dataTable tr th.sortable').on('click', function(event) { data_header_click(event); } );
+ $('#dataTable tr th.sortable div span').on('click', function(event) { event.stopPropagation(); $(this).closest('th').click() } );
+
+ <?php
+ } elseif (self::$_VARS[VAR_CODING]) {
+ ?>
+ $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
+ <?php
+ } else {
+ ?>
+ $('#dataTable tr th.sortable').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
+ $('#dataTable tr th.sortable').on('click', function(event) { data_header_click(event); } );
+ $('#dataTable tr th.sortable div span').on('click', function(event) { event.stopPropagation(); $(this).closest('th').click() } );
+
+ <?php
+ }
+
+ ?>
+ $('#dataTable td.enkaIcon span.monitor').click( function (event) { showSurveyAnswers(event); } );
+ var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
+ <?php
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
+ $column = 2;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ echo "postProcessAddLurkerTitles(".$column.");\n";
+ }
+
+ # pobarvamo celice in dodamo title za statuse
+ echo "postProcessAddMetaTitles();\n";
+
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
+ $column = 1;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ echo "postProcessAddRelevanceTitles(".$column.");\n";
+ }
+ if (self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) {
+ echo "postProcessAddEmailTitles(".(self::$showLineNumber ? 3 : 2).");\n";
+ }
+ ?>
</script>
- <?php
+ <?php
+
+
if ($f) {
fclose($f);
}
@@ -2535,11 +2761,6 @@ class SurveyDataDisplay{ if ($_GET['debug'] == 1) {
print_r("<pre>".$_command."</pre>");
}
-
- // Editiranje na dnu - brisanje vec userjev hkrati...
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1){
- self::displayBottomEdit();
- }
}
public static function url_to_link($text) {
@@ -2562,6 +2783,9 @@ class SurveyDataDisplay{ return false;
}
+ // Shranimo jezik vmesnika
+ $lang_old = $lang;
+
include_once('../../main/survey/app/global_function.php');
new \App\Controllers\SurveyController(true);
save('usr_id', self::$usr_id);
@@ -2571,7 +2795,7 @@ class SurveyDataDisplay{ } else {
$quick_view = true;
}
-
+
$rowa = SurveyInfo::getInstance()->getSurveyRow();
if ($quick_view) {
@@ -2592,22 +2816,11 @@ class SurveyDataDisplay{ echo "<script>function submitForm(){}</script>"."\n";
}
+
echo '<div id="edit_survey_data">';
- echo '<div class="inner quick_edit">';
- // title
- echo '<div class="quick_edit_title">';
-
- //echo $rowa['naslov'];
- if (self::$quickEdit_recnum[3]['hasPrev'] == true) {
- echo '<a href="#" onClick="location.href=\''.self::$quickEdit_recnum[0].'\'" title="'.$lang['srv_prev_resp'].'"><span class="faicon arrow2_l pointer"></span></a>';
- }
- echo 'Recnum '.self::$quickEdit_recnum[2];
- if (self::$quickEdit_recnum[3]['hasNext'] == true) {
- echo '<a href="#" onClick="location.href=\''.self::$quickEdit_recnum[1].'\'" title="'.$lang['srv_next_resp'].'"><span class="faicon arrow2_r pointer"></span></a>';
- }
-
- echo '</div>';
+
+ echo '<div class="quick_edit_inner">';
if ($quick_view == false) {
echo '<form name="vnos" id="vnos" method="post" action="../survey/index.php?anketa='.$_GET['anketa'].'&a=data&m=quick_edit&usr_id='.$_GET['usr_id'].'&quick_view=0&post=1" enctype="multipart/form-data">'."\n";
@@ -2693,6 +2906,7 @@ class SurveyDataDisplay{ # V VPOGLEDU NE FILTRIRAMO SPREMENLJIVK (v.v.: 27.11.2011)
#$tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables($_currentVariableProfile);
+ $tmp_svp_pv = array();
# č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
@@ -2726,33 +2940,38 @@ class SurveyDataDisplay{ while (get('grupa') != \App\Controllers\FindController::getInstance()->findNextGrupa() &&
(\App\Controllers\FindController::getInstance()->findNextGrupa() > 0 || (get('loop_id') != null && \App\Controllers\FindController::getInstance()->findNextLoopId() != null)));
}
- if ($quick_view == false) {
- //echo '<input type="submit" value="Shrani" /> ';<a href="#" onclick="document.forms['myFormName'].submit(); return false;">...</a>
- echo '<span class="floatRight spaceLeft" ><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="document.forms[\'vnos\'].submit(); return false;"><span>' . $lang['save'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" ><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="../survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'"><span>Nazaj na podatke</span></a></div></span>';
- #echo '</form>'."\n";
- }
- else{
+ if ($quick_view == false) {
echo '</form>'."\n";
}
- echo '</div>'; # inner
+ // restavriramo jezik vmesnika ce je slucajno drugacen od ankete
+ $lang = $lang_old;
- echo '<div id="quick_edit_title">';
+ echo '<div class="quick_edit_bottom_line">';
self::displayVnosIcons();
- echo '</div>';
-
- echo '<br /><br /><br /><br />';
-
+
+ if ($quick_view == false) {
+ echo '<div class="button_holder">';
+ echo ' <a href="../survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'"><button class="medium white-blue">'.$lang['srv_back_to_data'].'</button></a>';
+ echo ' <button class="medium blue" onclick="document.forms[\'vnos\'].submit(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+ }
+
echo '</div>';
+ echo '</div>'; # inner
+
+ // Div na desni z metapodatki
+ echo '<div class="quick_edit_meta_holder">';
+ echo ' <div id="quick_edit_meta">';
+ self::displayQuickEditMeta();
+ echo ' </div>';
+ echo '</div>';
- // Div na desni z metapodatki
- echo '<div id="quick_edit_meta">';
- self::displayQuickEditMeta();
echo '</div>';
+
// Preverimo ce gre za prvo urejanje - potem avtomatsko ustvarimo arhiv podatkov
if ($quick_view == false && isset($_GET['post']) && $_GET['post'] == '1') {
ob_flush();
@@ -2766,18 +2985,19 @@ class SurveyDataDisplay{ global $lang;
global $site_path;
- //echo '<h2>'.$lang['srv_data_title_quick_view'].'</h2>';
-
if (self::$dataFileStatus == FILE_STATUS_NO_DATA
|| self::$dataFileStatus == FILE_STATUS_NO_FILE
|| self::$dataFileStatus == FILE_STATUS_SRV_DELETED){
return false;
}
-
+
+ // Paginacija
self::displayQuickEditPagination();
- echo '<div id="div_analiza_filtri_right" class="floatRight vpogled">';
+
+ // Filtri - ?? todo ??
+ /*echo '<div id="div_analiza_filtri_right" class="floatRight vpogled">';
echo '<ul>';
# div za filtre statusov
SurveyStatusProfiles::DisplayLink(false);
@@ -2809,11 +3029,18 @@ class SurveyDataDisplay{ if ($doNewLine) {
echo '<br/>';
- }
+ }*/
+
- echo '<div id="quick_edit_title">';
+ // Zgrnja vrstica z ikonami in naslovom
+ echo '<div id="quick_edit_top_line">';
self::displayVnosIcons();
+
+ // title
+ echo '<div class="quick_edit_title">';
+ echo $lang['srv_recnum_long'].': '.self::$quickEdit_recnum[2];
+ echo '</div>';
echo '</div>';
}
@@ -2870,27 +3097,19 @@ class SurveyDataDisplay{ $current = count($uids)-1;
}
- echo '<div id="pagination" class="floatLeft">';
+ echo '<div class="pagination_holder">';
+ echo ' <div class="pagination">';
- # povezava -10
- /*if ($all > 10) {
- if ($current - 10 >= 0) {
- echo('<div><a href="'.$baseUrl.$uids[$current - 10].'">-10</a></div>');
- } else {
- # brez href povezave
- echo('<div class="disabledPage">-10</div>');
- }
- }*/
-
$controls=array('hasPrev'=>true,'hasNext'=>true);
# povezava na prejšnjo stran
- $prev_page = $uids[$current - 1] ? $uids[$current - 1] :$uids[$current];
+ $prev_page = ($current > 0 && $uids[$current - 1]) ? $uids[$current - 1] :$uids[$current];
if( ($current - 1) >= 0) {
- echo('<div><a href="'.$baseUrl.$prev_page.'"><span class="faicon pagination_left icon-blue"></span></a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$prev_page.'"><div class="arrow left"><span class="faicon pagination_left"></span></div></a>';
+ }
+ else {
# brez href povezave
- echo('<div class="disabledPage"><span class="faicon pagination_left icon-blue_soft"></span></div>');
+ echo '<div class="arrow left disabledPage"><span class="faicon pagination_left"></span></div>';
$controls['hasPrev'] = false;
}
@@ -2907,38 +3126,32 @@ class SurveyDataDisplay{ }
if($a == $current) {
# brez href povezave
- echo('<div class="currentPage">'.($a+1).'</div>');
- } else {
- echo('<div><a href="'.$baseUrl.$uids[$a].'">'.($a+1).'</a></div>');
+ echo '<div class="page_number currentPage">'.($a+1).'</div>';
+ }
+ else {
+ echo '<a href="'.$baseUrl.$uids[$a].'"><div class="page_number">'.($a+1).'</div></a>';
}
- } else {
+ }
+ else {
$skipped = true;
}
}
# povezava na naslednjo stran
- $next_page = ($uids[$current + 1]) ? $uids[$current + 1] : $uids[$current];
+ $next_page = (isset($uids[$current + 1]) && $uids[$current + 1]) ? $uids[$current + 1] : $uids[$current];
if(($current + 1) < $all) {
- echo('<div><a href="'.$baseUrl.$next_page.'"><span class="faicon pagination_right icon-blue"></span></a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$next_page.'"><div class="arrow right"><span class="faicon pagination_right"></span></div></a>';
+ }
+ else {
# brez href povezave
- echo('<div class="disabledPage"><span class="faicon pagination_right icon-blue_soft"></span></div>');
+ echo '<div class="arrow right disabledPage"><span class="faicon pagination_right"></span></div>';
$controls['hasNext'] = false;
}
- /*if ($all > 10) {
- if ($current + 10 < $all) {
- echo('<div><a href="'.$baseUrl.$uids[$current + 10].'">+10</a></div>');
- } else {
- # brez href povezave
- echo('<div class="disabledPage">+10</div>');
- }
- }*/
-
+ echo ' </div>';
echo '</div>';
// vrnemo link na prejsnega, link na naslednjega in recnum trenutnega
- //return array($baseUrl.$prev_page, $baseUrl.$next_page, $uid_rec[self::$usr_id], $controls);
self::$quickEdit_recnum = array($baseUrl.$prev_page, $baseUrl.$next_page, $uid_rec[self::$usr_id], $controls);
}
else {
@@ -3003,14 +3216,14 @@ class SurveyDataDisplay{ // jezik
// Dobimo vse jezike za katere obstaja jezikovna datoteka
include_once($site_path.'lang/jeziki.php');
- $jeziki = $lang_all_global['ime'];
+ $jeziki = isset($lang_all_global['ime']) ? $lang_all_global['ime'] : "";
$jeziki['0'] = $lang['language'];
echo '<tr><td class="left">'.$lang['lang'].':</td>';
- echo '<td class="right">'.$jeziki[$rowu['language']].'</td></tr>';
+ echo '<td class="right">'.isset($jeziki[$rowu['language']]) ? $jeziki[$rowu['language']] : "".'</td></tr>';
}
// status
- echo '<tr><td class="left">'.$lang['status'].':</td>';
+ echo '<tr><td class="left">'.$lang['status'].'</td>';
echo '<td class="right">'.($rowu['last_status'] ? $rowu['last_status'] : ' ').'</td></tr>';
// lurker
@@ -3042,21 +3255,19 @@ class SurveyDataDisplay{ echo '<td class="right">'.$text.'</td></tr>';
// preberemo popravljanje po straneh
- $sqlG = sisplet_query("SELECT ug.time_edit, g.naslov FROM srv_user_grupa".self::$db_table." ug, srv_grupa g WHERE g.ank_id = '".self::$sid."' AND ug.usr_id = '".self::$usr_id."' AND g.id = ug.gru_id ORDER BY g.vrstni_red ASC");
+ $sqlG = sisplet_query("SELECT ug.time_edit, g.naslov, g.vrstni_red FROM srv_user_grupa".self::$db_table." ug, srv_grupa g WHERE g.ank_id = '".self::$sid."' AND ug.usr_id = '".self::$usr_id."' AND g.id = ug.gru_id ORDER BY g.vrstni_red ASC");
while($rowG = mysqli_fetch_array($sqlG)){
$datetime = strtotime($rowG['time_edit']);
$text = date("d.m.Y, H:i:s", $datetime);
- echo '<tr><td class="left">'.$rowG['naslov'].':</td>';
+ echo '<tr><td class="left">'.$lang['srv_stran'].' '.$rowG['vrstni_red'].':</td>';
echo '<td class="right">'.$text.'</td></tr>';
}
- if ( $admin_type <= 1) {
-
+ if ( $admin_type <= 1) {
echo '<tr><td class="left">'.$lang['srv_sc_txt1'].':</td>';
- echo '<td class="right"><a href="#" onclick="sc_display(\''.self::$usr_id.'\'); return false;">'.$lang['srv_sc_txt2'].'</a></td></tr>';
-
+ echo '<td class="right"><a href="#" onclick="sc_display(\''.self::$usr_id.'\'); return false;">'.$lang['srv_sc_txt2'].'</a></td></tr>';
}
}
@@ -3172,7 +3383,7 @@ class SurveyDataDisplay{ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
+ echo '.container {margin-bottom:45px;} #dataTableScroller {display:none;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
echo '</style>';
echo '<!--[if lt IE 7]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
@@ -3205,7 +3416,7 @@ class SurveyDataDisplay{ echo '</script>';
echo '</head>';
- echo '<body style="margin:5px; padding:5px;" >';
+ echo '<body class="public_link data" style="margin:5px; padding:5px;" >';
echo '<h2>'.$lang['srv_publc_data_title_for'].self::$survey['naslov'].'</h2>';
echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $anketa . '" />';
@@ -3228,9 +3439,6 @@ class SurveyDataDisplay{ 'a'=>'list_xls',
'anketa'=>$anketa)));
echo '<div class="printHide" style="margin-top:6px; margin-bottom:60px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a> ';
- echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a> ';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
if (isset($properties['profile_id_status']))
{
@@ -3272,19 +3480,7 @@ class SurveyDataDisplay{ </script><?php
echo '</div>';
-
- echo '<div id="navigationBottom" class="printHide">';
-
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span><img src="'.$site_url.'admin/survey/icons/icons/printer.png" vartical-align="middle" /> '.$lang['hour_print2'].'</span></a></div></span>';
- echo '<span class="spaceRight floatRight printHide" style="margin-top:6px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a> ';
- echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a> ';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
- echo '</span>';
-
- echo '<br class="clr" />';
- echo '</div>';
-
+
echo '</body>';
echo '</html>';
}
@@ -3306,20 +3502,26 @@ class SurveyDataDisplay{ $lang_admin = $row['value'];
}
+ $sqlVersion = sisplet_query("SELECT value FROM misc WHERE what = 'version'");
+ $rowVersion = mysqli_fetch_assoc($sqlVersion);
+
#izpišemo HTML
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
- echo '<head>';
- echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
+
+
+ echo '<head>';
+
+ echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />';
- echo '<script type="text/javascript" src="'.$site_url.'admin/survey/script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
+
+ echo '<script type="text/javascript" src="'.$site_url.'admin/survey/script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
echo '<script type="text/javascript" src="'.$site_url.'admin/survey/minify/g=jsnew"></script>';
- echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
- echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<!--[if lt IE 7]>';
+
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css?v='.$rowVersion['value'].'" media="screen" rel="stylesheet" />';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint?v='.$rowVersion['value'].'" media="print" rel="stylesheet" />';
+
+ echo '<!--[if lt IE 7]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
echo '<![endif]-->';
echo '<!--[if IE 7]>';
@@ -3328,9 +3530,7 @@ class SurveyDataDisplay{ echo '<!--[if IE 8]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie8hacks.css" type="text/css" />';
echo '<![endif]-->';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
+
echo '<script>';
echo 'function chkstate(){';
echo ' if(document.readyState=="complete"){';
@@ -3348,12 +3548,17 @@ class SurveyDataDisplay{ echo ' window.close();';
echo '}';
echo '</script>';
+
echo '</head>';
- echo '<body style="margin:5px; padding:5px;" onBlur="window.close();">';
- echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $_REQUEST['anketa'] . '" />';
- #echo '<div id="div_analiza_single_var" class="container">';
+
+ echo '<body class="quick_list_data" onBlur="window.close();">';
+
+ echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $_REQUEST['anketa'] . '" />';
+
+
echo '<div id="analiza_data">';
+
//Izvoz v PDF / RTF / XLS
$_url1 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
serialize(
@@ -3370,14 +3575,18 @@ class SurveyDataDisplay{ array( 'b'=>'export',
'a'=>'list_xls',
'anketa'=>$anketa)));
- echo '<div class=" printHide" style="margin-top:6px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a> ';
+
+
+ echo '<div class="printHide">';
+
+ /*echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a> ';
echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a> ';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
+ echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';*/
- echo '<br class="clr"/>';
echo $lang['srv_data_print_preview'];
+
echo '</div>';
+
self::$printPreview = true;
self::$_VARS[VAR_DATA] = 1;
@@ -3385,6 +3594,7 @@ class SurveyDataDisplay{ self::$_VARS[VAR_META] = 0;
self::$_VARS[VAR_EMAIL] = 0;
self::$_VARS[VAR_RELEVANCE] = 0;
+ self::$_VARS[VAR_STATUS] = 0;
self::$_VARS[VAR_EDIT] = 0;
self::$_VARS[VAR_PRINT] = 0;
self::$_VARS[VAR_MONITORING] = 0;
@@ -3392,27 +3602,23 @@ class SurveyDataDisplay{ unset(self::$_SVP_PV['invitation']);
}
-
- # ponastavimo nastavitve- filter
+
+ # ponastavimo nastavitve- filter
self::setUpFilter();
self::DisplayDataTable();
+
echo '</div>';
- echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="close_win(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span class="faicon print_small icon-grey_dark_link"></span> '.$lang['hour_print2'].'</a></div></span>';
-
- echo '<span class="spaceRight floatRight printHide" style="margin-top:6px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a> ';
- echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a> ';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="medium white-blue" onclick="window.print(); return false;">'.$lang['hour_print2'].'</button>';
+ echo ' <button class="medium blue" onclick="close_win(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</span>';
-
- echo '<br class="clr" />';
+
echo '</div>';
echo '</body>';
+
echo '</html>';
}
@@ -3423,33 +3629,35 @@ class SurveyDataDisplay{ $userAccess = UserAccess::getInstance($global_user_id);
// gumbi na levi (delete, edit, izvozi...)
- echo '<div id="left_options">';
+ echo '<div class="quick_edit_icons">';
- echo '<span class="faicon delete_circle large icon-orange_link" title="'.$lang['srv_delete_data_row'].'" onClick="quickEditAction(\'delete\', \''.self::$usr_id.'\');"></span>';
- echo '<span class="faicon edit_square large icon-grey_dark_link" title="'.$lang['srv_edit_data_row'].'" onClick="quickEditAction(\'edit\', \''.self::$usr_id.'\');"></span>';
- echo '<span class="faicon print_small large icon-grey_dark_link" title="'.$lang['PRN_Izpis'].'" onClick="printAnaliza(\'Vpogled\'); return false;"></span>';
+ echo '<span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" onClick="quickEditAction(\'edit\', \''.self::$usr_id.'\');"></span>';
- // Ce imamo izvoze v paketu
- if($userAccess->checkUserAccess($what='data_export')){
- echo '<span class="faicon pdf large icon-grey_dark_link" title="'.$lang['PDF_Izpis'].'" onClick="quickEditAction(\'pdf\', \''.self::$usr_id.'\');"></span>';
- echo '<span class="faicon rtf large icon-grey_dark_link" title="'.$lang['RTF_Izpis'].'" onClick="quickEditAction(\'rtf\', \''.self::$usr_id.'\');"></span>';
- }
- else{
- echo '<span class="faicon pdf large icon-grey_dark_link user_access_locked" title="'.$lang['PDF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
- echo '<span class="faicon rtf large icon-grey_dark_link user_access_locked" title="'.$lang['RTF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
- }
-
- echo '<span class="faicon copy large icon-grey_dark_link" title="'.$lang['srv_copy_data'].'" onClick="quickEditAction(\'copy\', \''.self::$usr_id.'\');"></span>';
-
- // omogocimo/onemogocimo popravljanje vnosa
+ // omogocimo/onemogocimo popravljanje vnosa
if(isset($_GET['quick_view']) && $_GET['quick_view'] == 0){
- echo '<span class="faicon edit large icon-grey_dark_link_reverse" title="'.$lang['srv_quick_view_off'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon edit" title="'.$lang['srv_quick_view_off'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
echo '<input type="hidden" id="quick_view" value="0">';
}
else{
- echo '<span class="faicon edit large icon-grey_dark_link" title="'.$lang['srv_quick_view_on'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon edit gray" title="'.$lang['srv_quick_view_on'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
echo '<input type="hidden" id="quick_view" value="1">';
}
+
+ echo '<span class="faicon copy" title="'.$lang['srv_copy_data'].'" onClick="quickEditAction(\'copy\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon delete" title="'.$lang['srv_delete_data_row'].'" onClick="quickEditAction(\'delete\', \''.self::$usr_id.'\');"></span>';
+
+ // Ce imamo izvoze v paketu
+ if($userAccess->checkUserAccess($what='data_export')){
+ echo '<span class="faicon pdf" title="'.$lang['PDF_Izpis'].'" onClick="quickEditAction(\'pdf\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon rtf" title="'.$lang['RTF_Izpis'].'" onClick="quickEditAction(\'rtf\', \''.self::$usr_id.'\');"></span>';
+ }
+ else{
+ echo '<span class="faicon pdf user_access_locked" title="'.$lang['PDF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
+ echo '<span class="faicon rtf user_access_locked" title="'.$lang['RTF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
+ }
+
+ echo '<span class="faicon print" title="'.$lang['PRN_Izpis'].'" onClick="printAnaliza(\'Vpogled\'); return false;"></span>';
+
echo '</div>';
}
@@ -3457,7 +3665,7 @@ class SurveyDataDisplay{ if (self::$dataFileStatus >= 0) {
#status - če smo v meta ali imamo profil vse enote
- if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
+ if (true|| (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
|| ( SurveyStatusProfiles::getCurentProfileId() == 1 )) {
SurveyAnalysisHelper::getInstance()->displayStatusLegend();
}
@@ -3467,7 +3675,7 @@ class SurveyDataDisplay{ if (self::$dataFileStatus >= 0) {
#testni vnosi - samo ce imamo testne
- if (self::$_HAS_TEST_DATA) {
+ if (self::$_HAS_TEST_DATA && self::$_VARS[VAR_RELEVANCE]) {
SurveyAnalysisHelper::getInstance()->displayTestLegend();
}
}
@@ -3478,25 +3686,7 @@ class SurveyDataDisplay{ SurveyAnalysisHelper::getInstance()->displayMissingLegend();
}
}
-
- static function DisplaySnLinks() {
- global $lang, $site_url;
-
- echo '<div id="data_sn_buttons">';
- // Gumb za preklop na EGO
- echo '<span>';
- echo '<a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '0').'"'.((int)self::$_VARS[VAR_CIRCLES]==0?' class="red"':'').'>'.$lang['srv_lnk_ego'].'</a>';
- echo '</span>';
-
- // Gumb za preklop na ALTER
- echo '<span>';
- echo '<a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '1').'"'.((int)self::$_VARS[VAR_CIRCLES]==1?' class="red"':'').'>'.$lang['srv_lnk_alter'].'</a>';
- echo '</span>';
-
- echo '</div>';
- }
-
static function setSnDisplayFullTableCheckbox() {
session_start();
@@ -3510,14 +3700,18 @@ class SurveyDataDisplay{ $offset = 0;
- // Ce nismo na prvi strani spremenljivk je offset drugacen in prikazemo stevilko na zacetku
+ // OLD - Ce nismo na prvi strani spremenljivk je offset drugacen in prikazemo stevilko na zacetku
+
if(self::$_VARS[VAR_SPR_PAGE] > 1){
$offset = strpos($line, '</td><td>');
}
elseif (self::$lineoffset > 0 ) {
- for ($i = 0; $i < self::$lineoffset; $i++) {
+ /* for ($i = 0; $i < self::$lineoffset; $i++) {
$offset = strpos($line,'</td><td>',$offset+1);
- }
+ } */
+
+ // NEW - vedno prikazemo st vrstice na prvem mestu (na prvi strani na drugem, zaradi uid)
+ $offset = strpos($line,'</td><td>',$offset+1);
}
return $offset;
|