diff --git a/admin/survey/SurveyAdmin.php b/admin/survey/SurveyAdmin.php index 76349cefc..b59304d78 100644 --- a/admin/survey/SurveyAdmin.php +++ b/admin/survey/SurveyAdmin.php @@ -267,158 +267,93 @@ class SurveyAdmin global $site_domain; global $aai_instalacija; - $sql = sisplet_query("SELECT email FROM users WHERE id='$global_user_id'"); - $row = mysqli_fetch_assoc($sql); - if ($row['email'] == "test@1ka.si") { - echo '
'; - echo '' . $lang['notify_testUser'] . ''; - echo '
'; - } - - echo '
'; - - - // user navigacija - echo '
'; - - // Search po zunanji lupini - preusmeri na drupalov search - echo '
'; - - if($lang['id'] != "1") - $drupal_search_url = 'https://www.1ka.si/d/en/iskanje/'; - else - $drupal_search_url = 'https://www.1ka.si/d/sl/iskanje/'; - - echo '
'; - - echo ''; - - echo ' '; - echo ''; - echo ''; - - echo '
'; - - echo '
'; - - - // Hitra pomoč - povezave na linke s pomočjo na www.1ka.si - $subdomain = ($lang['id'] == "1") ? 'www' : 'english'; - $help_url = Common::getHelpUrl($subdomain, $this->first_action); - echo '
'; - echo ' '; - echo ''; - echo ' '; - echo '
'; - - // povezava na fieldwork sync - if ($this->anketa > 0) { - - // poglej če je tale ID ankete v srv_fieldwork - $sql = sisplet_query("SELECT id FROM srv_fieldwork where sid_server='" . $this->anketa . "'"); - if (mysqli_num_rows($sql) > 0) { - // nariši link. - echo '
'; - echo ''; - echo ''; - echo ' '; - echo '
'; - } - } - - $sql = $this->db_select_user($global_user_id); - $row = mysqli_fetch_array($sql); - - $text = $row['name'] . ' ' . $row['surname']; - $text = (strlen($text) > 25) ? substr($text, 0, 25) . '...' : $text; - - - echo '
' . $text . ' '; - echo '
'; - - echo '' . $lang['edit_data'] . ''; - - // Odjava na nov nacin preko frontend/api - echo '
'; - echo '' . $lang['logout'] . ''; - echo '
'; - - echo '
'; - echo '
'; - - echo '
'; - - - // logotip - echo ''; - echo '
'; - echo '
'; - /***** SEZNAM ANKET - Ce ni nastavljene ankete, potem prikazujemo seznam na prvi strani *****/ - if (!($this->anketa > 0)) { + /********************* GLAVA *********************/ + echo '
'; - $this->displaySeznamAnket(); - } - /***** GLAVNA VSEBINA - Znotraj posamezne ankete *****/ - else{ + // DESKTOP HEADER + echo '
'; - echo '
anketa == 0 ? ' class="prva"' : '') . '>'; + // Nastavitve zgoraj desno v headerju (search, help, profil...) + $this->displayHeaderRight(); + + // logotip + $this->displayHeaderLogo(); + + // Znotraj posamezne ankete + if($this->anketa > 0){ + + // Utripajoc napis "Demo anketa" + $this->displayHeaderDemoSurvey(); // Prikaze podatke o anketi in navigacijo - na vrhu (top bar) - $this->displayAnketaTop(); + $this->displayHeaderAnketa(); + } + // Seznam anket + else{ + $this->displayHeaderSeznamAnket(); + } + + echo '
'; + + // MOBILE HEADER + echo '
'; + + $mobile_admin = new MobileSurveyAdmin($this); + $mobile_admin->displayHeaderMobile(); + + echo '
'; + + echo '
'; + /********************* GLAVA - END *********************/ + + + /********************* MAIN *********************/ + echo '
'; + + // SEZNAM ANKET - Ce ni nastavljene ankete, potem prikazujemo seznam na prvi strani *****/ + if (!($this->anketa > 0)) { + $this->displaySeznamAnket(); + } + // ZNOTRAJ ANKETE + else{ + echo '
'; echo '
'; $this->displayAnketa(); echo '
'; - echo '
'; - - - // Predpregled tipa vprašanj - prikazujemo samo kadar smo v urejanju ankete - if (($_GET['a'] == '' && isset($_GET['anketa'])) || $_GET['a'] == 'branching') { - - echo '
'; - - echo '
'; - $this->getTipPreviewHtml(); - echo '
'; - - echo '
'; // tip_preview - } - - // Utripajoc napis "Demo anketa" - $row = SurveyInfo::getInstance()->getSurveyRow(); - if ($row['invisible'] == 1 && !Dostop::isMetaAdmin()) { - echo '
'; - echo '
' . $lang['srv_close_invisible'] . '
'; - - ?> '; } /***** SKRITI DIVI ZA POPUPE *****/ $this->displayHiddenPopups(); - - echo '
'; + echo '
'; + /********************* MAIN - END *********************/ + - /***** FOOTER *****/ + /********************* FOOTER *********************/ $this->displayFooter(); + /********************* FOOTER - END *********************/ + + + echo '
'; } + // Prikazemo skrite dive za popupe private function displayHiddenPopups(){ global $lang; + + // Predpregled tipa vprašanj - prikazujemo samo kadar smo v urejanju ankete + $this->getTipPreviewHtml(); + + // Loading ikona echo '
'; echo ' '.$lang['srv_saving']; @@ -546,9 +481,124 @@ class SurveyAdmin echo '
'; echo ''; } + + + // Prikazemo podatke zgoraj desno v glavi (search, user, help) + private function displayHeaderRight(){ + global $site_url; + global $global_user_id; + global $lang; + + + // user navigacija + echo '
'; + + + // Search po zunanji lupini - preusmeri na drupalov search + echo '
'; + + if($lang['id'] != "1") + $drupal_search_url = 'https://www.1ka.si/d/en/iskanje/'; + else + $drupal_search_url = 'https://www.1ka.si/d/sl/iskanje/'; + + echo '
'; + + echo ''; + + echo ' '; + echo ''; + echo ''; + + echo '
'; + + echo '
'; + + + // Hitra pomoč - povezave na linke s pomočjo na www.1ka.si + $subdomain = ($lang['id'] == "1") ? 'www' : 'english'; + $help_url = Common::getHelpUrl($subdomain, $this->first_action); + echo '
'; + echo ' '; + echo ''; + echo ' '; + echo '
'; + + + // povezava na fieldwork sync + if ($this->anketa > 0) { + + // poglej če je tale ID ankete v srv_fieldwork + $sql = sisplet_query("SELECT id FROM srv_fieldwork where sid_server='" . $this->anketa . "'"); + if (mysqli_num_rows($sql) > 0) { + // nariši link. + echo '
'; + + echo ''; + echo ''; + echo ' '; + + echo '
'; + } + } + + + // User profil + $sql = $this->db_select_user($global_user_id); + $row = mysqli_fetch_array($sql); + + $text = $row['name'] . ' ' . $row['surname']; + $text = (strlen($text) > 25) ? substr($text, 0, 25) . '...' : $text; + + echo '
'.$text.' '; + echo '
'; + + echo '' . $lang['edit_data'] . ''; + + // Odjava na nov nacin preko frontend/api + echo '
'; + echo '' . $lang['logout'] . ''; + echo '
'; + + echo '
'; + echo '
'; + + + echo '
'; + } + + // Prikazemo logo zgoraj levo + public function displayHeaderLogo(){ + global $lang; + global $site_url; + + echo ''; + } + + // Utripajoc napis "Demo anketa" + private function displayHeaderDemoSurvey(){ + global $lang; + + $row = SurveyInfo::getInstance()->getSurveyRow(); + + if ($row['invisible'] == 1 && !Dostop::isMetaAdmin()) { + + echo '
'; + echo '
' . $lang['srv_close_invisible'] . '
'; + + ?> thirdNavigation(); } + /** + * prikaze glavo v seznamu anket + * + */ + private function displayHeaderSeznamAnket(){ + global $lang, $site_url, $global_user_id, $admin_type, $site_domain; + + // Pobrisemo vse preview vnose + Common::deletePreviewData($this->anketa); + + # naložimo razred z seznamom anket + $SL = new SurveyList(); + $SLCount = $SL->countSurveys(); + $SLCountPhone = $SL->countPhoneSurveys(); + + // Obvestilo da ima uporabnik neprebrano sporocilo + $NO = new Notifications(); + $countMessages = $NO->countMessages(); + if ($countMessages > 0) { + echo '
'; + echo $lang['srv_notifications_alert']; + echo '
'; + + // Ce imamo vklopljen avtomatski prikaz sporcila (za pomembne zadeve), ga prikazemo po loadu + if($NO->checkForceShow()) + echo ''; + } + + // GDPR popup za prejemanje obvestil - force ce ga se ni izpolnil - SAMO NA www.1ka.si, test.1ka.si in virtualkah + if (($site_url == 'https://www.1ka.si/' || $site_url == 'http://test.1ka.si/' || $site_url == 'https://1ka.arnes.si/' || ($cookie_domain == '.1ka.si' && $virtual_domain == true)) + && User::getInstance()->getSetting($setting='gdpr_agree') == '-1') { + + // Avtomatsko prikazemo po loadu + echo ''; + } + + + echo '
'; + + echo '
 
