diff --git a/admin/survey/SurveyAdmin.php b/admin/survey/SurveyAdmin.php index 8a62385f8..4e26eba5c 100644 --- a/admin/survey/SurveyAdmin.php +++ b/admin/survey/SurveyAdmin.php @@ -2226,6 +2226,7 @@ class SurveyAdmin || $_GET['a'] == 'forma' || $_GET['a'] == 'metadata' || $_GET['a'] == 'mobile_settings' + || $_GET['a'] == 'table_settings' || $_GET['a'] == A_PRIKAZ || $_GET['a'] == A_MISSING || $_GET['a'] == A_SKUPINE @@ -2554,6 +2555,7 @@ class SurveyAdmin || $_GET['a'] == 'forma' || $_GET['a'] == 'metadata' || $_GET['a'] == 'mobile_settings' + || $_GET['a'] == 'table_settings' || $_GET['a'] == A_PRIKAZ || $_GET['a'] == A_EXPORTSETTINGS || $_GET['a'] == A_GDPR @@ -3127,6 +3129,11 @@ class SurveyAdmin echo '
  • '; echo '' . $lang['srv_mobile_settings'] . '
  • '; + # prikaz tabel + echo '
  • '; + echo '' . $lang['srv_table_settings'] . '
  • '; + + # prevajanje - jezik (standardne besede) echo '
  • '; echo '' . $lang['srv_standardne_besede'] . '
  • '; diff --git a/admin/survey/SurveyAdminAjax.php b/admin/survey/SurveyAdminAjax.php index f1ec30e05..3573c5588 100644 --- a/admin/survey/SurveyAdminAjax.php +++ b/admin/survey/SurveyAdminAjax.php @@ -933,6 +933,10 @@ class SurveyAdminAjax { if (isset($_POST['mobile_tables'])) { SurveySetting::getInstance()->setSurveyMiscSetting('mobile_tables', $_POST['mobile_tables']); } + + if (isset($_POST['pc_tables'])) { + SurveySetting::getInstance()->setSurveyMiscSetting('pc_tables', $_POST['pc_tables']); + } if (isset($_POST['export_font_size'])) { SurveySetting::getInstance()->setSurveyMiscSetting('export_font_size', $_POST['export_font_size']); diff --git a/admin/survey/SurveyAdminSettings.php b/admin/survey/SurveyAdminSettings.php index 825f2eb0c..16b4ade56 100644 --- a/admin/survey/SurveyAdminSettings.php +++ b/admin/survey/SurveyAdminSettings.php @@ -502,11 +502,11 @@ class SurveyAdminSettings { echo '
    '; echo ''; - echo ''; + echo ''; echo '
    '; echo '
    '; echo ''; - echo ''; + echo ''; echo '
    '; echo ''; @@ -1771,7 +1771,7 @@ class SurveyAdminSettings { echo ''; // Prilagoditev tabel pri mobilnikih - $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables'); + /*$mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables'); echo '
    '; echo ''.$lang['srv_settings_mobile_tables'].':'; @@ -1788,12 +1788,69 @@ class SurveyAdminSettings { echo ' '; echo '
    '; - echo ''; + echo '';*/ echo ''; echo ''; } + + /*Nastavitve prikaza za tabele*/ + if ($_GET['a'] == 'table_settings') { + + SurveySetting::getInstance()->Init($this->anketa); + + echo '
    '; + + echo ''.$lang['srv_table_settings_title'].''; + + + // Prilagoditev tabel na pc-ju + $pc_tables = SurveySetting::getInstance()->getSurveyMiscSetting('pc_tables'); + + echo '
    '; + + echo ''.$lang['srv_table_settings_pc_tables'].':'; + echo '
    '; + echo ''; + echo ' '; + echo '
    '; + echo '
    '; + echo ''; + echo ' '; + echo '
    '; + echo '
    '; + echo ''; + echo ' '; + echo '
    '; + + echo '
    '; + + + // Prilagoditev tabel pri mobilnikih + $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables'); + + echo '
    '; + + echo ''.$lang['srv_table_settings_mobile_tables'].':'; + echo '
    '; + echo ''; + echo ' '; + echo '
    '; + echo '
    '; + echo ''; + echo ' '; + echo '
    '; + echo '
    '; + echo ''; + echo ' '; + echo '
    '; + + echo '
    '; + + + echo '
    '; + } /*Metapodatki (Parapodatki)*/ if ($_GET['a'] == 'metadata') { @@ -8741,7 +8798,7 @@ class SurveyAdminSettings { echo $lang['srv_stevilo_vnosov'].':'; echo '
    '; echo ''; - echo '(max 1000)'; + echo '(max. 1000)'; echo '
    '; echo ''; @@ -8761,20 +8818,22 @@ class SurveyAdminSettings { echo ''.$lang['srv_delete_testdata'].' ('.$total_rows.')'; - echo ''; + + if ($total_rows > 0) { + + echo '
    '; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; - echo '
    Labela Veljavni odgovori (Grafični prikaz)
    '; - - if ($total_rows > 0) { - + echo ''; + $prevpage = 0; + $sql = sisplet_query("SELECT s.id, s.gru_id, s.tip, s.naslov, g.naslov AS pagename FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND s.visible='1' AND g.ank_id='$this->anketa' ORDER BY g.vrstni_red, s.vrstni_red"); while ($row = mysqli_fetch_array($sql)) { diff --git a/admin/survey/api/api_test.php b/admin/survey/api/api_test.php index 6e292c5c4..33e879860 100644 --- a/admin/survey/api/api_test.php +++ b/admin/survey/api/api_test.php @@ -8,26 +8,30 @@ // Nastavimo url api-ja //$api_url = 'http://test.1ka.si/admin/survey/api/api.php'; -//$api_url = 'https://www.1ka.si/admin/survey/api/api.php'; // Nastavimo identifier in key userja -$identifier = 'a1c3b90fdae3c45d'; -$private_key = 'e60032141a7aae518f9938636b963fc14d58d40025dc7b6b82f4e69b8a42599e'; +/*$identifier = 'a1c3b90fdae3c45d'; +$private_key = 'e60032141a7aae518f9938636b963fc14d58d40025dc7b6b82f4e69b8a42599e';*/ -$api_url = 'http://localhost/admin/survey/api/api.php'; +$api_url = 'https://www.1ka.si/admin/survey/api/api.php'; +$identifier = '3ccc9cbc90493d09'; +$private_key = 'b8dbeceed3d0d7f80ca5d82ba352d9696c1804ff9b9d45272b8e99ea0a4987d6'; + +/*$api_url = 'http://localhost/admin/survey/api/api.php'; $identifier = '0d712128f7fe5707'; -$private_key = 'd0ea50f1deabe2d9d9082c4c2a25c7db3648cab59f7a19939c808f602bdbc1be'; +$private_key = 'd0ea50f1deabe2d9d9082c4c2a25c7db3648cab59f7a19939c808f602bdbc1be';*/ // Nastavimo parametre -//$ank_id = '8086'; +$ank_id = '384751'; //$action = 'getSurveyQuestions'; -$action = 'createSurvey'; +//$action = 'createSurvey'; +$action = 'getSurveyResponseData'; // Izvedemo klic (GET ali POST) //$result = executeGET(); -$result = executePOST(); +//$result = executePOST(); @@ -55,6 +59,7 @@ function executeGET(){ // GET params $params = 'action='.$action; // Funkcija, ki jo želimo izvesti $params .= '&ank_id='.$ank_id; // ostali parametri potrebni za klic funkcije (id ankete, vprašanja...) + $params .= '&usr_id=50666962'; // ostali parametri potrebni za klic funkcije (id ankete, vprašanja...) // Pripravimo podatke za hashiranje $request_method = 'GET'; diff --git a/admin/survey/classes/class.GDPR.php b/admin/survey/classes/class.GDPR.php index 5a6bc9db4..a74ec0090 100644 --- a/admin/survey/classes/class.GDPR.php +++ b/admin/survey/classes/class.GDPR.php @@ -64,10 +64,10 @@ class GDPR{ echo '
    '; - echo '
    '; + echo '
    '; echo '
    '; - echo ''; + echo ''; echo '
    GDPR ANKETE
    '; echo '
    '; @@ -83,10 +83,10 @@ class GDPR{ echo '
    '; - echo '
    '; + echo '
    '; echo '
    '; - echo ''; + echo ''; echo '
    POTENCIALNO GDPR ANKETE
    '; echo '
    '; @@ -102,10 +102,10 @@ class GDPR{ echo '
    '; - echo '
    '; + echo '
    '; echo '
    '; - echo ''; + echo ''; echo '
    NE-GDPR ANKETE
    '; echo '
    '; diff --git a/admin/survey/classes/tracking/CrossRoad.php b/admin/survey/classes/tracking/CrossRoad.php index b9c44700e..abf919188 100644 --- a/admin/survey/classes/tracking/CrossRoad.php +++ b/admin/survey/classes/tracking/CrossRoad.php @@ -145,6 +145,7 @@ class CrossRoad { case A_MISSING: case A_METADATA: case A_MOBILESETTINGS: + case A_TABLESETTINGS: case A_JEZIK: # nastavitve jezik case A_UREJANJE: # nastavitve komentarjev case A_PRIKAZ: # nastavitve komentarjev diff --git a/admin/survey/definition.php b/admin/survey/definition.php index 50206f69a..b7864bf4b 100644 --- a/admin/survey/definition.php +++ b/admin/survey/definition.php @@ -241,6 +241,7 @@ define('A_FORMA', 'forma'); # urejanje ankete - manjkajoče vrednosti define('A_METADATA', 'metadata'); # urejanje ankete - prikaz metapodatkov define('A_MOBILESETTINGS', 'mobile_settings'); # urejanje ankete - nastavitve prikaza pri mobitelih + define('A_TABLESETTINGS', 'table_settings'); # urejanje ankete - nastavitve prikaza tabel define('A_PRIKAZ', 'prikaz'); # prikaz podatkov in analiz define('A_MAILING', 'advanced_email'); # nastavitve email strežnika define('A_SKUPINE', 'skupine'); # skupine diff --git a/admin/survey/script/GDPR_seznam_anket.js b/admin/survey/script/GDPR_seznam_anket.js index 5be2c2916..4f39f6b1f 100644 --- a/admin/survey/script/GDPR_seznam_anket.js +++ b/admin/survey/script/GDPR_seznam_anket.js @@ -147,7 +147,49 @@ function test_function() { } } +function gdpr_ankete(){ + var check_gdpr_ankete = document.getElementById('gdpr_ankete_check'); + + //GDOR ANKETE + if (check_gdpr_ankete.checked){ + check_gdpr_ankete.checked = false; + test_function(); + } + else { + check_gdpr_ankete.checked = true; + test_function(); + } +} +function potenc_gdpr_ankete(){ + + var check_potenc_gdpr = document.getElementById('potenc_gdpr_ankete_check'); + + //POTENCGDOR ANKETE + if (check_potenc_gdpr.checked){ + check_potenc_gdpr.checked = false; + test_function(); + } + else { + check_potenc_gdpr.checked = true; + test_function(); + } +} + +function ne_gdpr_ankete(){ + + var check_negdpr_ankete = document.getElementById('ne_gdpr_ankete'); + + //NE GDPR ANKETE + if (check_negdpr_ankete.checked){ + check_negdpr_ankete.checked = false; + test_function(); + } + else { + check_negdpr_ankete.checked = true; + test_function(); + } +} function teme_options(){ var toggle = document.getElementsByClassName('buttons-window'); diff --git a/lang/1.php b/lang/1.php index 9c8c15651..b99185486 100644 --- a/lang/1.php +++ b/lang/1.php @@ -4016,6 +4016,10 @@ $lang = array ( "srv_mobile_settings_title" => "Prikaz ankete na mobilnih napravah", "srv_mobile_survey" => "Anketa ustvarjena v mobilni aplikaciji", "srv_mobile_add_question" => "Dodaj vprašanje", + "srv_table_settings" => "Nastavitve tabel", + "srv_table_settings_title" => "Prikaz vprašanj tipa tabela", + 'srv_table_settings_mobile_tables' => "Prilagoditev vprašanj tipa 'Tabela' na mobilnih napravah", + 'srv_table_settings_pc_tables' => "Prilagoditev vprašanj tipa 'Tabela' na računalniku", "srv_standardne_besede" => "Standardne besede", "srv_prevajanje_dodaj" => "Dodaj nov prevod za", "srv_base_lang" => "Osnovni jezik", diff --git a/lang/2.php b/lang/2.php index 0c653dcda..e30ccf069 100644 --- a/lang/2.php +++ b/lang/2.php @@ -3986,8 +3986,12 @@ $lang = array ( "srv_mobile_settings_title" => "Survey display on mobile devices", "srv_mobile_survey" => "Survey created with mobile app", "srv_mobile_add_question" => "Add question", + "srv_table_settings" => "Table settings", + "srv_table_settings_title" => "Table questions settings", + 'srv_table_settings_mobile_tables' => "Optimization of 'Table' type questions on mobile devices", + 'srv_table_settings_pc_tables' => "Optimization of 'Table' type questions on desktop computer", "srv_prevajanje_dodaj" => "Add translation for", - "srv_multi_lang" => "Multilanguage surveys", + "srv_multi_lang" => "Multilanguage surveys", "srv_base_lang" => "Basic language", "srv_lang_elements" => "Standard text", "srv_trans_lang" => "Translation", diff --git a/main/survey/app/Controllers/Vprasanja/MultigridMobileController.php b/main/survey/app/Controllers/Vprasanja/MultigridMobileController.php index c121fd6e7..30696f9e7 100644 --- a/main/survey/app/Controllers/Vprasanja/MultigridMobileController.php +++ b/main/survey/app/Controllers/Vprasanja/MultigridMobileController.php @@ -61,7 +61,7 @@ class MultigridMobileController extends Controller{ // Nastavitev za prilagoditev mobilnih tabel (z razpiranjem ali brez) SurveySetting::getInstance()->Init(get('anketa')); - $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables'); + $tables_setting = (get('mobile') == 1) ? SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables') : SurveySetting::getInstance()->getSurveyMiscSetting('pc_tables'); $gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0); @@ -95,7 +95,7 @@ class MultigridMobileController extends Controller{ // Izrisemo celotno vsebino tabele za mobietl - echo '
    '; + echo '
    '; $orderby = Model::generate_order_by_field($spremenljivka, get('usr_id')); @@ -169,14 +169,14 @@ class MultigridMobileController extends Controller{ echo '
    '; // Puscica za razpiranje ce imamo vklopljene mobilne tabele z razpiranjem - if($mobile_tables == 2) + if($tables_setting == 2) echo ''; echo '
    '; // IZPOLNJENA VREDNOST, ce obstaja in ce imamo vklopljene mobilne tabele z razpiranjem - if($mobile_tables == 2){ + if($tables_setting == 2){ echo '
    '.($grid_id != '' ? $grid_data_value : '').'
    '; } @@ -386,7 +386,7 @@ class MultigridMobileController extends Controller{ // Nastavitev za prilagoditev mobilnih tabel (z razpiranjem ali brez) SurveySetting::getInstance()->Init(get('anketa')); - $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables'); + $tables_setting = (get('mobile') == 1) ? SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables') : SurveySetting::getInstance()->getSurveyMiscSetting('pc_tables'); $gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0); @@ -439,7 +439,7 @@ class MultigridMobileController extends Controller{ // Izrisemo celotno vsebino tabele za mobietl - echo '
    '; + echo '
    '; $orderby = Model::generate_order_by_field($spremenljivka, get('usr_id')); @@ -512,7 +512,7 @@ class MultigridMobileController extends Controller{ echo '
    '; // Puscica za razpiranje ce imamo vklopljene mobilne tabele z razpiranjem - /*if($mobile_tables == 2) + /*if($tables_setting == 2) echo '';*/ echo '
    '; @@ -714,7 +714,7 @@ class MultigridMobileController extends Controller{ // Nastavitev za prilagoditev mobilnih tabel (z razpiranjem ali brez) SurveySetting::getInstance()->Init(get('anketa')); - $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables'); + $tables_setting = (get('mobile') == 1) ? SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables') : SurveySetting::getInstance()->getSurveyMiscSetting('pc_tables'); $gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0); @@ -750,7 +750,7 @@ class MultigridMobileController extends Controller{ // Izrisemo celotno vsebino tabele za mobitel - echo '
    '; + echo '
    '; $orderby = Model::generate_order_by_field($spremenljivka, get('usr_id')); @@ -819,7 +819,7 @@ class MultigridMobileController extends Controller{ echo '
    '; // Puscica za razpiranje ce imamo vklopljene mobilne tabele z razpiranjem - if($mobile_tables == 2) + if($tables_setting == 2) echo ''; echo '
    '; @@ -931,7 +931,7 @@ class MultigridMobileController extends Controller{ // Nastavitev za prilagoditev mobilnih tabel (z razpiranjem ali brez) SurveySetting::getInstance()->Init(get('anketa')); - $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables'); + $tables_setting = (get('mobile') == 1) ? SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables') : SurveySetting::getInstance()->getSurveyMiscSetting('pc_tables'); $gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0); @@ -985,7 +985,7 @@ class MultigridMobileController extends Controller{ // Izrisemo celotno vsebino tabele za mobietl - echo '
    '; + echo '
    '; $orderby = Model::generate_order_by_field($spremenljivka, get('usr_id')); @@ -1059,11 +1059,7 @@ class MultigridMobileController extends Controller{ echo ' '; } - echo '
    '; - - // Puscica za razpiranje ce imamo vklopljene mobilne tabele z razpiranjem - /*if($mobile_tables == 2) - echo '';*/ + echo '
    '; echo '
    '; @@ -1269,7 +1265,7 @@ class MultigridMobileController extends Controller{ // Nastavitev za prilagoditev mobilnih tabel (z razpiranjem ali brez) SurveySetting::getInstance()->Init(get('anketa')); - $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables'); + $tables_setting = (get('mobile') == 1) ? SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables') : SurveySetting::getInstance()->getSurveyMiscSetting('pc_tables'); $gridAlign = (($spremenljivkaParams->get('gridAlign') > 0) ? $spremenljivkaParams->get('gridAlign') : 0); @@ -1325,7 +1321,7 @@ class MultigridMobileController extends Controller{ // Izrisemo celotno vsebino tabele za mobitel - echo '
    '; + echo '
    '; $orderby = Model::generate_order_by_field($spremenljivka, get('usr_id')); @@ -1397,7 +1393,7 @@ class MultigridMobileController extends Controller{ echo '
    '; // Puscica za razpiranje ce imamo vklopljene mobilne tabele z razpiranjem - if($mobile_tables == 2) + if($tables_setting == 2) echo ''; echo '
    '; diff --git a/main/survey/app/Controllers/Vprasanja/VprasanjaController.php b/main/survey/app/Controllers/Vprasanja/VprasanjaController.php index ddec09520..32aac2383 100644 --- a/main/survey/app/Controllers/Vprasanja/VprasanjaController.php +++ b/main/survey/app/Controllers/Vprasanja/VprasanjaController.php @@ -231,7 +231,9 @@ class VprasanjaController extends Controller // JS za mobilno razpiranje tabel SurveySetting::getInstance()->Init(get('anketa')); $mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables'); - if($mobile_tables == 2){ + $pc_tables = SurveySetting::getInstance()->getSurveyMiscSetting('pc_tables'); + + if(($mobile_tables == 2 && get('mobile') == 1) || ($pc_tables == 2 && get('mobile') != 1)){ echo '