'; + + echo '
'; + $SL->display_tabs(); + echo '
'; + + echo '
'; + + + # smo v knjižnici + $SL->display_sub_tabs(); + } + + // Priakz footerja private function displayFooter(){ global $lang; @@ -575,7 +678,8 @@ class SurveyAdmin global $aai_instalacija; global $mysql_database_name; - echo ''; - echo ''; // END #main - - echo ''; // END #main_holder + echo ''; } + // Prikaze ime ankete, zvezdico in tiste linke spodi (ker se vse refresha z ajaxom) private function anketa_active() { global $lang; @@ -3140,7 +3243,7 @@ class SurveyAdmin } // Linki za napredne module - function showAdvancedModulesLinks() + private function showAdvancedModulesLinks() { global $lang; global $site_url; @@ -3329,54 +3432,15 @@ class SurveyAdmin * prikaze seznam anket in polje za dodajanje na prvi strani * */ - function displaySeznamAnket(){ + private function displaySeznamAnket(){ global $lang, $site_url, $global_user_id, $admin_type, $site_domain; - // Pobrisemo vse preview vnose - Common::deletePreviewData($this->anketa); # naložimo razred z seznamom anket $SL = new SurveyList(); $SLCount = $SL->countSurveys(); $SLCountPhone = $SL->countPhoneSurveys(); - // Obvestilo da ima uporabnik neprebrano sporocilo - $NO = new Notifications(); - $countMessages = $NO->countMessages(); - if ($countMessages > 0) { - echo '
'; - echo $lang['srv_notifications_alert']; - echo '
'; - - // Ce imamo vklopljen avtomatski prikaz sporcila (za pomembne zadeve), ga prikazemo po loadu - if($NO->checkForceShow()) - echo ''; - } - - // GDPR popup za prejemanje obvestil - force ce ga se ni izpolnil - SAMO NA www.1ka.si, test.1ka.si in virtualkah - if (($site_url == 'https://www.1ka.si/' || $site_url == 'http://test.1ka.si/' || $site_url == 'https://1ka.arnes.si/' || ($cookie_domain == '.1ka.si' && $virtual_domain == true)) - && User::getInstance()->getSetting($setting='gdpr_agree') == '-1') { - - // Avtomatsko prikazemo po loadu - echo ''; - } - - - echo '
'; - - echo '
 
'; - - echo '
'; - $SL->display_tabs(); - echo '
'; - - echo '
'; - - - # smo v knjižnici - $SL->display_sub_tabs(); - - // VSEBINA POSAMEZNEGA TABA PRI MOJIH ANKETAH echo '
'; @@ -3666,6 +3730,8 @@ class SurveyAdmin echo '
'; } + + /** * vrne kodo ankete, ki se jo uporabi za embed * @@ -4983,10 +5049,24 @@ class SurveyAdmin * preview * */ - function getTipPreviewHtml(){ + private function getTipPreviewHtml(){ global $lang; global $global_user_id; + + // Predpregled tipa vprašanj - prikazujemo samo kadar smo v urejanju ankete + if (!$this->anketa > 0) + return; + + if ( ($_GET['a'] != '' || !isset($_GET['anketa'])) && $_GET['a'] != 'branching' ) + return; + + + echo '
'; + + echo '
'; + + // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik $userAccess = UserAccess::getInstance($global_user_id); @@ -5892,6 +5972,11 @@ class SurveyAdmin echo '
'; } } + + + echo '
'; + + echo ''; // tip_preview } /** diff --git a/admin/survey/SurveyAdminAjax.php b/admin/survey/SurveyAdminAjax.php index 0a70dcd2c..b5c6b7804 100644 --- a/admin/survey/SurveyAdminAjax.php +++ b/admin/survey/SurveyAdminAjax.php @@ -1281,7 +1281,7 @@ class SurveyAdminAjax { $avtorSql = sisplet_query("SELECT insert_uid FROM srv_anketa WHERE id='" . $this->anketa . "'"); $avtorRow = mysqli_fetch_assoc($avtorSql); - // da ne more zbrisat avtorja (razen če je test@1ka.si) + // da ne more zbrisat avtorja $avtorPogoj = (isset ($avtorRow['insert_uid']) && $avtorRow['insert_uid'] > 0) ? " AND (uid != ".$avtorRow['insert_uid']." )" : ""; // da ne more zbrisat sam sebe $avtorID = " AND uid != '" . $global_user_id . "'"; diff --git a/admin/survey/classes/mobile/class.MobileSurveyAdmin.php b/admin/survey/classes/mobile/class.MobileSurveyAdmin.php index d046c6e91..b5ae4ed16 100644 --- a/admin/survey/classes/mobile/class.MobileSurveyAdmin.php +++ b/admin/survey/classes/mobile/class.MobileSurveyAdmin.php @@ -7,33 +7,78 @@ -class MobileSurveyAdmin extends SurveyAdmin{ +class MobileSurveyAdmin{ - function __construct(){ + var $surveyAdminClass; + + + function __construct($surveyAdminClass){ global $site_url; + $this->surveyAdminClass = $surveyAdminClass; } - // Izris glave z menijem - public function displayMobileHeader(){ + // Izris glave z menijem - znotraj ankete + public function displayHeaderMobile(){ + + echo '
'; + + // Ikona za meni + $this->displayMobileMenuIcon(); - echo '
'; - // Meni - $this->displayMobileMenu(); - - // Logo - echo ''; + $this->displayMobileMenu(); + + // Naslov ankete + if($this->surveyAdminClass->anketa > 0){ + $this->displayMobileSurveyTitle(); + } + // Logo - enak kot na desktopu + else{ + $this->displayMobileLogo(); + } echo '
'; } + + // Prikazemo mobile logo + private function displayMobileLogo(){ + global $lang; + global $site_url; + + echo ''; + } + + private function displayMobileSurveyTitle(){ + + SurveyInfo::getInstance()->SurveyInit($this->surveyAdminClass->anketa); + $row = SurveyInfo::getInstance()->getSurveyRow(); + + echo '
'.$row['naslov'].'
'; + } + + private function displayMobileMenuIcon(){ + + echo '
'; + echo ' '; + echo '
'; + } + + // Izris menija private function displayMobileMenu(){ - echo '
'; + echo '
'; // Izris uporabniških podatkov v dropdownu $this->displayMobileMenuUser(); diff --git a/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php b/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php index ec1a226b7..b6175a6de 100644 --- a/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php +++ b/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php @@ -2801,14 +2801,7 @@ class SurveyInvitationsNew { else { return false; } - - # če je testni uporabnik mu ne prikažemo linkov - $sql = sisplet_query("SELECT email FROM users WHERE id='$global_user_id'"); - list($email) = mysqli_fetch_row($sql); - if ( $email == 'test@1ka.si' ) { - return false; - } - + if (!isset($_POST['noNavi']) || (isset($_POST['noNavi']) && $_POST['noNavi'] != 'true')) { $_sub_action = $_GET['m']; diff --git a/admin/survey/index.php b/admin/survey/index.php index 6c6076de3..60a1c2713 100644 --- a/admin/survey/index.php +++ b/admin/survey/index.php @@ -175,10 +175,6 @@ $sql = sisplet_query("SELECT email FROM users WHERE id='$global_user_id'"); $row = mysqli_fetch_assoc($sql); - if ( $row['email'] == 'test@1ka.si') { - $cssBodyClass .= ' test_user'; - } - /**************** BODY ****************/ echo ''."\n"; diff --git a/public/css/admin.css b/public/css/admin.css index f22fddd59..ea3fa147c 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -253,6 +253,7 @@ iframe { padding: 0; margin: 0; border: 0; + flex-grow: 1; } #main #anketa { border: 0; @@ -5892,6 +5893,10 @@ and open the template in the editor. #enka_nav input[type="text"]:focus { width: 200px; }*/ +.mobile_header { + display: none; +} + #logo { position: absolute; left: 15px; @@ -7506,6 +7511,12 @@ span.faicon.spinner::before { content: ""; } +/* Bars - mobile menu */ +span.faicon.bars::before { + font-size: 26px; + content: ""; +} + /* To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates @@ -13516,6 +13527,7 @@ and open the template in the editor. #globalSetingsLinks ul { padding: 5px; margin: 0px; + list-style: none; } #globalSetingsLinks ul li { padding: 4px 0px 4px 20px; @@ -28444,6 +28456,55 @@ a.addIfIcon { } @media (max-width: 600px) { + .desktop_header { + display: none; + } + + .mobile_header { + display: flex; + align-items: center; + width: 100%; + height: 70px; + } + .mobile_header.survey_edit { + color: white; + background-color: #1e88e5; + } + .mobile_header.survey_list { + color: #1e88e5; + background-color: white; + } + .mobile_header .mobile_menu_icon { + width: 50px; + text-align: center; + } + .mobile_header .mobile_menu_icon span { + cursor: pointer; + } + .mobile_header .mobile_survey_title { + width: calc(100% - 100px); + text-align: center; + font-size: 14px; + font-weight: 500; + } + .mobile_header .mobile_logo { + width: calc(100% - 100px); + } + .mobile_header .mobile_logo #enka_logo { + margin: 0 auto; + } + .mobile_header .mobile_menu { + display: none; + z-index: 99999; + position: fixed; + left: 0; + top: 0px; + bottom: 0px; + width: 80%; + height: 100%; + background-color: white; + } + #srv_footer { display: flex; flex-direction: column; diff --git a/resources/sass/admin/Settings/navigation.scss b/resources/sass/admin/Settings/navigation.scss index d5a71ee95..7c47cdd96 100644 --- a/resources/sass/admin/Settings/navigation.scss +++ b/resources/sass/admin/Settings/navigation.scss @@ -26,6 +26,9 @@ and open the template in the editor. ul { padding: 5px; margin: 0px; + + list-style: none; + li { padding: 4px 0px 4px 20px; border-bottom: 1px $grey_super_light solid; diff --git a/resources/sass/admin/basic/basic.scss b/resources/sass/admin/basic/basic.scss index 741b0f510..3ef8244dd 100644 --- a/resources/sass/admin/basic/basic.scss +++ b/resources/sass/admin/basic/basic.scss @@ -259,6 +259,8 @@ iframe { margin: 0; border: 0; + flex-grow: 1; + #anketa { border: 0; padding: 0px 0px 0px 0px; diff --git a/resources/sass/admin/header.scss b/resources/sass/admin/header.scss index 22f9d8aee..4a89b93d7 100644 --- a/resources/sass/admin/header.scss +++ b/resources/sass/admin/header.scss @@ -27,6 +27,10 @@ $header_background: #ffffff; width: 200px; }*/ +.mobile_header{ + display: none; +} + #logo { position: absolute; left: 15px; diff --git a/resources/sass/admin/icons/standard.scss b/resources/sass/admin/icons/standard.scss index 2a861f0f1..effbc3b56 100644 --- a/resources/sass/admin/icons/standard.scss +++ b/resources/sass/admin/icons/standard.scss @@ -526,9 +526,15 @@ span.faicon.minus_orange::before{ } - /* Spinner */ span.faicon.spinner::before{ font-size: 18px; content: "\f110"; } + + +/* Bars - mobile menu */ +span.faicon.bars::before{ + font-size: 26px; + content: "\f0c9"; +} diff --git a/resources/sass/admin/mobile/header.scss b/resources/sass/admin/mobile/header.scss index 8b1378917..abce44702 100644 --- a/resources/sass/admin/mobile/header.scss +++ b/resources/sass/admin/mobile/header.scss @@ -1 +1,64 @@ +.desktop_header{ + display: none; +} +.mobile_header{ + display: flex; + align-items: center; + + width: 100%; + height: 70px; + + + // Znotraj ankete + &.survey_edit{ + color: white; + background-color: $strong_blue; + } + + // Seznam anket + &.survey_list{ + color: $strong_blue; + background-color: white; + } + + + .mobile_menu_icon{ + width: 50px; + text-align: center; + + span{ + cursor: pointer; + } + } + + .mobile_survey_title{ + width: calc(100% - 100px); + + text-align: center; + font-size: 14px; + font-weight: 500; + } + .mobile_logo{ + width: calc(100% - 100px); + + #enka_logo{ + margin: 0 auto; + } + } + + .mobile_menu{ + display: none; + z-index: 99999; + + position: fixed; + left: 0; + top: 0px; + bottom: 0px; + width: 80%; + height: 100%; + + + background-color: white; + } +}