From 19985dbb8c0aa66dc4bf7905abc1148de909097d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Tue, 11 Jan 2022 12:35:47 +0100 Subject: prvi-commit --- .../survey/modules/mod_360_1KA/R/360_stopinj_1ka.R | 970 +++++++ .../modules/mod_360_1KA/class.Survey3601ka.php | 258 ++ .../modules/mod_360_1KA/latexkosi/a-glava-1ka.tex | 105 + .../modules/mod_360_1KA/latexkosi/logo/CDI.png | Bin 0 -> 9623 bytes .../modules/mod_360_1KA/latexkosi/logo/CDI1.png | Bin 0 -> 27392 bytes .../mod_360_1KA/latexkosi/logo/CDI_glava.png | Bin 0 -> 7557 bytes .../latexkosi/logo/CDI_naslovnica - Copy.png | Bin 0 -> 103881 bytes .../mod_360_1KA/latexkosi/logo/CDI_naslovnica.png | Bin 0 -> 62604 bytes .../modules/mod_360_1KA/latexkosi/logo/circle.png | Bin 0 -> 21379 bytes .../modules/mod_360_1KA/latexkosi/pojasnilo.tex | 21 + .../modules/mod_360_1KA/latexkosi/sloven2e.sty | 42 + .../modules/mod_360_1KA/latexkosi/tabela.tex | 11 + .../survey/modules/mod_360_1KA/latexkosi/uvod.tex | 7 + .../latexkosi/varstvo_osebnih_podatkov.tex | 8 + .../modules/mod_360_1KA/latexkosi/z-noga.tex | 1 + .../survey/modules/mod_360_1KA/results/.gitignore | 2 + admin/survey/modules/mod_MAZA/class.MAZA.php | 1944 ++++++++++++++ admin/survey/modules/mod_MAZA/class.MAZAExport.php | 325 +++ admin/survey/modules/mod_MAZA/css/MAZA.css | 109 + admin/survey/modules/mod_MAZA/info MAZA.txt | 1 + admin/survey/modules/mod_MAZA/js/MAZA.js | 731 ++++++ .../modules/mod_SPEEDINDEX/R/speeder_index.R | 98 + .../mod_SPEEDINDEX/class.SurveySpeedIndex.php | 204 ++ admin/survey/modules/mod_WPN/class.WPN.php | 184 ++ admin/survey/modules/mod_WPN/frontend/_DS_Store | Bin 0 -> 6148 bytes .../mod_WPN/frontend/android-chrome-192x192.png | Bin 0 -> 6211 bytes .../mod_WPN/frontend/android-chrome-512x512.png | Bin 0 -> 14989 bytes .../modules/mod_WPN/frontend/apple-splash-1125.png | Bin 0 -> 91858 bytes .../modules/mod_WPN/frontend/apple-splash-1242.png | Bin 0 -> 107859 bytes .../modules/mod_WPN/frontend/apple-splash-1536.png | Bin 0 -> 109418 bytes .../modules/mod_WPN/frontend/apple-splash-1668.png | Bin 0 -> 129115 bytes .../modules/mod_WPN/frontend/apple-splash-2048.png | Bin 0 -> 181771 bytes .../modules/mod_WPN/frontend/apple-splash-640.png | Bin 0 -> 38268 bytes .../modules/mod_WPN/frontend/apple-splash-750.png | Bin 0 -> 57249 bytes .../modules/mod_WPN/frontend/apple-touch-icon.png | Bin 0 -> 6129 bytes .../modules/mod_WPN/frontend/browserconfig.xml | 9 + admin/survey/modules/mod_WPN/frontend/css/main.css | 509 ++++ .../modules/mod_WPN/frontend/css/normalize.min.css | 1 + .../modules/mod_WPN/frontend/css/production.css | 1 + .../modules/mod_WPN/frontend/favicon-16x16.png | Bin 0 -> 997 bytes .../modules/mod_WPN/frontend/favicon-32x32.png | Bin 0 -> 1785 bytes admin/survey/modules/mod_WPN/frontend/favicon.ico | Bin 0 -> 15086 bytes admin/survey/modules/mod_WPN/frontend/humans.txt | 13 + .../modules/mod_WPN/frontend/img/1ka_logo_en.png | Bin 0 -> 28565 bytes .../survey/modules/mod_WPN/frontend/img/assign.svg | 1 + admin/survey/modules/mod_WPN/frontend/img/aths.png | Bin 0 -> 12051 bytes .../modules/mod_WPN/frontend/img/connected.svg | 1 + admin/survey/modules/mod_WPN/frontend/img/data.svg | 1 + .../modules/mod_WPN/frontend/img/facebook.svg | 1 + .../modules/mod_WPN/frontend/img/googleplay.png | Bin 0 -> 9230 bytes admin/survey/modules/mod_WPN/frontend/img/ios.png | Bin 0 -> 13356 bytes admin/survey/modules/mod_WPN/frontend/img/mail.svg | 1 + .../modules/mod_WPN/frontend/img/mentioned.svg | 1 + .../modules/mod_WPN/frontend/img/messaging.svg | 1 + .../survey/modules/mod_WPN/frontend/img/search.svg | 1 + .../modules/mod_WPN/frontend/img/security.svg | 1 + .../survey/modules/mod_WPN/frontend/img/share.png | Bin 0 -> 4719 bytes admin/survey/modules/mod_WPN/frontend/img/text.svg | 1 + .../modules/mod_WPN/frontend/img/twitter.svg | 1 + .../survey/modules/mod_WPN/frontend/img/vault.svg | 1 + .../modules/mod_WPN/frontend/img/youtube.svg | 1 + admin/survey/modules/mod_WPN/frontend/index.html | 196 ++ admin/survey/modules/mod_WPN/frontend/index1.html | 360 +++ admin/survey/modules/mod_WPN/frontend/js/main.js | 169 ++ .../survey/modules/mod_WPN/frontend/manifest.json | 21 + .../modules/mod_WPN/frontend/mstile-150x150.png | Bin 0 -> 4751 bytes .../modules/mod_WPN/frontend/safari-pinned-tab.svg | 290 +++ admin/survey/modules/mod_WPN/frontend/sw.js | 124 + admin/survey/modules/mod_WPN/frontend/ui.html | 104 + admin/survey/modules/mod_WPN/info WPN.txt | 5 + .../class.SurveyAdvancedParadata.php | 145 ++ .../class.SurveyAdvancedParadataExport.php | 559 ++++ .../class.SurveyAdvancedParadataLog.php | 309 +++ .../docs/Specifikacija parapodatkov.xml | 165 ++ .../mod_advanced_paradata/js/advanced_paradata.js | 556 ++++ .../js/advanced_paradata_postTime.js | 20 + .../mod_advanced_paradata/js/sledenjeOpozoril.js | 264 ++ admin/survey/modules/mod_chat/class.SurveyChat.php | 82 + .../mod_fieldwork/class.SurveyFieldwork.php | 126 + .../survey/modules/mod_geoIP/class.SurveyGeoIP.php | 276 ++ .../class/Ajax/AjaxHierarhijaClass.php | 561 ++++ .../Ajax/AjaxHierarhijaDostopUporabnikovClass.php | 243 ++ .../class/Ajax/AjaxSuperSifraClass.php | 69 + .../class/Ajax/AjaxUporabnikiClass.php | 834 ++++++ .../mod_hierarhija/class/HierarhijaAjaxClass.php | 1063 ++++++++ .../class/HierarhijaAnalysisClass.php | 2617 +++++++++++++++++++ .../mod_hierarhija/class/HierarhijaClass.php | 2261 ++++++++++++++++ .../mod_hierarhija/class/HierarhijaHelper.php | 340 +++ .../mod_hierarhija/class/HierarhijaIzvoz.php | 344 +++ .../class/HierarhijaIzvozAnalize.php | 470 ++++ .../class/HierarhijaKopiranjeClass.php | 418 +++ .../class/HierarhijaPorocilaClass.php | 321 +++ .../modules/mod_hierarhija/css/mod_hierarhija.css | 755 ++++++ .../mod_hierarhija/css/vendor/datatables.min.css | 21 + .../css/vendor/jstree/default-dark/32px.png | Bin 0 -> 1562 bytes .../css/vendor/jstree/default-dark/40px.png | Bin 0 -> 5717 bytes .../css/vendor/jstree/default-dark/style.css | 1075 ++++++++ .../css/vendor/jstree/default-dark/style.min.css | 1 + .../css/vendor/jstree/default-dark/throbber.gif | Bin 0 -> 1720 bytes .../css/vendor/jstree/default/32px.png | Bin 0 -> 3121 bytes .../css/vendor/jstree/default/40px.png | Bin 0 -> 1880 bytes .../css/vendor/jstree/default/style.css | 1031 ++++++++ .../css/vendor/jstree/default/style.min.css | 1 + .../css/vendor/jstree/default/throbber.gif | Bin 0 -> 1720 bytes .../css/vendor/jstree/proton/30px.png | Bin 0 -> 6423 bytes .../css/vendor/jstree/proton/32px.png | Bin 0 -> 3333 bytes .../fonts/titillium/titilliumweb-bold-webfont.eot | Bin 0 -> 24108 bytes .../fonts/titillium/titilliumweb-bold-webfont.svg | 2377 +++++++++++++++++ .../fonts/titillium/titilliumweb-bold-webfont.ttf | Bin 0 -> 49936 bytes .../fonts/titillium/titilliumweb-bold-webfont.woff | Bin 0 -> 27344 bytes .../titillium/titilliumweb-extralight-webfont.eot | Bin 0 -> 24056 bytes .../titillium/titilliumweb-extralight-webfont.svg | 2410 +++++++++++++++++ .../titillium/titilliumweb-extralight-webfont.ttf | Bin 0 -> 50224 bytes .../titillium/titilliumweb-extralight-webfont.woff | Bin 0 -> 27108 bytes .../titillium/titilliumweb-regular-webfont.eot | Bin 0 -> 25059 bytes .../titillium/titilliumweb-regular-webfont.svg | 2725 ++++++++++++++++++++ .../titillium/titilliumweb-regular-webfont.ttf | Bin 0 -> 50788 bytes .../titillium/titilliumweb-regular-webfont.woff | Bin 0 -> 28152 bytes .../css/vendor/jstree/proton/style.css | 1122 ++++++++ .../css/vendor/jstree/proton/style.min.css | 1 + .../css/vendor/jstree/proton/throbber.gif | Bin 0 -> 1720 bytes .../mod_hierarhija/css/vendor/select2.min.css | 1 + .../modules/mod_hierarhija/db_hirarhija_create.sql | 190 ++ .../survey/modules/mod_hierarhija/img/sort_asc.png | Bin 0 -> 160 bytes .../mod_hierarhija/img/sort_asc_disabled.png | Bin 0 -> 148 bytes .../modules/mod_hierarhija/img/sort_both.png | Bin 0 -> 201 bytes .../modules/mod_hierarhija/img/sort_desc.png | Bin 0 -> 158 bytes .../mod_hierarhija/img/sort_desc_disabled.png | Bin 0 -> 146 bytes admin/survey/modules/mod_hierarhija/index.php | 5 + .../modules/mod_hierarhija/js/vendor/custom-vue.js | 1545 +++++++++++ .../modules/mod_hierarhija/js/vendor/custom.js | 832 ++++++ .../js/vendor/datatables-slovenian.json | 23 + .../mod_hierarhija/js/vendor/datatables.min.js | 237 ++ .../mod_hierarhija/js/vendor/hierarhija_analize.js | 363 +++ .../js/vendor/jquery.nicefileinput.min.js | 1 + .../modules/mod_hierarhija/js/vendor/jstree.min.js | 6 + .../modules/mod_hierarhija/js/vendor/onload.js | 16 + .../mod_hierarhija/js/vendor/select2.min.js | 3 + .../modules/mod_hierarhija/js/vendor/status.js | 137 + .../mod_hierarhija/js/vendor/vue-resource.min.js | 7 + .../modules/mod_hierarhija/js/vendor/vue.min.js | 9 + .../mod_hierarhija/model/HierarhijaOnlyQuery.php | 328 +++ .../mod_hierarhija/model/HierarhijaQuery.php | 981 +++++++ .../mod_hierarhija/porocila/R/Anketiranci.docx | Bin 0 -> 18072 bytes .../mod_hierarhija/porocila/R/Hierarhija_1ka.R | 358 +++ .../mod_hierarhija/porocila/R/Hierarhija_1ka_pdf.R | 315 +++ .../porocila/R/Hierarhija_1ka_streznik.R | 348 +++ .../modules/mod_hierarhija/porocila/R/test.tex | 1 + .../modules/mod_hierarhija/porocila/R/test_1ka.R | 19 + .../mod_hierarhija/porocila/R/test_1ka_pdf.R | 17 + .../porocila/latexkosi/samoevalvacija_glava.tex | 91 + .../porocila/latexkosi/samoevalvacija_noga.tex | 1 + .../mod_hierarhija/porocila/results/.gitignore | 3 + .../porocila/results/slike/.gitignore | 2 + .../mod_hierarhija/porocila/temp/.gitignore | 2 + .../class.SurveyJsonSurveyData.php | 642 +++++ .../docs/Demo izvoza Test 1, r1-NB.json | 374 +++ .../docs/Specifikacija izvoza, r1-NB.docx | Bin 0 -> 38741 bytes .../survey/modules/mod_kakovost/R/calc.usability.R | 72 + .../survey/modules/mod_kakovost/R/gen.survey.str.R | 71 + .../modules/mod_kakovost/R/gen.usability.matrix.R | 181 ++ admin/survey/modules/mod_kakovost/R/kakovost.R | 47 + .../modules/mod_kakovost/class.SurveyKakovost.php | 906 +++++++ .../survey/modules/mod_panel/class.SurveyPanel.php | 168 ++ admin/survey/modules/mod_quiz/class.SurveyQuiz.php | 106 + .../mod_slideshow/class.SurveySlideshow.php | 248 ++ .../modules/mod_uporabnost/R/calc.usability.R | 72 + .../modules/mod_uporabnost/R/gen.survey.str.R | 71 + .../mod_uporabnost/R/gen.usability.matrix.R | 181 ++ admin/survey/modules/mod_uporabnost/R/uporabnost.R | 47 + .../mod_uporabnost/class.SurveyUporabnost.php | 1023 ++++++++ .../modules/mod_uporabnost/results/.gitignore | 2 + .../survey/modules/mod_uporabnost/temp/.gitignore | 2 + .../R/app/rsconnect/shinyapps.io/1kadsa/vizual.dcf | 10 + .../modules/mod_vizualizacija/R/app/vizual.R | 58 + .../class.SurveyVizualizacija.php | 211 ++ .../modules/mod_voting/class.SurveyVoting.php | 71 + 177 files changed, 40802 insertions(+) create mode 100644 admin/survey/modules/mod_360_1KA/R/360_stopinj_1ka.R create mode 100644 admin/survey/modules/mod_360_1KA/class.Survey3601ka.php create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/a-glava-1ka.tex create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI.png create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI1.png create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_glava.png create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_naslovnica - Copy.png create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_naslovnica.png create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/logo/circle.png create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/pojasnilo.tex create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/sloven2e.sty create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/tabela.tex create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/uvod.tex create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/varstvo_osebnih_podatkov.tex create mode 100644 admin/survey/modules/mod_360_1KA/latexkosi/z-noga.tex create mode 100644 admin/survey/modules/mod_360_1KA/results/.gitignore create mode 100644 admin/survey/modules/mod_MAZA/class.MAZA.php create mode 100644 admin/survey/modules/mod_MAZA/class.MAZAExport.php create mode 100644 admin/survey/modules/mod_MAZA/css/MAZA.css create mode 100644 admin/survey/modules/mod_MAZA/info MAZA.txt create mode 100644 admin/survey/modules/mod_MAZA/js/MAZA.js create mode 100644 admin/survey/modules/mod_SPEEDINDEX/R/speeder_index.R create mode 100644 admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php create mode 100644 admin/survey/modules/mod_WPN/class.WPN.php create mode 100644 admin/survey/modules/mod_WPN/frontend/_DS_Store create mode 100644 admin/survey/modules/mod_WPN/frontend/android-chrome-192x192.png create mode 100644 admin/survey/modules/mod_WPN/frontend/android-chrome-512x512.png create mode 100644 admin/survey/modules/mod_WPN/frontend/apple-splash-1125.png create mode 100644 admin/survey/modules/mod_WPN/frontend/apple-splash-1242.png create mode 100644 admin/survey/modules/mod_WPN/frontend/apple-splash-1536.png create mode 100644 admin/survey/modules/mod_WPN/frontend/apple-splash-1668.png create mode 100644 admin/survey/modules/mod_WPN/frontend/apple-splash-2048.png create mode 100644 admin/survey/modules/mod_WPN/frontend/apple-splash-640.png create mode 100644 admin/survey/modules/mod_WPN/frontend/apple-splash-750.png create mode 100644 admin/survey/modules/mod_WPN/frontend/apple-touch-icon.png create mode 100644 admin/survey/modules/mod_WPN/frontend/browserconfig.xml create mode 100644 admin/survey/modules/mod_WPN/frontend/css/main.css create mode 100644 admin/survey/modules/mod_WPN/frontend/css/normalize.min.css create mode 100644 admin/survey/modules/mod_WPN/frontend/css/production.css create mode 100644 admin/survey/modules/mod_WPN/frontend/favicon-16x16.png create mode 100644 admin/survey/modules/mod_WPN/frontend/favicon-32x32.png create mode 100644 admin/survey/modules/mod_WPN/frontend/favicon.ico create mode 100644 admin/survey/modules/mod_WPN/frontend/humans.txt create mode 100644 admin/survey/modules/mod_WPN/frontend/img/1ka_logo_en.png create mode 100644 admin/survey/modules/mod_WPN/frontend/img/assign.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/aths.png create mode 100644 admin/survey/modules/mod_WPN/frontend/img/connected.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/data.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/facebook.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/googleplay.png create mode 100644 admin/survey/modules/mod_WPN/frontend/img/ios.png create mode 100644 admin/survey/modules/mod_WPN/frontend/img/mail.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/mentioned.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/messaging.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/search.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/security.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/share.png create mode 100644 admin/survey/modules/mod_WPN/frontend/img/text.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/twitter.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/vault.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/img/youtube.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/index.html create mode 100644 admin/survey/modules/mod_WPN/frontend/index1.html create mode 100644 admin/survey/modules/mod_WPN/frontend/js/main.js create mode 100644 admin/survey/modules/mod_WPN/frontend/manifest.json create mode 100644 admin/survey/modules/mod_WPN/frontend/mstile-150x150.png create mode 100644 admin/survey/modules/mod_WPN/frontend/safari-pinned-tab.svg create mode 100644 admin/survey/modules/mod_WPN/frontend/sw.js create mode 100644 admin/survey/modules/mod_WPN/frontend/ui.html create mode 100644 admin/survey/modules/mod_WPN/info WPN.txt create mode 100644 admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadata.php create mode 100644 admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataExport.php create mode 100644 admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php create mode 100644 admin/survey/modules/mod_advanced_paradata/docs/Specifikacija parapodatkov.xml create mode 100644 admin/survey/modules/mod_advanced_paradata/js/advanced_paradata.js create mode 100644 admin/survey/modules/mod_advanced_paradata/js/advanced_paradata_postTime.js create mode 100644 admin/survey/modules/mod_advanced_paradata/js/sledenjeOpozoril.js create mode 100644 admin/survey/modules/mod_chat/class.SurveyChat.php create mode 100644 admin/survey/modules/mod_fieldwork/class.SurveyFieldwork.php create mode 100644 admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php create mode 100644 admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaClass.php create mode 100644 admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php create mode 100644 admin/survey/modules/mod_hierarhija/class/Ajax/AjaxSuperSifraClass.php create mode 100644 admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php create mode 100644 admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php create mode 100644 admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php create mode 100644 admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php create mode 100644 admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php create mode 100644 admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php create mode 100644 admin/survey/modules/mod_hierarhija/class/HierarhijaIzvozAnalize.php create mode 100644 admin/survey/modules/mod_hierarhija/class/HierarhijaKopiranjeClass.php create mode 100644 admin/survey/modules/mod_hierarhija/class/HierarhijaPorocilaClass.php create mode 100644 admin/survey/modules/mod_hierarhija/css/mod_hierarhija.css create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/datatables.min.css create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/32px.png create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/40px.png create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/style.css create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/style.min.css create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/throbber.gif create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/32px.png create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/40px.png create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/style.css create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/style.min.css create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/throbber.gif create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/30px.png create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/32px.png create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.eot create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.svg create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.ttf create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.woff create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.eot create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.svg create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.ttf create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.woff create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.eot create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.svg create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.ttf create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.woff create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/style.css create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/style.min.css create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/throbber.gif create mode 100644 admin/survey/modules/mod_hierarhija/css/vendor/select2.min.css create mode 100644 admin/survey/modules/mod_hierarhija/db_hirarhija_create.sql create mode 100644 admin/survey/modules/mod_hierarhija/img/sort_asc.png create mode 100644 admin/survey/modules/mod_hierarhija/img/sort_asc_disabled.png create mode 100644 admin/survey/modules/mod_hierarhija/img/sort_both.png create mode 100644 admin/survey/modules/mod_hierarhija/img/sort_desc.png create mode 100644 admin/survey/modules/mod_hierarhija/img/sort_desc_disabled.png create mode 100644 admin/survey/modules/mod_hierarhija/index.php create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/custom-vue.js create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/custom.js create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/datatables-slovenian.json create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/datatables.min.js create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/hierarhija_analize.js create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/jquery.nicefileinput.min.js create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/jstree.min.js create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/onload.js create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/select2.min.js create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/status.js create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/vue-resource.min.js create mode 100644 admin/survey/modules/mod_hierarhija/js/vendor/vue.min.js create mode 100644 admin/survey/modules/mod_hierarhija/model/HierarhijaOnlyQuery.php create mode 100644 admin/survey/modules/mod_hierarhija/model/HierarhijaQuery.php create mode 100644 admin/survey/modules/mod_hierarhija/porocila/R/Anketiranci.docx create mode 100644 admin/survey/modules/mod_hierarhija/porocila/R/Hierarhija_1ka.R create mode 100644 admin/survey/modules/mod_hierarhija/porocila/R/Hierarhija_1ka_pdf.R create mode 100644 admin/survey/modules/mod_hierarhija/porocila/R/Hierarhija_1ka_streznik.R create mode 100644 admin/survey/modules/mod_hierarhija/porocila/R/test.tex create mode 100644 admin/survey/modules/mod_hierarhija/porocila/R/test_1ka.R create mode 100644 admin/survey/modules/mod_hierarhija/porocila/R/test_1ka_pdf.R create mode 100644 admin/survey/modules/mod_hierarhija/porocila/latexkosi/samoevalvacija_glava.tex create mode 100644 admin/survey/modules/mod_hierarhija/porocila/latexkosi/samoevalvacija_noga.tex create mode 100644 admin/survey/modules/mod_hierarhija/porocila/results/.gitignore create mode 100644 admin/survey/modules/mod_hierarhija/porocila/results/slike/.gitignore create mode 100644 admin/survey/modules/mod_hierarhija/porocila/temp/.gitignore create mode 100644 admin/survey/modules/mod_json_survey_export/class.SurveyJsonSurveyData.php create mode 100644 admin/survey/modules/mod_json_survey_export/docs/Demo izvoza Test 1, r1-NB.json create mode 100644 admin/survey/modules/mod_json_survey_export/docs/Specifikacija izvoza, r1-NB.docx create mode 100644 admin/survey/modules/mod_kakovost/R/calc.usability.R create mode 100644 admin/survey/modules/mod_kakovost/R/gen.survey.str.R create mode 100644 admin/survey/modules/mod_kakovost/R/gen.usability.matrix.R create mode 100644 admin/survey/modules/mod_kakovost/R/kakovost.R create mode 100644 admin/survey/modules/mod_kakovost/class.SurveyKakovost.php create mode 100644 admin/survey/modules/mod_panel/class.SurveyPanel.php create mode 100644 admin/survey/modules/mod_quiz/class.SurveyQuiz.php create mode 100644 admin/survey/modules/mod_slideshow/class.SurveySlideshow.php create mode 100644 admin/survey/modules/mod_uporabnost/R/calc.usability.R create mode 100644 admin/survey/modules/mod_uporabnost/R/gen.survey.str.R create mode 100644 admin/survey/modules/mod_uporabnost/R/gen.usability.matrix.R create mode 100644 admin/survey/modules/mod_uporabnost/R/uporabnost.R create mode 100644 admin/survey/modules/mod_uporabnost/class.SurveyUporabnost.php create mode 100644 admin/survey/modules/mod_uporabnost/results/.gitignore create mode 100644 admin/survey/modules/mod_uporabnost/temp/.gitignore create mode 100644 admin/survey/modules/mod_vizualizacija/R/app/rsconnect/shinyapps.io/1kadsa/vizual.dcf create mode 100644 admin/survey/modules/mod_vizualizacija/R/app/vizual.R create mode 100644 admin/survey/modules/mod_vizualizacija/class.SurveyVizualizacija.php create mode 100644 admin/survey/modules/mod_voting/class.SurveyVoting.php (limited to 'admin/survey/modules') diff --git a/admin/survey/modules/mod_360_1KA/R/360_stopinj_1ka.R b/admin/survey/modules/mod_360_1KA/R/360_stopinj_1ka.R new file mode 100644 index 0000000..16b3416 --- /dev/null +++ b/admin/survey/modules/mod_360_1KA/R/360_stopinj_1ka.R @@ -0,0 +1,970 @@ +#Sys.setlocale(category = "LC_ALL", locale = "slovenian") +#Sys.setlocale('LC_CTYPE', 'pl_PL.UTF-8') +Sys.setlocale(category = "LC_CTYPE", locale = "Slovenian") +# Potrebne knjižnjice +libraries <- c('tools', 'psych', 'Hmisc', 'reports', + 'fmsb','car','Cairo','openxlsx','sqldf','data.table', + 'gridExtra','ggplot2','Rcpp','grid','scales') +lapply(libraries, FUN = function(y) { + do.call('require', list(y))}) + +library(scales) +# //Potrebne knjižnjice// # + +# Ustvarimo mape, kamor bomo shranjevali poročilo in pdf grafov +dir.create('modules/mod_360_1KA/results', showWarnings=FALSE) +dir.create('modules/mod_360_1KA/results/slike', showWarnings=FALSE) + + + +# Uvoz podatkov +podatki <- read.csv2("modules/mod_360_1KA/temp/test.csv",sep=";", header=T, fill=T, stringsAsFactors=FALSE,encoding='UTF-8') +if (podatki[1,1]==("Ustreznost") | podatki[1,1]==("Relevance")) {podatki <- podatki[2:nrow(podatki),]} +# Izberemo le veljavne enote (status=6) +podatki <- subset(podatki, status==6) + + +# Ker bomo računalni povprečja iz baze odstranimo tudi vse manjkajolče vrednosti +junk <- c("-1","-2", "-3", "-4", "-5") +# Izberemo vse stolpce, ki se začnejo na črko Q +sel <- grepl("Q",names(podatki)) +podatki[sel] <- lapply(podatki[sel], function(x) replace(x,x %in% junk, NA)) +podatki <- subset(podatki, !(is.na(Q1))) + + +# Povprečja ocen agregirana glede na razmerje (nadrejeni, podrejeni, samoocenjevalec, sodelavec) +# Uporabimo v grafih posameznih kompetenc +razmerjeMean_Q2 <- sqldf(" + select + Q1 + ,round(avg(Q2a),1) as Q2a + ,round(avg(Q2b),1) as Q2b + ,round(avg(Q2c),1) as Q2c + ,round(avg(Q2d),1) as Q2d + ,round(avg(Q2e),1) as Q2e + ,round(avg(Q2f),1) as Q2f + from podatki + group by + Q1 + ") + +razmerjeMean_Q3 <- sqldf(" + select + round(avg(Q3a),1) as Q3a + ,round(avg(Q3b),1) as Q3b + ,round(avg(Q3c),1) as Q3c + ,round(avg(Q3d),1) as Q3d + ,round(avg(Q3e),1) as Q3e + ,round(avg(Q3f),1) as Q3f + ,round(avg(Q3g),1) as Q3g + ,round(avg(Q3h),1) as Q3h + ,round(avg(Q3i),1) as Q3i + from podatki + group by + Q1 + ") + +razmerjeMean_Q4 <- sqldf(" + select + round(avg(Q4a),1) as Q4a + ,round(avg(Q4b),1) as Q4b + ,round(avg(Q4c),1) as Q4c + ,round(avg(Q4d),1) as Q4d + ,round(avg(Q4e),1) as Q4e + ,round(avg(Q4f),1) as Q4f + from podatki + group by + Q1 + ") + +razmerjeMean_Q5 <- sqldf(" + select + round(avg(Q5a),1) as Q5a + ,round(avg(Q5b),1) as Q5b + ,round(avg(Q5c),1) as Q5c + ,round(avg(Q5d),1) as Q5d + ,round(avg(Q5e),1) as Q5e + ,round(avg(Q5f),1) as Q5f + ,round(avg(Q5g),1) as Q5g + from podatki + group by + Q1 + ") + +razmerjeMean_Q6 <- sqldf(" + select + round(avg(Q6a),1) as Q6a + ,round(avg(Q6b),1) as Q6b + ,round(avg(Q6c),1) as Q6c + ,round(avg(Q6d),1) as Q6d + ,round(avg(Q6e),1) as Q6e + ,round(avg(Q6f),1) as Q6f + from podatki + group by + Q1 + ") + +razmerjeMean <- cbind(razmerjeMean_Q2,razmerjeMean_Q3,razmerjeMean_Q4,razmerjeMean_Q5,razmerjeMean_Q6) +razmerjeMean <- as.data.frame(lapply(razmerjeMean, as.numeric)) + +povprecja.razmerij <- razmerjeMean +#Izračun skupnih povprečij posameznih komponent +povprecja.razmerij$Q2_komuniciranje <- round(rowMeans(razmerjeMean[grepl("Q2",names(razmerjeMean))],na.rm=T),1) +povprecja.razmerij$Q3_odlocanje <- round(rowMeans(razmerjeMean[grepl("Q3",names(razmerjeMean))],na.rm=T),1) +povprecja.razmerij$Q4_vodenje_ravnanje <-round(rowMeans(razmerjeMean[grepl("Q4",names(razmerjeMean))],na.rm=T),1) +povprecja.razmerij$Q5_vodenje_projektov <- round(rowMeans(razmerjeMean[grepl("Q5",names(razmerjeMean))],na.rm=T),1) +povprecja.razmerij$Q6_medosebne_vescine <- round(rowMeans(razmerjeMean[grepl("Q6",names(razmerjeMean))],na.rm=T),1) + + +# Povprečja posameznih kompetence glede na razmerje do ocenjevane osebe +# Skupna povprečja po stolpcih za GRAFE +# Prikažemo posamezne barplote povprečne ocene glede na razmerje +Q2_komuniciranje <- round(colMeans(razmerjeMean[grepl("Q2",names(razmerjeMean))],na.rm=T),1) +Q3_odlocanje <- round(colMeans(razmerjeMean[grepl("Q3",names(razmerjeMean))],na.rm=T),1) +Q4_vodenje_ravnanje <- round(colMeans(razmerjeMean[grepl("Q4",names(razmerjeMean))],na.rm=T),1) +Q5_vodenje_projektov <- round(colMeans(razmerjeMean[grepl("Q5",names(razmerjeMean))],na.rm=T),1) +Q6_medosebne_vescine <- round(colMeans(razmerjeMean[grepl("Q6",names(razmerjeMean))],na.rm=T),1) +## Povprečja kompetenc glede na razmerje do ocenjevane osebe// ## + + +#Skupna povprečja po stolpcih za posamezne TABELE # Skupne ocene +osnovni.podatki <- podatki +osnovni.podatki <- as.data.frame(suppressWarnings(lapply(osnovni.podatki, as.numeric))) +Q2_komuniciranje.skupaj <- round(colMeans(osnovni.podatki[grepl("Q2",names(osnovni.podatki))],na.rm=T),1) +Q3_odlocanje.skupaj <- round(colMeans(osnovni.podatki[grepl("Q3",names(osnovni.podatki))],na.rm=T),1) +Q4_vodenje_ravnanje.skupaj <- round(colMeans(osnovni.podatki[grepl("Q4",names(osnovni.podatki))],na.rm=T),1) +Q5_vodenje_projektov.skupaj <- round(colMeans(osnovni.podatki[grepl("Q5",names(osnovni.podatki))],na.rm=T),1) +Q6_medosebne_vescine.skupaj <- round(colMeans(osnovni.podatki[grepl("Q6",names(osnovni.podatki))],na.rm=T),1) + +# //TABELE # Skupne ocene// # + + +# pretvorba imen stolpcev in vrstic tabel za latex znake +toLatex <- function(tabela) { + if (!is.null(colnames(tabela))) { + colnames(tabela) <- Hmisc::latexTranslate(colnames(tabela)) + } + if (!is.null(rownames(tabela))) { + rownames(tabela) <- Hmisc::latexTranslate(rownames(tabela)) + } + return(tabela) +} +## + +############################## +## Opisne statistike za tabele +############################## +# N oz. število odgovorov +predN <- apply(osnovni.podatki[c(grepl("Q",names(osnovni.podatki)))],2, FUN=function(x) sum(!is.na(x))) +names(predN) <- paste0(names(predN),"_N") +#SD +predSd <- apply(osnovni.podatki[c(grepl("Q",names(osnovni.podatki)))], 2, FUN=sd, na.rm=TRUE) +names(predSd) <- paste0(names(predSd),"_sd") +predSd <- round(predSd,1) +#MIN +predMin <- apply(osnovni.podatki[c(grepl("Q",names(osnovni.podatki)))], 2, FUN=min, na.rm=TRUE) +names(predMin) <- paste0(names(predMin),"_max") +predMin[predMin==Inf] <- NA +#MAX +predMax <- apply(osnovni.podatki[c(grepl("Q",names(osnovni.podatki)))],2, FUN=max, na.rm=TRUE) +names(predMax) <- paste0(names(predMax),"_max") +predMax[predMax==Inf] <- NA +## //Opisne statistike za tabele// ## + + +########################### +#### making latex file #### +########################### +## LATEX TABLE 1: Q2 KOMUNICIRANJE +mean.Q2_komuniciranje.skupaj <- round(mean(Q2_komuniciranje.skupaj),1) + +tabela.Q2 <- cbind.data.frame( + N = as.numeric(predN[grepl("Q2",names(predN))]), + mean = Q2_komuniciranje.skupaj, + sd = as.numeric(predSd[grepl("Q2",names(predSd))]), + min = as.numeric(predMin[grepl("Q2",names(predMin))]), + max = as.numeric(predMax[grepl("Q2",names(predMax))])) +# Če je NA naj se v tabeli prikaže "." +tabela.Q2[is.na(tabela.Q2)] <- "." +# Dodamo skupno povprečje komponent +tabela.Q2 <- rbind(tabela.Q2, c('',mean.Q2_komuniciranje.skupaj,'','','')) + +# Dodamo imena vrstic, ki bodo imena anketnih vprašanj +namesQ2_komuniciranje <- c("Sposobnost besednega izražanja pri predstavitvi ideje.", + "Sposobnost pravočasnega in točnega poročanja.", + "Sposobnost informiranja drugih.", + "Sposobnost spodbujanja in uporabe odkrite komunikacije.", + "Sposobnost podajanja točnih in usklajenih informacij ali navodil.", + "Sposobnost uporabe primernih komunikacijskih orodij.") + +rownames(tabela.Q2) <- c(Hmisc::latexTranslate(paste0("\\hline\n",namesQ2_komuniciranje)), "\\hline\n\\textbf{Skupaj}") +# Imena stolpcev +colnames(tabela.Q2) <- c("\\textbf{n}","\\textbf{povprečje}","\\textbf{std. odklon}","\\textbf{min}","\\textbf{max}") + +# Latex tabela +tabelatex1 <- capture.output(Hmisc::latex(toLatex(tabela.Q2), + caption="Povprečje komponent ", + rowlabel='\\textbf{Kompetence komuniciranja}', + file='', + where='H', + col.just=rep_len('|c', ncol(tabela.Q2)), + rowlabel.just='m{8cm}')) + +## //LATEX TABLE 1: Q2 KOMUNICIRANJE// ## + + +#################################################### +## LATEX TABLE 2: Q3 Sposobnost odločanja in presoje +#################################################### +# Izračunamo skupno povprečje +mean.Q3_odlocanje.skupaj <- round(mean(Q3_odlocanje.skupaj),1) + +tabela.Q3 <- cbind.data.frame( + N = as.numeric(predN[grepl("Q3",names(predN))]), + mean = Q3_odlocanje.skupaj, + sd = as.numeric(predSd[grepl("Q3",names(predSd))]), + min = as.numeric(predMin[grepl("Q3",names(predMin))]), + max = as.numeric(predMax[grepl("Q3",names(predMax))])) + +# Če je NA naj se v tabeli prikaže "." +tabela.Q3[is.na(tabela.Q3)] <- "." +# Dodamo skupno povprečje komponent +tabela.Q3 <- rbind(tabela.Q3, c('',mean.Q3_odlocanje.skupaj,'','','')) + +# Dodamo imena vrstic, ki bodo imena anketnih vprašanj +namesQ3_sposobnost <- c("Sposobnost dobrih in pravočasnih odločitev.", + "Sposobnost samozavestnega in suverenega odločanja.", + "Sposobnost uporabe sistematičnega in analitičnega pristopa.", + "Sposobnost sprejemanja dobrih odločitev tudi pod pritiskom.", + "Sposobnost mediacije in iskanja konsenza med vpletenimi v konfliktu. ", + "Sposobnost sprejemanja odločitev in ukrepov v težkih situacijah.", + "Sposobnost prevzemanja odgovornosti za svoje odločitve.", + "Sposobnost uporabe preteklih izkušenj.", + "Sposobnost širokega razmišljanja.") + +rownames(tabela.Q3) <- c(Hmisc::latexTranslate(paste0("\\hline\n",namesQ3_sposobnost)), "\\hline\n\\textbf{Skupaj}") +# Imena stolpcev +colnames(tabela.Q3) <- c("\\textbf{n}","\\textbf{povprečje}","\\textbf{std. odklon}","\\textbf{min}","\\textbf{max}") + +# Latex tabela +tabelatex2 <- capture.output(Hmisc::latex(toLatex(tabela.Q3), + caption="Povprečje komponent ", + rowlabel='\\textbf{Kompetence sposobnosti odločanja in presoje}', + file='', + where='H', + col.just=rep_len('|c', ncol(tabela.Q3)), + rowlabel.just='m{8cm}')) + +## //LATEX TABLE 2: Q3 Sposobnost odločanja in presoje// ## + + + + +################################################# +## LATEX TABLE 3: Q4 Vodenje in ravnanje z ljudmi +################################################# +# Izračunamo še skupna povprečja +mean.Q4_vodenje_ravnanje.skupaj <- round(mean(Q4_vodenje_ravnanje.skupaj),1) + +tabela.Q4 <- cbind.data.frame( + N = as.numeric(predN[grepl("Q4",names(predN))]), + mean = Q4_vodenje_ravnanje.skupaj, + sd = as.numeric(predSd[grepl("Q4",names(predSd))]), + min = as.numeric(predMin[grepl("Q4",names(predMin))]), + max = as.numeric(predMax[grepl("Q4",names(predMax))])) + +# Če je NA naj se v tabeli prikaže "." +tabela.Q4[is.na(tabela.Q4)] <- "." +# Dodamo skupno povprečje komponent +tabela.Q4 <- rbind(tabela.Q4, c('',mean.Q4_vodenje_ravnanje.skupaj,'','','')) + +# Dodamo imena vrstic, ki bodo imena anketnih vprašanj +namesQ4_vodenje <- c("Sposobnost spodbujanja in motiviranja zaposlenih.", + "Sposobnost definiranja nalog in odgovornost.", + "Sposobnost modrega in učinkovitega delegiranja.", + "Sposobnost vzdrževanja dobrega, zabavnega in stimulativnega delovnega okolja.", + "Sposobnost nagrajevanja posamičnih in skupinskih dosežkov in dela.", + "Sposobnost razvijanja sodelovanja na vseh ravneh.") + +rownames(tabela.Q4) <- c(Hmisc::latexTranslate(paste0("\\hline\n",namesQ4_vodenje)), "\\hline\n\\textbf{Skupaj}") +# Imena stolpcev +colnames(tabela.Q4) <- c("\\textbf{n}","\\textbf{povprečje}","\\textbf{std. odklon}","\\textbf{min}","\\textbf{max}") + +# Latex tabela +tabelatex3 <- capture.output(Hmisc::latex(toLatex(tabela.Q4), + caption="Povprečje komponent ", + rowlabel='\\textbf{Kompetence vodenja in ravnanja z ljudmi}', + file='', + where='H', + col.just=rep_len('|c', ncol(tabela.Q4)), + rowlabel.just='m{8cm}')) + +## //LATEX TABLE 3: Q4 Vodenje in ravnanje z ljudmi// ## + + + + +################################################# +## LATEX TABLE 4: Q5 Vodenje projektov +################################################# +# Izračunamo še skupna povprečja +mean.Q5_vodenje_projektov.skupaj <- round(mean(Q5_vodenje_projektov.skupaj),1) + +tabela.Q5 <- cbind.data.frame( + N = as.numeric(predN[grepl("Q5",names(predN))]), + mean = Q5_vodenje_projektov.skupaj, + sd = as.numeric(predSd[grepl("Q5",names(predSd))]), + min = as.numeric(predMin[grepl("Q5",names(predMin))]), + max = as.numeric(predMax[grepl("Q5",names(predMax))])) + +# Če je NA naj se v tabeli prikaže "." +tabela.Q5[is.na(tabela.Q5)] <- "." +# Dodamo skupno povprečje komponent +tabela.Q5 <- rbind(tabela.Q5, c('',mean.Q5_vodenje_projektov.skupaj,'','','')) + +# Dodamo imena vrstic, ki bodo imena anketnih vprašanj +namesQ5_vodenje_projektov <- c("Sposobnost postavljanja jasnih in merljivih ciljev in mejnikov.", + "Sposobnost sistematizacije dela in procesov.", + "Sposobnost opredeljevanja vloge in pristojnosti ter odgovornosti.", + "Sposobnost definiranja potrebnih virov.", + "Sposobnost koordinacije procesov v celotni organizaciji.", + "Sposobnost spremljanja projektov in določanja korektivnih akcij.", + "Sposobnost vodenja več projektov hkrati.") + +rownames(tabela.Q5) <- c(Hmisc::latexTranslate(paste0("\\hline\n",namesQ5_vodenje_projektov)), "\\hline\n\\textbf{Skupaj}") +# Imena stolpcev +colnames(tabela.Q5) <- c("\\textbf{n}","\\textbf{povprečje}","\\textbf{std. odklon}","\\textbf{min}","\\textbf{max}") + +# Latex tabela +tabelatex4 <- capture.output(Hmisc::latex(toLatex(tabela.Q5), + caption="Povprečje komponent ", + rowlabel='\\textbf{Kompetence vodenja projektov}', + file='', + where='H', + col.just=rep_len('|c', ncol(tabela.Q5)), + rowlabel.just='m{8cm}')) + +## //LATEX TABLE 4: Q5 Vodenje projektov// ## + + + + +################################################# +## LATEX TABLE 5: Q6 Medosebne veščine +################################################# +# Izračunamo še skupna povprečja +mean.Q6_medosebne_vescine.skupaj <- round(mean(Q6_medosebne_vescine.skupaj),1) + +tabela.Q6 <- cbind.data.frame( + N = as.numeric(predN[grepl("Q6",names(predN))]), + mean = Q6_medosebne_vescine.skupaj, + sd = as.numeric(predSd[grepl("Q6",names(predSd))]), + min = as.numeric(predMin[grepl("Q6",names(predMin))]), + max = as.numeric(predMax[grepl("Q6",names(predMax))])) + +# Če je NA naj se v tabeli prikaže "." +tabela.Q6[is.na(tabela.Q6)] <- "." +# Dodamo skupno povprečje komponent +tabela.Q6 <- rbind(tabela.Q6, c('',mean.Q6_medosebne_vescine.skupaj,'','','')) + +# Dodamo imena vrstic, ki bodo imena anketnih vprašanj +namesQ6_vescine <- c("Sposobnost reševanja konfliktov.", + "Sposobnost poslušanja.", + "Sposobnost podajanja povratnih informacij in konstruktivne kritike.", + "Sposobnost grajenja neformalnih odnosov za doseganje ciljev.", + "Sposobnost prilagodljivosti in odprte glave.", + "Sposobnost pogajanja.") + +rownames(tabela.Q6) <- c(Hmisc::latexTranslate(paste0("\\hline\n",namesQ6_vescine)),"\\hline\n\\textbf{Skupaj}") +# Imena stolpcev +colnames(tabela.Q6) <- c("\\textbf{n}","\\textbf{povprečje}","\\textbf{std. odklon}","\\textbf{min}","\\textbf{max}") + +# Latex tabela +tabelatex5 <- capture.output(Hmisc::latex(toLatex(tabela.Q6), + caption="Povprečje komponent", + rowlabel='\\textbf{Medosebne veščine}', + file='', + where='H', + col.just=rep_len('|c', ncol(tabela.Q6)), + rowlabel.just='m{8cm}')) + +## //LATEX TABLE 5: Q6 Medosebne veščine// ## + + + +######### +#BARPLOT +######### +# Rangiranje kompetenc + +tabela.cont <- cbind.data.frame( + a = povprecja.razmerij$Q2_komuniciranje, + b = povprecja.razmerij$Q3_odlocanje, + c = povprecja.razmerij$Q4_vodenje_ravnanje, + d = povprecja.razmerij$Q5_vodenje_projektov, + e = povprecja.razmerij$Q6_medosebne_vescine) + + +tabela.cont1 <- t(tabela.cont) +tabela.cont2 <- rowMeans(tabela.cont1) +tabela.cont1.means <- colMeans(tabela.cont1) + +tabela.cont <- rbind(tabela.cont1, tabela.cont1.means) +tabela.cont2 <- rowMeans(tabela.cont) +tabela.cont <- cbind(tabela.cont,tabela.cont2) +tabela.cont <- round(tabela.cont, 1) + +tabela.odstopanje.max <- apply(tabela.cont, 1, max) +tabela.odstopanje.min <- apply(tabela.cont, 1, min) +tabela.odstop.skupaj <- tabela.odstopanje.max - tabela.odstopanje.min +tabela.cont <- cbind(tabela.cont, round(tabela.odstop.skupaj,1)) +rownames(tabela.cont) <- c("Komuniciranje","Sposobnost odločanja","Vodenje in ravnanje", + "Vodenje projektov","Medosebne veščine",'\\hline\n\\textbf{Povprečje}') +colnames(tabela.cont) <- c('Nadrejeni', 'Podrejeni', 'Sodelavec', 'Samoocenjevalec',"\\textbf{Skupaj}","\\textbf{Odstopanje}") + +# Latex tabele +tabela.contR.tex <- capture.output(Hmisc::latex(toLatex(tabela.cont), + caption="Rangirane kompetence glede na povprečje rezultatov", + rowlabel='Kompetenca', + file='', + where='H', + col.just=c("|c","|c","|c","|c|","|c","|c"), + rowlabel.just='m{5cm}')) + + +## TABELA ZA <- Rangiranje kompetenc ## +tabela.matrix <- cbind.data.frame( + a = povprecja.razmerij$Q2_komuniciranje, + b = povprecja.razmerij$Q3_odlocanje, + c = povprecja.razmerij$Q4_vodenje_ravnanje, + d = povprecja.razmerij$Q5_vodenje_projektov, + e = povprecja.razmerij$Q6_medosebne_vescine) + +tabela.matrix<-t(tabela.matrix) +rownames(tabela.cont) <- c("Komuniciranje","Sposobnost odločanja","Vodenje in ravnanje", + "Vodenje projektov","Medosebne veščine",'\\hline\n\\textbf{Povprečje}') +colnames(tabela.matrix) <- c('Nadrejeni', 'Podrejeni', 'Enak nivo', 'Samoocenjevalec') +tabela.matrix <- round(tabela.matrix, 1) + +## GRAF ## +# BARPLOT RANGIRANIH KOMPETENC +df <- as.data.frame(tabela.matrix) +rownames(df) <- c("Komuniciranje", "Sposobnost odlocanja", "Vodenje in ravnanje", "Vodenje projektov", "Medosebne vescine") +df$name <- rownames(df) + +# Data.table +df2 <- melt(setDT(df), id="name") +df2[, difference := max(value) - min(value), by = name] + + + +pdf(paste('modules/mod_360_1KA/results/slike/rangiranje_kompetenc.pdf', sep=''), family='sans', pointsize=11, width=8, height=7,encoding = 'CP1250') + + + +# GGplot +p <- ggplot(df2, aes(x=name, y=value, fill=variable)) + + theme_bw()+ + geom_bar(stat="identity",width=0.8, position="dodge") + + geom_line(aes(x=name, y=difference, group=1), size=1.5, color="red") + + scale_x_discrete(expand = c(0,0)) + + scale_y_continuous(expand = c(0,0), limits = c(0,5)) + + theme(legend.position = "bottom", axis.text.x = element_text(angle = 20,vjust = 0.3)) + + scale_fill_manual(values = c("#d99694", "#c00000", "#632523","#7F7F7F")) + + geom_text(aes(x = name, y = 0.15, label = round(value, 2), fill = variable), + angle = 90, position = position_dodge(width = 0.7), size = 5) + +# Odstranimo še imena x in y osi ter naslov legende +p + labs(x="",y="")+ guides(fill=guide_legend(title=NULL)) + +dev.off() + +tex.graf <- c(paste0( + "\\begin{figure}[H]", + "\\caption{Razlike med ocenjevalci za povprečno oceno na \\textbf{vseh kompetencah}}", + paste0("\\centerline{\\includegraphics[width=0.80\\textwidth]{slike/rangiranje_kompetenc.pdf}}"), + "\\end{figure}") + +) +## //RANGIRANJE KOMPETENC// ## + + + +##################################### +# PRIPRAVA PDOATKOV ZA GRAFE: GGPLOT +#################################### +# Najprej ustvarimo spremenljivke v katere zapišemo tekst vprašanj, ki se bo prikazal na grafih, na y osi +# IMENA KOMPETENC ZA GGPLOT pod tabelami za posamenzo kompetenco. Prikaz CELOTNEGA TEKSTA ## +###### +## TEKST Q2 KOMUNICIRANJE ## +##### +names(Q2_komuniciranje.skupaj) <- (namesQ2_komuniciranje) +# Za prikaz CELOTNEGA teksta v ggplotu +# Dodaj line break oz. nov odstavek za vsakih 30 znakov teksta. +names.komuniciranje <- gsub('(.{1,43})(\\s|$)', '\\1\n',names(Q2_komuniciranje.skupaj)) + +###### +## TEKST Q3 SPOSOBNOST ODLOČANJA ## +##### +names(Q3_odlocanje.skupaj) <- (namesQ3_sposobnost) +# Za prikaz CELOTNEGA teksta v ggplotu +# Dodaj line break oz. nov odstavek za vsakih 30 znakov teksta. +names.sposobnost <- gsub('(.{1,43})(\\s|$)', '\\1\n',names(Q3_odlocanje.skupaj)) + +###### +## TEKST Q4 Vodenje in ravnanje z ljudmi ## +##### +names(Q4_vodenje_ravnanje.skupaj) <- (namesQ4_vodenje) +# Za prikaz CELOTNEGA teksta v ggplotu +# Dodaj line break oz. nov odstavek za vsakih 30 znakov teksta. +names.vodenje.ravnanje <- gsub('(.{1,43})(\\s|$)', '\\1\n',names(Q4_vodenje_ravnanje.skupaj)) + +###### +## TEKST Q5 Vodenje projektov ## +##### +names(Q5_vodenje_projektov.skupaj) <- (namesQ5_vodenje_projektov) +# Za prikaz CELOTNEGA teksta v ggplotu +# Dodaj line break oz. nov odstavek za vsakih 30 znakov teksta. +names.vodenje.projektov <- gsub('(.{1,43})(\\s|$)', '\\1\n',names(Q5_vodenje_projektov.skupaj)) + +###### +## TEKST Q6 Medosebne veščine ## +##### +names(Q6_medosebne_vescine.skupaj) <- (namesQ6_vescine) +# Za prikaz CELOTNEGA teksta v ggplotu +# Dodaj line break oz. nov odstavek za vsakih 30 znakov teksta. +names.vescine <- gsub('(.{1,43})(\\s|$)', '\\1\n',names(namesQ6_vescine)) + +## //IMENA KOMPETENC// ## + + +############################################################## +## IZRAČUN POVPREČIJ POSAMEZNE SKUPINE ZA POSAMEZNO KOMPETENCO +############################################################## +########### +# NADREJENI +########### +nadrejeni <- subset(razmerjeMean, Q1==1) +#1 Q2 Komuniciranje +nadrejeni.komuniciranje <- colMeans(nadrejeni[grepl("Q2",names(nadrejeni))],na.rm=T) +#2 Q3 Sposobnost odločanja in presoje +nadrejeni.odlocanje <- colMeans(nadrejeni[grepl("Q3",names(nadrejeni))],na.rm=T) +#3 Q4 Vodenje in ravnanje z ljudmi +nadrejeni.vodenje.ravananje <- colMeans(nadrejeni[grepl("Q4",names(nadrejeni))],na.rm=T) +#5 Q5 Vodenje projektov +nadrejeni.vodenje.projektov <- colMeans(nadrejeni[grepl("Q5",names(nadrejeni))],na.rm=T) +#6 Q6 Medosebne veščine +nadrejeni.vescine <- colMeans(nadrejeni[grepl("Q6",names(nadrejeni))],na.rm=T) +## //nadrejeni// ## + + +########### +# Podrejeni +########### +podrejeni <- subset(razmerjeMean, Q1==2) +#1 Q2 Komuniciranje +podrejeni.komuniciranje <- colMeans(podrejeni[grepl("Q2",names(podrejeni))],na.rm=T) +#2 Q3 Sposobnost odločanja in presoje +podrejeni.odlocanje <- colMeans(podrejeni[grepl("Q3",names(podrejeni))],na.rm=T) +#3 Q4 Vodenje in ravnanje z ljudmi +podrejeni.vodenje.ravananje <- colMeans(podrejeni[grepl("Q4",names(podrejeni))],na.rm=T) +#5 Q5 Vodenje projektov +podrejeni.vodenje.projektov <- colMeans(podrejeni[grepl("Q5",names(podrejeni))],na.rm=T) +#6 Q6 Medosebne veščine +podrejeni.vescine <- colMeans(podrejeni[grepl("Q6",names(podrejeni))],na.rm=T) + + +########### +# Sodelavec +########### +sodelavec <- subset(razmerjeMean, Q1==3) +#1 Q2 Komuniciranje +sodelavec.komuniciranje <- colMeans(sodelavec[grepl("Q2",names(sodelavec))],na.rm=T) +#2 Q3 Sposobnost odločanja in presoje +sodelavec.odlocanje <- colMeans(sodelavec[grepl("Q3",names(sodelavec))],na.rm=T) +#3 Q4 Vodenje in ravnanje z ljudmi +sodelavec.vodenje.ravananje <- colMeans(sodelavec[grepl("Q4",names(sodelavec))],na.rm=T) +#5 Q5 Vodenje projektov +sodelavec.vodenje.projektov <- colMeans(sodelavec[grepl("Q5",names(sodelavec))],na.rm=T) +#6 Q6 Medosebne veščine +sodelavec.vescine <- colMeans(sodelavec[grepl("Q6",names(sodelavec))],na.rm=T) + +################# +# Samoocenjevalec +################# +samoocenjevalec <- subset(razmerjeMean, Q1==4) +#1 Q2 Komuniciranje +samoocenjevalec.komuniciranje <- colMeans(samoocenjevalec[grepl("Q2",names(samoocenjevalec))],na.rm=T) +#2 Q3 Sposobnost odločanja in presoje +samoocenjevalec.odlocanje <- colMeans(samoocenjevalec[grepl("Q3",names(samoocenjevalec))],na.rm=T) +#3 Q4 Vodenje in ravnanje z ljudmi +samoocenjevalec.vodenje.ravananje <- colMeans(samoocenjevalec[grepl("Q4",names(samoocenjevalec))],na.rm=T) +#5 Q5 Vodenje projektov +samoocenjevalec.vodenje.projektov <- colMeans(samoocenjevalec[grepl("Q5",names(samoocenjevalec))],na.rm=T) +#6 Q6 Medosebne veščine +samoocenjevalec.vescine <- colMeans(samoocenjevalec[grepl("Q6",names(samoocenjevalec))],na.rm=T) +## //IZRAČUN POVPREČIJ POSAMEZNE SKUPINE ZA POSAMEZNO KOMPETENCO// ## + + + +#################GGPLOT############################# +##GGPLOT GRAF ZA POSAMEZNO SKUPINO POD TABELAMI##### +#################################################### + +####### GGPLOT Q2 KOMUNICIRANJE ######## +library(reshape2) +kompetenc.Q2.KOMUNICIRANJE <- rbind(nadrejeni.komuniciranje,podrejeni.komuniciranje,sodelavec.komuniciranje,samoocenjevalec.komuniciranje) +kompetenc.Q2.KOMUNICIRANJE <- t(as.matrix(kompetenc.Q2.KOMUNICIRANJE)) +colnames(kompetenc.Q2.KOMUNICIRANJE) <- c("Nadrejeni", "Podrejeni", "Enak nivo", "Samooc.") +test<- c("Sposobnost besednega izrazanja pri predstavitvi ideje.", + "Sposobnost pravocasnega in tocnega porocanja.", + "Sposobnost informiranja drugih.", + "Sposobnost spodbujanja in uporabe odkrite komunikacije.", + "Sposobnost podajanja tocnih in usklajenih informacij ali navodil.", + "Sposobnost uporabe primernih komunikacijskih orodij.") +rownames(kompetenc.Q2.KOMUNICIRANJE) <- test + + + +ggplot.Q2 <- melt(kompetenc.Q2.KOMUNICIRANJE) + + +pdf(paste('modules/mod_360_1KA/results/slike/ggplot_komuniciranje.pdf', sep=''), pointsize=10, width=7.5, height=6.5,encoding = 'CP1250') + + + +p<-ggplot(ggplot.Q2, aes(y = value,x = Var1, fill = Var2)) + coord_flip()+ + theme_bw() + + scale_y_continuous(expand=c(0,0), limits=c(0,5.4),oob = rescale_none) + + scale_fill_manual(values = c("#d99694", "#c00000", "#632523","#7F7F7F")) + xlim(rev(levels(ggplot.Q2$Var1)))+ + theme(axis.title=element_blank(),axis.ticks.y=element_blank(),legend.position = "bottom", + axis.text.x = element_text(angle = 0,vjust = 0.4)) + + geom_bar(stat = "identity", width = 0.7, position = position_dodge(width=0.7)) + + geom_text(aes(x = Var1, y=5.2, label = round(value, 2), fill = Var2), + angle = 0, position = position_dodge(width = 0.7), size = 4.2) +p <- p + labs(fill="") +#Nastavitve sirine in višine legende +#p + guides(fill=guide_legend( +# keywidth=1, +# keyheight=1, +# default.unit="inch") +#) +p2 <- p + + stat_summary(fun.y = mean, color = "red", geom = "line", aes(group = 1)) + + stat_summary(fun.y = mean, color = "black", geom ="point", aes(group = 1), size = 3, + show.legend = FALSE) + +# This is the data for your dots in the graph +foo <- as.data.frame(ggplot_build(p2)$data[[4]]) +foo$y <- round(foo$y, 1) + +p2 + annotate("text", x = foo$x, y = foo$y + 0.5, color = "black", label = foo$y) + +dev.off() + +# SLIKA GRAFA: Latex in PDF +tex.ggplot.Q2 <- c(paste0( + "\\begin{figure}[H]", + "\\caption{Povprečje komponent po skupinah \\textbf{kompetence komuniciranja}}", + paste0("\\centerline{\\includegraphics[width=0.85\\textwidth]{slike/ggplot_komuniciranje.pdf}}"), + "\\end{figure}")) +## //GGPLOT Q2 KOMUNICIRANJE// ## + +######################### + +####### GGPLOT Q3 SPOSOBNOST ODLOČANJA IN PRESOJE ######## + + +pdf(paste('modules/mod_360_1KA/results/slike/ggplot_odlocanje.pdf', sep=''), family = 'sans', pointsize=10, width=7.5, height=7,encoding = 'CP1250') + +kompetenc.Q3.SPOSOBNOST.OD <- rbind(nadrejeni.odlocanje,podrejeni.odlocanje,sodelavec.odlocanje,samoocenjevalec.odlocanje) +kompetenc.Q3.SPOSOBNOST.OD <- t(as.matrix(kompetenc.Q3.SPOSOBNOST.OD)) +colnames(kompetenc.Q3.SPOSOBNOST.OD) <- c("Nadrejeni", "Podrejeni", "Enak nivo", "Samooc.") + + + +#test22 <- c("Sposobnost dobrih in pravočasnih odločitev.", + # "odlo\u010Danja.", + # "Sposobnost uporabe sistemati\u010Dnega in analiti\u010Dnega pristopa.", + # "Sposobnost sprejemanja dobrih odločitev tudi pod pritiskom.", + # "Sposobnost mediacije in iskanja konsenza med vpletenimi v konfliktu. ", + # "Sposobnost sprejemanja odločitev in ukrepov v težkih situacijah.", + # "Sposobnost prevzemanja odgovornosti za svoje odločitve.", + # "Sposobnost uporabe preteklih izkušenj.", + # "Sposobnost širokega razmišljanja.") +#rownames(kompetenc.Q3.SPOSOBNOST.OD) <- test22 +rownames(kompetenc.Q3.SPOSOBNOST.OD) <- names.sposobnost +ggplot.Q3 <- melt(kompetenc.Q3.SPOSOBNOST.OD) +# Če so manjkajoči podatki (NA ali NaN) v vrsticah jih odstranimo +ggplot.Q3 <- ggplot.Q3[complete.cases(ggplot.Q3),] + + + +p<-ggplot(ggplot.Q3, aes(x = Var1, y = value, fill = Var2)) + coord_flip()+ + theme_bw() + + scale_y_continuous(expand=c(0,0), limits=c(0,5.4),oob = rescale_none) + + scale_fill_manual(values = c("#d99694", "#c00000", "#632523","#7F7F7F")) + xlim(rev(levels(ggplot.Q3$Var1)))+ + theme(axis.title=element_blank(),axis.ticks.y=element_blank(),legend.position = "bottom", + axis.text.x = element_text(angle = 0,vjust = 0.4)) + + geom_bar(stat = "identity", width = 0.7, position = position_dodge(width=0.7)) + + geom_text(aes(x = Var1, y =5.2, label = round(value, 2), fill = Var2), + angle = 0, position = position_dodge(width = 0.8), size = 4.2) +p <- p + labs(fill="") + +p2 <- p + + stat_summary(fun.y = mean, color = "red", geom = "line", aes(group = 1)) + + stat_summary(fun.y = mean, color = "black", geom ="point", aes(group = 1), size = 3, + show.legend = FALSE) + +# This is the data for your dots in the graph +foo <- as.data.frame(ggplot_build(p2)$data[[4]]) +foo$y <- round(foo$y, 1) + +p2 + annotate("text", x = foo$x, y = foo$y + 0.5, color = "black", label = foo$y) + +dev.off() + +# SLIKA GRAFA: Latex in PDF +tex.ggplot.Q3 <- c(paste0( + "\\begin{figure}[H]", + "\\caption{Povprečje komponent po skupinah \\textbf{kompetence sposobnosti odločanja in presoje}}", + paste0("\\centerline{\\includegraphics[width=0.75\\textwidth]{slike/ggplot_odlocanje.pdf}}"), + "\\end{figure}")) +## //GGPLOT Q3 SPOSOBNOST ODLOČANJA IN PRESOJE// ## + +######################### + +####### GGPLOT Q4 VODENJE IN RAVNANJE Z LJUDMI ######## +kompetenc.Q4.VODENJE.LJUDI <- rbind(nadrejeni.vodenje.ravananje,podrejeni.vodenje.ravananje, + sodelavec.vodenje.ravananje,samoocenjevalec.vodenje.ravananje) +kompetenc.Q4.VODENJE.LJUDI <- t(as.matrix(kompetenc.Q4.VODENJE.LJUDI)) +colnames(kompetenc.Q4.VODENJE.LJUDI) <- c("Nadrejeni", "Podrejeni", "Enak nivo", "Samooc.") +rownames(kompetenc.Q4.VODENJE.LJUDI) <- names.vodenje.ravnanje + + +ggplot.Q4 <- melt(kompetenc.Q4.VODENJE.LJUDI) +# Če so manjkajoči podatki (NA ali NaN) v vrsticah jih odstranimo +ggplot.Q4 <- ggplot.Q4[complete.cases(ggplot.Q4),] + + +pdf(paste('modules/mod_360_1KA/results/slike/ggplot_vodenje_ravnanje.pdf', sep=''), family = 'sans', pointsize=10, width=7.5, height=7,encoding = 'CP1250') + +p<-ggplot(ggplot.Q4, aes(x = Var1, y = value, fill = Var2)) + coord_flip()+ + theme_bw() + + scale_y_continuous(expand=c(0,0), limits=c(0,5.4),oob = rescale_none) + + scale_fill_manual(values = c("#d99694", "#c00000", "#632523","#7F7F7F")) + xlim(rev(levels(ggplot.Q4$Var1)))+ + theme(axis.title=element_blank(),axis.ticks.y=element_blank(),legend.position = "bottom", + axis.text.x = element_text(angle = 0,vjust = 0.4)) + + geom_bar(stat = "identity", width = 0.7, position = position_dodge(width=0.7)) + + geom_text(aes(x = Var1, y =5.2, label = round(value, 2), fill = Var2), + angle = 0, position = position_dodge(width = 0.8), size = 4.2) +p <- p + labs(fill="") + +p2 <- p + + stat_summary(fun.y = mean, color = "red", geom = "line", aes(group = 1)) + + stat_summary(fun.y = mean, color = "black", geom ="point", aes(group = 1), size = 3, + show.legend = FALSE) + +# This is the data for your dots in the graph +foo <- as.data.frame(ggplot_build(p2)$data[[4]]) +foo$y <- round(foo$y, 1) + +p2 + annotate("text", x = foo$x, y = foo$y + 0.5, color = "black", label = foo$y) + +dev.off() + +# SLIKA GRAFA: Latex in PDF +tex.ggplot.Q4 <- c(paste0( + "\\begin{figure}[H]", + "\\caption{Povprečje komponent po skupinah \\textbf{kompetence vodenja in ravnanja z ljudmi}}", + paste0("\\centerline{\\includegraphics[width=0.85\\textwidth]{slike/ggplot_vodenje_ravnanje.pdf}}"), + "\\end{figure}")) +## //GGPLOT Q4 VODENJE IN RAVNANJE Z LJUDMI// ## + +######################### + +####### GGPLOT Q5 VODENJE PROJEKTOV ######## +kompetenc.Q5.VODENJE.PROJEKTOV <- rbind(nadrejeni.vodenje.projektov,podrejeni.vodenje.projektov, + sodelavec.vodenje.projektov,samoocenjevalec.vodenje.projektov) +kompetenc.Q5.VODENJE.PROJEKTOV <- t(as.matrix(kompetenc.Q5.VODENJE.PROJEKTOV)) +colnames(kompetenc.Q5.VODENJE.PROJEKTOV) <- c("Nadrejeni", "Podrejeni", "Enak nivo", "Samooc.") +rownames(kompetenc.Q5.VODENJE.PROJEKTOV) <- names.vodenje.projektov + + +ggplot.Q5 <- melt(kompetenc.Q5.VODENJE.PROJEKTOV) +# Če so manjkajoči podatki (NA ali NaN) v vrsticah jih odstranimo +ggplot.Q5 <- ggplot.Q5[complete.cases(ggplot.Q5),] +# +# +# +# + +pdf(paste('modules/mod_360_1KA/results/slike/ggplot_vodenje_projektov.pdf', sep=''), family = 'sans', pointsize=10, width=7.5, height=7) + +p<-ggplot(ggplot.Q5, aes(x = Var1, y = value, fill = Var2)) + coord_flip()+ + theme_bw() + + scale_y_continuous(expand=c(0,0), limits=c(0,5.4),oob = rescale_none) + + scale_fill_manual(values = c("#d99694", "#c00000", "#632523","#7F7F7F")) + xlim(rev(levels(ggplot.Q5$Var1)))+ + theme(axis.title=element_blank(),axis.ticks.y=element_blank(),legend.position = "bottom", + axis.text.x = element_text(angle = 0,vjust = 0.4)) + + geom_bar(stat = "identity", width = 0.7, position = position_dodge(width=0.7)) + + geom_text(aes(x = Var1, y =5.2, label = round(value, 2), fill = Var2), + angle = 0, position = position_dodge(width = 0.8), size = 4.2) +p <- p + labs(fill="") + +p2 <- p + + stat_summary(fun.y = mean, color = "red", geom = "line", aes(group = 1)) + + stat_summary(fun.y = mean, color = "black", geom ="point", aes(group = 1), size = 3, + show.legend = FALSE) + +# This is the data for your dots in the graph +foo <- as.data.frame(ggplot_build(p2)$data[[4]]) +foo$y <- round(foo$y, 1) + +p2 + annotate("text", x = foo$x, y = foo$y + 0.5, color = "black", label = foo$y) + +dev.off() + +# SLIKA GRAFA: Latex in PDF +tex.ggplot.Q5 <- c(paste0( + "\\begin{figure}[H]", + "\\caption{Povprečje komponent po skupinah \\textbf{kompetence vodenja projektov}}", + paste0("\\centerline{\\includegraphics[width=0.85\\textwidth]{slike/ggplot_vodenje_projektov.pdf}}"), + "\\end{figure}")) +## //GGPLOT Q5 VODENJE PROJEKTOV// ## + +################### + +####### GGPLOT Q6 MEDOSEBNE VEŠČINE ######## +kompetenc.Q6.MEDOSEBNE.VESCINE <- rbind(nadrejeni.vescine,podrejeni.vescine, + sodelavec.vescine,samoocenjevalec.vescine) +kompetenc.Q6.MEDOSEBNE.VESCINE <- t(as.matrix(kompetenc.Q6.MEDOSEBNE.VESCINE)) +colnames(kompetenc.Q6.MEDOSEBNE.VESCINE) <- c("Nadrejeni", "Podrejeni", "Enak nivo", "Samooc.") +rownames(kompetenc.Q6.MEDOSEBNE.VESCINE) <- names.vescine + + +ggplot.Q6 <- melt(kompetenc.Q6.MEDOSEBNE.VESCINE) +# Če so manjkajoči podatki (NA ali NaN) v vrsticah jih odstranimo +ggplot.Q6 <- ggplot.Q6[complete.cases(ggplot.Q6),] +# +# +# +# + +pdf(paste('modules/mod_360_1KA/results/slike/ggplot_medosebne_vescine.pdf', sep=''), family = 'sans', pointsize=10, width=7.5, height=7) + +p<-ggplot(ggplot.Q6, aes(x = Var1, y = value, fill = Var2)) + coord_flip()+ + theme_bw() + + scale_y_continuous(expand=c(0,0), limits=c(0,5.4),oob = rescale_none) + + scale_fill_manual(values = c("#d99694", "#c00000", "#632523","#7F7F7F")) + xlim(rev(levels(ggplot.Q2$Var1)))+ + theme(axis.title=element_blank(),axis.ticks.y=element_blank(),legend.position = "bottom", + axis.text.x = element_text(angle = 0,vjust = 0.4)) + + geom_bar(stat = "identity", width = 0.7, position = position_dodge(width=0.7)) + + geom_text(aes(x = Var1, y =5.2, label = round(value, 2), fill = Var2), + angle = 0, position = position_dodge(width = 0.8), size = 4.2) +p <- p + labs(fill="") + +p2 <- p + + stat_summary(fun.y = mean, color = "red", geom = "line", aes(group = 1)) + + stat_summary(fun.y = mean, color = "black", geom ="point", aes(group = 1), size = 3, + show.legend = FALSE) + +# This is the data for your dots in the graph +foo <- as.data.frame(ggplot_build(p2)$data[[4]]) +foo$y <- round(foo$y, 1) + +p2 + annotate("text", x = foo$x, y = foo$y + 0.5, color = "black", label = foo$y) + +dev.off() + +# SLIKA GRAFA: Latex in PDF +tex.ggplot.Q6 <- c(paste0( + "\\begin{figure}[H]", + "\\caption{Povprečje komponent po skupinah \\textbf{kompetence medosebnih veščin}}", + paste0("\\centerline{\\includegraphics[width=0.85\\textwidth]{slike/ggplot_medosebne_vescine.pdf}}"), + "\\end{figure}")) +## //GGPLOT Q6 MEDOSEBNE VEŠČINE// ## + + + +####################### +#RADAR AKA. SPIDER GRAF +####################### +## RADAR GRAF + +pdf(paste('modules/mod_360_1KA/results/slike/radar.pdf', sep=''), family='sans', pointsize=11, width=8, height=7) + +radar.data <- t(tabela.matrix) +# provide the data you want to plot, and the desired range + +myrange <- c(1, 5) + +# create a data frame with the max and min as the first two rows +mydf <- data.frame(rbind(max=myrange[2], min=myrange[1], radar.data)) + +# create a radar chart +colnames(mydf) <- c("Komuniciranje","Sposobnost odlocanja\nin presoje","Vodenje in ravnanje z ljudmi","Vodenje projektov", "Medosebne vescine") + + +radarchart(mydf, pcol=c("#d99694", "#c00000", "#632523","#7F7F7F"), cglcol='gray75', + plwd=2, plty=1, cglwd=1, cglty=1, seg=4, axistype=1, caxislabels=c(1:5), + axislabcol='gray25', centerzero=TRUE) + +legend('topright', legend=c("Nadrejeni","Podrejeni","Enak nivo","Samooc."), + col=c("#d99694", "#c00000", "#632523","#7F7F7F"), lty=1, lwd=2, bty='n') + +dev.off() + +#tekst nad radar grafom +radar.poj <- c("Kvantitativno pridobljene informacije kompetenc so zelo uporabne pri oblikovanju + radar diagrama. Znotraj diagrama so ustrezno prikazane bolj/manj poudarjene lastnosti posameznega zaposlenega.\\ + Radar diagram prikazuje, kako se je ocenjevana oseba pri posameznih kompetencah ocenila, glede na to, kako so to osebo + ocenili drugi. Slednje pa je zelo uporabno in hitro lahko opazimo ali med ocenjevano osebo + in drugimi obstajajo razlike pri percepciji posameznih kompetenc.") + +tex.radar <- c(radar.poj,"\\begin{figure}[H]", "\\caption{Radar diagram povprečij kompetenc po skupinah}", + paste0('\\centerline{\\includegraphics[width=0.95\\textwidth]{slike/radar.pdf}}'), + "\\end{figure}") + +##// RADAR GRAF//## + +Sys.setlocale("LC_ALL", "Czech") + + + +# Dodatno pojasnilo glede VAROVANJA OSEBNIH PODATKOV +varovanje.podatkov <- scan("modules/mod_360_1KA/latexkosi/varstvo_osebnih_podatkov.tex", character(0), sep="\n", quiet=TRUE,encoding='UTF-8') +varovanje.podatkov <- gsub('©', 'Š', varovanje.podatkov, fixed=T) +varovanje.podatkov <- gsub('ą', 'š', varovanje.podatkov,fixed=T) +varovanje.podatkov <- gsub('®', 'Ž', varovanje.podatkov,fixed=T) +varovanje.podatkov <- gsub('\u017E', 'ž', varovanje.podatkov,fixed=T) +varovanje.podatkov <- gsub('\u2013', '-', varovanje.podatkov,fixed=T) +################################################ +## Sestavljanje latex datotek in Generiranje PDF +################################################ +tex.glava <- scan("modules/mod_360_1KA/latexkosi/a-glava-1ka.tex", character(0), sep="\n", quiet=TRUE,encoding='UTF-8') +tex.pojasnilo <- scan("modules/mod_360_1KA/latexkosi/pojasnilo.tex", character(0), sep="\n", quiet=TRUE,encoding='UTF-8') # Uvod +tex.pojasnilo <- gsub('©', 'Š', tex.pojasnilo, fixed=T) +tex.pojasnilo <- gsub('ą', 'š', tex.pojasnilo,fixed=T) +tex.pojasnilo <- gsub('®', 'Ž', tex.pojasnilo,fixed=T) +tex.pojasnilo <- gsub('\u017E', 'ž', tex.pojasnilo,fixed=T) +tex.pojasnilo <- gsub('\u2013', '-', tex.pojasnilo,fixed=T) +tex.noga <- scan("modules/mod_360_1KA/latexkosi/z-noga.tex", character(0), sep="\n", quiet=TRUE) +Rdirektorij <- getwd() + + +tex.izbor <- c(tex.glava,tex.pojasnilo, "\\newpage", + "\\chapter{Kompetence komuniciranja}",tabelatex1,"\\newpage",tex.ggplot.Q2, + "\\chapter{Kompetence sposobnosti odločanja in presoje}", tabelatex2,"\\newpage",tex.ggplot.Q3, + "\\chapter{Kompetence vodenja in ravnanja z ljudmi}",tabelatex3,"\\newpage", tex.ggplot.Q4, + "\\chapter{Kompetence vodenja projektov}",tabelatex4,"\\newpage",tex.ggplot.Q5, + "\\chapter{Medosebne veščine}",tabelatex5,"\\newpage",tex.ggplot.Q6, + "\\chapter{Rangiranje kompetenc}",tabela.contR.tex,"\\newpage",tex.graf, + "\\chapter{Radar diagram}",tex.radar,varovanje.podatkov,tex.noga) + + +setwd(paste(Rdirektorij, "modules/mod_360_1KA/results", sep="/")) +cat(tex.izbor, file=paste0("mod_360_CDI.tex"), sep="\n") +tools::texi2pdf(file=paste0("mod_360_CDI.tex"), quiet=TRUE, clean=TRUE) +setwd(Rdirektorij) + diff --git a/admin/survey/modules/mod_360_1KA/class.Survey3601ka.php b/admin/survey/modules/mod_360_1KA/class.Survey3601ka.php new file mode 100644 index 0000000..aa4a6c0 --- /dev/null +++ b/admin/survey/modules/mod_360_1KA/class.Survey3601ka.php @@ -0,0 +1,258 @@ +ul evealvacija + if ((int)$anketa > 0){ + $this->anketa = $anketa; + + # polovimo vrsto tabel (aktivne / neaktivne) + SurveyInfo :: getInstance()->SurveyInit($this->anketa); + if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) { + $this->db_table = '_active'; + } + } + } + + + // Prikazemo vsa porocila + public function displayReports(){ + global $lang; + + echo '
'.$lang['srv_360_reports'].''; + echo ''; + echo '
'; + + // IzvaĹľamo + if(isset($_GET['export']) && $_GET['export'] == '1'){ + $this->executeExport(); + } + } + + // Prikazemo nastavitve pri vklopu naprednega modula + public function displaySettings(){ + global $lang; + + echo 'Dodatne nastavitve...'; + } + + + // Zgeneriramo pdf analizo + public function executeExport(){ + global $site_path; + global $lang; + global $admin_type; + + // Zgeneriramo zacasne csv datoteke + $this->prepareCSV(); + + // Poklicemo R skripto in zgeneriramo pdf + $script = $site_path . SCRIPT_FOLDER . '/360_stopinj_1ka.R'; + $out = exec('Rscript '.$script.' 2>&1', $output, $return_var); + + // Testiranje - izpis errorjev + if($admin_type == 0){ + echo '
'; + echo 'Rscript '.$script; + //echo '
'.$out.'
'; + var_dump($output); + echo '
'; + } + + // Pripravimo file za download + if(file_exists($site_path . RESULTS_FOLDER . '/mod_360_CDI.pdf')){ + + $file = $site_path . RESULTS_FOLDER . '/mod_360_CDI.pdf'; + + header('Content-Description: File Transfer'); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename='.basename('mod_360_CDI.pdf')); + header('Content-Transfer-Encoding: binary'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + header('Content-Length: ' . filesize($file)); + + ob_clean(); + flush(); + + readfile($file); + } + + // Na koncu pobrisemo zacasne datoteke + $this->deleteTemp(); + + // Ugasnemo skripto:) + die(); + } + + // Pripravimo zacasne datoteke + private function prepareCSV(){ + global $site_path; + + $temp_folder = $site_path . TEMP_FOLDER.'/'; + + $SDF = SurveyDataFile::get_instance(); + $SDF->init($this->anketa); + $_headFileName = $SDF->getHeaderFileName(); + $_dataFileName = $SDF->getDataFileName(); + $_fileStatus = $SDF->getStatus(); + + if ($_headFileName != null && $_headFileName != '') { + $_HEADERS = unserialize(file_get_contents($_headFileName)); + } + else { + echo 'Error! Empty file name!'; + } + + // Zaenkrat dopuscamo samo status 6 in brez lurkerjev + //$status_filter = '('.STATUS_FIELD.' ~ /6|5/)&&('.LURKER_FIELD.'==0)'; + $status_filter = '('.STATUS_FIELD.'==6)&&('.LURKER_FIELD.'==0)'; + + //$start_sequence = $_HEADERS['_settings']['dataSequence']; + $start_sequence = 2; + $end_sequence = $_HEADERS['_settings']['metaSequence']-1; + + $field_delimit = ';'; + + // Filtriramo podatke po statusu in jih zapisemo v temp folder + if (IS_WINDOWS) { + //$command = 'awk -F"|" "BEGIN {{OFS=\",\"} {ORS=\"\n\"}} '.$status_filter.' { print $0}" '.$_dataFileName.' >> '.$temp_folder.'/temp_data_'.$this->anketa.'.dat'; + $out = shell_exec('awk -F"|" "BEGIN {{OFS=\",\"} {ORS=\"\n\"}} '.$status_filter.'" '.$_dataFileName.' | cut -d "|" -f '.$start_sequence.'-'.$end_sequence.' >> '.$temp_folder.'/temp_data_'.$this->anketa.'.dat'); + + # zamenjamo | z ; + //exec('sed "s/|/\x22'.$field_delimit.'=\x22/g" '.$temp_folder.'/temp_data_'.$this->anketa.'.dat >> '.$temp_folder.'/temp_data_'.$this->anketa.'.csv'); + } + else { + //$command = 'awk -F"|" \'BEGIN {{OFS=","} {ORS="\n"}} '.$status_filter.' { print $0; }\' '.$_dataFileName.' >> '.$temp_folder.'/temp_data_'.$this->anketa.'.dat'; + $out = shell_exec('awk -F"|" \'BEGIN {{OFS=","} {ORS="\n"}} '.$status_filter.'\' '.$_dataFileName.' | cut -d \'|\' -f '.$start_sequence.'-'.$end_sequence.' >> '.$temp_folder.'/temp_data_'.$this->anketa.'.dat'); + + # zamenjamo | z ; + //exec('sed \'s/|/\x22'.$field_delimit.'=\x22/g\' '.$temp_folder.'/temp_data_'.$this->anketa.'.dat >> '.$temp_folder.'/temp_data_'.$this->anketa.'.csv'); + } + + + // Ustvarimo koncni CSV + if ($fd = fopen($temp_folder.'/temp_data_'.$this->anketa.'.dat', "r")) { + + //$fd2 = fopen($temp_folder.'/data_'.$this->anketa.'.csv', "w"); + $fd2 = fopen($temp_folder.'/test.csv', "w"); + + //header('Content-Encoding: windows-1250'); + //header('Content-Type: application/csv charset=windows-1250'); + + # naredimo header row + foreach ($_HEADERS AS $spid => $spremenljivka) { + if (count($spremenljivka['grids']) > 0) { + foreach ($spremenljivka['grids'] AS $gid => $grid) { + foreach ($grid['variables'] AS $vid => $variable ){ + if ($spremenljivka['tip'] !== 'sm' && !($variable['variable'] == 'uid' && $variable['naslov'] == 'User ID')){ + $output1 .= strip_tags($variable['variable']).$field_delimit; + $output2 .= '"'.strip_tags($variable['naslov']).'"'.$field_delimit; + } + } + } + } + } + + // Spremenimo encoding v windows-1250 + //$output1 = iconv("UTF-8","Windows-1250//TRANSLIT", $output1); + //$output2 = iconv("UTF-8","Windows-1250//TRANSLIT", $output2); + + fwrite($fd2, $output1."\r\n"); + fwrite($fd2, $output2."\r\n"); + + + while ($line = fgets($fd)) { + + //fwrite($fd2, '="'); + //$line = str_replace(array("\r","\n","|"), array("","",'";="'), $line); + $line = '"' . str_replace(array("\r","\n","\"","|"), array("","","",'";"'), $line) . '"'; + + // Spremenimo encoding v windows-1250 + $line = iconv("UTF-8","Windows-1250//TRANSLIT", $line); + //$line = str_replace(array("č","š","ž","Č","Š","Ž"), array("\v{c}","\v{s}","\v{z}","\v{C}","\v{S}","\v{Z}"), $line); + + fwrite($fd2, $line); + //fwrite($fd2, '"'); + fwrite($fd2, "\r\n"); + } + + fclose($fd2); + } + fclose($fd); + + + // Na koncu pobrisemo temp datoteke + if (file_exists($temp_folder.'/temp_data_'.$this->anketa.'.dat')) { + unlink($temp_folder.'/temp_data_'.$this->anketa.'.dat'); + } + } + + // Pobrisemo zacasne datoteke + private function deleteTemp(){ + global $site_path; + + $temp_folder = $site_path . TEMP_FOLDER.'/'; + + if (file_exists($temp_folder.'/data_'.$this->anketa.'.csv')) { + unlink($temp_folder.'/data_'.$this->anketa.'.csv'); + } + + // Pobrisemo zacasno CSV datoteko s podatki + if (file_exists($temp_folder.'/test.csv')) { + unlink($temp_folder.'/test.csv'); + } + + // Pobrisemo pdf grafe ki so bili vstavljeni v porocilo + $files = glob($site_path . RESULTS_FOLDER . '/part-predmet-slike/*'); + foreach($files as $file){ + if(is_file($file)) + unlink($file); + } + + // Pobrisemo še vse ostalo v rezultatih + $files = glob($site_path . RESULTS_FOLDER . '/*'); + foreach($files as $file){ + if(is_file($file)) + unlink($file); + } + } + +} \ No newline at end of file diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/a-glava-1ka.tex b/admin/survey/modules/mod_360_1KA/latexkosi/a-glava-1ka.tex new file mode 100644 index 0000000..9292e1f --- /dev/null +++ b/admin/survey/modules/mod_360_1KA/latexkosi/a-glava-1ka.tex @@ -0,0 +1,105 @@ +\documentclass[11pt,a4paper]{report} +\usepackage[cm]{fullpage} +\setlength{\headheight}{12pt} +\usepackage{arev} +\usepackage[T1]{fontenc} +\usepackage{times} +%\usepackage[nofligs]{verdana} +\usepackage[fontsize=11pt]{scrextend} +\usepackage{amsmath} +\usepackage[cp1250]{inputenc} +\usepackage[utf8]{inputenc} + +\usepackage{subcaption} +\usepackage{graphicx} +\usepackage{xcolor} +\definecolor{firebrick3}{HTML}{cd2626} +\definecolor{dodgerblue3}{HTML}{1874cd} +\definecolor{BrickRed}{HTML}{B6321C} +\definecolor{OrangeRed}{HTML}{F58137} +\definecolor{PineGreen}{HTML}{008B72} +\definecolor{Orange}{HTML}{F58137} +\definecolor{Green}{HTML}{00A64F} +\definecolor{Atlantis}{HTML}{8CBA2E} +\definecolor{Blue Stone}{HTML}{006666} +\definecolor{Black}{HTML}{000000} +\definecolor{Red}{HTML}{FF0006} +\definecolor{Gray}{HTML}{AAAAAA} +\usepackage{times} +\usepackage{float} +\usepackage{multirow} +\usepackage{wrapfig} + + + +\usepackage{setspace} + +\renewcommand\thesection{\Alph{section}} +\renewcommand\thesubsection{\thechapter.\arabic{subsection}} +\usepackage{chngcntr} +\counterwithout*{subsection}{section} +\counterwithin*{subsection}{chapter} +\usepackage{titlesec} +\titleformat{\chapter}[hang]{\LARGE\bfseries}{\thechapter{. }}{12pt}{\LARGE\bfseries} +\titlespacing*{\chapter}{0pt}{-13pt}{10pt} +\usepackage{longtable} +\usepackage{setspace} +\usepackage{array,calc} +\newcolumntype{A}[1]{>{\begin{minipage}{#1}\vspace{\tabcolsep}}l<{\vspace{\tabcolsep}\end{minipage}}} +\newenvironment{Complement}[1][0.75cm]{\hspace{#1}\begin{minipage}{\linewidth-#1}\hspace{-#1}\ignorespaces}{\end{minipage}} + + + +\usepackage{fancyhdr} +\pagestyle{fancyplain} +\renewcommand{\chaptermark}[1]{\markboth{#1}{}} +\fancyhf{} +\renewcommand{\headrulewidth}{0.4pt} +\renewcommand{\footrulewidth}{0.4pt} +\fancyhead[L]{ \includegraphics[width=2cm]{../latexkosi/logo/CDI_glava.png} } +\fancyfoot[L]{} +\fancyfoot[R]{\small{Stran \thepage}} +\headsep 25pt +\fancypagestyle{plain}{ + \renewcommand{\headrulewidth}{0.4pt} + \renewcommand{\footrulewidth}{0.4pt} +} + + +\usepackage{hyperref} +\hypersetup{ + colorlinks=true, + linkcolor=black, + urlcolor=blue, + pdfstartview={XYZ null null 1}, + pdftitle={naslov!} +} +\urlstyle{same} + +\setlength{\parindent}{0cm} +\LTcapwidth=\textwidth %to keep longtable captions in one row + +%začetek za dodatek po letih +\makeatletter +\@addtoreset{chapter}{part} +\makeatother +\usepackage{alphalph} +\makeatletter +\newalphalph{\alphmult}[mult]{\@Alph}{26} +\makeatother +\renewcommand{\thesection}{\alphmult{\value{section}}} +%konec za dodatek po letih + + +\begin{document} + \begin{titlepage} + \begin{center} + \vspace*{-8.5\baselineskip} % Da bo slika na vrhu + \includegraphics[width=18cm]{../latexkosi/logo/CDI1.png}~\\[4cm] + \includegraphics[width=17.5cm]{../latexkosi/logo/CDI_naslovnica.png}~\\[4cm] + %\textsc{ \LARGE \textbf{ \color{Red} Center za družboslovno informatiko \\[2cm] analiza 360 stopinj}}\\[6.5cm] + %\includegraphics[width=14.5cm]{../latexkosi/logo/slika.jpg}~\\[6cm] + {\large Ljubljana, \today} + \end{center} + \end{titlepage} +\tableofcontents \ No newline at end of file diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI.png b/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI.png new file mode 100644 index 0000000..bcdaa99 Binary files /dev/null and b/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI.png differ diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI1.png b/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI1.png new file mode 100644 index 0000000..757bd7d Binary files /dev/null and b/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI1.png differ diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_glava.png b/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_glava.png new file mode 100644 index 0000000..2bdaa9e Binary files /dev/null and b/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_glava.png differ diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_naslovnica - Copy.png b/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_naslovnica - Copy.png new file mode 100644 index 0000000..fd80776 Binary files /dev/null and b/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_naslovnica - Copy.png differ diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_naslovnica.png b/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_naslovnica.png new file mode 100644 index 0000000..6f9b9c0 Binary files /dev/null and b/admin/survey/modules/mod_360_1KA/latexkosi/logo/CDI_naslovnica.png differ diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/logo/circle.png b/admin/survey/modules/mod_360_1KA/latexkosi/logo/circle.png new file mode 100644 index 0000000..428c976 Binary files /dev/null and b/admin/survey/modules/mod_360_1KA/latexkosi/logo/circle.png differ diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/pojasnilo.tex b/admin/survey/modules/mod_360_1KA/latexkosi/pojasnilo.tex new file mode 100644 index 0000000..58352a9 --- /dev/null +++ b/admin/survey/modules/mod_360_1KA/latexkosi/pojasnilo.tex @@ -0,0 +1,21 @@ +\chapter{Metodologija} +\subsection{Vprašalnik kompetenc po metodi 360°} +Kompetence so skupek povezav med znanjem, veščinami in vedenji, ki vplivajo na delo posameznika in korelirajo z uspešnostjo na delovnem mestu. So skupek povezav, ki so merljive z dobro sprejetimi standardi in ki jih lahko izboljšujemo z izobraževanjem in razvojem zaposlenih. Z vprašalnikom kompetenc merimo sledeče dimenzije: + + +\begin{itemize} +\item Komuniciranje +\item Sposobnosti odločanja in presoje +\item Vodenje in ravnanje z ljudmi +\item Vodenje projektov +\item Medosebne veščine +\end{itemize} +\bigskip + \textbf{Metoda 360 stopinj} je orodje, s katerim merimo prisotnost oziroma izraženost kompetenc pri posamezniku. Pomaga nam identificirati posameznikove prednosti in njegove šibke točke ter odkriti potenciale za razvoj ter možnosti za izboljšave. Ta metoda je kompleksna in zanesljiva, saj pri njej ocenjujemo kompetence posameznika z več vidikov, z vidika: +\begin{enumerate} + \item nadrejenih, + \item sodelavcev na enakem nivoju, + \item podrejenih, + \item ter z vidika ocenjevanca (samoocena). +\end{enumerate} +Na ta način dobimo celostno sliko, ki je lahko v pomoč pri določanju nadaljnjih razvojnih ciljev za posameznika na področjih, kjer se je pokazalo, da je še prostor za izboljšave. diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/sloven2e.sty b/admin/survey/modules/mod_360_1KA/latexkosi/sloven2e.sty new file mode 100644 index 0000000..d3c0728 --- /dev/null +++ b/admin/survey/modules/mod_360_1KA/latexkosi/sloven2e.sty @@ -0,0 +1,42 @@ +% +% slovene.sty - prilagoditev zvrsti ARTICLE, BOOK in REPORT slovenscini +% +\@ifundefined{slovensko}{\def\slovensko{}}{\endinput} +\typeout{Document Style Option 'Sloven2e' ver 0.1. / 11-Nov-95 / V.B.} + +% naslovi + +\def\abstractname{Povzetek} +\def\appendixname{Dodatek} +\def\bibname{Literatura} +\def\ccname{cc} +\def\chaptername{Poglavje} +\def\contentsname{Kazalo} +\def\enclname{Priloge} +\def\figurename{Slika\ } +\def\headpagename{Stran} +\def\headtoname{Komu} +\def\indexname{Stvarno kazalo} +\def\listfigurename{Slike} +\def\listtablename{Tabele} +\def\partname{Del} +\def\prefacename{Predgovor} +\def\seename{glej} +\def\alsoseename{glej tudi} +\def\refname{Viri} +\def\tablename{Tabela\ } + +% tekoci datum + +\def\today{\number\day. \ifcase\month\or + januar\or februar\or marec\or april\or maj\or junij\or + julij\or avgust\or september\or oktober\or november\or december\fi + \space\number\year} + + +% slovenski narekovaji + +\def\lqlq{\leavevmode\hbox{,\kern-.1em,}} +\def\rqrq{\leavevmode\hbox{`\kern-.1em`}} + +\endinput diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/tabela.tex b/admin/survey/modules/mod_360_1KA/latexkosi/tabela.tex new file mode 100644 index 0000000..2823ed7 --- /dev/null +++ b/admin/survey/modules/mod_360_1KA/latexkosi/tabela.tex @@ -0,0 +1,11 @@ +\documentclass[landscape]{report} +\usepackage[cp1250]{inputenc} +\usepackage{csz} +\usepackage{sloven2e} +\usepackage{longtable} +\usepackage{geometry} +\newgeometry{left=0cm,bottom=0cm} +\begin{document} +\footnotesize +\renewcommand*{\arraystretch}{1.25} +\renewcommand{\tabcolsep}{1mm} \ No newline at end of file diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/uvod.tex b/admin/survey/modules/mod_360_1KA/latexkosi/uvod.tex new file mode 100644 index 0000000..7bdcdec --- /dev/null +++ b/admin/survey/modules/mod_360_1KA/latexkosi/uvod.tex @@ -0,0 +1,7 @@ +\textbf{ANALIZA 360° STOPINJ:} +\begin{itemize} +\item je mera povratnih informacij vedenj in kompetenc, +\item zagotavlja povratne informacije odnosu podjetja (nadrejenih, podrejenih, sodelavcev) do zaposlenega, +\item obravnava spretnosti kot so: komuniciranje, vodenje, odločanje, ravnanje itd., +\item se osredotoča na subjektivna področja, kot so značaj zaposlenega in njegova učinkovitost. +\end{itemize} \ No newline at end of file diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/varstvo_osebnih_podatkov.tex b/admin/survey/modules/mod_360_1KA/latexkosi/varstvo_osebnih_podatkov.tex new file mode 100644 index 0000000..cb31f1e --- /dev/null +++ b/admin/survey/modules/mod_360_1KA/latexkosi/varstvo_osebnih_podatkov.tex @@ -0,0 +1,8 @@ + +\chapter{Dodatek} +Vse ocene, izsledki in poročila (bodisi individualna poročila bodisi skupna poročila) vsebujejo osebne in občutljive osebne podatke kandidatov in so zato strogo zaupne narave. Njihova uporaba, posredovanje, dostopnost in arhiviranje mora biti dosledno izvedeno v skladu z Zakonom o varstvu osebnih podatkov (ZVOP-1, Ur.l. RS, št. 86/2004, Ur.l. RS, št. 113/2005-ZInfP, 51/2007-ZUstS-A, 67/2007, 94/2007-UPB1). S predajo teh podatkov Pogodbeniku, se le-ta obvezuje, da bo s temi podatki ravnal v skladu z zgoraj omenjenim zakonom in da prevzame popolno odgovornost za nepravilno uporabo, nepooblaščen dostop ali neupravičeno posredovanje tretjim osebam. + + + +\chapter{Varstvo osebnih podatkov} +Vsi podatki o kandidatih (bodisi individualna poročila bodisi skupna poročila), ki vsebujejo psihološke podatke kandidatov ter ocene, izsledke in poročila ocenjevalnega centra so občutljivi podatki in so strogo zaupne narave. Njihova uporaba, posredovanje, dostopnost in arhiviranje mora biti dosledno izvedeno v skladu z Zakonom o varstvu osebnih podatkov (ZVOP-1, Ur.l. RS, št. 86/2004, Ur.l. RS, št. 113/2005-ZInfP, 51/2007-ZUstS-A, 67/2007, 94/2007-UPB1). S predajo teh podatkov Pogodbeniku, se le-ta obvezuje, da bo s temi podatki ravnal v skladu z zgoraj omenjenim zakonom in da prevzame popolno odgovornost za nepravilno uporabo, nepooblaščen dostop ali neupravičeno posredovanje tretjim osebam. \ No newline at end of file diff --git a/admin/survey/modules/mod_360_1KA/latexkosi/z-noga.tex b/admin/survey/modules/mod_360_1KA/latexkosi/z-noga.tex new file mode 100644 index 0000000..815ab68 --- /dev/null +++ b/admin/survey/modules/mod_360_1KA/latexkosi/z-noga.tex @@ -0,0 +1 @@ +\end{document} \ No newline at end of file diff --git a/admin/survey/modules/mod_360_1KA/results/.gitignore b/admin/survey/modules/mod_360_1KA/results/.gitignore new file mode 100644 index 0000000..a3a0c8b --- /dev/null +++ b/admin/survey/modules/mod_360_1KA/results/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/admin/survey/modules/mod_MAZA/class.MAZA.php b/admin/survey/modules/mod_MAZA/class.MAZA.php new file mode 100644 index 0000000..c430546 --- /dev/null +++ b/admin/survey/modules/mod_MAZA/class.MAZA.php @@ -0,0 +1,1944 @@ +_ank_id = $ank_id; + //get survey title and link + if($ank_id > 0){ + SurveyInfo::getInstance()->SurveyInit($ank_id); + $this->_ank_title = SurveyInfo::getSurveyColumn('naslov'); + $this->_ank_link = SurveyInfo::getSurveyLink(); + } + } + + public function display() { + global $admin_type, $lang; + + // Izpis vseh poslanih sporocil + if ($admin_type == 0) { + //navigacija + $this->displayNavigation(); + + //is survey activated + $act = sisplet_query("SELECT active FROM srv_anketa WHERE id='" . $this->_ank_id . "'", 'obj'); + if($act->active != 1) + echo '

'.$lang['srv_anketa_noactive2'].'

'; + + $_sub_action = isset($_GET['m']) ? $_GET['m'] : 'maza_dashboard'; + + $active_step[] = array(1 => '', 2 => '', 3 => '', 4 => '', 5 => '', 6 => '', 7 => ''); + + switch ($_sub_action) { + case 'maza_dashboard': + $this -> surveyDescription(); + echo '
'; + $this -> getUsersStatistics(); + echo '
'; + $this -> generateNewUsersForm(); + echo '
'; + $this -> exportIdentifiersForm(); + break; + + case 'maza_send_notification': + // obrazec za posiljanje sporocil + $this->sendMessageForm(); + break; + + case 'maza_set_alarm': + // obrazec za posiljanje alarmov + $this->setRepeaterForm(); + echo '
'; + $this->setAlarmForm(); + echo ''; + break; + + case 'maza_set_geofencing': + //obrazec za posiljanje geofences + $sql_r = sisplet_query("SELECT COUNT(geofence_on) AS cnt FROM maza_srv_geofences WHERE ank_id='" . $this->_ank_id . "' AND geofence_on=1", 'obj'); + $this->setGeofencesForm($sql_r->cnt); + echo ''; + break; + + case 'maza_set_activity': + //obrazec za posiljanje aktivnosti + $this->setActivityForm(); + break; + + case 'maza_set_tracking': + //obrazec za posiljanje sledenja + $this->setTrackingForm(); + //echo ''; + break; + + case 'maza_set_entry': + //obrazec za posiljanje sledenja + $this->setEntryForm(); + //echo ''; + break; + + default: + $active_step['1'] = ' active'; + break; + } + if(isset($_GET['FCM_response'])) + echo '

'.$_GET['FCM_response']; + } + } + + function displayNavigation() { + global $lang; + + $_sub_action = isset($_GET['m']) ? $_GET['m'] : 'maza_dashboard'; + + $active_step[] = array(1 => '', 2 => '', 3 => '', 4 => '', 5 => '', 6 => '', 7 => ''); + + switch ($_sub_action) { + case 'maza_dashboard': + $active_step['1'] = ' active'; + break; + + case 'maza_send_notification': + $active_step['2'] = ' active'; + break; + + case 'maza_set_alarm': + $active_step['3'] = ' active'; + break; + + case 'maza_set_geofencing': + $active_step['4'] = ' active'; + break; + + case 'maza_set_activity': + $active_step['5'] = ' active'; + break; + + case 'maza_set_tracking': + $active_step['6'] = ' active'; + break; + + case 'maza_set_entry': + $active_step['7'] = ' active'; + break; + + default: + $active_step['1'] = ' active'; + break; + } + + echo '

'; + echo ''; + echo '
'; + + echo '
'; + echo '
'; + } + + // Obrazec za posiljanje notificationa + private function sendMessageForm() { + global $lang; + + //FORM FOR NOTIFICATION + echo '
'; + echo '' . $lang['srv_maza_send_notification'] . ''; + echo '
'; + /* echo ''.$lang['srv_notifications_send_reciever'].': '; + + // Checkboxa za posiljenje vsem uporabnikoom (slo in ang) + echo '
'; + echo '

'; + */ + echo ''; + echo ''; + echo '' . $lang['srv_notifications_send_title'] . ':

'; + echo '' . $lang['srv_notifications_send_text'] . ':

'; + + echo '

'; + + //echo '

'; + + echo ''; + + echo '

' . $_POST['maza_result'] . '

'; + + echo '
'; + echo '


'; + + //FORM FOR WEB PUSH NOTIFICATIONs + /*echo '
'; + echo 'PWA notification (test and fixed)'; + echo '
'; + /* echo ''.$lang['srv_notifications_send_reciever'].': '; + + // Checkboxa za posiljenje vsem uporabnikoom (slo in ang) + echo '
'; + echo '

'; + */ + /*echo ''; + echo ''; + echo '' . $lang['srv_notifications_send_title'] . ':

'; + echo '' . $lang['srv_notifications_send_text'] . ':

'; + + //echo '

'; + + //echo '

'; + + echo ''; + + echo '

' . $_POST['maza_result'] . '

'; + + echo '
'; + echo '
';*/ + } + + // Obrazec za posiljanje alarmov + private function setAlarmForm() { + global $lang; + + //FORM FOR ALARM + $sql_r = sisplet_query("SELECT * FROM maza_srv_alarms WHERE ank_id='" . $this->_ank_id . "'", 'obj'); + + echo '
'; + echo '' . $lang['srv_maza_send_alarm'] . ''; + + $disabled = ''; + if ($this->isRepeaterRunning && $sql_r->alarm_on == '1') { + echo '
'; + echo ''; + //$disabled = ' disabled="disabled"'; + echo '' . $lang['srv_maza_alarm_on'] . '
'; + + ///////////////////////////////////AKCIJA + echo '

'; + echo '
'; + } + + //form to set or update alarm + echo '
'; + /* echo ''.$lang['srv_notifications_send_reciever'].': '; + + // Checkboxa za posiljenje vsem uporabnikoom (slo in ang) + echo '
'; + echo '

'; + */ + + if ((sizeof($sql_r) == 0 || $sql_r->alarm_on == '0') && $this->isRepeaterRunning) + echo '' . $lang['srv_maza_alarm_off'] . '
'; + else + echo '
'; + + echo ''; + echo ''; + + echo '
'; + echo '
'; + + $sql_r->alarm_notif_title = ($sql_r->alarm_notif_title) ? $sql_r->alarm_notif_title : $lang['srv_maza_alarm_default_title']; + $sql_r->alarm_notif_message = ($sql_r->alarm_notif_message) ? $sql_r->alarm_notif_message : $lang['srv_maza_alarm_default_message'].$this->_ank_title; + echo '' . $lang['srv_notifications_send_title'] . ':

'; + echo '' . $lang['srv_notifications_send_text'] . ':

'; + + /*echo '

';*/ + + //echo '

'; + + echo '
'; + + echo '
'; + + echo '' . $lang['srv_maza_alarm_when_to_show'] . ''; + + echo ' + + +

'; + + echo '
repeat_by == 'daily') ? '' : 'style="display: none;"') .'>'; + echo '' . $lang['srv_maza_alarm_daily_every'] . ': ' + . ' ' . $lang['srv_maza_alarm_days'] . '
'; + + $weekly_array = (isset($sql_r->day_in_week) && $sql_r->day_in_week != 'null') ? json_decode($sql_r->day_in_week) : array(); + echo '
repeat_by == 'weekly') ? '' : 'style="display: none;"') .'>'; + echo '' . $lang['srv_maza_alarm_day_week'] . ':'; + echo ''; + //echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
At time in day:

'; + + $time_array = (isset($sql_r->time_in_day) && $sql_r->time_in_day != 'null') ? json_decode($sql_r->time_in_day) : array(); + echo '' . $lang['srv_maza_alarm_time_day'] . ':'; + echo ''; + //echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
At time in day:
'; + + echo '
'; + echo '
'; + + if ((sizeof($sql_r) == 0 || $sql_r->alarm_on == '0') && $this->isRepeaterRunning){ + echo ''; + } + else + echo '
'; + + echo '

' . $_POST['maza_result'] . '

'; + + echo '
'; + echo '
'; + + echo '
'; + + echo '
'; + echo '' . $lang['srv_maza_data_export'] . ''; + echo '' + . '' . $lang['srv_maza_alarm_export_respondents'] . ''; + echo '
'; + } + + // Obrazec za posiljanje alarmov + private function setRepeaterForm() { + global $lang; + + //FORM FOR ALARM + $sql_r = sisplet_query("SELECT * FROM maza_srv_repeaters WHERE ank_id='" . $this->_ank_id . "'", 'obj'); + + $dateToday = DateTime::createFromFormat('Y-m-d', date("Y-m-d")); + //if start date of repeater exists + if($sql_r->datetime_start){ + $dateTimeStart = new DateTime($sql_r->datetime_start); + $dateStart = DateTime::createFromFormat('Y-m-d', $dateTimeStart->format('Y-m-d')); + //is repeater start date <= of today? if yes, repeater has started + $hasRepeaterStarted = ($dateStart->getTimestamp() <= $dateToday->getTimestamp()); + $this->isRepeaterRunning = $hasRepeaterStarted && $sql_r->repeater_on == '1'; + $dateTimeStart = $dateTimeStart->format('d.m.Y'); + } + else + $dateTimeStart = ""; + + //if end date of repeater exists + if($sql_r->datetime_end){ + $dateTimeEnd = new DateTime($sql_r->datetime_end); + $dateEnd = DateTime::createFromFormat('Y-m-d', $dateTimeEnd->format('Y-m-d')); + //is repeater end date < of today? if yes, repeater has ended + $hasRepeaterEnd = ($dateEnd->getTimestamp() < $dateToday->getTimestamp()); + $this->isRepeaterRunning = $hasRepeaterStarted && $sql_r->repeater_on == '1' && !$hasRepeaterEnd; + $dateTimeEnd = $dateTimeEnd->format('d.m.Y'); + } + else + $dateTimeEnd = ""; + + echo '
'; + echo '' . $lang['srv_maza_repeater_title'] . ''; + + $disabled = ''; + if ($this->isRepeaterRunning) { + echo '
'; + echo ''; + //$disabled = ' disabled="disabled"'; + echo '' . $lang['srv_maza_repeater_on'] . '
'; + + ///////////////////////////////////AKCIJA + echo '

'; + echo '
'; + } + + //form to set or update alarm + echo '
'; + /* echo ''.$lang['srv_notifications_send_reciever'].': '; + + // Checkboxa za posiljenje vsem uporabnikoom (slo in ang) + echo '
'; + echo '

'; + */ + + if ($sql_r->repeater_on > 0 && $hasRepeaterStarted) + echo '
'; + + //echo ''; + echo ''; + + //echo '
'; + + echo '
' . $lang['srv_maza_repeater_when_to_start'] . ''; + echo ''; + if (!$hasRepeaterStarted && $dateTimeStart) + echo ' '.$lang['srv_maza_repeater_edit_warning'].''; + echo '

'; + + echo '
' . $lang['srv_maza_repeater_when_to_end'] . ''; + echo ''; + echo '


'; + + echo '
' . $lang['srv_maza_repeater_when_to_repeat'] . ''; + echo ' + + +


'; + + echo '
repeat_by == 'daily') ? '' : 'style="display: none;"') .'>'; + echo '' . $lang['srv_maza_alarm_daily_every'] . ': ' + . ' ' . $lang['srv_maza_alarm_days'] . '
'; + + $weekly_array = (isset($sql_r->day_in_week) && $sql_r->day_in_week != 'null') ? json_decode($sql_r->day_in_week) : array(); + echo '
repeat_by == 'weekly') ? '' : 'style="display: none;"') .'>'; + echo '' . $lang['srv_maza_alarm_day_week'] . ':'; + echo ''; + //echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
At time in day:

'; + + $time_array = (isset($sql_r->time_in_day) && $sql_r->time_in_day != 'null') ? json_decode($sql_r->time_in_day) : array(); + echo '' . $lang['srv_maza_alarm_time_day'] . ':'; + echo ''; + //echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
At time in day:
'; + + //echo '
'; + echo '
'; + + //repeater not in motion yet + if ((sizeof($sql_r) == 0 || $sql_r->repeater_on < 2) && !$hasRepeaterStarted){ + echo ''; + } + //repeater ended + else + echo '
'; + + echo '

' . $_POST['maza_result'] . '

'; + + echo '
'; + echo '
'; + } + + /** + * Obrazec za posiljanje geofencev + * @global type $admin_type + * @global type $global_user_id + * @global type $lang + * @param type $geocnt - count of all geofences that are on + */ + private function setGeofencesForm($geocnt) { + global $lang; + + echo '
'; + echo '' . $lang['srv_maza_geofencing'] . ''; + + //FORM FOR GEOFENCES + if ($geocnt > 0) { + echo '
'; + echo ''; + //$disabled = ' disabled="disabled"'; + echo '' . $lang['srv_maza_geofencing_on'] . '
'; + + ///////////////////////////////////AKCIJA + echo '

'; + echo '
'; + } + else + echo '' . $lang['srv_maza_geofencing_off'] . '
'; + + //form to set or update GEOFENCES + echo '
'; + + echo ''; + echo ''; + + //izrisi search box za v mapo + echo ''; + + //DIV for google map + echo '
'; + echo '
'; + + //NOTIFICATION SETTINGS + //FORM FOR geofence notification + $sql_r = sisplet_query("SELECT * FROM maza_srv_geofences WHERE ank_id='" . $this->_ank_id . "' LIMIT 1", 'obj'); + + echo '
'; + echo '' . $lang['srv_maza_geofencing_notification'] . ''; + + echo '
'; + echo '
'; + + if(!$sql_r) + $sql_r = (object)array('notif_title'=>'', 'notif_message'=>'', 'notif_sound'=>1, 'trigger_survey' => "1", 'on_transition'=>'dwell', 'after_seconds' => 300); + + $disable = ($sql_r->trigger_survey == null) ? ' disabled="disabled"' : ''; + + echo '
'; + echo '

'; + echo '
'; + + $sql_r->notif_title = ($sql_r->notif_title) ? $sql_r->notif_title : $lang['srv_maza_geofence_default_title']; + $sql_r->notif_message = ($sql_r->notif_message) ? $sql_r->notif_message : $lang['srv_maza_alarm_default_message'].$this->_ank_title; + echo '' . $lang['srv_notifications_send_title'] . ':

'; + echo '' . $lang['srv_notifications_send_text'] . ':

'; + + /*echo '

';*/ + + //echo '

'; + + echo '
'; + + echo '
'; + + echo '
'; + echo '

'; + echo '
'; + + echo '' . $lang['srv_maza_alarm_when_to_show'] . ''; + + echo ' + +

'; + + echo '
'; + echo '' . $lang['srv_maza_geofence_after'] . ': ' + . ' ' . $lang['srv_maza_geofence_time_unit'] . '
'; + + echo '
'; + echo '
'; + echo '

'; + + echo ''; + + echo '

' . $_POST['maza_result'] . '

'; + + echo '
'; + echo '
'; + + echo '
'; + + echo '
'; + echo '' . $lang['srv_maza_data_export'] . ''; + echo '' + . '' . $lang['srv_maza_geofence_export_triggered_answered'] . ''; + echo '' + . '' . $lang['srv_maza_geofence_export_triggered'] . ''; + echo '' + . '' . $lang['srv_maza_geofence_export'] . ''; + echo '
'; + } + + // Obrazec za posiljanje nextpin aktivnosti + private function setActivityForm() { + global $lang; + + echo '
'; + echo '' . $lang['srv_maza_activity'] . ''; + + //FORM FOR activity + $sql_r = sisplet_query("SELECT COUNT(activity_on) AS cnt FROM maza_srv_activity WHERE ank_id='" . $this->_ank_id . "' AND activity_on=1", 'obj'); + + if ($sql_r->cnt > 0) { + echo '
'; + echo ''; + //$disabled = ' disabled="disabled"'; + echo '' . $lang['srv_maza_activity_on'] . '
'; + + ///////////////////////////////////AKCIJA + echo '

'; + echo '
'; + } + else + echo '' . $lang['srv_maza_activity_off'] . '
'; + + //form to set or update activity + echo '
'; + + echo ''; + echo ''; + + //NOTIFICATION SETTINGS + //FORM FOR activity notification + $sql_r = sisplet_query("SELECT * FROM maza_srv_activity WHERE ank_id='" . $this->_ank_id . "' LIMIT 1", 'obj'); + + echo '
'; + echo '' . $lang['srv_maza_geofencing_notification'] . ''; + + echo '
'; + echo '
'; + + if(!$sql_r) + $sql_r = (object)array('notif_title'=>'', 'notif_message'=>'', 'notif_sound'=>1, 'activity_type'=>'path', 'after_seconds' => 300); + + $sql_r->notif_title = ($sql_r->notif_title) ? $sql_r->notif_title : $lang['srv_maza_geofence_default_title']; + $sql_r->notif_message = ($sql_r->notif_message) ? $sql_r->notif_message : $lang['srv_maza_alarm_default_message'].$this->_ank_title; + echo '' . $lang['srv_notifications_send_title'] . ':

'; + echo '' . $lang['srv_notifications_send_text'] . ':

'; + + /*echo '

';*/ + + //echo '

'; + + echo '
'; + + echo '
'; + + echo '' . $lang['srv_maza_alarm_when_to_show'] . ''; + + echo ' + +

'; + + echo '
'; + echo '' . $lang['srv_maza_activity_after'] . ': ' + . ' ' . $lang['srv_maza_geofence_time_unit'] . '
'; + + echo '
'; + echo '
'; + echo '

'; + + echo ''; + + echo '

' . $_POST['maza_result'] . '

'; + + echo '
'; + echo '
'; + } + + // Obrazec za posiljanje sledenja + private function setTrackingForm() { + global $lang; + + echo '
'; + echo '' . $lang['srv_maza_tracking'] . ''; + + //FORM FOR activity + $sql_r = sisplet_query("SELECT COUNT(tracking_on) AS cnt FROM maza_srv_tracking WHERE ank_id='" . $this->_ank_id . "' AND tracking_on=1", 'obj'); + + if ($sql_r->cnt > 0) { + echo '
'; + echo ''; + //$disabled = ' disabled="disabled"'; + echo '' . $lang['srv_maza_tracking_on'] . '
'; + + ///////////////////////////////////AKCIJA + echo '

'; + echo '
'; + } + else + echo '' . $lang['srv_maza_tracking_off'] . '
'; + + //form to set or update activity + echo '
'; + + echo ''; + echo ''; + + //NOTIFICATION SETTINGS + //FORM FOR activity notification + $sql_r = sisplet_query("SELECT * FROM maza_srv_tracking WHERE ank_id='" . $this->_ank_id . "' LIMIT 1", 'obj'); + + echo '
'; + echo '' . $lang['srv_maza_tracking_settings'] . ''; + + echo '
'; + + if(!$sql_r) + $sql_r = (object)array('activity_recognition'=>0, 'tracking_accuracy'=>'high', 'interval_wanted' => 30, 'interval_fastes' => 10, 'displacement_min' => 10, 'ar_interval_wanted' => 30); + + echo '
'; + + echo '' . $lang['srv_maza_tracking_accuracy'] . ': '; + + echo ' + +

'; + + echo '
'; + echo '' . $lang['srv_maza_tracking_interval_wanted'] . ': ' + . ' ' . $lang['srv_maza_geofence_time_unit'] . '
'; + echo '
'; + + echo '
'; + echo '' . $lang['srv_maza_tracking_interval_fastes'] . ': ' + . ' ' . $lang['srv_maza_geofence_time_unit'] . '
'; + echo '
'; + + echo '
'; + echo '' . $lang['srv_maza_tracking_displacement_min'] . ': ' + . ' ' . $lang['srv_maza_tracking_displacement_m'] . '
'; + echo '
'; + + echo '
'; + + echo '
'; + echo '

'; + echo '
'; + + echo '
activity_recognition == 1) ? '' : 'hidden').'>'; + echo '' . $lang['srv_maza_tracking_interval_wanted'] . ': ' + . ' ' . $lang['srv_maza_geofence_time_unit'] . '
'; + echo '
'; + + echo '
'; + echo '

'; + + echo ''; + + echo '

' . $_POST['maza_result'] . '

'; + + echo '
'; + echo '
'; + + echo '
'; + + echo '
'; + echo '' . $lang['srv_maza_data_export'] . ''; + echo '' + . '' . $lang['srv_maza_tracking_export_all_locations'] . ''; + echo '' + . '' . $lang['srv_maza_tracking_export_all_ar'] . ''; + echo '
'; + } + + // Obrazec za nastavljanje vnosov + private function setEntryForm() { + global $lang; + + echo '
'; + echo '' . $lang['srv_maza_entry'] . ''; + + //FORM FOR DATA ENTRIES + $sql_r = sisplet_query("SELECT COUNT(entry_on) AS cnt FROM maza_srv_entry WHERE ank_id='" . $this->_ank_id . "' AND entry_on=1", 'obj'); + + if ($sql_r->cnt > 0) { + echo '
'; + echo ''; + //$disabled = ' disabled="disabled"'; + echo '' . $lang['srv_maza_entry_on'] . '
'; + + ///////////////////////////////////AKCIJA + echo '

'; + echo '
'; + } + else + echo '' . $lang['srv_maza_entry_off'] . '
'; + + //form to set or update entry + echo '
'; + + echo ''; + echo ''; + + $sql_r = sisplet_query("SELECT * FROM maza_srv_entry WHERE ank_id='" . $this->_ank_id . "' LIMIT 1", 'obj'); + + echo '
'; + echo '

'; + echo '

'; + + echo ''; + + echo '

' . $_POST['maza_result'] . '

'; + + echo '
'; + echo '
'; + + echo '
'; + + echo '
'; + echo '' . $lang['srv_maza_data_export'] . ''; + echo '' + . '' . $lang['srv_maza_tracking_export_all_locations'] . ''; + echo '
'; + } + + // Obrazec za generiranje novih identifikatorjev + private function generateNewUsersForm() { + global $lang; + + //FORM FOR NOTIFICATION + echo '
'; + echo '' . $lang['srv_maza_users_generator'] . ''; + echo '
'; + + echo ''; + echo ''; + echo '' . $lang['srv_maza_users_generator_number'] . ':
'; + + echo ''; + + echo '
'; + echo '
'; + } + + // Obrazec za urejanje opisa raziskave + private function surveyDescription() { + global $lang; + + $sql_r = sisplet_query("SELECT srv_description FROM maza_survey WHERE srv_id='" . $this->_ank_id . "'", 'obj'); + + //FORM FOR NOTIFICATION + echo '
'; + echo '' . $lang['srv_maza_users_description'] . ''; + echo '
'; + + echo ''; + echo ''; + echo '

'; + + echo ''; + + echo '
'; + echo '
'; + } + + // Obrazec za izvoz vseh identifikatorjev + private function exportIdentifiersForm() { + global $lang; + + echo '
'; + echo '' . $lang['srv_maza_data_export'] . ''; + echo '
'; + + echo '
'; + echo '
'; + echo '

'; + + echo '' + . '' . $lang['srv_lnk_excel'] . ''; + + echo '
'; + echo '
'; + + //header('location: ' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=maza_csv&anketa=' . $this->_ank_id) . '&m=maza_csv&a=ident_export'); + } + + // Obrazec za posiljanje notificationa + private function getUsersStatistics() { + global $lang; + + $Query = "SELECT COUNT(*) cnt FROM maza_user_srv_access AS sa " . + "LEFT JOIN (SELECT id, datetime_last_active FROM maza_app_users) AS au " . + "ON au.id = sa.maza_user_id WHERE sa.ank_id='$this->_ank_id' AND au.datetime_last_active IS NOT NULL AND datetime_unsubscribed IS NULL;"; + $resultActivated = sisplet_query($Query, "obj"); + + $Query = "SELECT COUNT(*) cnt FROM maza_user_srv_access " . + "WHERE ank_id='$this->_ank_id' AND datetime_unsubscribed IS NOT NULL;"; + $resultDeactivated = sisplet_query($Query, "obj"); + + $Query = "SELECT COUNT(*) cnt FROM maza_user_srv_access WHERE ank_id='$this->_ank_id';"; + $resultAll = sisplet_query($Query, "obj"); + + //TABLE OF USERS STATISTICS + echo '
'; + echo '' . $lang['srv_maza_users_statistics'] . ''; + + echo '' . $lang['srv_maza_users_activated'] . ':' . $resultActivated->cnt.'
'; + echo '' . $lang['srv_maza_users_inactive'] . ':' . ($resultAll->cnt - $resultActivated->cnt - $resultDeactivated->cnt) .'
'; + echo '' . $lang['srv_maza_users_deactive'] . ':' . $resultDeactivated->cnt .'
'; + echo '
'.$lang['srv_maza_users_sum'].': '.$resultAll->cnt.'

'; + + //echo '' . $lang['srv_lnk_excel'] . ' (' . $lang['srv_maza_users_inactive'] . ')'; + //echo '' . $lang['srv_lnk_excel'] . ' (' . $lang['srv_maza_users_activated'] . ')'; + + echo '
'; + } + + function addUrl($what) { + global $site_url; + + if ($what == null || trim($what) == '') { + $what = 'maza_dashboard'; + } + $url = $site_url . 'admin/survey/index.php?anketa=' . $this->_ank_id . '&a=' . A_MAZA . '&m=' . $what; + + return $url; + } + + private function send_FCM_message($msg, $action) { + //get all registration ids + $reg_ids = array(); + $Query = "SELECT registration_id FROM maza_app_users AS au " + . "LEFT JOIN (SELECT maza_user_id, ank_id FROM maza_user_srv_access) AS sa " + . "ON au.id = sa.maza_user_id WHERE sa.ank_id='$this->_ank_id' AND " + . "au.registration_id != 'NULL' AND au.registration_id != ''"; + $sql_array = sisplet_query($Query, 'array'); + //$rql = mysqli_fetch_assoc ($reg_ids); + foreach ($sql_array as $pair) + array_push($reg_ids, $pair['registration_id']); + + $fields = array + ( + //can send to max 1000 reg_ids at once - split it on 1000 and send each chuck + 'registration_ids' => $reg_ids, + 'data' => $msg + ); + + if ((isset($_POST['maza_notification_priority']) && $_POST['maza_notification_priority'] == 1) + || $action == 'alarm' || $action == 'geofencing' || $action == 'activity' || $action == 'tracking' || $action == 'entry' || $action == 'all') + $fields['priority'] = 'high'; + + //do a curl to send notifications + $result = $this->send_FCM_mesage_curl($fields); + $this->send_FCM_message_navigate($action, $fields, $result); + } + + /** + * Do a curl to firebase to send notifications to devices + * @global type $FCM_server_key - FCM server key + * @param type $fields - json object containig FCM registration ids of devices and data to send + * @return type - json result of curl output + */ + private function send_FCM_mesage_curl($fields){ + #API access key from Google API's Console + global $FCM_server_key; + + $headers = array + ( + 'Authorization: key=' . $FCM_server_key, + 'Content-Type: application/json' + ); + #Send Reponse To FireBase Server + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send'); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); + $result = curl_exec($ch); + curl_close($ch); + + #Echo Result Of FireBase Server + //error_log($result); + //error_log(json_encode($headers)); + //error_log(json_encode($fields)); + //error_log(json_encode($result)); + + return $result; + } + + /** + * After sending FCM message, navigate to right submodule + * @param type $action - action or name of submodule + * @param type $fields - optional (just for test) + * @param type $headers - optional (just for test) + * @param type $result - optional (just for test) + */ + private function send_FCM_message_navigate($action, $fields, $result){ + switch ($action) { + case 'alarm': + $action = '&m=maza_set_alarm'; + break; + + case 'notification': + $action = '&m=maza_send_notification'; + break; + + case 'geofencing': + $action = '&m=maza_set_geofencing'; + break; + + case 'activity': + $action = '&m=maza_set_activity'; + break; + + case 'tracking': + $action = '&m=maza_set_tracking'; + break; + + case 'entry': + $action = '&m=maza_set_entry'; + break; + + case 'survey_info': + $action = '&m=maza_dashboard'; + break; + + default: + $action = '&m=maza_dashboard'; + break; + } + + if($action) + header('location: index.php?anketa=' . $this->_ank_id . '&a=maza' . $action . '&FCM_response=' . json_encode($fields, JSON_UNESCAPED_SLASHES). /*json_encode($headers, JSON_UNESCAPED_SLASHES).*/ json_encode($result, JSON_UNESCAPED_SLASHES)); + } + + public function ajax_sendNotification() { + $action = $_POST['maza_action']; + $title = $_POST['maza_title']; + $message = $_POST['maza_message']; + $srv_title = ""; + $repeat = 0; + $repeater = 0; + $geofences = 0; + $activity = 0; + $entry = 0; + + if ($action == 'alarm'){ + $this->maza_save_alarm($title, $message, /*$_POST['maza_notification_sound']*/1); + $sql_a = sisplet_query("SELECT repeat_by, time_in_day, day_in_week, every_which_day FROM maza_srv_alarms WHERE ank_id='" . $this->_ank_id . "'", 'obj'); + $repeat = array("repeat_by" => $sql_a->repeat_by, "time_in_day" => json_decode($sql_a->time_in_day), "day_in_week" => json_decode($sql_a->day_in_week), "every_which_day" => $sql_a->every_which_day); + $sql_r = sisplet_query("SELECT repeat_by, time_in_day, day_in_week, every_which_day, datetime_start, datetime_end FROM maza_srv_repeaters WHERE ank_id='" . $this->_ank_id . "'", 'obj'); + $repeater = array("repeat_by" => $sql_r->repeat_by, "time_in_day" => json_decode($sql_r->time_in_day), "day_in_week" => json_decode($sql_r->day_in_week), "every_which_day" => $sql_r->every_which_day, + "datetime_start" => $sql_r->datetime_start, "datetime_end" => $sql_r->datetime_end); + } + else if ($action == 'geofencing'){ + $geofences = $this->getRunningGeofences(); + } + else if ($action == 'activity'){ + $sql_a = sisplet_query("SELECT id, activity_type, after_seconds FROM maza_srv_activity WHERE ank_id='" . $this->_ank_id . "'", 'obj'); + $activity = array("id" => $sql_a->id, "activity_type" => $sql_a->activity_type, "after_seconds" => $sql_a->after_seconds); + + $sql_n = sisplet_query("SELECT naslov FROM srv_anketa WHERE id='" . $this->_ank_id . "'", 'obj'); + $srv_title = $sql_n->naslov; + } + else if ($action == 'tracking'){ + $sql_a = sisplet_query("SELECT * FROM maza_srv_tracking WHERE ank_id='" . $this->_ank_id . "'", 'obj'); + $tracking = array("id" => $sql_a->id, "activity_recognition" => $sql_a->activity_recognition, + "tracking_accuracy" => $sql_a->tracking_accuracy, "interval_wanted" => $sql_a->interval_wanted, + "interval_fastes" => $sql_a->interval_fastes, "displacement_min" => $sql_a->displacement_min, + "ar_interval_wanted" => $sql_a->ar_interval_wanted); + + $sql_n = sisplet_query("SELECT naslov FROM srv_anketa WHERE id='" . $this->_ank_id . "'", 'obj'); + $srv_title = $sql_n->naslov; + } + else if ($action == 'entry'){ + $entry = $this->getRunningEntry(); + $sql_n = sisplet_query("SELECT naslov FROM srv_anketa WHERE id='" . $this->_ank_id . "'", 'obj'); + $srv_title = $sql_n->naslov; + } + + #prep the bundle + $msg = array + ( + 'action' => $action, + 'ank_id' => $this->_ank_id, + 'message' => $message, + 'title' => $title, + 'link' => $this->_ank_link, + 'srv_title' => $srv_title, + 'repeat' => $repeat, + 'repeater' => $repeater, + 'geofences' => $geofences, + 'activity' => $activity, + 'tracking' => $tracking, + 'entry' => $entry, + 'sound' => /*(isset($_POST['maza_notification_sound']) && $_POST['maza_notification_sound'] == 1) ?*/ 1 //: 0 + ); + + $this->send_FCM_message($msg, $action); + } + + private function send_FCM_message_pwa($msg, $action) { + $reg_ids = sisplet_query("SELECT endpoint_key FROM browser_notifications_respondents", 'onevalarray'); + + //get all registration ids + /*$reg_ids = array('cJyD7jXFuGY:APA91bGmB4qXhZE2QOxPbjHm8ZTeyslXaejUfyVDmr06FDm-2p76sF2_A8Q0HGm0EZGdJ_O_iUACfJcsXznVWGe5SeDuI9S8F5HgqwZ1d7G2hN0PQiJL7Q8TlqjWCpbajjAWZ_OmxzLU', + 'e0jGT0OYYCY:APA91bGRjTI7iAuuvevYEtz9QLg5bQE2ha1L44PLSVg_kkrFn4up7ZeHzh50dW9vOxCch_hdTs-cEmx3HKuKIoxOnvCMuj7faInTkU4t80fxOjL7D1isuEmWXBM52pheEiE9nScF-i63');*/ + /*$Query = "SELECT registration_id FROM maza_app_users AS au " + . "LEFT JOIN (SELECT maza_user_id, ank_id FROM maza_user_srv_access) AS sa " + . "ON au.id = sa.maza_user_id WHERE sa.ank_id='$this->_ank_id' AND " + . "au.registration_id != 'NULL' AND au.registration_id != ''"; + $sql_array = sisplet_query($Query, 'array'); + //$rql = mysqli_fetch_assoc ($reg_ids); + foreach ($sql_array as $pair) + array_push($reg_ids, $pair['registration_id']);*/ + + $fields = array + ( + //can send to max 1000 reg_ids at once - split it on 1000 and send each chuck + 'registration_ids' => $reg_ids, + 'data' => $msg + ); + + //do a curl to send notifications + $result = $this->send_FCM_mesage_curl($fields); + $this->send_FCM_message_navigate($action, $fields, $result); + } + + public function ajax_sendNotification_pwa() { + $action = $_POST['maza_action']; + $title = $_POST['maza_title']; + $message = $_POST['maza_message']; + + $sql_n = sisplet_query("SELECT naslov FROM srv_anketa WHERE id='" . $this->_ank_id . "'", 'obj'); + + #prep the bundle + $msg = array + ( + 'action' => $action, + 'ank_id' => $this->_ank_id, + 'message' => $message, + 'title' => $title, + 'link' => $this->_ank_link, + 'srv_title' => $sql_n->naslov, + 'sound' => /*(isset($_POST['maza_notification_sound']) && $_POST['maza_notification_sound'] == 1) ?*/ 1 //: 0 + ); + + $this->send_FCM_message_pwa($msg, $action); + } + + /** + * Check if id of maza app user and indentifier match + * @param type $maza_uid - id of maza app auser + * @param type $maza_identifier - string identifier of maza app user + * @return boolean - true if match, false otherwise + */ + public function maza_validate_user($maza_uid, $maza_identifier) { + $sql = sisplet_query("SELECT * FROM maza_app_users WHERE id='$maza_uid' AND identifier='$maza_identifier'"); + if (mysqli_num_rows($sql) > 0) + return true; + else + return false; + } + + /** + * Update datetime of user last_active + * @param type $maza_uid - id of maza app user + */ + public function maza_update_user_active($maza_uid, $registration_id = null) { + $registration_id_query = ''; + if (isset($registration_id) && $registration_id != '') + $registration_id_query = ", registration_id = '$registration_id'"; + + sisplet_query("UPDATE maza_app_users SET datetime_last_active = NOW()$registration_id_query WHERE id='$maza_uid'"); + } + + /** + * Insert pair of users id's in maza_srv_users table if not already exists + * @param type $maza_uid - id of maza app user + * @param type $srv_uid - id of survey respondent + * @param type $srv_version - timestamp version of survey (important with repeaters) + * @param type $tgeofence_id - id of triggered geofence + * @param type $tactivity_id - id of triggered activity + * @param type $mode - mode of survey (repeater, geofence, activity, entry) + */ + public function maza_save_srv_user($maza_uid, $srv_uid, $srv_version, $tgeofence_id=null, $tactivity_id=null, $mode) { + //check if pair already existst in DB + $sql = sisplet_query("SELECT * FROM maza_srv_users WHERE maza_user_id='$maza_uid' AND srv_user_id='$srv_uid'"); + //it is already there + if (mysqli_num_rows($sql) > 0) + return false; + else { + if(!$tgeofence_id) + $tgeofence_id = 'NULL'; + if(!$tactivity_id) + $tactivity_id = 'NULL'; + + //get datetime from version + if($srv_version){ + $myDateTime = new DateTime(); + $myDateTime->setTimestamp($srv_version); + $newDateString = $myDateTime->format('Y-m-d H:i:s'); + } + + //insert in table + sisplet_query("INSERT INTO maza_srv_users (maza_user_id, srv_user_id, srv_version_datetime, tgeof_id, tact_id, mode) VALUES ('" . $maza_uid . "', '" . $srv_uid . "', '$newDateString', $tgeofence_id, $tactivity_id, ".($mode ? "'$mode'" : 'NULL').");"); + return true; + } + } + + public function ajax_maza_on_off() { + $on_off = json_decode($_POST['on_off']); + if (isset($on_off) && $on_off) + $this->maza_on(); + else + $this->maza_off(); + } + + + public function ajax_maza_cancel_alarm() { + $msg = array + ( + 'action' => 'cancel_alarm', + 'srv_id' => $this->_ank_id + ); + + sisplet_query("UPDATE maza_srv_alarms SET alarm_on='0' WHERE ank_id='" . $this->_ank_id . "'"); + + $this->send_FCM_message($msg, 'alarm'); + } + + public function maza_off($ank_id = null) { + if($ank_id) + $this->_ank_id = $ank_id; + + $this->maza_cancel_repeater_db(); + $this->maza_cancel_geofencing_db(); + $this->maza_cancel_entry_db(); + $this->maza_cancel_activity_db(); + $this->maza_cancel_tracking_db(); + + $msg = array + ( + 'action' => 'cancel_all', + 'srv_id' => $this->_ank_id + ); + $this->send_FCM_message($msg, 'all'); + } + + public function maza_cancel_repeater(){ + $msg = array + ( + 'action' => 'stop_repeater', + 'srv_id' => $this->_ank_id + ); + $this->send_FCM_message($msg, 'alarm'); + + $this->maza_cancel_repeater_db(); + header('location: index.php?anketa=' . $this->_ank_id . '&a=maza&m=maza_set_alarm'); + } + + public function maza_cancel_repeater_db(){ + sisplet_query("UPDATE maza_srv_alarms SET alarm_on='0' WHERE ank_id = '" . $this->_ank_id . "'"); + //for now, we cannot change repeater of survey - repeater_on = 2 means that survey was canceled while repeater was on + sisplet_query("UPDATE maza_srv_repeaters SET repeater_on='2', datetime_end=NOW() WHERE ank_id='" . $this->_ank_id . "'"); + } + + public function maza_on() { + $sel = sisplet_query("SELECT COUNT(id) as cnt FROM maza_srv_alarms WHERE ank_id = '" . $this->_ank_id . "';", 'obj'); + if($sel->cnt == 0) + sisplet_query("INSERT INTO maza_srv_alarms (ank_id) VALUES ('" . $this->_ank_id . "')"); + $sel = sisplet_query("SELECT COUNT(id) as cnt FROM maza_srv_repeaters WHERE ank_id = '" . $this->_ank_id . "';", 'obj'); + if($sel->cnt == 0) + sisplet_query("INSERT INTO maza_srv_repeaters (ank_id) VALUES ('" . $this->_ank_id . "')"); + $sel = sisplet_query("SELECT COUNT(id) as cnt FROM maza_survey WHERE srv_id = '" . $this->_ank_id . "';", 'obj'); + if($sel->cnt == 0) + sisplet_query("INSERT INTO maza_survey (srv_id) VALUES ('" . $this->_ank_id . "')"); + } + + private function maza_save_alarm($title, $message, $sound) { + //for now, available title is only default + sisplet_query("UPDATE maza_srv_alarms SET alarm_on='1', "//alarm_notif_title='$title', " + . "alarm_notif_message='$message', alarm_notif_sound='$sound' WHERE ank_id='" . $this->_ank_id . "'"); + } + + //returns random alphanumerical code + public function randomAlphaNumericCode($length) { + $token = ""; + $codeAlphabet = "ABCDEFGHJKLMNOPQRSTUVWXYZ"; + $codeAlphabet .= "abcdefghijkmnopqrstuvwxyz"; + $codeAlphabet .= "0123456789"; + $max = /*strlen($codeAlphabet)-1;*/59; // edited + + for ($i = 0; $i < $length; $i++) { + $token .= $codeAlphabet[mt_rand(0, $max)]; + } + + return $token; + } + + /** + * Generate new users or + * @param type $howManyUsers - number of new users to generate or 'self' for self identifier creation by app via API + * @return array array of identifiers or pair of id and identifier if 'self' + */ + public function insertNewUsers ($howManyUsers = 0){ + //create users from modul + if($howManyUsers > 0){ + $identifiers = array(); + $query = "BEGIN; "; + for($i = 0; $i < $howManyUsers; $i++){ + $generated_identifier = $this -> randomAlphaNumericCode(8); + //$salted_identifier = base64_encode(hash(SHA256, $generated_identifier . $pass_salt)); + + array_push($identifiers, $generated_identifier); + $query .= "INSERT INTO maza_app_users (identifier) VALUES('$generated_identifier'); INSERT INTO maza_user_srv_access (maza_user_id, ank_id) VALUES(LAST_INSERT_ID(), '$this->_ank_id'); "; + } + $query .= "COMMIT;"; + sisplet_query($query, 'multi_query'); + + return $identifiers; + } + //user self creates an identifier (from mobile app via API) + elseif($howManyUsers == 'self'){ + $generated_identifier = $this -> randomAlphaNumericCode(8); + sisplet_query("INSERT INTO maza_app_users (identifier, datetime_last_active) VALUES ('".$generated_identifier."', NOW())"); + $id = mysqli_insert_id($GLOBALS['connect_db']); + return array("id"=>$id, "identifier"=>$generated_identifier); + } + } + + public function ajax_maza_generate_users() { + $userNumb = $_POST['maza_users_generator_number']; + $this->insertNewUsers($userNumb); + header('location: index.php?anketa=' . $this->_ank_id . '&a=maza&m=maza_dashboard'); + } + + public function ajax_maza_survey_description() { + $desc = $_POST['srv_maza_users_description']; + + sisplet_query("UPDATE maza_survey SET srv_description='$desc' WHERE srv_id='" . $this->_ank_id . "'"); + + /*$msg = array + ( + 'action' => 'survey_info', + 'description' => $desc, + 'srv_id' => $this->_ank_id + ); + $this->send_FCM_message($msg, 'survey_info');*/ + header('location: index.php?anketa=' . $this->_ank_id . '&a=maza&m=maza_dashboard'); + } + + public function ajax_changeRepeatBy() { + $repeatby = $_POST['maza_repeatby']; + $table = $_POST['maza_table']; + sisplet_query("UPDATE maza_srv_$table SET repeat_by='$repeatby' WHERE ank_id='" . $this->_ank_id . "'"); + } + + public function ajax_changeTimeInDay() { + $time_in_day = json_encode($_POST['maza_time_in_day']); + $table = $_POST['maza_table']; + sisplet_query("UPDATE maza_srv_$table SET time_in_day='$time_in_day' WHERE ank_id='" . $this->_ank_id . "'"); + } + + public function ajax_changeDayInWeek() { + $day_in_week = json_encode($_POST['maza_day_in_week']); + $table = $_POST['maza_table']; + sisplet_query("UPDATE maza_srv_$table SET day_in_week='$day_in_week' WHERE ank_id='" . $this->_ank_id . "'"); + } + + public function ajax_changeEveryWhichDay() { + $every_which_day = $_POST['maza_every_which_day']; + $table = $_POST['maza_table']; + sisplet_query("UPDATE maza_srv_$table SET every_which_day='$every_which_day' WHERE ank_id='" . $this->_ank_id . "'"); + } + + public function ajax_saveRepeater() { + $repeatby = $_POST['maza_repeater_intervalby']; + $time_in_day = json_encode($_POST['maza_repeater_timeinday']); + $every_which_day = ($_POST['maza_repeater_everywhichday']) ? $_POST['maza_repeater_everywhichday'] : 1; + $day_in_week = json_encode($_POST['maza_repeater_dayinweek']); + $Start_date = $_POST['maza_repeater_date_start']; + $End_date = $_POST['maza_repeater_date_end']; + + if($Start_date){ + if($End_date){ + $End_date = DateTime::createFromFormat('d.m.Y', $End_date); + $End_date = $End_date->format("Y-m-d"); + $End_date = "datetime_end='$End_date', "; + } + $Start_date = DateTime::createFromFormat('d.m.Y', $Start_date); + $Start_date = $Start_date->format("Y-m-d"); + + sisplet_query("UPDATE maza_srv_repeaters SET repeater_on='1', datetime_start='$Start_date', $End_date" + . "every_which_day='$every_which_day', day_in_week='$day_in_week', " + . "time_in_day='$time_in_day', repeat_by='$repeatby' WHERE ank_id='" . $this->_ank_id . "'"); + } + header('location: index.php?anketa=' . $this->_ank_id . '&a=maza&m=maza_set_alarm'); + } + + /** + * Insert/save new geofence + */ + function ajax_insert_geofence(){ + $add = $_POST['address']; + $lat = $_POST['lat']; + $lng = $_POST['lng']; + $rad = $_POST['radius']; + $trigger_survey = "NOW()"; + + $sql = sisplet_query("SELECT trigger_survey FROM maza_srv_geofences WHERE ank_id=".$this->_ank_id." LIMIT 1", 'obj'); + if($sql && $sql->trigger_survey==null){ + $trigger_survey="NULL"; + } + + //last decimals of coordiates are not exact same in database, because float in mySql is not precise - practical variations are minimal + $id = sisplet_query("INSERT INTO maza_srv_geofences (ank_id, address, lat, lng, radius, trigger_survey) " + . "VALUES ('$this->_ank_id', '$add', '$lat', '$lng', '$rad', $trigger_survey)", "id"); + + echo $id; + } + + /** + * Update geofence by ID + */ + function ajax_update_geofence(){ + if($_POST['id']){ + $update = ''; + $update .= $_POST['address'] ? "address = '".$_POST['address']."', " : ''; + $update .= $_POST['lat'] ? "lat = '".$_POST['lat']."', " : ''; + $update .= $_POST['lng'] ? "lng = '".$_POST['lng']."', " : ''; + $update .= $_POST['radius'] ? "radius = '".$_POST['radius']."', " : ''; + $update = substr($update, 0, -2); + + //last decimals of coordiates are not exact same in database, because float in mySql is not precise - practical variations are minimal + sisplet_query("UPDATE maza_srv_geofences SET $update WHERE id='".$_POST['id']."'"); + } + } + + /** + * Update geofenceinternal name by ID + */ + function ajax_update_geofence_name(){ + if($_POST['id']){ + sisplet_query("UPDATE maza_srv_geofences SET name='".$_POST['name']."' WHERE id='".$_POST['id']."'"); + } + } + + /** + * Delete geofence by ID + */ + function ajax_delete_geofence(){ + if($_POST['id']){ + $sql = sisplet_query("DELETE FROM maza_srv_geofences WHERE id='".$_POST['id']."'"); + if($sql) + echo 'OK'; + } + } + + /** + * Get array of geofences for this survey + * @return type string JSON array of all geofences for this survey + */ + function ajax_get_all_geofences(){ + $sql = sisplet_query("SELECT * FROM maza_srv_geofences WHERE ank_id=".$this->_ank_id, 'array'); + echo json_encode($sql); + } + + /** + * Calncel all geofences for this survey + * Turn geofences off in DB and send cancelation to all subscriptors via FCM + */ + public function maza_cancel_geofencing(){ + $msg = array + ( + 'action' => 'cancel_geofencing', + 'srv_id' => $this->_ank_id + ); + $this->send_FCM_message($msg, 'geofencing'); + + $this->maza_cancel_geofencing_db(); + header('location: index.php?anketa=' . $this->_ank_id . '&a=maza&m=maza_set_geofencing'); + } + + public function maza_cancel_geofencing_db(){ + sisplet_query("UPDATE maza_srv_geofences SET geofence_on='0' WHERE ank_id = '" . $this->_ank_id . "'"); + } + + /** + * Run all geofences for this survey + * Turn geofences on in DB and send them to subscriptors via FCM + */ + public function maza_run_geofences(){ + $title = $_POST['maza_title']; + $message = $_POST['maza_message']; + $sound = /*$_POST['maza_notification_sound']*/1; + $transition = $_POST['maza_geofence_on_transition']; + $time = $_POST['maza_geofence_after_time']; + $location_triggered = $_POST['maza_geofence_location_triggered']; + $trigger_survey = $_POST['maza_geofence_trigger_survey']; + + sisplet_query("UPDATE maza_srv_geofences SET geofence_on='1', notif_title='$title', " + . "notif_message='$message', notif_sound='$sound', after_seconds='$time', " + . "on_transition='$transition', location_triggered='$location_triggered', " + . "trigger_survey=".($trigger_survey ? 'NULL' : 'NOW()' )." " + . "WHERE ank_id='" . $this->_ank_id . "'"); + + $this->ajax_sendNotification(); + } + + /** + * Get array of running geofences for this survey + * @return type array of all running geofences for this survey + */ + public function getRunningGeofences(){ + return sisplet_query("SELECT * FROM maza_srv_geofences WHERE geofence_on=1 AND ank_id='" . $this->_ank_id . "'", 'array'); + } + + /** + * Get object of running data entry for this survey + * @return type object of running data entry for this survey + */ + private function getRunningEntry(){ + return sisplet_query("SELECT * FROM maza_srv_entry WHERE entry_on=1 AND ank_id='" . $this->_ank_id . "'", 'obj'); + } + + /** + * Calncel data entry for this survey + * Turn data entry off in DB and send cancelation to all subscriptors via FCM + */ + public function maza_cancel_entry(){ + $msg = array + ( + 'action' => 'cancel_entry', + 'srv_id' => $this->_ank_id + ); + $this->send_FCM_message($msg, 'entry'); + + $this->maza_cancel_entry_db(); + header('location: index.php?anketa=' . $this->_ank_id . '&a=maza&m=maza_set_entry'); + } + + public function maza_cancel_entry_db(){ + sisplet_query("UPDATE maza_srv_entry SET entry_on='0' WHERE ank_id = '" . $this->_ank_id . "'"); + } + + /** + * Run all data entry for this survey + * Turn data entry on in DB and send them to subscriptors via FCM + */ + public function maza_run_entry(){ + $location_triggered = $_POST['maza_entry_location_check']; + + $sel = sisplet_query("SELECT COUNT(id) as cnt FROM maza_srv_entry WHERE ank_id = '" . $this->_ank_id . "';", 'obj'); + if($sel->cnt == 0) + sisplet_query("INSERT INTO maza_srv_entry (ank_id, location_check, entry_on) VALUES ('" . $this->_ank_id . "', '$location_triggered', '1')"); + else + sisplet_query("UPDATE maza_srv_entry SET entry_on='1', location_check='$location_triggered' WHERE ank_id='" . $this->_ank_id . "'"); + + //if location is on, create system variables for coordinates + if($location_triggered == '1'){ + //is there already system varibles in survey for coordinates + $sel = sisplet_query("SELECT COUNT(s.id) as cnt, g.id, s.gru_id, g.ank_id, s.variable FROM srv_spremenljivka as s " + . "LEFT JOIN (SELECT id, ank_id FROM srv_grupa) AS g ON g.id = s.gru_id " + . "WHERE g.ank_id='$this->_ank_id' AND variable='latitude';", 'obj'); + + //sys variables not created yet + if($sel->cnt == 0){ + //create empty variables + $ba = new BranchingAjax($this->_ank_id); + $spr_lng = $ba->spremenljivka_new(0, 0, 0, 0, true); + $spr_lat = $ba->spremenljivka_new(0, 0, 0, 0, true); + + //set system variables + sisplet_query("UPDATE srv_spremenljivka SET naslov='latitude', variable='latitude', tip='21', " + . "visible='0', sistem='1', variable_custom='1' WHERE id='$spr_lat';"); + sisplet_query("UPDATE srv_spremenljivka SET naslov='longitude', variable='longitude', tip='21', " + . "visible='0', sistem='1', variable_custom='1' WHERE id='$spr_lng';"); + + sisplet_query("INSERT INTO srv_vrednost (id, spr_id, naslov, variable, vrstni_red, variable_custom, hidden) VALUES ('', '$spr_lat', 'latitude', 'latitude', '1', '1', '1');"); + sisplet_query("INSERT INTO srv_vrednost (id, spr_id, naslov, variable, vrstni_red, variable_custom, hidden) VALUES ('', '$spr_lng', 'longitude', 'longitude', '1', '1', '1');"); + + Common::getInstance()->updateEditStamp(); + } + } + $this->ajax_sendNotification(); + } + + /** + * Run activity for this survey + * Turn activity on in DB and send them to subscriptors via FCM + */ + public function maza_run_activity(){ + $title = $_POST['maza_title']; + $message = $_POST['maza_message']; + $sound = /*$_POST['maza_notification_sound']*/1; + $transition = $_POST['maza_activity_type']; + $time = $_POST['maza_activity_after_time']; + + $sel = sisplet_query("SELECT COUNT(id) as cnt FROM maza_srv_activity WHERE ank_id = '" . $this->_ank_id . "';", 'obj'); + if($sel->cnt > 0) + sisplet_query("UPDATE maza_srv_activity SET activity_on='1', notif_title='$title', " + . "notif_message='$message', notif_sound='$sound', after_seconds='$time', activity_type='$transition' WHERE ank_id='" . $this->_ank_id . "'"); + else + sisplet_query("INSERT INTO maza_srv_activity (ank_id, activity_on, notif_title, notif_message, notif_sound, after_seconds, activity_type) " + . "VALUES ('".$this->_ank_id."', '1', '".$title."', '".$message."', '".$sound."', '".$time."', '".$transition."')"); + + $this->ajax_sendNotification(); + } + + /** + * Calncel all activities for this survey + * Turn activities off in DB and send cancelation to all subscriptors via FCM + */ + public function maza_cancel_activity(){ + $msg = array + ( + 'action' => 'cancel_activity', + 'srv_id' => $this->_ank_id + ); + $this->send_FCM_message($msg, 'activity'); + + $this->maza_cancel_activity_db(); + header('location: index.php?anketa=' . $this->_ank_id . '&a=maza&m=maza_set_activity'); + } + + public function maza_cancel_activity_db(){ + sisplet_query("UPDATE maza_srv_activity SET activity_on='0' WHERE ank_id = '" . $this->_ank_id . "'"); + } + + /** + * Send post request to nextpin API to create new user + * @param type $identifier - identifier of user to register on nextpin + * @param type $password - passwor to set in nextpin for this user + */ + public function nextpin_create_user($identifier, $password){ + #credentials to use nextpin API + global $NextPinMainToken; + + $fields = array + ( + 'username' => $this->nextpin_token_prefix . $identifier, + 'password' => $password + ); + + $this -> nextpin_API_call($NextPinMainToken, $fields, 'auth/createUser'); + } + + /** + * Send post request to nextpin API to set new activity listener + * @param type $identifier - identifier of user to register on nextpin + * @param type $password - passwor to set in nextpin for this user + */ + public function nextpin_set_activity_listener($identifier){ + global $site_url; + + $sql_a = sisplet_query("SELECT id, activity_type, after_seconds FROM maza_srv_activity WHERE ank_id='" . $this->_ank_id . "'", 'obj'); + + $target = $sql_a->activity_type == 'path' ? 'P' : 'S'; + + $fields = array + ( + 'target' => $target, + 'trigger_group' => "1KAPanel_trigger_".$this->_ank_id, + 'threshold' => $sql_a->after_seconds, + 'host' => $site_url, + 'port' => "80", + 'path' => "/admin/survey/api/api.php?action=nextpinalarmgetter&act_id=".$sql_a->id."&identifier=".$identifier + ); + + $this -> nextpin_API_call($this->nextpin_token_prefix.$identifier, $fields, 'alerts/setActivityForUser'); + } + + /** + * Send post request to nextpin API + * @param type $token - token/username to use it in request header + * @param type $body - data to put it in body of request + * @param type $method - method to append in link after .../NextPin/ + */ + private function nextpin_API_call($token, $body, $method){ + $headers = array + ( + 'token: ' . $token, + 'Content-Type: application/json' + ); + //error_log(json_encode($body, JSON_UNESCAPED_SLASHES)); + //error_log(json_encode($headers)); + #Send Reponse To FireBase Server + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, 'http://traffic.ijs.si/NextPin/'.$method); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body, JSON_UNESCAPED_SLASHES)); + $result = curl_exec($ch); + curl_close($ch); + + $myfile = fopen("nextpin_test3.txt", "a+") or die("Unable to open file!"); + //if($this->params['action'] != 'mazaUpdateTrackingLog'){ + $date = new DateTime(); + $date = $date->format('d.m.Y H:i:s'); + //} + fwrite($myfile, $date.' nextpin_API_call'."\n"); + fwrite($myfile, "\n".json_encode($headers)."\n"); + + fwrite($myfile, json_encode($body, JSON_UNESCAPED_SLASHES)."\n"); + + fwrite($myfile, json_encode($result, JSON_UNESCAPED_SLASHES)."\n"); + + $txt = "------------------------------------------------------------------------------------------------\n\n"; + fwrite($myfile, $txt); + fclose($myfile); + + //error_log(json_encode($result)); + } + + public function writeintxt ($text){ + $myfile = fopen("nextpin_test3.txt", "a+") or die("Unable to open file!"); + //if($this->params['action'] != 'mazaUpdateTrackingLog'){ + $date = new DateTime(); + $date = $date->format('d.m.Y H:i:s'); + //} + fwrite($myfile, $date.' '.$text."\n"); + + $txt = "------------------------------------------------------------------------------------------------\n\n"; + fwrite($myfile, $txt); + fclose($myfile); + } + + /** + * Run tracking for this survey + * Turn tracking on in DB and send them to subscriptors via FCM + */ + public function maza_run_tracking(){ + $activity_recognition = $_POST['maza_tracking_activity_recognition']; + $tracking_accuracy = $_POST['maza_tracking_accuracy']; + $interval_wanted = $_POST['maza_tracking_interval_wanted']; + $interval_fastes = $_POST['maza_tracking_interval_fastes']; + $displacement_min = $_POST['maza_tracking_displacement_min']; + $ar_interval_wanted = $_POST['maza_tracking_ar_interval_wanted']; + + $sel = sisplet_query("SELECT COUNT(id) as cnt FROM maza_srv_tracking WHERE ank_id = '" . $this->_ank_id . "';", 'obj'); + if($sel->cnt > 0) + sisplet_query("UPDATE maza_srv_tracking SET tracking_on='1', activity_recognition='$activity_recognition', " + . "tracking_accuracy='$tracking_accuracy', interval_wanted='$interval_wanted', " + . "interval_fastes='$interval_fastes', displacement_min='$displacement_min', " + . "ar_interval_wanted='$ar_interval_wanted' WHERE ank_id='" . $this->_ank_id . "'"); + else + sisplet_query("INSERT INTO maza_srv_tracking (ank_id, tracking_on, activity_recognition, tracking_accuracy, interval_wanted, interval_fastes, displacement_min, ar_interval_wanted) " + . "VALUES ('".$this->_ank_id."', '1', '".$activity_recognition."', '".$tracking_accuracy."', '".$interval_wanted."', '".$interval_fastes."', '".$displacement_min."', '".$ar_interval_wanted."')"); + + $this->ajax_sendNotification(); + } + + /** + * Calncel all activities for this survey + * Turn activities off in DB and send cancelation to all subscriptors via FCM + */ + public function maza_cancel_tracking(){ + $msg = array + ( + 'action' => 'cancel_tracking', + 'srv_id' => $this->_ank_id + ); + $this->send_FCM_message($msg, 'tracking'); + + $this->maza_cancel_tracking_db(); + header('location: index.php?anketa=' . $this->_ank_id . '&a=maza&m=maza_set_tracking'); + } + + public function maza_cancel_tracking_db(){ + sisplet_query("UPDATE maza_srv_tracking SET tracking_on='0' WHERE ank_id = '" . $this->_ank_id . "'"); + } + + public function maza_check_expired_surveys(){ + $arr = sisplet_query("SELECT ank.id, ank.expire, ank.active, mo.ank_id, mo.modul, mo.vrednost FROM srv_anketa AS ank " + . "LEFT JOIN (SELECT * FROM srv_anketa_module) AS mo ON ank.id = mo.ank_id " + . "WHERE ank.active = '1' AND ank.expire < CURDATE() AND mo.modul = 'maza' AND mo.vrednost = '1'", 'array'); + + if($arr){ + foreach ($arr as $ank){ + $this -> maza_off($ank['ank_id']); + } + } + } +} +?> \ No newline at end of file diff --git a/admin/survey/modules/mod_MAZA/class.MAZAExport.php b/admin/survey/modules/mod_MAZA/class.MAZAExport.php new file mode 100644 index 0000000..cfb6863 --- /dev/null +++ b/admin/survey/modules/mod_MAZA/class.MAZAExport.php @@ -0,0 +1,325 @@ +_ank_id = $ank_id; + } + + /*private function getDataInactiveIdentifiers() { + $Query = "SELECT au.datetime_inserted, au.identifier FROM maza_app_users AS au " . + "LEFT JOIN (SELECT ank_id, maza_user_id FROM maza_user_srv_access) AS sa " . + "ON au.id = sa.maza_user_id WHERE sa.ank_id='$this->_ank_id' AND au.datetime_last_active IS NULL;"; + + $podatki = array(array('inserted', 'identifier')); + + $sqlQuery = sisplet_query($Query); + + if (mysqli_num_rows($sqlQuery)) { + while ($sql_row = mysqli_fetch_assoc($sqlQuery)) { + $podatki[] = array($sql_row['datetime_inserted'], $sql_row['identifier']); + } + } + + return $podatki; + } + + private function getDataActiveIdentifiers() { + $Query = "SELECT au.datetime_inserted, au.identifier, au.datetime_last_active, au.deviceInfo, au.tracking_log FROM maza_app_users AS au " . + "LEFT JOIN (SELECT ank_id, maza_user_id FROM maza_user_srv_access) AS sa " . + "ON au.id = sa.maza_user_id WHERE sa.ank_id='$this->_ank_id' AND au.datetime_last_active IS NOT NULL;"; + + $podatki = array(array('inserted', 'identifier', 'last_active', 'device_info', 'tracking_log')); + + $sqlQuery = sisplet_query($Query); + + if (mysqli_num_rows($sqlQuery)) { + while ($sql_row = mysqli_fetch_assoc($sqlQuery)) { + $podatki[] = array($sql_row['datetime_inserted'], $sql_row['identifier'], $sql_row['datetime_last_active'], $sql_row['deviceInfo'], $sql_row['tracking_log']); + } + } + + return $podatki; + }*/ + + private function getDataIdentifiers() { + $act = isset($_POST['maza_active_ident']) && $_POST['maza_active_ident'] == 1; + $inact = isset($_POST['maza_inactive_ident']) && $_POST['maza_inactive_ident'] == 1; + $deact = isset($_POST['maza_deactive_ident']) && $_POST['maza_deactive_ident'] == 1; + + $where = ''; + if($act && !$inact) + $where .= ' AND au.datetime_last_active IS NOT NULL'; + else if(!$act && $inact && $deact) + $where .= ' AND (au.datetime_last_active IS NULL OR sa.datetime_unsubscribed IS NOT NULL)'; + else if(!$act && $inact) + $where .= ' AND au.datetime_last_active IS NULL'; + if($deact && !$act && !$inact) + $where .= ' AND sa.datetime_unsubscribed IS NOT NULL'; + else if(!$deact) + $where .= ' AND sa.datetime_unsubscribed IS NULL'; + + $Query = "SELECT au.datetime_inserted, au.identifier, au.datetime_last_active, au.deviceInfo, au.tracking_log, sa.datetime_unsubscribed FROM maza_app_users AS au " . + "LEFT JOIN (SELECT ank_id, maza_user_id, datetime_unsubscribed FROM maza_user_srv_access) AS sa " . + "ON au.id = sa.maza_user_id WHERE sa.ank_id='$this->_ank_id'$where;"; + + $podatki = array(array('inserted', 'identifier', 'last_active', 'device_info', 'tracking_log', 'unsubscribed')); + + $sqlQuery = sisplet_query($Query); + + if (mysqli_num_rows($sqlQuery)) { + while ($sql_row = mysqli_fetch_assoc($sqlQuery)) { + $podatki[] = array($sql_row['datetime_inserted'], $sql_row['identifier'], $sql_row['datetime_last_active'], $sql_row['deviceInfo'], $sql_row['tracking_log'], $sql_row['datetime_unsubscribed']); + } + } + + return $podatki; + } + + private function getDataTrackingLocations() { + $Query = "SELECT au.identifier, ml.maza_user_id, ml.lat, ml.lng, ml.provider, ml.timestamp, ml.accuracy, ml.altitude, " + . "ml.bearing, ml.speed, ml.vertical_acc, ml.speed_acc, ml.bearing_acc, ml.extras, ml.is_mock FROM maza_user_locations AS ml " + . "LEFT JOIN (SELECT ank_id, maza_user_id, datetime_started FROM maza_user_srv_access) AS sa " + . "ON ml.maza_user_id = sa.maza_user_id " + . "LEFT JOIN (SELECT id, identifier FROM maza_app_users) AS au ON au.id = ml.maza_user_id " + . "WHERE sa.ank_id='$this->_ank_id' AND sa.datetime_started IS NOT NULL AND sa.datetime_started <= ml.timestamp " + . "ORDER BY sa.datetime_started, au.identifier, ml.timestamp DESC;"; + + $podatki = array(array('Identifier', 'timestamp', 'latitude', 'longitude', 'provider', 'accuracy', + 'altitude', 'bearing', 'speed', 'vertical_acc', 'speed_acc', 'bearing_acc', 'extras', 'is_mock')); + + $sqlQuery = sisplet_query($Query); + + if (mysqli_num_rows($sqlQuery)) { + while ($row = mysqli_fetch_assoc($sqlQuery)) { + $podatki[] = array($row['identifier'], $row['timestamp'], $row['lat'], $row['lng'], $row['provider'], + $row['accuracy'], $row['altitude'], $row['bearing'], $row['speed'], $row['vertical_acc'], $row['speed_acc'], + $row['bearing_acc'], $row['extras'], $row['is_mock']); + } + } + return $podatki; + } + + private function getDataTrackingAR() { + $Query = "SELECT au.identifier, ml.maza_user_id, ml.timestamp, ml.in_vehicle, ml.on_bicycle, ml.on_foot, ml.walking, " + . "ml.running, ml.still, ml.tilting, ml.unknown FROM maza_user_activity_recognition AS ml " + . "LEFT JOIN (SELECT ank_id, maza_user_id, datetime_started FROM maza_user_srv_access) AS sa " + . "ON ml.maza_user_id = sa.maza_user_id " + . "LEFT JOIN (SELECT id, identifier FROM maza_app_users) AS au ON au.id = ml.maza_user_id " + . "WHERE sa.ank_id='$this->_ank_id' AND sa.datetime_started IS NOT NULL AND sa.datetime_started <= ml.timestamp " + . "ORDER BY sa.datetime_started, au.identifier, ml.timestamp DESC;"; + + $podatki = array(array('identifier', 'timestamp', 'in_vehicle', 'on_bicycle', 'on_foot', 'walking', 'running', + 'still', 'tilting', 'unknown')); + + $sqlQuery = sisplet_query($Query); + + if (mysqli_num_rows($sqlQuery)) { + while ($row = mysqli_fetch_assoc($sqlQuery)) { + $podatki[] = array($row['identifier'], $row['timestamp'], $row['in_vehicle'], $row['on_bicycle'], $row['on_foot'], + $row['walking'], $row['running'], $row['still'], $row['tilting'], $row['unknown']); + } + } + + return $podatki; + } + + private function getDataAlarmRespondents() { + $Query = "SELECT au.identifier, su.maza_user_id, su.srv_user_id, su.mode, su.srv_version_datetime, res.id, res.recnum, re.ank_id FROM maza_srv_users AS su " + . "LEFT JOIN (SELECT ank_id, maza_user_id, datetime_started FROM maza_user_srv_access) AS sa ON su.maza_user_id = sa.maza_user_id " + . "LEFT JOIN (SELECT ank_id FROM maza_srv_repeaters) AS re ON re.ank_id = sa.ank_id " + . "LEFT JOIN (SELECT id, identifier FROM maza_app_users) AS au ON au.id = su.maza_user_id " + . "LEFT JOIN (SELECT id, recnum FROM srv_user) AS res ON res.id = su.srv_user_id " + . "WHERE sa.ank_id='$this->_ank_id' AND re.ank_id='$this->_ank_id' AND sa.datetime_started IS NOT NULL AND (mode='repeater' OR (su.geof_id IS NULL AND su.activity_id IS NULL)) "//todo zadnji OR je samo zacasno, pobrisi enkrat po APP verziji 25 + . "ORDER BY sa.datetime_started, au.identifier, su.srv_version_datetime DESC;"; + + $podatki = array(array('identifier', 'recnum', 'time_version')); + + $sqlQuery = sisplet_query($Query); + + if (mysqli_num_rows($sqlQuery)) { + while ($row = mysqli_fetch_assoc($sqlQuery)) { + $podatki[] = array($row['identifier'], $row['recnum'], $row['srv_version_datetime']); + } + } + return $podatki; + } + + private function getDataTriggeredGeofences() { + $Query = "SELECT tg.id, tg.maza_user_id, tg.geof_id, tg.triggered_timestamp, tg.enter_timestamp, tg.dwell_timestamp, au.identifier, ge.name, su.maza_user_id, su.srv_user_id, su.srv_version_datetime, su.mode, su.tgeof_id, res.id, res.recnum " + . ", ml.maza_user_id, ml.lat, ml.lng, ml.provider, ml.timestamp, ml.accuracy, ml.altitude, ml.bearing, ml.speed, ml.vertical_acc, ml.speed_acc, ml.bearing_acc, ml.extras, ml.is_mock" + . " FROM maza_srv_triggered_geofences AS tg " + . "LEFT JOIN (SELECT tgeof_id, maza_user_id, lat, lng, provider, timestamp, accuracy, altitude, bearing, speed, vertical_acc, speed_acc, bearing_acc, extras, is_mock FROM maza_user_locations) AS ml ON tg.id = ml.tgeof_id " + . "LEFT JOIN (SELECT ank_id, id, name FROM maza_srv_geofences) AS ge ON ge.id = tg.geof_id " + . "LEFT JOIN (SELECT ank_id, maza_user_id, datetime_started FROM maza_user_srv_access) AS sa ON tg.maza_user_id = sa.maza_user_id " + . "LEFT JOIN (SELECT id, identifier FROM maza_app_users) AS au ON au.id = tg.maza_user_id " + . "LEFT JOIN (SELECT maza_user_id, srv_user_id, srv_version_datetime, tgeof_id, mode FROM maza_srv_users) AS su ON su.maza_user_id = tg.maza_user_id AND su.tgeof_id = tg.id " + . "LEFT JOIN (SELECT id, recnum FROM srv_user) AS res ON res.id = su.srv_user_id " + . "WHERE sa.ank_id='$this->_ank_id' AND ge.ank_id='$this->_ank_id' AND sa.datetime_started IS NOT NULL " + . "ORDER BY sa.datetime_started, au.identifier, tg.triggered_timestamp DESC;"; + + $podatki = array(array('identifier', 'recnum', 'geofence_id', 'geofence_name', 'triggered_timestamp', 'enter_timestamp', 'dwell_timestamp', 'location_timestamp', 'latitude', 'longitude', 'provider', 'accuracy', + 'altitude', 'bearing', 'speed', 'vertical_acc', 'speed_acc', 'bearing_acc', 'extras', 'is_mock')); + + $sqlQuery = sisplet_query($Query); + + if (mysqli_num_rows($sqlQuery)) { + while ($row = mysqli_fetch_assoc($sqlQuery)) { + $podatki[] = array($row['identifier'], $row['recnum'], $row['geof_id'], $row['name'], $row['triggered_timestamp'], $row['enter_timestamp'], $row['dwell_timestamp'], + $row['timestamp'], $row['lat'], $row['lng'], $row['provider'], $row['accuracy'], $row['altitude'], $row['bearing'], $row['speed'], $row['vertical_acc'], $row['speed_acc'], + $row['bearing_acc'], $row['extras'], $row['is_mock']); + } + } + return $podatki; + } + + private function getDataTriggeredGeofencesAnswers() { + $Query = "SELECT tg.id, tg.maza_user_id, tg.geof_id, tg.triggered_timestamp, au.identifier, ge.name, su.maza_user_id, su.srv_user_id, su.srv_version_datetime, su.mode, su.tgeof_id, res.id, res.recnum " + . ", ml.maza_user_id, ml.lat, ml.lng, ml.provider, ml.timestamp, ml.accuracy, ml.altitude, ml.bearing, ml.speed, ml.vertical_acc, ml.speed_acc, ml.bearing_acc, ml.extras, ml.is_mock" + . " FROM maza_srv_triggered_geofences AS tg " + . "LEFT JOIN (SELECT tgeof_id, maza_user_id, lat, lng, provider, timestamp, accuracy, altitude, bearing, speed, vertical_acc, speed_acc, bearing_acc, extras, is_mock FROM maza_user_locations) AS ml ON tg.id = ml.tgeof_id " + . "LEFT JOIN (SELECT ank_id, id, name FROM maza_srv_geofences) AS ge ON ge.id = tg.geof_id " + . "LEFT JOIN (SELECT ank_id, maza_user_id, datetime_started FROM maza_user_srv_access) AS sa ON tg.maza_user_id = sa.maza_user_id " + . "LEFT JOIN (SELECT id, identifier FROM maza_app_users) AS au ON au.id = tg.maza_user_id " + . "LEFT JOIN (SELECT maza_user_id, srv_user_id, srv_version_datetime, tgeof_id, mode FROM maza_srv_users) AS su ON su.maza_user_id = tg.maza_user_id AND su.tgeof_id = tg.id " + . "LEFT JOIN (SELECT id, recnum FROM srv_user) AS res ON res.id = su.srv_user_id " + . "WHERE sa.ank_id='$this->_ank_id' AND ge.ank_id='$this->_ank_id' AND sa.datetime_started IS NOT NULL AND su.mode='geofence' " + . "ORDER BY res.recnum DESC;"; + + $podatki = array(array('identifier', 'recnum', 'geofence_id', 'geofence_name', 'triggered_timestamp', 'location_timestamp', 'latitude', 'longitude', 'provider', 'accuracy', + 'altitude', 'bearing', 'speed', 'vertical_acc', 'speed_acc', 'bearing_acc', 'extras', 'is_mock')); + + $sqlQuery = sisplet_query($Query); + + if (mysqli_num_rows($sqlQuery)) { + while ($row = mysqli_fetch_assoc($sqlQuery)) { + $podatki[] = array($row['identifier'], $row['recnum'], $row['geof_id'], $row['name'], $row['triggered_timestamp'], $row['timestamp'], $row['lat'], $row['lng'], $row['provider'], + $row['accuracy'], $row['altitude'], $row['bearing'], $row['speed'], $row['vertical_acc'], $row['speed_acc'], + $row['bearing_acc'], $row['extras'], $row['is_mock']); + } + } + return $podatki; + } + + private function getDataEntryLocations() { + $Query = "SELECT au.identifier, su.maza_user_id, su.srv_user_id, su.srv_version_datetime, su.mode, res.id, res.recnum, su.loc_id, ml.id " + . ", ml.maza_user_id, ml.lat, ml.lng, ml.provider, ml.timestamp, ml.accuracy, ml.altitude, ml.bearing, ml.speed, ml.vertical_acc, ml.speed_acc, ml.bearing_acc, ml.extras, ml.is_mock" + . " FROM maza_srv_users AS su " + . "LEFT JOIN (SELECT ank_id, maza_user_id, datetime_started FROM maza_user_srv_access) AS sa ON su.maza_user_id = sa.maza_user_id " + . "LEFT JOIN (SELECT id, identifier FROM maza_app_users) AS au ON au.id = su.maza_user_id " + . "LEFT JOIN (SELECT * FROM maza_user_locations) AS ml ON su.maza_user_id = ml.maza_user_id AND su.loc_id = ml.id " + . "LEFT JOIN (SELECT id, recnum FROM srv_user) AS res ON res.id = su.srv_user_id " + . "WHERE sa.ank_id='$this->_ank_id' AND sa.datetime_started IS NOT NULL AND su.mode='entry' " + . "ORDER BY res.recnum DESC;"; + + $podatki = array(array('identifier', 'recnum', 'entry_timestamp', 'location_timestamp', 'latitude', 'longitude', 'provider', 'accuracy', + 'altitude', 'bearing', 'speed', 'vertical_acc', 'speed_acc', 'bearing_acc', 'extras', 'is_mock')); + + $sqlQuery = sisplet_query($Query); + + if (mysqli_num_rows($sqlQuery)) { + while ($row = mysqli_fetch_assoc($sqlQuery)) { + $podatki[] = array($row['identifier'], $row['recnum'], $row['srv_version_datetime'], $row['timestamp'], $row['lat'], $row['lng'], $row['provider'], + $row['accuracy'], $row['altitude'], $row['bearing'], $row['speed'], $row['vertical_acc'], $row['speed_acc'], + $row['bearing_acc'], $row['extras'], $row['is_mock']); + } + } + return $podatki; + } + + private function getDataGeofences() { + $Query = "SELECT * FROM maza_srv_geofences WHERE ank_id='$this->_ank_id' ORDER BY id;"; + + $podatki = array(array('id', 'survey_id', 'geofence_on', 'center_latitude', 'center_longitude', 'radius', 'center_address', 'name', + 'notification_title', 'notification_message', 'notification_sound', 'on_transition', 'after_seconds', 'location_after_triggered')); + + $sqlQuery = sisplet_query($Query); + + if (mysqli_num_rows($sqlQuery)) { + while ($row = mysqli_fetch_assoc($sqlQuery)) { + $podatki[] = array($row['id'], $row['ank_id'], $row['geofence_on'], $row['lat'], $row['lng'], $row['radius'], $row['address'], $row['name'], $row['notif_title'], + $row['notif_message'], $row['notif_sound'], $row['on_transition'], $row['after_seconds'], $row['location_triggered']); + } + } + + return $podatki; + } + + private function exportCSVTable($data, $name) { + // Izvozimo CSV + $fp = fopen('php://output', 'w'); + + header('Content-Type: application/csv charset=UTF-8'); + header('Content-Disposition: attachement; filename="'.$name.'_' . time() .'_'. $this->_ank_id . '.csv";'); + echo "\xEF\xBB\xBF"; // UTF-8 BOM + + foreach ($data as $row) { + fputcsv($fp, $row, ','); + } + + fclose($fp); + } + + public function exportCSVIdentifiers(){ + $data = $this->getDataIdentifiers(); + $this->exportCSVTable($data, 'maza_identifiers'); + } + + /*public function exportCSVInactiveIdentifiers(){ + $data = $this->getDataInactiveIdentifiers(); + $this->exportCSVTable($data, 'maza_inactive'); + } + + public function exportCSVActiveIdentifiers(){ + $data = $this->getDataActiveIdentifiers(); + $this->exportCSVTable($data, 'maza_active'); + }*/ + + public function exportCSVTrackingLocations(){ + $data = $this->getDataTrackingLocations(); + $this->exportCSVTable($data, 'maza_tracking_locations'); + } + + public function exportCSVTrackingAR(){ + $data = $this->getDataTrackingAR(); + $this->exportCSVTable($data, 'maza_tracking_ar'); + } + + public function exportCSVEntryLocations(){ + $data = $this->getDataEntryLocations(); + $this->exportCSVTable($data, 'maza_entry_locations'); + } + + public function exportCSVTriggeredGeofences(){ + $data = $this->getDataTriggeredGeofences(); + $this->exportCSVTable($data, 'maza_triggered_geofences'); + } + + public function exportCSVTriggeredGeofencesAnswered(){ + $data = $this->getDataTriggeredGeofencesAnswers(); + $this->exportCSVTable($data, 'maza_triggered_geofences_answers'); + } + + public function exportCSVGeofences(){ + $data = $this->getDataGeofences(); + $this->exportCSVTable($data, 'maza_geofences'); + } + + public function exportCSVAlarmRespondets(){ + $data = $this->getDataAlarmRespondents(); + $this->exportCSVTable($data, 'maza_alarm_respondets'); + } +} + +?> \ No newline at end of file diff --git a/admin/survey/modules/mod_MAZA/css/MAZA.css b/admin/survey/modules/mod_MAZA/css/MAZA.css new file mode 100644 index 0000000..8793fc2 --- /dev/null +++ b/admin/survey/modules/mod_MAZA/css/MAZA.css @@ -0,0 +1,109 @@ +/** +*Uroš PodkriĹľnik 12.10.2017 +* +*za modul MAZA - mobilna aplikacija za anketirance (projekt ARRS 2017) mobilno zbiranje podatkov +*/ +#MAZA{ + margin: 60px 35px; + min-height: 500px; + padding: 5px 1% 0 13px; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/*KOPIJA OD NOTIFICATIONS*/ +#MAZA .sent_list, +#MAZA .recieved_list{ + display: inline; + float: left; + + width: 470px; + min-height: 200px; + margin-right: 60px; +} +#MAZA .sent_list ul, +#MAZA .recieved_list ul{ + padding-left: 0; +} +#MAZA .sent_list ul li, +#MAZA .recieved_list ul li{ + list-style-type: none; + + margin: 5px 0; + padding: 5px 8px; + + background-color: #eff2f7; + border: 1px #eff2f7 solid; +} +#MAZA .sent_list ul li.unread, +#MAZA .recieved_list ul li.unread{ + background-color: #d8dfea; +} + +#MAZA .recieved_list ul li:hover, +#MAZA .recieved_list ul li.active{ + cursor: pointer; + + background-color: #d8dfea; + border: 1px #6d87ad solid; +} + +#MAZA #message{ + display: inline; + float: left; + + margin-top: 30px; + padding: 20px; + + width: 415px; + + background-color: #eff2f7; +} + +#MAZA .send_form{ + display: inline; + float: left; + + margin-top: 30px; + padding: 20px; + + width: 415px; + + background-color: #eff2f7; +} +#MAZA .send_form input[type="text"], +#MAZA .send_form textarea{ + width: 400px; + padding: 3px 5px; + + border: 1px solid #c6c6c6 !important; + color: #333 !important; +} \ No newline at end of file diff --git a/admin/survey/modules/mod_MAZA/info MAZA.txt b/admin/survey/modules/mod_MAZA/info MAZA.txt new file mode 100644 index 0000000..e43b360 --- /dev/null +++ b/admin/survey/modules/mod_MAZA/info MAZA.txt @@ -0,0 +1 @@ +Mobilna Aplikacija Za Anketirance \ No newline at end of file diff --git a/admin/survey/modules/mod_MAZA/js/MAZA.js b/admin/survey/modules/mod_MAZA/js/MAZA.js new file mode 100644 index 0000000..a229c26 --- /dev/null +++ b/admin/survey/modules/mod_MAZA/js/MAZA.js @@ -0,0 +1,731 @@ +/** + * modul MAZA - mobilna aplikacija za anketirance + * Uroš PodkriĹľnik 17.10.2017 + */ + +//default number of meters of radius for geofences +var maza_default_radius = 50; +//days relative to today to start date of repeater +var maza_start_day_repeater = -1; +//days relative to today to end date of repeater +var maza_end_day_repeater = 1; +//is geofencing on +var geofencing_on = false; + +function maza_on_off() { + $.post('ajax.php?t=MAZA&a=maza_on_off', {on_off: $('#advanced_module_maza').is(':checked'), anketa: srv_meta_anketa_id}); +} + +function doMAZAInactiveUsersExportCSV() { + $.post('ajax.php?t=MAZA&a=InactiveUsersExportCSV', {anketa: srv_meta_anketa_id}); +} + +function onAlarmsFormsLoad() { + var maza_submit_repeater = $('#maza_submit_repeater'); + var maza_submit_alarms = $('#maza_submit_alarms'); + //array of range from - to for input everywhichday in form of alarms or repeater + var maza_everywhichday_range = [2, 6]; + + //ALARM + $('input[name="maza_title"]').bind('input', function () { + maza_toggle_submit_alarms(); + }); + $('input[name="maza_message"]').bind('input', function () { + maza_toggle_submit_alarms(); + }); + $('input[name="maza_alarm_intervalby"]').bind('change', function () { + $('#maza_alarm_div_weekly').toggle(($(this).val() === 'weekly')); + $('#maza_alarm_div_daily').toggle(($(this).val() === 'daily')); + maza_toggle_submit_alarms(); + $.post('ajax.php?t=MAZA&a=changeRepeatBy', {anketa: srv_meta_anketa_id, maza_repeatby: $(this).val(), maza_table: "alarms"}); + }); + $('input[name="maza_alarm_timeinday[]"]').bind('change', function () { + var times = []; + $('input:checkbox[name="maza_alarm_timeinday[]"]:checked').each(function () { + times.push($(this).val()); + }); + maza_toggle_submit_alarms(); + $.post('ajax.php?t=MAZA&a=changeTimeInDay', {anketa: srv_meta_anketa_id, maza_time_in_day: times, maza_table: "alarms"}); + }); + $('input[name="maza_alarm_dayinweek[]"]').bind('change', function () { + var times = []; + $('input:checkbox[name="maza_alarm_dayinweek[]"]:checked').each(function () { + times.push($(this).val()); + }); + maza_toggle_submit_alarms(); + $.post('ajax.php?t=MAZA&a=changeDayInWeek', {anketa: srv_meta_anketa_id, maza_day_in_week: times, maza_table: "alarms"}); + }); + $('input[name="maza_alarm_everywhichday"]').bind('input', function () { + if ($(this).val() >= maza_everywhichday_range[0] && $(this).val() <= maza_everywhichday_range[1]) + $.post('ajax.php?t=MAZA&a=changeEveryWhichDay', {anketa: srv_meta_anketa_id, maza_every_which_day: $(this).val(), maza_table: "alarms"}); + maza_toggle_submit_alarms(); + }); + + //REPEATER + $('input[name="maza_repeater_intervalby"]').bind('change', function () { + $('#maza_repeater_div_weekly').toggle(($(this).val() === 'weekly')); + $('#maza_repeater_div_daily').toggle(($(this).val() === 'daily')); + //$.post('ajax.php?t=MAZA&a=changeRepeatBy', {anketa: srv_meta_anketa_id, maza_repeatby: $(this).val(), maza_table: "repeaters"}); + maza_toggle_submit_repeater(); + }); + $('input[name="maza_repeater_timeinday[]"]').bind('change', function () { + /*var times = []; + $('input:checkbox[name="maza_repeater_timeinday[]"]:checked').each(function () { + times.push($(this).val()); + }); + if(times) + $('#maza_repeater_div_everyday').css("border", "none");*/ + maza_toggle_submit_repeater(); + //$.post('ajax.php?t=MAZA&a=changeTimeInDay', {anketa: srv_meta_anketa_id, maza_time_in_day: times, maza_table: "repeaters"}); + }); + $('input[name="maza_repeater_dayinweek[]"]').bind('change', function () { + /*var times = []; + $('input:checkbox[name="maza_repeater_dayinweek[]"]:checked').each(function () { + times.push($(this).val()); + });*/ + /*if(times) + $('#maza_repeater_div_weekly').css("border", "none");*/ + maza_toggle_submit_repeater(); + //$.post('ajax.php?t=MAZA&a=changeDayInWeek', {anketa: srv_meta_anketa_id, maza_day_in_week: times, maza_table: "repeaters"}); + }); + $('input[name="maza_repeater_everywhichday"]').bind('input', function () { + /*if ($(this).val() > 1 && $(this).val() < 7){ + //$('#maza_repeater_div_everywhichday').css("border", "none"); + //$.post('ajax.php?t=MAZA&a=changeEveryWhichDay', {anketa: srv_meta_anketa_id, maza_every_which_day: $(this).val(), maza_table: "repeaters"}); + }*/ + maza_toggle_submit_repeater(); + }); + $('input[name="maza_repeater_date_start"]').bind('change', function () { + var pickedDateSplit = this.value.split("."); + var pickedDate = new Date(pickedDateSplit[2], pickedDateSplit[1]-1, pickedDateSplit[0]); + var pickedDateFormated = $.datepicker.formatDate('dd.mm.yy', pickedDate); + this.value = pickedDateFormated; + + var pickedDateTimestamp = pickedDate.getTime(); + var nowDate = new Date(); + var todayDateTimestamp = (new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())).getTime(); + + //if date is not valid, clear it + if(!pickedDateTimestamp || pickedDateTimestamp < todayDateTimestamp+(maza_start_day_repeater*86400000)){ + this.value = ""; + $("#maza_repeater_start_date_warning").hide(); + } + maza_toggle_submit_repeater(); + }); + $('input[name="maza_repeater_date_end"]').bind('change', function () { + var pickedDateSplit = this.value.split("."); + var pickedDate = new Date(pickedDateSplit[2], pickedDateSplit[1]-1, pickedDateSplit[0]); + var pickedDateFormated = $.datepicker.formatDate('dd.mm.yy', pickedDate); + this.value = pickedDateFormated; + + var pickedDateTimestamp = pickedDate.getTime(); + var nowDate = new Date(); + var todayDateTimestamp = (new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())).getTime(); + + //if date is not valid, clear it + if(!pickedDateTimestamp || pickedDateTimestamp < todayDateTimestamp+(maza_end_day_repeater*86400000)){ + this.value = ""; + } + maza_toggle_submit_repeater(); + }); + + /** + * Toggle submition button for alarms form + */ + function maza_toggle_submit_alarms() { + if (!$('input[name="maza_message"]').val().length > 0) + maza_submit_alarms.hide(); + else { + if ($('input:checkbox[name="maza_alarm_timeinday[]"]:checked').length === 0) + maza_submit_alarms.hide(); + else if ($('input[name="maza_alarm_intervalby"]:checked').val() === "everyday") + maza_submit_alarms.show(); + else if ($('input[name="maza_alarm_intervalby"]:checked').val() === "daily") { + var everywhichday = $('input[name="maza_alarm_everywhichday"]').val(); + if (everywhichday >= maza_everywhichday_range[0] && everywhichday <= maza_everywhichday_range[1]) + maza_submit_alarms.show(); + else + maza_submit_alarms.hide(); + } else if ($('input[name="maza_alarm_intervalby"]:checked').val() === "weekly") { + if ($('input:checkbox[name="maza_alarm_dayinweek[]"]:checked').length === 0) + maza_submit_alarms.hide(); + else + maza_submit_alarms.show(); + } + } + } + + /** + * Toggle submition button for repeater form + */ + /*function maza_check_submit_repeater() { + if($('#maza_repeater_date_start').val().length > 0){ + if ($('input:checkbox[name="maza_repeater_timeinday"]:checked').length === 0){ + $('#maza_repeater_div_everyday').css("border", "red solid 1px"); + return false; + } + else if ($('input[name="maza_repeater_intervalby"]:checked').val() === "everyday") + return true; + else if ($('input[name="maza_repeater_intervalby"]:checked').val() === "daily") { + var everywhichday = $('input[name="maza_repeater_everywhichday"]').val(); + if (everywhichday >= maza_everywhichday_range[0] && everywhichday <= maza_everywhichday_range[1]) + return true; + else{ + $('#maza_repeater_div_daily').css("border", "red solid 1px"); + return false; + } + } else if ($('input[name="maza_repeater_intervalby"]:checked').val() === "weekly") { + if ($('input:checkbox[name="maza_repeater_dayinweek"]:checked').length === 0){ + $('#maza_repeater_div_weekly').css("border", "red solid 1px"); + return false; + } + else + return true; + } + } + }*/ + + /** + * Toggle submition button for repeater form + */ + function maza_toggle_submit_repeater() { + var startVal = $('#maza_repeater_date_start').val(); + var endVal = $('#maza_repeater_date_end').val(); + var datesValid = true; + + if(startVal && endVal){ + var startDateSplit = startVal.split("."); + var startDate = new Date(startDateSplit[2], startDateSplit[1]-1, startDateSplit[0]); + var endDateSplit = endVal.split("."); + var endDate = new Date(endDateSplit[2], endDateSplit[1]-1, endDateSplit[0]); + datesValid = startVal < endVal; + } + + if(!startVal || (startVal && !datesValid)) + maza_submit_repeater.hide(); + else if ($('input:checkbox[name="maza_repeater_timeinday[]"]:checked').length === 0) + maza_submit_repeater.hide(); + else if ($('input[name="maza_repeater_intervalby"]:checked').val() === "everyday") + maza_submit_repeater.show(); + else if ($('input[name="maza_repeater_intervalby"]:checked').val() === "daily") { + var everywhichday = $('input[name="maza_repeater_everywhichday"]').val(); + if (everywhichday >= maza_everywhichday_range[0] && everywhichday <= maza_everywhichday_range[1]) + maza_submit_repeater.show(); + else + maza_submit_repeater.hide(); + } else if ($('input[name="maza_repeater_intervalby"]:checked').val() === "weekly") { + if ($('input:checkbox[name="maza_repeater_dayinweek[]"]:checked').length === 0) + maza_submit_repeater.hide(); + else + maza_submit_repeater.show(); + } + } + + maza_toggle_submit_alarms(); + maza_toggle_submit_repeater(); + mazaChooseDate(maza_start_day_repeater, $("#maza_repeater_date_start")); + mazaChooseDate(maza_end_day_repeater, $("#maza_repeater_date_end")); +} + +/** + * Sets datepicke on start of repeater input + * @param {type} maza_start_day_repeater - int of days to start calendar relative to today + * @param {type} element - element to set calendar on + * @returns {undefined} + */ +function mazaChooseDate(maza_start_day_repeater, element) { + element.datepicker({ + //selectOtherMonths: true, + //changeMonth: true, + minDate: maza_start_day_repeater, + dateFormat: "dd.mm.yy", + showAnim: "slideDown", + //showOn: "button", + //buttonImage: srv_site_url + "admin/survey/script/calendar/calendar.gif", + //buttonImageOnly: true, + onSelect: function (dateText, inst) { + element.trigger('change'); + return false; + } + }); +} + +/** + * When geofencing form is loaded + * @param {type} ank_id - ID of survey + * @param {type} geo_on - is geofencing on + * @returns {undefined} + */ +function onGeofencingFormsLoad(ank_id, geo_on){ + geofencing_on = geo_on; + //preveri, ce je google API ze includan (ce se je vedno icludal, je prislo do errorjev) + if((typeof google === 'object' && typeof google.maps === 'object')){ + mazaMaps(ank_id); + } + else{ + //main/app/contollers/js/Maps/Declaration.js + mapsAPIseNi (function(){mazaMaps(ank_id);}); + } + + //disable/enable notification setting based on checkbox + $('#maza_geofence_trigger_survey').bind('change', function () { + if(this.checked){ + $("#maza_title").prop('disabled', true); + $("#maza_message").prop('disabled', true); + } + else{ + $("#maza_title").prop('disabled', false); + $("#maza_message").prop('disabled', false); + } + }); +} + +/** + * Toggle AR interval on AR checkbox changed + * @param {type} checkbox - checkbox element + * @returns {undefined} + */ +function toggleARInterval(checkbox){ + if (checkbox.checked) + $('#maza_ar_interval_div').show(); + else + $('#maza_ar_interval_div').hide(); +} + +//nastavi mapo +function mazaMaps(ank_id){ + //mapType = tip zemljevida, ki bo prikazan. Recimo za satelitsko sliko google.maps.MapTypeId.SATELLITE (moĹľno še .ROADMAP) + var mapType = google.maps.MapTypeId.ROADMAP; + //centerInMap = string naslova, kaj bo zajel zemljevid. Rec. Slovenija / ali Ljubljana + //var centerInMap = ''; + + //pridobi parametre za centriranje mape in jo nastavi za kasnejso uporabo + /*var centerInMapKoordinate = ; + if(centerInMapKoordinate) + centerInMapKoordinate = JSON.parse(centerInMapKoordinate);*/ + + //Deklaracija potrebnih stvari za delovanje in upravljanje google maps JS API + var mapOptions = { + disableDoubleClickZoom: true, + mapTypeId: mapType + }; + + //ce je v bazi naslov enak vpisanemu v nastavitvah, nastavi po parametrih + /*if(centerInMapKoordinate.fokus === centerInMap || centerInMap === ''){ + mapOptions.center = {lat: parseFloat(centerInMapKoordinate.center.lat), + lng: parseFloat(centerInMapKoordinate.center.lng)}; + mapOptions.zoom = parseInt(centerInMapKoordinate.zoom); + } */ + //ce ni parametrov v bazi ali pa je nanovo kreirana spremenljivka, nastavi na Slovenijo + //else if(!centerInMapKoordinate && centerInMap === ''){ + mapOptions.center = {lat: 46.151241, lng: 14.995463}; + mapOptions.zoom = 7; + //} + + //deklaracija zemljevida + var mapdiv = document.getElementById("maza_map_geofencing"); + var map = new google.maps.Map(mapdiv, mapOptions); + //to se kasneje uporabi za pridobitev mape z id-em spremenljivke + mapdiv.gMap = map; + //deklaracija mej/okvira prikaza na zemljevidu + bounds['maza_map_geofencing'] = new google.maps.LatLngBounds(); + + //deklaracija geocoderja (API) + if(!geocoder) + geocoder = new google.maps.Geocoder(); + if(!infowindow) + infowindow = new google.maps.InfoWindow(); + + allMarkers['maza_map_geofencing'] = []; + + if(!geofencing_on){ + searchBox('maza_map_geofencing', function doAfterPlaceFromSearchBox(pos, address){ + //reset bounds, so we can focus only on this geofence + bounds['maza_map_geofencing'] = new google.maps.LatLngBounds(); + //save geofence + maza_saveGeofence(address, maza_create_basic_circle(pos, address, maza_default_radius, true)); + }); + + //set click event on map + maza_klikNaMapo(); + } + + //ni ok, ce se klice globalna spremenljivka srv_meta_anketa_id, ker se ne vedno pravi cas nastavi + $.post('ajax.php?t=MAZA&a=get_all_geofences', {anketa: ank_id}, + function (data) { + if(data.length > 0) + //id - id markerja v bazi + map_data_fill_vnaprej_geofences(JSON.parse(data)); + }); +} + +/** + * Create and fill existing geofences in map + * @param map_data JSON Object + */ +function map_data_fill_vnaprej_geofences(map_data) { + for (var row in map_data) { + var row_object = map_data[row]; + var pos = {lat: row_object.lat, lng: row_object.lng}; + + maza_createCircleVnaprej(row_object.address, maza_create_basic_circle(pos, row_object.address, row_object.radius, false), row_object.id, row_object.name); + } +} + + +/** + * Ustvari in vrne basic circle, na mapo spremenljivke z danimi koordinatami + * @param {type} pos - koordinate - objekt {lat: ???, lng: ???} + * @param {string} addressFromSearchBox - address if adding marker from searchBox, null otherwise + * (used for ignoring duplicates) + * @returns {google.maps.Circle} + */ +function maza_create_basic_circle(pos, address, radius, fromSearchBox) { + var circle = null; + + if(fromSearchBox === undefined) { + fromSearchBox = false; + } + + //pridobi mapo spremenljivke + var map = document.getElementById("maza_map_geofencing").gMap; + + if(fromSearchBox) + circle = address ? findMarkerFromAddress(address, "maza_map_geofencing") : null; + + if (!circle) { + //kreiraj marker + /*var marker = new google.maps.Marker({ + position: new google.maps.LatLng(pos.lat, pos.lng), + map: map, + identifier: getMarkerUniqueId(pos.lat, pos.lng, "maza_map_geofencing")//, + //icon: {url: "img_0/marker_text_off.png"} + });*/ + + // Add circle overlay and bind to marker + circle = new google.maps.Circle({ + center: new google.maps.LatLng(pos.lat, pos.lng), + map: map, + radius: parseFloat(radius), //in meters + editable: !geofencing_on, + fillColor: 'red' + }); + //circle.bindTo('center', marker, 'position'); + + //add marker in array + allMarkers["maza_map_geofencing"].push(circle); + + return circle; + } else { + //trigger click on marker, to focus it and open infowindow + //google.maps.event.trigger(circle, 'click'); + + //reset bounds + bounds['maza_map_geofencing'] = new google.maps.LatLngBounds(); + //add to bounds + bounds["maza_map_geofencing"].union(circle.getBounds()); + //zemljevid se prilagodi okviru + map.fitBounds(bounds["maza_map_geofencing"]); + return null + } +} + +/** + * funkcija, ki kreira osnovni geofence (rdec) + * @param {type} address - String - label o informacijah markerja + * @param {type} marker - google maps new created circle + * @returns {undefined} + */ +function maza_saveGeofence(address, circle) { + if (circle != null) { + //save new marker in DB + $.post('ajax.php?t=MAZA&a=insert_geofence', {address: address, + lat: circle.getCenter().lat(), lng: circle.getCenter().lng(), radius: maza_default_radius, anketa: srv_meta_anketa_id}, + function (id) { + //id - id markerja v bazi + maza_createCircleVnaprej(address, circle, id, null); + }); + } +} + +/** + * Set what to do when click event on map + * @returns {undefined} + */ +function maza_klikNaMapo() { + //pridobi mapo spremenljivke + var map = document.getElementById("maza_map_geofencing").gMap; + + // ko user klikne na mapo, funkcija vrne pozicijo (koordinate - position) ter kreira + google.maps.event.addListener(map, 'click', function (event) { + + //koordinate + var pos = { + lat: event.latLng.lat(), + lng: event.latLng.lng() + }; + + // naslov se pridobi, da se klice geocoding + GeocodingF(pos, function (data) { + //ce ne vrne null - je nasel naslov + if (data != null) { + //reset bounds, to set focus only on this geofence + bounds['maza_map_geofencing'] = new google.maps.LatLngBounds(); + + //kreira marker na lokaciji, kjer je uporabnik kliknil + maza_saveGeofence(data.formatted_address, maza_create_basic_circle(pos, data.formatted_address, maza_default_radius, false)); + } else { + //odpre se okno, ce je prislo do napake - null - (mozen je tudi prekratek delay med geocoding requesti) + alert(lang['srv_resevanje_alert_location_not_found_map']); + } + }); + + + return pos; + }); +} + +/** + * funkcija, ki kreira osnovni circle (rdec) + * @param {type} address - String - label o informacijah markerja + * @param {type} circle - google maps new created circle + * @param {type} id - id vrednosti markerja iz tabele geofence + * @param {type} name - interno ime geofenca + * @returns {undefined} + */ +function maza_createCircleVnaprej(address, circle, id, name) { + if (circle != null) { + //pridobi mapo spremenljivke + var map = document.getElementById("maza_map_geofencing").gMap; + + circle.address = address; + circle.id = id; + if(name) + circle.name = name; + circle.infowin = makeGeofenceInfoWindow(circle); + setListenersGeofence(circle, map); + + //markers[markerId] = marker; // cache marker in markers object + //dont set listeners if survey is locked + //bindMarkerEventsVM("maza_map_geofencing", marker, map); // bind right click event to marker + //maza_setDeleteMenu(circle, map, "maza_map_geofencing"); + + //Create a div element for container. + /*var container = document.createElement("div"); + //margin, da se pri italic ne odreze zadja crka + container.style.cssText = 'margin-right:1px'; + + //Create a label element for address. + var address = document.createElement("label"); + address.innerHTML = '' + address + ''; + address.style.cssText = 'font-size:0.85em;'; + container.appendChild(address);*/ + + //listener ob kliku na marker + /*google.maps.event.addListener(marker, 'click', function () { + //if infowindow in opened, blur focus, so saving in DB can be triggered + blurTitleInfowindow(false); + infowindow.setContent(container); + infowindow.open(map, marker); + });*/ + + google.maps.event.addListener(circle,'radius_changed',function(){ + //console.log('radius_changed '+circle.getRadius()); + $.post('ajax.php?t=MAZA&a=update_geofence', {id: circle.id, radius: circle.getRadius(), anketa: srv_meta_anketa_id}); + circle.radius = circle.getRadius(); + circle.infowin = makeGeofenceInfoWindow(circle); + infowindow.close(); + }); + google.maps.event.addListener(circle,'center_changed',function(){ + //console.log('center_changed '+circle.getCenter()); + //koordinate + var pos = { + lat: circle.getCenter().lat(), + lng: circle.getCenter().lng() + }; + + // naslov se pridobi, da se klice geocoding + GeocodingF(pos, function (data) { + //ce ne vrne null - je nasel naslov + if (data != null) { + //save changes in DB + $.post('ajax.php?t=MAZA&a=update_geofence', {id: circle.id, lat: circle.getCenter().lat(), lng: circle.getCenter().lng(), address: data.formatted_address, anketa: srv_meta_anketa_id}); + circle.address = data.formatted_address; + } else { + //did not found address, save empty string + $.post('ajax.php?t=MAZA&a=update_geofence', {id: circle.id, lat: circle.getCenter().lat(), lng: circle.getCenter().lng(), address: '', anketa: srv_meta_anketa_id}); + circle.address = 'Unknown address'; + } + circle.infowin = makeGeofenceInfoWindow(circle); + infowindow.close(); + }); + + }); + + //add to bounds + bounds["maza_map_geofencing"].union(circle.getBounds()); + + //zemljevid se prilagodi okviru + map.fitBounds(bounds["maza_map_geofencing"]); + } +} + +/** + * Creates and returns a html container for infowindow + * @param {type} shape - googles shape - polyline or polygon + * @returns {makeShapeInfoWindow.container|Element} + */ +function makeGeofenceInfoWindow(shape) { + //Create a div element for container. + var container = document.createElement("div"); + //margin, da se pri italic ne odreze zadja crka + container.style.cssText = 'margin-right:1px'; + + //Create a textarea for the input text + var textBoxTitle = document.createElement("input"); + textBoxTitle.style.cssText = "font-weight:bold; font-size:1em !important; display: block; float: left;"; + textBoxTitle.type = "text"; + textBoxTitle.placeholder = lang['srv_maza_geofence_infowin_name']; + if(shape.name) + textBoxTitle.value = shape.name; + textBoxTitle.className = "input_title"; + textBoxTitle.maxLength = "20"; + textBoxTitle.id = "map_input_overlay_id_" + shape.id; + if(geofencing_on) + textBoxTitle.disabled=true; + container.appendChild(textBoxTitle); + //ko se spremeni textarea v windowinfo, spremeni value inputa za text + google.maps.event.addDomListener(textBoxTitle, "change", function () { + //save title of marker in DB + $.post('ajax.php?t=MAZA&a=update_geofence_name', {id: shape.id, name: textBoxTitle.value, + anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id}); + }); + + if(!geofencing_on){ + var deleteImg = document.createElement("span"); + deleteImg.className = "faicon delete icon-grey_dark_link"; + deleteImg.title = lang['srv_vprasanje_delete_line_map']; + deleteImg.style.cssText = "height:1.65em; display: block; float: right; margin-left:7px; cursor: pointer;"; + container.appendChild(deleteImg); + + //ko se spremeni textarea v windowinfo, spremeni value inputa za text + google.maps.event.addDomListener(deleteImg, "click", function () { + if (confirm(lang['srv_maza_geofence_delete_confirm_map'])) + maza_delete_geofence(shape); + }); + } + + container.appendChild(document.createElement("br")); + + //Create a label element for address. + var address = document.createElement("label"); + address.innerHTML = '' + shape.address + ''; + address.style.cssText = 'font-size:0.85em; cursor: default;'; + container.appendChild(address); + container.appendChild(document.createElement("br")); + + //Create a label element for radius. + var radius = document.createElement("label"); + radius.innerHTML = lang['srv_maza_geofence_infowin_radius'] + Math.round(shape.radius) + lang['srv_maza_geofence_infowin_radius_unit']; + radius.style.cssText = 'font-size:0.85em;cursor: default;'; + container.appendChild(radius); + container.appendChild(document.createElement("br")); + + //ko se spremeni textarea v windowinfo, spremeni value inputa za text + /*google.maps.event.addDomListener(textBoxTitle, "change", function () { + //save title of SHAPE in DB + var lineData = {anketa: srv_meta_anketa_id, spr_id: spremenljivka, + overlay_id: shape.overlay_id, address: textBoxTitle.value}; + $.post('ajax.php?t=branching&a=edit_naslov_polyline', lineData); + });*/ + + return container; +} + +/** + * Set Liteners when editing a shape + * @param {type} spremenljivka - id spremenljivke + * @param {type} shape - googles shape to set listeners on + * @param {type} map - google map + * @param locked boolean true, if survey is locked in branching + * @returns {undefined} + */ +function setListenersGeofence(shape, map) { + //listener ob kliku na marker + google.maps.event.addListener(shape, 'click', function (ev) { + //changeFocusLine(this); + + //open infowindow + infowindow.setContent(this.infowin); + infowindow.setPosition(ev.latLng); + infowindow.open(map); + + $("#map_input_overlay_id_" + shape.id).focus(); + }); +} + +/** + * Sets rightclick and dblclick listeners to open delete menu + * @param {type} shape - shape to set listeners on + * @param {type} map - map on which to hover menu (shape's map) + * @param {type} spremenljivka - id of variable + * @returns {undefined} + */ +function maza_delete_geofence(circle) { + $.post('ajax.php?t=MAZA&a=delete_geofence', {id: circle.id, anketa: srv_meta_anketa_id}, + function (data){ + if(data = 'OK') + circle.setMap(null); + infowindow.close(); + }); +} + +/** + * Sets rightclick and dblclick listeners to open delete menu + * @param {type} shape - shape to set listeners on + * @param {type} map - map on which to hover menu (shape's map) + * @param {type} spremenljivka - id of variable + * @returns {undefined} + */ +function maza_setDeleteMenu(shape, map, spremenljivka) { + google.maps.event.addListener(shape, 'rightclick', function (e) { + deleteMenu.open_shape(map, shape, e.latLng, spremenljivka); + }); + google.maps.event.addListener(shape, 'dblclick', function (e) { + deleteMenu.open_shape(map, shape, e.latLng, spremenljivka); + }); +} + +/** + * Onclick function when saving repeater + * @returns {undefined} + */ +function maza_repeater_submit_button_click(){ + var inputVal = $("#maza_repeater_date_start").val(); + var pickedDateSplit = inputVal.split("."); + var pickedDate = new Date(pickedDateSplit[2], pickedDateSplit[1]-1, pickedDateSplit[0]); + + var pickedDateTimestamp = pickedDate.getTime(); + var nowDate = new Date(); + var todayDateTimestamp = (new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate())).getTime(); + + //date is in starting range, show warning + if(pickedDateTimestamp <= todayDateTimestamp){ + var result = confirm(lang['srv_maza_repeater_edit_warning_alert']); + if(result) + $('#maza_save_repeater_form').submit(); + } + //date is in the future, all ok, save it + else + $('#maza_save_repeater_form').submit(); +} + +/** + * Onclick function when finishing repeater + * @returns {undefined} + */ +function maza_repeater_cancel_click(){ + var result = confirm(lang['srv_maza_repeater_finish_warning_alert']); + if(result) + $('#maza_cancel_repeater_form').submit(); +} diff --git a/admin/survey/modules/mod_SPEEDINDEX/R/speeder_index.R b/admin/survey/modules/mod_SPEEDINDEX/R/speeder_index.R new file mode 100644 index 0000000..f41ef2f --- /dev/null +++ b/admin/survey/modules/mod_SPEEDINDEX/R/speeder_index.R @@ -0,0 +1,98 @@ +params <- commandArgs(trailingOnly = TRUE) +ID <- params[1] + +library(foreign) # Import csv or sav data + +######################### +# SPEEDER INDEX FUNKCIJA +######################### +# funkcija je napisana s for zankami, da je lazje razumljivo, sicer pa je to počansejši način, zato ce bos popravljal +# raje uporabi apply ali by ali kaj podobnega +speeder <- function(data){ + # izracuna mediane po stolpcih + medians <- apply(X = data, 2, median, na.rm=T) + # naredi novo matriko enakih dimenizij, kot je orig. podatkovna matrika + news <- matrix(NA, nrow = dim(data)[1], ncol = dim(data)[2]) + + # gre cez vse enote + for (i in 1:dim(data)[1]){ + for (j in 1:dim(data)[2]){ + # ce je manjkajoca vrednost ne naredi nic + if (is.na(data[i,j]) == T) {news[i,j] <- NA} + if (is.na(data[i,j]) == F){ + # ce je vrednost pri enoti vecja ali enaka od mediane potem ji pripise 1 + if (data[i,j] >= medians[j]){news[i,j] <- 1} + # ce je vrednost pri enoti manjsa, ji pripise vrednost pri enoti deljeno z vrednostjo mediane odgovarajaoce spr. + if (data[i,j] < medians[j]){news[i,j] <- (data[i,j]/medians[j])} + } + } + } + + # izracuna povprecja (tocka 3 v algoritmu) + povprecja <- rowMeans(news, na.rm=T) + # ce je pod 10 procentov vseh, potem je speeder + speed_no_speed <- as.numeric(povprecja < quantile(povprecja, 0.1)) + speed_no_speed[speed_no_speed == 1] <- "1" + speed_no_speed[speed_no_speed == 0] <- "0" + return(speed_no_speed) +} +## //SPEEDER INDEX FUNKCIJA// ## + + + +# Preberemo vhodne podatke +datumi <- read.csv2(paste0("modules/mod_SPEEDINDEX/temp/datum", ID, ".csv"), sep=";", header = T, fill = T, stringsAsFactors = FALSE) +#if (datumi[1,1]=="Ustreznost") {datumi <- datumi[2:nrow(datumi),]} +datumi <- subset(datumi, Status==6) + +## SELECT APROPRIATE DATA ## +# Iz baze izberemo le stolpce, ki nas zanimajo: Vse stolpce, ki v imenu vsebujejo Datum (ker računamo čase na strani) ter Id = RECNUM +test <- datumi[ ,grepl("Datum|Id" , names( datumi ) ) ] + +# Izberemo le stolpce, ki vsebujejo več kot 10 znakov zato, ker so bile nekje v stolpcih vrednosti 0 ali 1 +#test <- test[apply(test, MARGIN = 1, function(x) all(nchar(x) > 10)), ] + +# Zapišemo RECNUm oz. ID +test_id <- test[1] + + +# Počistimo še DATUM in izberemo le URO +test <- apply(test[2:ncol(test)], 2, function(y) gsub(".* ", "", y)) +test <- test[ , ! apply( test , 2 , function(x) all(is.na(x)) ) ] +# Če so na straneh prazne vrednosti, prepišemo vrednosti iz prejšnjega stolpca +#test <- ifelse(test=="", test[,-1], test) +## //SELECT APROPRIATE DATA// ## + + + +# čas v sekundah, ki ga je anketiranec preživel na x strani (ki se izračuna kot razlika med stolpcem date_x in date_x+1) +makeTime <- function(x) as.POSIXct(paste(Sys.Date(), x)) +dat <- apply(test, 2, makeTime) +data <- mapply(x = 2:ncol(dat), + y = 1:(ncol(dat) -1), + function(x, y) dat[ , x] - dat[ , y]) + + + + +# data <- read.spss("speederindex.sav", to.data.frame = T) +data <- as.matrix(data) +# Poženemo funkcijo speeder index na podatkih +#speeder(data) +speederindex <- speeder(data) +# Indeksu dodamo čase respondentov po straneh +speederindex <- cbind(speederindex, data) + +df <- speederindex + +colnames(df)[1] <- "Index hitrosti" + +for(i in 2:ncol(df)){ + colnames(df)[i] <- paste0("Stran ", i-1) +} + +df <- cbind(test_id,df) + +# Zapišemo rezultat v csv +write.csv2(df, paste0("modules/mod_SPEEDINDEX/results/speederindex", ID, ".csv"),row.names=F) +#write.csv2(speederindex, file ="modules/mod_SPEEDINDEX/results/speederindex.csv",row.names=T) diff --git a/admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php b/admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php new file mode 100644 index 0000000..87a1e8b --- /dev/null +++ b/admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php @@ -0,0 +1,204 @@ +ul evealvacija + if ((int)$anketa > 0){ + $this->anketa = $anketa; + + # polovimo vrsto tabel (aktivne / neaktivne) + SurveyInfo :: getInstance()->SurveyInit($this->anketa); + if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) { + $this->db_table = '_active'; + } + } + } + + + // PrikaĹľemo stran + public function displaySpeedIndex(){ + global $lang; + + // Izvedemo pripravo datoteke + $this->executeExport(); + + // Izrisemo tabelo + $this->displaySpeedIndexTable(); + } + + // Prikazemo tabelo + private function displaySpeedIndexTable(){ + global $site_path; + global $lang; + + $result_folder = $site_path . RESULTS_FOLDER.'/'; + + echo '
'; + + echo ''.$lang['srv_speeder_index_text'].''; + + // Legenda + echo '
'; + echo ''.$lang['srv_speeder_index_legend_0'].''; + echo ''.$lang['srv_speeder_index_legend_1'].''; + echo '
'; + + echo ''; + + if (($handle = fopen($result_folder."speederindex".$this->anketa.".csv", "r")) !== FALSE) { + // Loop po vrsticah + $cnt=0; + while (($row = fgetcsv($handle, 1000, ';')) !== FALSE) { + + $status = ($row[1] == 1 ? 'speeder' : 'no_speeder'); + + echo ''; + + // Prva vrstica + if($cnt == 0){ + foreach($row as $val){ + echo ''; + } + } + // Vrstice s podatki + else{ + foreach($row as $val){ + echo ''; + } + } + + echo ''; + + $cnt++; + } + fclose($handle); + } + + echo '
'; + + // Prevedemo kar na roko:) + if($lang['id'] == '2'){ + if($val == 'Index hitrosti') + echo $lang['srv_speeder_index']; + else + echo str_replace("Stran", $lang['page'], $val); + } + else + echo $val; + + echo ''; + echo $val; + echo '
'; + } + + + // Zgeneriramo pdf analizo + public function executeExport(){ + global $site_path; + global $lang; + global $admin_type; + + // Zgeneriramo zacasne csv datoteke + $this->prepareCSV(); + + // Poklicemo R skripto in zgeneriramo pdf + $script = $site_path . SCRIPT_FOLDER . '/speeder_index.R'; + $out = exec('Rscript '.$script.' '.$this->anketa.' 2>&1', $output, $return_var); + + // Testiranje - izpis errorjev + /*if($admin_type == 0){ + echo '
'; + echo 'Rscript '.$script; + //echo '
'.$out.'
'; + var_dump($output); + echo '
'; + }*/ + + // Na koncu pobrisemo zacasne datoteke + $this->deleteTemp(); + } + + // Pripravi csv s podatki o casih po straneh + public function prepareCSV(){ + global $site_path; + global $lang; + global $admin_type; + + $temp_folder = $site_path . TEMP_FOLDER.'/'; + + $file_handler = fopen($temp_folder.'datum'.$this->anketa.'.csv',"w"); + + + // Prva vrstica + $line_header = 'Id;Status;Lurker;Datum_0;'; + + $grupe = array(); + $sql = sisplet_query("SELECT * FROM srv_grupa WHERE ank_id='".$this->anketa."' ORDER BY vrstni_red ASC"); + while ($row = mysqli_fetch_array($sql)) { + $line_header .= 'Datum_'.$row['vrstni_red'].';'; + + $grupe[$row['id']] = $row['vrstni_red']; + } + + fwrite($file_handler, substr($line_header, 0, -1)."\r\n"); + + + // Vrstice s podatki + $sql = sisplet_query("SELECT id, recnum, last_status, lurker, time_insert FROM srv_user u + WHERE ank_id='".$this->anketa."' AND preview='0' AND deleted='0' + ORDER BY recnum ASC"); + while ($row = mysqli_fetch_array($sql)) { + + $line = $row['recnum'].';'; + $line .= $row['last_status'].';'; + $line .= $row['lurker'].';'; + $line .= $row['time_insert'].';'; + + // Napolnimo case respondenta + $user_grupe = array(); + $sqlG = sisplet_query("SELECT gru_id, time_edit FROM srv_user_grupa".$this->db_table." + WHERE usr_id='".$row['id']."'"); + while ($rowG = mysqli_fetch_array($sqlG)) { + $user_grupe[$rowG['gru_id']] = $rowG['time_edit']; + } + + // Sprehodimo se po vseh straneh in zapisemo case v vrstico + foreach($grupe as $gru_id => $vrstni_red){ + + if(isset($user_grupe[$gru_id])) + $line .= $user_grupe[$gru_id].';'; + else + $line .= ';'; + } + + fwrite($file_handler, substr($line, 0, -1)."\r\n"); + } + + + fclose($file_handler); + } + + // Pobrisemo zacasne datoteke + private function deleteTemp(){ + global $site_path; + + $temp_folder = $site_path . TEMP_FOLDER.'/'; + + // Pobrisemo zacasno CSV datoteko s podatki + if (file_exists($temp_folder.'/datum'.$this->anketa.'.csv')) { + unlink($temp_folder.'/datum'.$this->anketa.'.csv'); + } + } + +} \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/class.WPN.php b/admin/survey/modules/mod_WPN/class.WPN.php new file mode 100644 index 0000000..baabfef --- /dev/null +++ b/admin/survey/modules/mod_WPN/class.WPN.php @@ -0,0 +1,184 @@ +_ank_id = $ank_id; + //get survey title and link + if($ank_id > 0){ + SurveyInfo::getInstance()->SurveyInit($ank_id); + $this->_ank_title = SurveyInfo::getSurveyColumn('naslov'); + $this->_ank_link = SurveyInfo::getSurveyLink(); + } + } + + public function display() { + global $admin_type, $global_user_id, $lang; + + // Izpis vseh poslanih sporocil + if ($admin_type == 0) { + //is survey activated + $act = sisplet_query("SELECT active FROM srv_anketa WHERE id='" . $this->_ank_id . "'", 'obj'); + if($act->active != 1) + echo '

'.$lang['srv_anketa_noactive2'].'

'; + + $this->sendMessageForm(); + + if(isset($_GET['FCM_response'])) + echo '

'.$_GET['FCM_response']; + } + } + + // Obrazec za posiljanje notificationa + private function sendMessageForm() { + global $admin_type, $global_user_id, $lang; + + //FORM FOR WEB PUSH NOTIFICATIONs + echo '

'; + echo ''.$lang["srv_wpn"].''; + echo '
'; + /* echo ''.$lang['srv_notifications_send_reciever'].': '; + + // Checkboxa za posiljenje vsem uporabnikoom (slo in ang) + echo '
'; + echo '

'; + */ + + echo ''; + echo '' . $lang['srv_notifications_send_title'] . ':

'; + echo '' . $lang['srv_notifications_send_text'] . ':

'; + + //echo '

'; + + //echo '

'; + + echo ''; + + echo '

' . $_POST['maza_result'] . '

'; + + echo '
'; + echo '
'; + } + + //PWA + public function ajax_wpn_save_subscription(){ + //whole link for endpoint - browser request link and endpoint key of user + $endpoint = $_POST['endpoint']; + //last slash index + $lsi = strrpos($endpoint, '/'); + //endpoint key + $endpoint_key = substr($endpoint, $lsi + 1); + //endpoint link + $endpoint_link = substr($endpoint, 0, $lsi + 1); + + sisplet_query("INSERT INTO browser_notifications_respondents (timestamp_joined, endpoint_link, endpoint_key, public_key, auth) " + . "VALUES (NOW(), '".$endpoint_link."', '".$endpoint_key."', '".$_POST['keys']['p256dh']."', '".$_POST['keys']['auth']."')"); + + echo 'Subscription added'; + } + + public function sendWebPushNotificationsToAll(){ + //global $FCM_server_key; + + $title = $_POST['wpn_title']; + $message = $_POST['wpn_message']; + + $payload = array('title'=>$title, 'message'=>$message, 'link'=>$this->_ank_link); + + /*$notifications = [ // this is the structure for the working draft from october 2018 (https://www.w3.org/TR/2018/WD-push-api-20181026/) + [ + 'subscription' => Subscription::create([ + "endpoint" => "https://updates.push.services.mozilla.com/wpush/v1/gAAAAABdoHSjAgtlSI2QNu_D6p3WDWITErDHYLWfbf37pgJd1HYnIukVaHfAxAOi4gxzPq1c8baWSMk9O6YkSOrbn7brlWaLpcNnKba1xgia13ESTwKNaevwY9_ciy3ojB4IXprryHTb", + "keys" => [ + 'p256dh' => "BIvluRM0T5ezCbH_IwEhsDr8D-kXq4sRfgmaG4OKOGbqrE6CWwcrvY5S7YpqfMgn_ZqOHlLaZX11skBWar3Xj3w", + 'auth' => "Tqco8e4PIAZL9zogxks3qQ" + ] + ]) + ], + [ + 'subscription' => Subscription::create([ + "endpoint" => "https://fcm.googleapis.com/fcm/send/cDZBBiO8nwA:APA91bG6pQJNapbmiT0zMED_HEiQNi2OxgmAJbjqWnny1H78FXFRzJXtcBi62xwdZHOr9GWrBsbE5ePPK58m9H9ZKhy0Q8TFKCu-Os-ykAN2IJL4lPVcUyslBMt8sCABlomHUHl8AQLR", + "keys" => [ + 'p256dh' => "BPyTEM7mLZAFQm-8bSsVmAJRDMeCTjwSmOCJXieK-xtwcRsKE9zLHZRpfp52ChQzrDZLi_n0RdBiX5yydC7DL90", + 'auth' => "iSKAhIqNvjlaOhXzk4ulJw" + ] + ]) + ], + [ + 'subscription' => Subscription::create([ + "endpoint" => "https://updates.push.services.mozilla.com/wpush/v2/gAAAAABdpZDL1nFRXedBJYYfTwdcqfrf2khsEXllMLEWPBIolO1t1wkptE7HzkypkPDEVwYq0ju1kNblwJHxA9v0k05oVNCuxBi0l0dDqsrZZ_TRao_hDprjzoSuuHE5z4zrTzbTwwxKqmxDYvF_1Ty28qaUaaLqFJGgOTgSjN9W3bkifRqDZnQ", + "keys" => [ + 'p256dh' => "BESWycM2xqcaFcvG1kYWGpnamq6IZd8mhGtSQpUsROBn0ejJmwI_vptgpW4jBwbQrcb-T8sXvmRRZ4HY9VLWJes", + 'auth' => "WnRV6LQEYcvwb21DnpXzkA" + ] + ]) + ], + [ + 'subscription' => Subscription::create([ + "endpoint" => "https://fcm.googleapis.com/fcm/send/cyGorE1fYnM:APA91bHq1if5UrRr1uI8HLD92M2OCekH1kH6q7HmrINkMFHmLq_RtuytWb9DKo2446WgvDRbzUjQXwQ88_b70NzOUBBFWhxaslJuQFyJZPHIkxRf--MIHTY-KSQ1JcPQYcED1QreaEZf", + "keys" => [ + 'p256dh' => "BPTZTRDEztn_YpAvdv4wjtCyNqo0RNFfWbjm9r7bgyZh2RBZgDvitaW_68hNC6cYGzKGJM9aMpGi59-_H8HYSn8", + 'auth' => "M79ZKrfJwEzPfHIpkN-tIw" + ] + ]) + ] + ];*/ + + //get all subscriptions and put them in array + $subscriptions = sisplet_query("SELECT endpoint_link, endpoint_key, public_key, auth FROM browser_notifications_respondents", 'array'); + $notifications = array(); + foreach ($subscriptions as $subsc){ + $subscription = array("endpoint"=>$subsc['endpoint_link'].$subsc['endpoint_key'], "keys"=>array('p256dh' => $subsc['public_key'],'auth' => $subsc['auth'])); + array_push($notifications, array('subscription' => Subscription::create($subscription))); + } + + $auth = array( + 'VAPID' => array( + 'subject' => 'mailto:enklikanketa@gmail.com', + 'publicKey' => 'BNVIBdCsC6vkmByQJ861pusHN1mV76X3mvAa1u4PxmleTv2m2whcEu9Elhh8Qz3XnqV6k58YCSVqaafl3bhPKLU', + 'privateKey' => 'c7mxuK7Nexe4NHnCtYE79p0iHzaXZGikWpua7z66dQg', + ), + ); + $webPush = new WebPush($auth); + // send multiple notifications with payload + foreach ($notifications as $notification) { + $webPush->sendNotification( + $notification['subscription'], + json_encode($payload) + ); + } + + // handle eventual errors here, and remove the subscription from your server if it is expired + foreach ($webPush->flush() as $report) { + $endpoint = $report->getRequest()->getUri()->__toString(); + if ($report->isSuccess()) { + echo "
[v] Message sent successfully for subscription {$endpoint}."; + } else { + echo "
[x] Message failed to sent for subscription {$endpoint}: {$report->getReason()}"; + } + } + } + +} +?> \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/_DS_Store b/admin/survey/modules/mod_WPN/frontend/_DS_Store new file mode 100644 index 0000000..404f156 Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/_DS_Store differ diff --git a/admin/survey/modules/mod_WPN/frontend/android-chrome-192x192.png b/admin/survey/modules/mod_WPN/frontend/android-chrome-192x192.png new file mode 100644 index 0000000..76f01ba Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/android-chrome-192x192.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/android-chrome-512x512.png b/admin/survey/modules/mod_WPN/frontend/android-chrome-512x512.png new file mode 100644 index 0000000..8e10c1b Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/android-chrome-512x512.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/apple-splash-1125.png b/admin/survey/modules/mod_WPN/frontend/apple-splash-1125.png new file mode 100644 index 0000000..0aaf720 Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/apple-splash-1125.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/apple-splash-1242.png b/admin/survey/modules/mod_WPN/frontend/apple-splash-1242.png new file mode 100644 index 0000000..dbd4770 Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/apple-splash-1242.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/apple-splash-1536.png b/admin/survey/modules/mod_WPN/frontend/apple-splash-1536.png new file mode 100644 index 0000000..86c5313 Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/apple-splash-1536.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/apple-splash-1668.png b/admin/survey/modules/mod_WPN/frontend/apple-splash-1668.png new file mode 100644 index 0000000..3c88be3 Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/apple-splash-1668.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/apple-splash-2048.png b/admin/survey/modules/mod_WPN/frontend/apple-splash-2048.png new file mode 100644 index 0000000..c61ef82 Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/apple-splash-2048.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/apple-splash-640.png b/admin/survey/modules/mod_WPN/frontend/apple-splash-640.png new file mode 100644 index 0000000..02fdc6f Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/apple-splash-640.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/apple-splash-750.png b/admin/survey/modules/mod_WPN/frontend/apple-splash-750.png new file mode 100644 index 0000000..36ec024 Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/apple-splash-750.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/apple-touch-icon.png b/admin/survey/modules/mod_WPN/frontend/apple-touch-icon.png new file mode 100644 index 0000000..6fce72f Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/apple-touch-icon.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/browserconfig.xml b/admin/survey/modules/mod_WPN/frontend/browserconfig.xml new file mode 100644 index 0000000..3b0a805 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #da532c + + + diff --git a/admin/survey/modules/mod_WPN/frontend/css/main.css b/admin/survey/modules/mod_WPN/frontend/css/main.css new file mode 100644 index 0000000..5a9be8b --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/css/main.css @@ -0,0 +1,509 @@ +/*! HTML5 Boilerplate v5.0 | MIT License | http://h5bp.com/ */ + +html { + color: #222; + font-size: 1em; + line-height: 1.4; +} + +::-moz-selection { + background: #b3d4fc; + text-shadow: none; +} + +::selection { + background: #b3d4fc; + text-shadow: none; +} + +hr { + display: block; + height: 1px; + border: 0; + border-top: 1px solid #ccc; + margin: 1em 0; + padding: 0; +} + +audio, +canvas, +iframe, +img, +svg, +video { + vertical-align: middle; +} + +fieldset { + border: 0; + margin: 0; + padding: 0; +} + +textarea { + resize: vertical; +} + +.browserupgrade { + margin: 0.2em 0; + background: #ccc; + color: #000; + padding: 0.2em 0; +} + + +/* ===== Initializr Styles ================================================== + Author: Jonathan Verrecchia - verekia.com/initializr/responsive-template + ========================================================================== */ + +body { + font: 16px/26px Helvetica, Helvetica Neue, Arial; +} + +.wrapper { + width: 90%; + margin: 0 5%; +} + +/* =================== + ALL: Blue Theme + =================== */ + +.header-container { + border-bottom: 20px solid #264de4; + position: fixed; + width: 100%; + top: 0px; +} + +.footer-container, +.main aside { + border-top: 20px solid #264de4; +} + +.header-container, +.footer-container, +.main aside { + background: #2965f1; +} + +.title { + color: white; +} + +/* ============== + MOBILE: Menu + ============== */ + +nav ul { + margin: 0; + padding: 0; + list-style-type: none; +} + +nav a { + display: block; + margin-bottom: 10px; + padding: 15px 0; + + text-align: center; + text-decoration: none; + font-weight: bold; + + color: white; + background: #264de4; +} + +nav{ + display: none; +} + +nav a:hover, +nav a:visited { + color: white; +} + +nav a:hover { + text-decoration: underline; +} + +/* ============== + MOBILE: Main + ============== */ + +.main { + padding: 30px 0; +} + +.main article h1 { + font-size: 2em; +} + +.main aside { + color: white; + padding: 0px 5% 10px; +} + +.footer-container footer { + color: white; + padding: 20px 0; +} + +/* =============== + ALL: IE Fixes + =============== */ + +.ie7 .title { + padding-top: 20px; +} + +/* ========================================================================== + Author's custom styles + ========================================================================== */ + +.subtitle{ + font-size: 1.1em; + font-style: italic; + font-weight: bolder; +} + +.responsiveImg { + margin: auto; + max-width: 128px; + border-radius: 50%; + padding: 0px 20px 10px 10px; +} + +.main header, .main section, .main footer{ + padding: 10px; + margin-bottom: 20px; +} + +.main header h1, .main section h2, .facultyContainer h4{ + background: #2965f1; + color: white; + padding: 10px; + border-top: 20px solid #264de4; +} + +.facultyContainer{ + padding: 5px; + +} +.facultyImage{ + float: left; + width: 30%; + height: 30%; + min-width: 180px; + margin: auto; + text-align: center; +} + +aside a{ + color: white; + text-decoration: none; +} + +.footerLinks{ + float: right; + text-align: right; +} + +.footerLinks a{ + color: white; + text-decoration: none; +} + +#trigger{ + float: right; + line-height: 10px; + padding: 5px; + height: 32px; + width: 32px; + position: fixed; + margin: 5px 10px 0px 15px; + cursor: pointer; + cursor: hand; + background-color: #264de4; + border-radius: 21px; + vertical-align: text-top; + right: 10px; + top: 10px; +} +.triggerLine{ + display: block; + width: calc(100% - 9px); + text-align: center; + height: 2px; + background-color: white; + margin: 6px auto; + border-radius: 2px; +} +.main-container{ + margin-top: 40px; +} + +#addToHomeScreen{ + display: block; + margin-top: 20px; + padding: 0px; + display: none; +} + +#addToHomeScreen img{ + max-width: 57px; + margin: 10px; + float: left; +} + +#addToHomeScreen button{ + background-color: #264de4; + color: white; + border: 1px #2965f1 solid; + margin: 5px 10px; +} + +#instructions{ + text-align: center; + background-color: #f2f4f4; + position: fixed; + bottom: 0px; + right: 20px; + left: 20px; + width: calc(100%-40px); + padding: 0px 10px 10px 10px; + display: none; +} + +#instructions img{ + max-width: 64px; +} + +#instructions button{ + position: absolute; + top: 0px; + right: 0px; + background-color: #264de4; + color: white; + border: 1px #2965f1 solid; +} + + +/* ========================================================================== + Media Queries + ========================================================================== */ + +@media only screen and (min-width: 480px) { + +/* ==================== + INTERMEDIATE: Menu + ==================== */ + + nav a { + float: left; + width: 27%; + margin: 0 1.7%; + padding: 25px 2%; + margin-bottom: 0; + } + + nav li:first-child a { + margin-left: 0; + } + + nav li:last-child a { + margin-right: 0; + } + #trigger{ + display: block; + } + + +/* ======================== + INTERMEDIATE: IE Fixes + ======================== */ + + nav ul li { + display: inline; + } + + .oldie nav a { + margin: 0 0.7%; + } +} + +@media only screen and (min-width: 768px) { + +/* ==================== + WIDE: CSS3 Effects + ==================== */ + + .header-container, + .main aside, + .main header, + .main section, + .main footer { + -webkit-box-shadow: 0 5px 10px #aaa; + -moz-box-shadow: 0 5px 10px #aaa; + box-shadow: 0 5px 10px #aaa; + } + +/* ============ + WIDE: Menu + ============ */ + + .title { + float: left; + } + + nav { + float: right; + width: 38%; + display: block !important; + } + #trigger{ + display: none; + } + +/* ============ + WIDE: Main + ============ */ + + .main article { + float: left; + width: 57%; + } + + .main aside { + float: right; + width: 28%; + } + + .main-container{ + margin-top: 100px; + } +} + +@media only screen and (min-width: 1140px) { + +/* =============== + Maximal Width + =============== */ + + .wrapper { + width: 1026px; /* 1140px - 10% for margins */ + margin: 0 auto; + } +} + +/* ========================================================================== + Helper classes + ========================================================================== */ + +.hidden { + display: none !important; + visibility: hidden; +} + +.visuallyhidden { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} + +.visuallyhidden.focusable:active, +.visuallyhidden.focusable:focus { + clip: auto; + height: auto; + margin: 0; + overflow: visible; + position: static; + width: auto; +} + +.invisible { + visibility: hidden; +} + +.clearfix:before, +.clearfix:after { + content: " "; + display: table; +} + +.clearfix:after { + clear: both; +} + +.clearfix { + *zoom: 1; +} + +/* ========================================================================== + Print styles + ========================================================================== */ + +@media print { + *, + *:before, + *:after { + background: transparent !important; + color: #000 !important; + box-shadow: none !important; + text-shadow: none !important; + } + + a, + a:visited { + text-decoration: underline; + } + + a[href]:after { + content: " (" attr(href) ")"; + } + + abbr[title]:after { + content: " (" attr(title) ")"; + } + + a[href^="#"]:after, + a[href^="javascript:"]:after { + content: ""; + } + + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + + thead { + display: table-header-group; + } + + tr, + img { + page-break-inside: avoid; + } + + img { + max-width: 100% !important; + } + + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + + h2, + h3 { + page-break-after: avoid; + } +} \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/css/normalize.min.css b/admin/survey/modules/mod_WPN/frontend/css/normalize.min.css new file mode 100644 index 0000000..f6e0b65 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/css/normalize.min.css @@ -0,0 +1 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/css/production.css b/admin/survey/modules/mod_WPN/frontend/css/production.css new file mode 100644 index 0000000..bf89b99 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/css/production.css @@ -0,0 +1 @@ +/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}blockquote,caption,dd,dl,fieldset,figure,form,hr,ol,pre,table,td,th,ul{margin:0;padding:0}[tabindex='-1']:focus{outline:0}body,button,input,select,textarea{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%}a:active,a:hover{outline:0}[role=button],a,button,input,label,select,textarea{-ms-touch-action:manipulation;touch-action:manipulation}ol,ul{margin-bottom:.8rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}code,kbd,pre,samp{font-family:Monaco,Menlo,Consolas,monospace}b,strong{line-height:inherit}em,i{font-style:italic;line-height:inherit}table{display:table;max-width:100%}td,th{line-height:1.6rem;vertical-align:middle}th{text-align:left}form{font-size:1rem}fieldset{border:0;min-width:0}legend{line-height:inherit;margin:0}input,optgroup,select,textarea{line-height:inherit}input,label,select{vertical-align:middle}input[type=file]{display:block;width:100%}textarea{height:auto;resize:vertical}input:focus,select:focus,textarea:focus{outline:0}.select select:focus:-moz-focusring{color:transparent;text-shadow:0 0 0 #000}select[multiple],select[size]{height:auto}.select--list:after{content:none!important}select::-ms-expand{display:none}option{color:#262b3a;background-color:#fff}fieldset[disabled] input,input[disabled],input[readonly]{cursor:not-allowed;opacity:1;pointer-events:none}button{line-height:inherit;vertical-align:middle}embed,iframe,img,object{display:inline-block;vertical-align:middle}iframe{border:0}img{border:0;font-style:italic;height:auto;-ms-interpolation-mode:bicubic}svg{max-height:100%}.gm-style img{max-width:none}html{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:Montserrat,Avenir,"Avenir Next",Trebuchet,Verdana,sans-serif;font-size:14px;font-style:normal;font-weight:400;min-height:100%;-webkit-tap-highlight-color:transparent}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}body{background-color:#f2f2f2!important;color:#262b3a;line-height:1.6rem;margin:0;padding:0;-moz-osx-font-smoothing:grayscale}::-moz-selection{background-color:#294ace;color:#fff;text-shadow:none}::selection{background-color:#294ace;color:#fff;text-shadow:none}img::-moz-selection{background:0 0}img::selection{background:0 0}img::-moz-selection{background:0 0}.btn{background-image:none;border-radius:30px;border-style:solid;border-width:1px;cursor:pointer;display:inline-block;font-family:Montserrat,Avenir,"Avenir Next",Trebuchet,Verdana,sans-serif;font-size:1rem;font-weight:700;line-height:1.6rem;margin-bottom:0;padding:.65rem 2.2rem .55rem;text-align:center;text-decoration:none;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-transition:background-color .2s ease-out,background .2s ease-out,color .2s ease-out,border .2s ease-out;transition:background-color .2s ease-out,background .2s ease-out,color .2s ease-out,border .2s ease-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap;-webkit-appearance:none;-moz-appearance:none;appearance:none}.btn:focus,.btn:hover{outline:0;text-decoration:none}.btn:active{outline:0;background-image:none}.btn.disabled,.btn[disabled],.btn[readonly],fieldset[disabled] .btn{cursor:not-allowed!important;opacity:1;pointer-events:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn--sm{font-size:.618rem;padding:.1rem .6rem 0}.btn--default{background-color:#294ace;border-color:#294ace;color:#fff}.btn--default:focus,.btn--default:hover{background-color:#213ba3;border-color:#213ba3}.btn--default:active{background-color:#182b79;border-color:#182b79}.btn--secondary,.btn--secondary:visited{background-color:#69f0ae;border-color:#69f0ae;color:#262b3a}.btn--secondary:focus,.btn--secondary:hover,.btn--secondary:visited:focus,.btn--secondary:visited:hover{background-color:#3beb95;border-color:#3beb95}.btn--secondary:active,.btn--secondary:visited:active{background-color:#16dd7c;border-color:#16dd7c}.container{margin-left:auto;margin-right:auto;max-width:900px;width:90%}.container--lg{margin-left:auto;margin-right:auto;max-width:1100px;width:90%}canvas,iframe,img,svg,video{max-width:100%}.logo{max-height:300px}.download{max-height:45px}.mentioned{max-height:45px}.illustration--small{max-height:80px}.icon{height:30px}.cta-image{max-height:100px}.form-control{background-image:none;border:1px solid transparent;border-radius:7px;color:#262b3a;display:block;font-family:Montserrat,Avenir,"Avenir Next",Trebuchet,Verdana,sans-serif;font-size:1rem;line-height:1.6rem;max-width:100%;padding:.65rem .8rem .55rem;width:100%;-moz-osx-font-smoothing:grayscale}.label{cursor:default;display:inline-block;max-width:100%}.legend{display:block;white-space:normal;width:100%}.form--stacked .checkbox,.form--stacked .input,.form--stacked .label,.form--stacked .radio,.form--stacked .select,.form--stacked .textarea{display:block;width:100%}.form--inline .form-control{display:inline-block;vertical-align:middle;width:auto}.form--inline .checkbox,.form--inline .radio{display:inline-block;vertical-align:middle}.select{color:#262b3a;display:block;position:relative}.select select{background-color:#fff;border:1px solid #abb2c9;border-radius:7px;color:#262b3a;cursor:pointer;display:inline-block;font-family:Montserrat,Avenir,"Avenir Next",Trebuchet,Verdana,sans-serif;line-height:1.6rem;margin:0;outline:0;padding:.65rem .8rem .55rem;width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none}.select select>option{background-color:#fff}.select:after{border-top:5px solid;border-right:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid transparent;content:"";display:inline-block;height:0;margin-top:-2px;pointer-events:none;position:absolute;right:13px;top:50%;width:0}::-webkit-input-placeholder{color:#7380a4;-webkit-font-smoothing:antialiased}::-moz-placeholder{color:#7380a4;-moz-osx-font-smoothing:grayscale}:-ms-input-placeholder{color:#7380a4}.grid-row{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0 -.8rem}.grid-column{-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;padding:0 .8rem}.grid-row--flex-cells>.grid-column{display:-webkit-box;display:-ms-flexbox;display:flex}.grid-row--top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.grid-row--center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.grid-row--bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.column--top{-ms-flex-item-align:start;align-self:flex-start}.column--center{-ms-flex-item-align:center;align-self:center}.column--bottom{-ms-flex-item-align:end;align-self:flex-end}.span-12,.span-whole{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.span-6,.span-half{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.span-4,.span-one-third{-ms-flex-preferred-size:33.33333%;flex-basis:33.33333%;max-width:33.33333%}.span-8,.span-two-thirds{-ms-flex-preferred-size:66.66667%;flex-basis:66.66667%;max-width:66.66667%}.span-3,.span-one-fourth{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.span-two-fourths{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.span-9,.span-three-fourths{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.span-one-fifth{-ms-flex-preferred-size:20%;flex-basis:20%;max-width:20%}.span-two-fifths{-ms-flex-preferred-size:40%;flex-basis:40%;max-width:40%}.span-three-fifths{-ms-flex-preferred-size:60%;flex-basis:60%;max-width:60%}.span-four-fifths{-ms-flex-preferred-size:80%;flex-basis:80%;max-width:80%}.span-1{-ms-flex-preferred-size:8.33333%;flex-basis:8.33333%;max-width:8.33333%}.span-2{-ms-flex-preferred-size:16.66667%;flex-basis:16.66667%;max-width:16.66667%}.span-5{-ms-flex-preferred-size:41.66667%;flex-basis:41.66667%;max-width:41.66667%}.span-7{-ms-flex-preferred-size:58.33333%;flex-basis:58.33333%;max-width:58.33333%}.span-10{-ms-flex-preferred-size:83.33333%;flex-basis:83.33333%;max-width:83.33333%}.span-11{-ms-flex-preferred-size:91.66667%;flex-basis:91.66667%;max-width:91.66667%}.offset-12{margin-left:100%}.offset-6,.offset-half{margin-left:50%}.offset-4,.offset-one-third{margin-left:33.33333%}.offset-8,.offset-two-thirds{margin-left:66.66667%}.offset-3,.offset-one-fourth{margin-left:25%}.offset-two-fourths{margin-left:50%}.offset-9,.offset-three-fourths{margin-left:75%}.offset-one-fifth{margin-left:20%}.offset-two-fifths{margin-left:40%}.offset-three-fifths{margin-left:60%}.offset-four-fifths{margin-left:80%}.offset-1{margin-left:8.33333%}.offset-2{margin-left:16.66667%}.offset-5{margin-left:41.66667%}.offset-7{margin-left:58.33333%}.offset-10{margin-left:83.33333%}.offset-11{margin-left:91.66667%}.default-links a,.default-links a:link,.default-links a:visited,.link,.link:link,.link:visited{color:#294ace;text-decoration:none;-webkit-transition:color .2s ease-out;transition:color .2s ease-out}.default-links a:focus,.default-links a:hover,.link:focus,.link:hover{color:#213ba3}.default-links a:active,.link:active{background-image:none;color:#142464;outline:0;-webkit-transition:color .2s ease-out;transition:color .2s ease-out}.link--text{border-bottom:1px solid #294ace}.no-bullets{list-style:none}.list--indented{padding-left:2.4rem}.list--inline{font-size:0}.list--inline li{display:inline-block;font-size:1rem}.h1,h1{font-size:2.1rem}.h2,h2{font-size:1.8rem}.h3,h3{font-size:1.3rem}.h4,dl,h4,ol,p,ul{font-size:1rem}.h5,h5{font-size:.618rem}.h6,.small,h6,small{font-size:.618rem}h1,h2,h3,h4,h5,h6{font-family:"Source Serif Pro",Georgia,Times,serif;font-weight:700;line-height:1;margin-top:0;margin-bottom:.8rem;text-rendering:optimizeLegibility}h6{color:#4a5472}.h1,.h2,.h3,.h4,.h5,.h6{line-height:1;margin-bottom:.8rem}p{margin:0}.small,small{font-weight:400;line-height:1;font-size:.8rem}hr{border:0;border-top:1px solid #abb2c9;display:block;height:1px}.blockquote{border-left:4px solid #abb2c9;font-family:Montserrat,Avenir,"Avenir Next",Trebuchet,Verdana,sans-serif;font-size:1.3rem;font-style:italic;max-width:100%;margin-bottom:.8rem;padding-left:1.2rem}.blockquote:after,.blockquote:before{content:""}.bold{font-weight:700}.regular{font-weight:400}.italic{font-style:italic}.align--left{text-align:left}.align--center{text-align:center}.align--right{text-align:right}.align--justify{text-align:justify}.line-height--base{line-height:1.6rem}.line-height--heading{line-height:1}.font--heading{font-family:"Source Serif Pro",Georgia,Times,serif}.font--reading{font-family:"Source Serif Pro",Georgia,Times,serif}.font--ui{font-family:Montserrat,Avenir,"Avenir Next",Trebuchet,Verdana,sans-serif}.border--full{border-color:#abb2c9;border-style:solid;border-width:1px}.border--top{border-top-color:#abb2c9;border-top-style:solid;border-top-width:1px}.border--right{border-right-color:#abb2c9;border-right-style:solid;border-right-width:1px}.border--bottom{border-bottom-color:#abb2c9;border-bottom-style:solid;border-bottom-width:1px}.border--left{border-left-color:#abb2c9;border-left-style:solid;border-left-width:1px}.border--none{border:0}.rounded{border-radius:7px}.rounded--top{border-radius:7px 7px 0 0}.rounded--right{border-radius:0 7px 7px 0}.rounded--bottom{border-radius:0 0 7px 7px}.rounded--left{border-radius:7px 0 0 7px}.circle{border-radius:50%}.text--white{color:#fff}.text--lightest-gray{color:#abb2c9}.text--light-gray{color:#7380a4}.text--gray{color:#4a5472}.text--dark-gray{color:#262b3a}.text--darkest-gray{color:#020203}.text--primary-color{color:#294ace}.text--secondary-color{color:#69f0ae}.text--tertiary-color{color:#ff5252}.bg--white{background-color:#fff}.bg--lightest-gray{background-color:#abb2c9}.bg--light-gray{background-color:#7380a4}.bg--gray{background-color:#4a5472}.bg--dark-gray{background-color:#262b3a}.bg--darkest-gray{background-color:#020203}.bg--primary-color{background-color:#294ace}.bg--secondary-color{background-color:#69f0ae}.bg--tertiary-color{background-color:#ff5252}.m0{margin:0}.mt0{margin-top:0}.mr0{margin-right:0}.mb0{margin-bottom:0}.ml0{margin-left:0}.m1{margin:.8rem}.mt1{margin-top:.8rem}.mr1{margin-right:.8rem}.mb1{margin-bottom:.8rem}.ml1{margin-left:.8rem}.m2{margin:2rem}.mt2{margin-top:2rem}.mr2{margin-right:2rem}.mb2{margin-bottom:2rem}.ml2{margin-left:2rem}.m3{margin:3.2rem}.mt3{margin-top:3.2rem}.mr3{margin-right:3.2rem}.mb3{margin-bottom:3.2rem}.ml3{margin-left:3.2rem}.m4{margin:4.4rem}.mt4{margin-top:4.4rem}.mr4{margin-right:4.4rem}.mb4{margin-bottom:4.4rem}.ml4{margin-left:4.4rem}.p-mb{margin-bottom:.8rem}.centered{margin-right:auto;margin-left:auto}.p0{padding:0}.pt0{padding-top:0}.pr0{padding-right:0}.pb0{padding-bottom:0}.pl0{padding-left:0}.p1{padding:.8rem}.pt1{padding-top:.8rem}.pr1{padding-right:.8rem}.pb1{padding-bottom:.8rem}.pl1{padding-left:.8rem}.p2{padding:2rem}.pt2{padding-top:2rem}.pr2{padding-right:2rem}.pb2{padding-bottom:2rem}.pl2{padding-left:2rem}.p3{padding:3.2rem}.pt3{padding-top:3.2rem}.pr3{padding-right:3.2rem}.pb3{padding-bottom:3.2rem}.pl3{padding-left:3.2rem}.p4{padding:4.4rem}.pt4{padding-top:4.4rem}.pr4{padding-right:4.4rem}.pb4{padding-bottom:4.4rem}.pl4{padding-left:4.4rem}.relative{position:relative}.absolute{position:absolute}.fixed{position:fixed}.top--0{top:0}.right--0{right:0}.bottom--0{bottom:0}.left--0{left:0}.z1{z-index:1}.z2{z-index:2}.z3{z-index:3}.z4{z-index:4}.z5{z-index:5}.vertical--top{vertical-align:top}.vertical--middle{vertical-align:middle}.vertical--bottom{vertical-align:bottom}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:-webkit-box;display:-ms-flexbox;display:flex}.overflow--scroll{overflow:scroll}.overflow--hidden{overflow:hidden}.overflow--visible{overflow:visible}.overflow--auto{overflow:auto}.show-on-mobile{display:none!important}.float--left{float:left}.float--right{float:right}.float--none{float:none}.full-width{width:100%}.half-width{width:50%}.fit{max-width:100%}.clearfix:after,.clearfix:before{content:"";display:table}.clearfix:after{clear:both}@media screen and (min-width:40em){html{font-size:16px}.h1,h1{font-size:4.236rem}.h2,h2{font-size:2.618rem}.h3,h3{font-size:1.618rem}.h4,dl,h4,ol,p,ul{font-size:1rem}.h5,h5{font-size:.618rem}.h6,.small,h6,small{font-size:.618rem}}@media screen and (max-width:50em){input,select,textarea{font-size:16px}}@media screen and (max-width:40em){.btn{display:block;margin-top:.8rem;width:100%}.grid-row{margin:0 auto}.grid-column{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%;padding:0;margin-left:0}.order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.block-on-mobile,.show-on-mobile{display:block!important}.hide-on-mobile{display:none!important}.align--center-on-mobile{text-align:center!important}.no-mr-on-mobile{margin-right:0!important}} \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/favicon-16x16.png b/admin/survey/modules/mod_WPN/frontend/favicon-16x16.png new file mode 100644 index 0000000..55b63b1 Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/favicon-16x16.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/favicon-32x32.png b/admin/survey/modules/mod_WPN/frontend/favicon-32x32.png new file mode 100644 index 0000000..5bde17d Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/favicon-32x32.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/favicon.ico b/admin/survey/modules/mod_WPN/frontend/favicon.ico new file mode 100644 index 0000000..8036a6b Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/favicon.ico differ diff --git a/admin/survey/modules/mod_WPN/frontend/humans.txt b/admin/survey/modules/mod_WPN/frontend/humans.txt new file mode 100644 index 0000000..168fd9d --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/humans.txt @@ -0,0 +1,13 @@ +# humanstxt.org/ +# The humans responsible & technology colophon + +# TEAM + + Designer/Developer: Jordan Bowman + @jrdnbwmn + eatapapaya.com + +# TECHNOLOGY COLOPHON + + HTML5, CSS3, Javascript + Normalize.css, Sass, Pear diff --git a/admin/survey/modules/mod_WPN/frontend/img/1ka_logo_en.png b/admin/survey/modules/mod_WPN/frontend/img/1ka_logo_en.png new file mode 100644 index 0000000..17ad047 Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/img/1ka_logo_en.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/img/assign.svg b/admin/survey/modules/mod_WPN/frontend/img/assign.svg new file mode 100644 index 0000000..80adabf --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/assign.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/aths.png b/admin/survey/modules/mod_WPN/frontend/img/aths.png new file mode 100644 index 0000000..ee66f21 Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/img/aths.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/img/connected.svg b/admin/survey/modules/mod_WPN/frontend/img/connected.svg new file mode 100644 index 0000000..0308ba8 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/connected.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/data.svg b/admin/survey/modules/mod_WPN/frontend/img/data.svg new file mode 100644 index 0000000..a7628fb --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/data.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/facebook.svg b/admin/survey/modules/mod_WPN/frontend/img/facebook.svg new file mode 100644 index 0000000..d3af18c --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/facebook.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/googleplay.png b/admin/survey/modules/mod_WPN/frontend/img/googleplay.png new file mode 100644 index 0000000..7714f8a Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/img/googleplay.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/img/ios.png b/admin/survey/modules/mod_WPN/frontend/img/ios.png new file mode 100644 index 0000000..ddc393a Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/img/ios.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/img/mail.svg b/admin/survey/modules/mod_WPN/frontend/img/mail.svg new file mode 100644 index 0000000..e05b85c --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/mail.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/mentioned.svg b/admin/survey/modules/mod_WPN/frontend/img/mentioned.svg new file mode 100644 index 0000000..078c89f --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/mentioned.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/messaging.svg b/admin/survey/modules/mod_WPN/frontend/img/messaging.svg new file mode 100644 index 0000000..ea5751b --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/messaging.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/search.svg b/admin/survey/modules/mod_WPN/frontend/img/search.svg new file mode 100644 index 0000000..61fb516 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/security.svg b/admin/survey/modules/mod_WPN/frontend/img/security.svg new file mode 100644 index 0000000..39f9f73 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/security.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/share.png b/admin/survey/modules/mod_WPN/frontend/img/share.png new file mode 100644 index 0000000..74f11bc Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/img/share.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/img/text.svg b/admin/survey/modules/mod_WPN/frontend/img/text.svg new file mode 100644 index 0000000..a734814 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/text.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/twitter.svg b/admin/survey/modules/mod_WPN/frontend/img/twitter.svg new file mode 100644 index 0000000..0c635e2 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/twitter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/vault.svg b/admin/survey/modules/mod_WPN/frontend/img/vault.svg new file mode 100644 index 0000000..d22f72d --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/vault.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/img/youtube.svg b/admin/survey/modules/mod_WPN/frontend/img/youtube.svg new file mode 100644 index 0000000..483d27d --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/img/youtube.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/survey/modules/mod_WPN/frontend/index.html b/admin/survey/modules/mod_WPN/frontend/index.html new file mode 100644 index 0000000..1b5c4a9 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/index.html @@ -0,0 +1,196 @@ + + + + + + + + + + + 1KA WPN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + +
+
+ +
+ +
+

Efficient data gathering.

+
+
+ Fast messaging +

Fast messaging

+
+
+ Assign to others +

Assign to others

+
+
+ Stay connected +

Stay connected

+
+ + +
+
+ + +
+ +
+
+
+

Usage data

+

Quis istud possit, inquit, negare? Videamus animi partes, quarum est conspectus illustrior; Illa sunt similia: hebes acies est cuipiam oculorum, corpore alius senescit; Non enim, si omnia non sequebatur.

+
+

Quae quo sunt excelsiores, eo dant clariora indicia naturae. Causa autem fuit huc veniendi ut quosdam hinc.

+

Carry Andersen, COO at Stripe

+
+
+
+ Usage data +
+
+ +
+
+ Absolute security +
+
+
+
+

Absolute security

+

Itaque his sapiens semper vacabit. Qualis ista philosophia est, quae non interitum afferat pravitatis, sed sit contenta mediocritate vitiorum? Quid de Platone aut de Democrito loquar? Quis istud possit, inquit negare?

+
+

Estne, quaeso, inquam, sitienti in bibendo voluptas? Duo Reges: constructio interrete.

+

Josh Blenton, Product Manager at Blinkist

+
+
+ +
+ + + + + + + +
+ + + + + + + + diff --git a/admin/survey/modules/mod_WPN/frontend/index1.html b/admin/survey/modules/mod_WPN/frontend/index1.html new file mode 100644 index 0000000..eca291f --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/index1.html @@ -0,0 +1,360 @@ + + + + + + + + + NCC Computer Science + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + +

Computer Science

+ +
+
+ +
+
+
+

Install App

+ NCC CS + Add our app to your home screen?
+ No, Thanks + +
+
+
+

Welcome!

+

+ You've come to the right place! +

+

+ It’s an exciting – and lucrative – time to be a + Computer Science major. At NCC, you’ll be grounded + in Computer Science fundamentals and exposed to + today’s employable technologies. Want to build + Mobile Apps? Want to create state of the art web + pages? Want to learn advanced topics? No worries + – we’ve got you covered. +

+

+ Whether you are a transfer student looking to start + an advanced degree or a programmer learning a new + language or just looking to add skills to your tool + set, NCC’s Computer Science Department has Courses + and Programs to meet your needs. +

+ +
+
+

Faculty

+

+ NCC's Computer Science faculty possess an abundance + of real world experience coupled with twenty-first century + teaching abilities. The result is classes that ground + students in theory while teaching them how to implement + the technologies needed to thrive in today's economy. +

+
+

+ Professor Tom Duffy, Department Chair +

+
+

+ Tom Duffy +

+

+ (203) 857-6892 +

+

+ tduffy@norwalk.edu +

+
+

+ + Professor Tom Duffy is the Chair of the Computer + Science Department and the Program Coordinator + for the Computer Science degree as well as the Web + Developer, Relational Database, and Smartphone App + Development certificates. He teaches courses in Web + Development, XML, Java, and Mobile Device Programming. +

+

+ Tom holds a Bachelor of Science degree in Mathematics + and Master of Arts degree in Mathematics/Computer Science + from Western Connecticut State University. He is the + owner of Bright Moments Software – a software company + specializing in Web Technologies. +

+

+ Tom has recently published Programming With Mobile Applications, his second book. The book is available from Cengage Learning. +

+

+ Back To Top +

+ +
+
+

+ Professor Patrick Cassidy +

+
+

+ Patrick Cassidy +

+

+ (203) 857-7336 +

+

+ pcassidy@norwalk.edu +

+
+

+ Professor Cassidy is the Coordinator for the Computer + Security degree and Networking Certificate programs. + He is also the Main Contact for NCC’s Cisco Academy. +

+

+ Before coming to NCC, Prof. Cassidy was a Project + Associate for the University of Michigan working out + of the General Motors Plant in Tarrytown, NY. He has + also taught at Westchester Community College in both + the Mathematics and Computer Science departments. +

+

+ He holds a M.S. in Computer Science from Polytechnic + University, a B.S. in Aeronautical Science from + Embry Riddle Aeronautical University, and an A.S. + in Mathematics and Science from Westchester Community + College. Prof. Cassidy is a Cisco Certified Network + Associate (CCNA) and Cisco Certified Academy Instructor + (CCAI). He also holds multiple ratings from the + FAA as well as being a Certified Flight + Instructor – Instrument (CFII). +

+

+ Back To Top +

+
+
+

+ Professor Kerry Cramer +

+
+

+ Kerry Cramer +

+

+ (203) 857-3332 +

+

+ kcramer@norwalk.edu +

+
+

+ Professor Kerry V. Cramer is an information technology + professional with 30 years experience in computer + programming, information technologies, and IT project + management. Mr. Cramer has been an adjunct professor at + Manhattanville College, and University of New Haven + teaching several courses in the Computer Science + curriculum as well as substitute teaching K-12 at + schools in the Danbury, CT area. +

+

Professor Cramer’s strengths + include strong project management disciplines, + technical, supervisory and team management skills in + Internet, Lotus Notes, and legacy application development + and maintenance environments as well as extensive college + and professional recruiting experience. +

+

+ Back To Top +

+
+
+

+ Professor Charles Gabor +

+
+

+ Charles Gabor +

+

+ (203) 857-7315 +

+

+ cgabor@norwalk.edu +

+
+

+ Professor Gabor teaches Database Development and Java courses. + Before joining the NCC faculty he was a Lieutenant/Senior + Military Instructor at the United States Naval Academy. + Prior to that he was a Software Engineer at Pitney Bowes Inc. +

+

+ Professor Gabor holds a graduate certificate in Computer + Science from Purdue University, a M.S. degree from + the University of New Haven and a B.S degree in + Applied Science from Charter Oak State College. + He is a member of the Honor Society in Computer Science, + Upsilon Pi Epsilon and a retired Commander in the U.S. Navy. +

+

+ Back To Top +

+
+ +
+
+

Programs

+

+ Our programs serve both traditional first-time students + as well as professionals currently working in the field. + The curriculum is flexible enough to meet the needs of + students who wish to transfer to a baccalaureate + institution and students preparing for immediate + entry into the workplace. +

+

+ Degree Programs +

+

+ AS Computer Science +

+

+ AS Computer Security +

+

+ Certificate Programs +

+

+ Relational Database Development +

+

+ Smartphone App Development +

+

+ Web Developer +

+

+ Back To Top +

+
+
+

Courses

+

+ Computer Science courses at NCC not only prepare students to + transfer into a baccalaureate institution. They also serve + those students who wish to enter the workforce directly. + All our courses expose students to the course's underlying CS + theory as well as teach students how to implement those + theories. The result is students who are prepared for + whatever they choose to do next. +

+

+ Computer Science (CSC) +

+

+ Computer Technology (CST) +

+

+ Computer Applications (CSA) +

+

+ Back To Top +

+
+
+ + + +
+
+ + +
+ +

+ icon +

+

+ Install our app on your Home Screen for Quick Access +

+

+ Tap share then Add To Home Screen +

+
+ + diff --git a/admin/survey/modules/mod_WPN/frontend/js/main.js b/admin/survey/modules/mod_WPN/frontend/js/main.js new file mode 100644 index 0000000..aa9ff02 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/js/main.js @@ -0,0 +1,169 @@ +window.onhashchange = function(){ + //Header is fixed, need to slide down some to see sectionHead + setTimeout('scrollBy(0,-110)',10); +}; +var hidden = true; +function toggleNav(){ + if(hidden){ + document.getElementsByTagName('nav')[0].style.display = 'block'; + }else{ + document.getElementsByTagName('nav')[0].style.display = 'none'; + } + hidden = !hidden; +} +var pwaSupport = false; + +if('serviceWorker' in navigator){ + pwaSupport = true; + //register the service worker + navigator.serviceWorker.register('sw.js').then(function(result){ + console.log('Service Worker Registered'); + console.log('Scope: ' + result.scope); + console.log('calling'); + subscribeDivControl(); + + /* + if('Notification' in window){ + console.log('Notifications Supported'); + Notification.requestPermission(function(status){ + console.log('Notification Status: ', status); + }); + var options = { + body: 'See What\'s New', + icon: 'android-chrome-192x192.png', + data: { + timestamp: Date.now(), + loc: 'index.html#info' + }, + actions: [ + {action: 'go', title: 'Go Now'} + ] + }; + notify('NCC Computer Science', options); + } + */ + }, function(error){ + console.log('Service Worker Regiatration Failed: '+ error); + }); +}else{ + document.getElementById('notif_not_supported_div').style.display='block'; + console.log('Service Workers Not Supported'); +} + +function notify(title, options){ + if(Notification.permission === 'granted'){ + navigator.serviceWorker.ready.then(function(reg){ + reg.showNotification(title, options); + }); + } +} + +var installEvt; +window.addEventListener('beforeinstallprompt', function(evt){ + console.log('Before Install Prompt'); + installEvt = evt; + evt.preventDefault(); + //document.getElementById('addToHomeScreen').style.display = 'block'; +}); + +function hidePrompt(){ + //document.getElementById('addToHomeScreen').style.display = 'none'; +} + +function installApp(){ + hidePrompt(); + installEvt.prompt(); + installEvt.userChoice.then(function(result){ + if(result.outcome === 'accepted') + console.log('App Installed'); + else + console.log('App Not Installed'); + }); +} + +window.addEventListener('appinstalled', function(evt){ + console.log('App Installed Event'); +}); + +window.onload = function(){ + if(pwaSupport){ + var p = navigator.platform; + if(p === 'iPhone' || p === 'iPad' || p === 'iPod'){ + if(!navigator.standalone){ + var lastShown = parseInt(localStorage.getItem('lastShown')); + var now = new Date().getTime(); + if(isNaN(lastShown) || (lastShown + 1000*60*60*24*7) <= now){ + document.getElementById('instructions').style.display = 'block'; + localStorage.setItem('lastShown', now); + } + } + } + } +}; + +function hideInstructions(){ + document.getElementById('instructions').style.display = 'none'; +} + +function clickButtonSubscribe(){ + subscribeToPush(); + subscribeDivControl(); +} + +function subscribeDivControl(){ + if(Notification.permission != 'granted'){ + document.getElementById('notif_join_div').style.display='block'; + document.getElementById('notif_joined_div').style.display='none'; + document.getElementById('notification_permission_warning').style.display='none'; + } + else { + document.getElementById('notif_joined_div').style.display='block'; + document.getElementById('notif_join_div').style.display='none'; + } +} + +function subscribeToPush(){ + console.log('subscribeToPush'); + navigator.serviceWorker.ready.then(function(reg){ + console.log(reg); + reg.pushManager.subscribe({ + userVisibleOnly:true, + applicationServerKey: urlBase64ToUint8Array('BNVIBdCsC6vkmByQJ861pusHN1mV76X3mvAa1u4PxmleTv2m2whcEu9Elhh8Qz3XnqV6k58YCSVqaafl3bhPKLU') + }).then(function(sub){ + subscribeDivControl(); + var json = JSON.parse(JSON.stringify(sub)); + console.log(json); + /*console.log(JSON.stringify(sub)); + console.log(sub.json());*/ + console.log('User Subscribed'); + //var json = {endpoint:"https://fcm.googleapis.com/fcm/send/deaedc3PCAg:APA91bGy7QpBtbuokjOQv0Y_BcSOujpabeRY6PG5MUbcsOpf7kZaKTmJMb1jYmW03rPRSIY1shFlzh3UOI4hItQoHlzp6yNuPamxOwgbIbK1tG7oiRaUplQBNC8dN3qwm52bEOPgbqBX",expirationTime:null,keys:{p256dh:"BIIbHDXNbOGKG-gYec7a8DMpqst2Uxavo_p1MS695lvPJ1ZHO0audpMPRSWwae5BmaHCN6MYC2rThAsGlamS3sw",auth:"7P5IQKoInqQnTOBG1ZzNgw"}}; + + $.post('../../../api/api.php?action=wpnAddSubscription&identifier=wpn', json, function(data){console.log(data);}); + + }).catch(function (err){ + //console.log(err); + document.getElementById('notification_permission_warning').style.display='block'; + }); + }); +} + +/** + * urlBase64ToUint8Array + * + * @param {string} base64String a public vavid key + */ +function urlBase64ToUint8Array(base64String) { + var padding = '='.repeat((4 - base64String.length % 4) % 4); + var base64 = (base64String + padding) + .replace(/\-/g, '+') + .replace(/_/g, '/'); + + var rawData = window.atob(base64); + var outputArray = new Uint8Array(rawData.length); + + for (var i = 0; i < rawData.length; ++i) { + outputArray[i] = rawData.charCodeAt(i); + } + return outputArray; +} + diff --git a/admin/survey/modules/mod_WPN/frontend/manifest.json b/admin/survey/modules/mod_WPN/frontend/manifest.json new file mode 100644 index 0000000..9451ce5 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/manifest.json @@ -0,0 +1,21 @@ +{ + "name": "1KA WPN", + "short_name": "1KA WPN", + "icons": [ + { + "src": "/admin/survey/modules/mod_WPN/frontend/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/admin/survey/modules/mod_WPN/frontend/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone", + "start_url": "/admin/survey/modules/mod_WPN/frontend/index.html", + "gcm_sender_id": "271835672394" +} diff --git a/admin/survey/modules/mod_WPN/frontend/mstile-150x150.png b/admin/survey/modules/mod_WPN/frontend/mstile-150x150.png new file mode 100644 index 0000000..2e5b11d Binary files /dev/null and b/admin/survey/modules/mod_WPN/frontend/mstile-150x150.png differ diff --git a/admin/survey/modules/mod_WPN/frontend/safari-pinned-tab.svg b/admin/survey/modules/mod_WPN/frontend/safari-pinned-tab.svg new file mode 100644 index 0000000..6a74d32 --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/safari-pinned-tab.svg @@ -0,0 +1,290 @@ + + + + +Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + + + + + + + + + + + + + + diff --git a/admin/survey/modules/mod_WPN/frontend/sw.js b/admin/survey/modules/mod_WPN/frontend/sw.js new file mode 100644 index 0000000..f20d9ac --- /dev/null +++ b/admin/survey/modules/mod_WPN/frontend/sw.js @@ -0,0 +1,124 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +var cacheName = 'CSv4'; + +var cachedFiles = [ + /*'/frontend/', + '/index.html', + '/manifest.json', + '/js/main.js', + '/js/production.css', + '/css/main.css' + '/frontend/css/normalize.min.css', + '/frontend/img/cassidy.jpg', + '/frontend/img/cramer.jpg', + '/frontend/img/duffy.jpg', + '/frontend/img/gabor.jpg', + '/frontend/img/aths.png', + '/frontend/img/share.png', + '/frontend/apple-touch-icon.png', + '/frontend/android-chrome-192x192.png'*/ +]; + +self.addEventListener('install', function(evt){ + console.log('Service Worker Install Event'); + //Add the file to the cache + evt.waitUntil( + caches.open(cacheName).then(function(cache){ + console.log('Caching Files'); + return cache.addAll(cachedFiles); + }).then(function(){ + return self.skipWaiting(); + }).catch(function(err){ + console.log('Cache Failed', err); + }) + ); +}); + +self.addEventListener('activate', function(evt){ + console.log('Service Worker Activated'); + evt.waitUntil( + caches.keys().then(function(keyList){ + return Promise.all(keyList.map(function(key){ + if(key !== cacheName){ + console.log('Removing Old Cache', key); + return caches.delete(key) + } + })); + }) + ); + return self.clients.claim(); +}); + +/*self.addEventListener('fetch', function(evt){ + console.log('Fetch Event' + evt.request.url); + evt.respondWith( + caches.match(evt.request).then(function(response){ + return response || fetch(evt.request); + }) + ); +});*/ + +function closeNotification(msg, evt){ + console.log(msg, evt.notification.data); + evt.notification.close(); +} + +self.addEventListener('notificationclose', function(evt){ + closeNotification('Notification Closed', evt); +}); + +self.addEventListener('notificationclick', function(evt){ + if(evt.action !== 'close'){ + evt.waitUntil( + self.clients.matchAll({type: 'window', includeUncontrolled: 'true'}).then(function(allClients){ + console.log(allClients); + var matchingClient = null; + for(var i = 0; i + + + + + + + + + + Carta + + + + + + + + + + + + + + + + +
+ + +
+

Colors

+
Primary brand color
+
Secondary brand color
+
Brand accent color
+
Darkest gray
+
Dark gray
+
Gray
+
Light gray
+
Lightest gray
+
+ + +
+

Type

+

A new take on health care for small businesses.

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, semper suscipit, posuere a, pede.

+

Sed adipiscing ornare risus. Morbi est est, blandit sit amet, sagittis vel, euismod vel, velit. Pellentesque egestas sem. Suspendisse commodo ullamcorper magna. Ut aliquam sollicitudin leo.

+
This is a blockquote. Suspendisse commodo ullamcorper magna.
+

Lorem superscript dolor subscript amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. cite. Donec sed tellus eget sapien fringilla nonummy. NBA Morbi imperdiet augue quis tellus. Suspendisse quam sem, AVE consequat at, commodo vitae, feugiat in nunc.

+

Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in pharetra a, ultricies in, diam. Sed arcu. Cras consequat.

+
    +
  • Aliquam tincidunt mauris eu risus.
  • +
  • Vestibulum auctor dapibus neque.
  • +
  • Nunc dignissim risus id metus.
  • +
  • Vivamus vestibulum nulla nec ante.
  • +
+

Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.

+
    +
  1. Integer vitae libero ac risus egestas placerat.
  2. +
  3. Praesent placerat risus quis eros.
  4. +
  5. Ut aliquam sollicitudin leo.
  6. +
  7. Donec quis dui at dolor tempor interdum.
  8. +
+
+ + +
+

Forms

+
+ + + +
+ +
+ + +
+
+ + +
+

Buttons

+ Medium Default + Medium Outline + Small Default +
+ +
+ + + + diff --git a/admin/survey/modules/mod_WPN/info WPN.txt b/admin/survey/modules/mod_WPN/info WPN.txt new file mode 100644 index 0000000..9d62bf7 --- /dev/null +++ b/admin/survey/modules/mod_WPN/info WPN.txt @@ -0,0 +1,5 @@ +Web Push Notifications +- Module is used for sending web push notifications to subscribers (browsers) +- This module is using third party library: https://github.com/web-push-libs/web-push-php + - PHP 7.1+ + - gmp, mbstring, curl, openssl \ No newline at end of file diff --git a/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadata.php b/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadata.php new file mode 100644 index 0000000..5368909 --- /dev/null +++ b/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadata.php @@ -0,0 +1,145 @@ + 0){ + $this->anketa = $anketa; + } + } + + + public function displaySettings(){ + global $lang; + + $settings = $this->getSettings(); + + echo '
'.$lang['settings'].''; + + // Belezenje post time-a + echo ''.$lang['srv_advanced_paradata_collect_post_time'].':'; + echo ''; + echo ''; + + echo '
'; + + echo '
'; + + + // Gumb shrani + echo '
'; + echo ''; + echo '
'; + echo '
'; + + echo '
'; + + + // Prikazemo parapodatke + $this->displayParadata(); + } + + // Pridobimo trenutne nastavitve za anketo + public function getSettings(){ + + $settings = array(); + + // Default vrednosti + $settings['collect_post_time'] = '1'; + + $sql = sisplet_query("SELECT * FROM srv_advanced_paradata_settings WHERE ank_id='".$this->anketa."'"); + if(mysqli_num_rows($sql) > 0){ + $row = mysqli_fetch_array($sql); + + $settings['collect_post_time'] = $row['collect_post_time']; + } + + return $settings; + } + + + private function displayParadata(){ + global $lang; + global $site_url; + + $sape = new SurveyAdvancedParadataExport($this->anketa); + + echo '
'.$lang['srv_results'].''; + + // Opcija za brisanje loga + echo '

'; + echo ' Delete all data'; + echo '

'; + + // Po sejah po straneh + echo 'Seja na strani'; + $href_csv = 'izvoz.php?m=advanced_paradata_csv&table=srv_advanced_paradata_page&anketa=' . $this->anketa; + echo ' (CSV izvoz)'; + $sape->displayPageTable(); + + // Po vprasanjih + echo 'Vprašanja'; + $href_csv = 'izvoz.php?m=advanced_paradata_csv&table=srv_advanced_paradata_question&anketa=' . $this->anketa; + echo ' (CSV izvoz)'; + $sape->displayQuestionTable(); + + // Po vrednostih + echo 'Vrednosti'; + $href_csv = 'izvoz.php?m=advanced_paradata_csv&table=srv_advanced_paradata_vrednost&anketa=' . $this->anketa; + echo ' (CSV izvoz)'; + $sape->displayVrednostTable(); + + // Ostalo + echo 'Ostalo'; + $href_csv = 'izvoz.php?m=advanced_paradata_csv&table=srv_advanced_paradata_other&anketa=' . $this->anketa; + echo ' (CSV izvoz)'; + $sape->displayOtherTable(); + + // Premiki miske + echo 'Premiki miške'; + $href_csv = 'izvoz.php?m=advanced_paradata_csv&table=srv_advanced_paradata_movement&anketa=' . $this->anketa; + echo ' (CSV izvoz)'; + $sape->displayMovementTable(); + + // Alerti + echo 'Alerti'; + $href_csv = 'izvoz.php?m=advanced_paradata_csv&table=srv_advanced_paradata_alert&anketa=' . $this->anketa; + echo ' (CSV izvoz)'; + $sape->displayAlertTable(); + + echo '
'; + } + + + public function ajax() { + + // Brisanje logov + if (isset($_GET['a']) && $_GET['a'] == 'logDataDelete') { + + $sql = sisplet_query("DELETE FROM srv_advanced_paradata_page WHERE ank_id='".$this->anketa."'"); + } + + // Shranjevanje nastavitev + if(isset($_GET['a']) && $_GET['a'] == 'save_settings'){ + + $collect_post_time = isset($_POST['collect_post_time']) ? $_POST['collect_post_time'] : '1'; + + $sql = sisplet_query("INSERT INTO srv_advanced_paradata_settings + (ank_id, collect_post_time) VALUES ('".$this->anketa."', '".$collect_post_time."') + ON DUPLICATE KEY UPDATE collect_post_time='".$collect_post_time."'"); + if (!$sql) echo mysqli_error($GLOBALS['connect_db']); + } + } +} \ No newline at end of file diff --git a/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataExport.php b/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataExport.php new file mode 100644 index 0000000..7055b07 --- /dev/null +++ b/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataExport.php @@ -0,0 +1,559 @@ + 0){ + $this->anketa = $anketa; + } + } + + + // Izvozimo ustrezno tabelo v csv + public function exportTable($table_name='srv_advanced_paradata_page'){ + global $site_path; + + ini_set('memory_limit', '4048M'); + + // Dobimo naslove stolpcev + $header = $this->getHeader($table_name); + + + // Pripravimo datoteko za izvoz + $file = $site_path.'admin/survey/modules/mod_advanced_paradata/temp/'.$table_name.'_'.$this->anketa.'.csv'; + $fd = fopen($file, "w"); + + $convertTypes = array('charSet' => 'windows-1250', + 'delimit' => ',', + 'newLine' => "\n", + 'BOMchar' => "\xEF\xBB\xBF"); + # dodamo boomchar za utf-8 + fwrite($fd, $convertTypes['BOMchar']); + + // Zapisemo header row + $header_line = ''; + foreach($header as $col){ + $header_line .= $col.','; + } + $header_line = substr($header_line, 0, -1); + fwrite($fd, $header_line."\r\n"); + + // Zapisemo vsako vrstico posebej + // Dobimo vrstice s podatki + switch($table_name){ + + case 'srv_advanced_paradata_question': + $data = $this->writeQuestionParadata($fd, $header); + break; + + case 'srv_advanced_paradata_vrednost': + $data = $this->writeVrednostParadata($fd, $header); + break; + + case 'srv_advanced_paradata_other': + $data = $this->writeOtherParadata($fd, $header); + break; + + case 'srv_advanced_paradata_movement': + $data = $this->writeMovementParadata($fd, $header); + break; + + case 'srv_advanced_paradata_alert': + $data = $this->writeAlertParadata($fd, $header); + break; + + default: + $data = $this->writePageParadata($fd, $header); + break; + } + + fclose($fd); + + + // Pripravimo file za download + if(file_exists($file)){ + + header('Content-Description: File Transfer'); + //header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename='.basename(''.$table_name.'_'.$this->anketa.'.csv'.'')); + + header("Content-type: text/x-csv; charset=utf-8"); + //header("Content-type: text/csv"); + + header('Content-Transfer-Encoding: binary'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + header('Content-Length: ' . filesize($file)); + + ob_clean(); + flush(); + + readfile($file); + } + + // Na koncu pobrisemo zacasne datoteke + if (file_exists($file)) { + unlink($file); + } + + // Ugasnemo skripto:) + die(); + } + + + // Izpisemo tabelo parapodatkov vezanih na strani + public function displayPageTable(){ + global $lang; + + $data = $this->getPageParadata(); + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + foreach($data as $row){ + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + echo ''; + } + + echo '
IDUser IDPage IDRecnumLoad timePost timeUser AgentDevice pixel ratiowidth x heightavailWidth x availHeightjQuery windowWidth x windowHeightjQuery documentWidth x documentHeightLanguage
'.$row['id'].''.$row['usr_id'].''.$row['gru_id'].''.$row['recnum'].''.$row['load_time'].''.$row['post_time'].''.$row['user_agent'].''.$row['devicePixelRatio'].''.$row['width'].'px X '.$row['height'].'px'.$row['availWidth'].'px X '.$row['availHeight'].'px'.$row['jquery_windowW'].'px X '.$row['jquery_windowH'].'px'.$row['jquery_documentW'].'px X '.$row['jquery_documentH'].'px'.$row['language'].'
'; + } + // Izpisemo tabelo parapodatkov vezanih na vprasanja + public function displayQuestionTable(){ + + $data = $this->getQuestionParadata(); + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + foreach($data as $row){ + + echo ''; + + echo ''; + echo ''; + echo ''; + + echo ''; + } + + echo '
Page session IDQuestion IDOrder
'.$row['page_id'].''.$row['spr_id'].''.$row['vre_order'].'
'; + } + + // Izpisemo tabelo parapodatkov vezanih na vredosti + public function displayVrednostTable(){ + + $data = $this->getVrednostParadata(); + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + foreach($data as $row){ + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + echo ''; + } + + echo '
Page session IDQuestion IDVrednost IDTimeEventValue
'.$row['page_id'].''.$row['spr_id'].''.$row['vre_id'].''.$row['time'].''.$row['event'].''.$row['value'].'
'; + } + + // Izpisemo tabelo ostalih parapodatkov + public function displayOtherTable(){ + + $data = $this->getOtherParadata(); + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + foreach($data as $row){ + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + echo ''; + } + + echo '
Page session IDTimeEventValuePositionElement typeElement idElement class
'.$row['page_id'].''.$row['time'].''.$row['event'].''.$row['value'].'X: '.$row['pos_x'].', Y: '.$row['pos_y'].''.$row['div_type'].''.$row['div_id'].''.$row['div_class'].'
'; + } + + // Izpisemo tabelo premikov miske + public function displayMovementTable(){ + + $data = $this->getMovementParadata(); + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + foreach($data as $row){ + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + echo ''; + } + + echo '
Page session IDTime startTime endPosition startPosition endDistance traveled
'.$row['page_id'].''.$row['time_start'].''.$row['time_end'].'X: '.$row['pos_x_start'].', Y: '.$row['pos_y_start'].'X: '.$row['pos_x_end'].', Y: '.$row['pos_y_end'].''.$row['distance'].'
'; + } + + // Izpisemo tabelo ostalih parapodatkov + public function displayAlertTable(){ + + $data = $this->getAlertParadata(); + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + foreach($data as $row){ + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + echo ''; + } + + echo '
Page session IDDisplay timeClose timeTypeTrigger IDTrigger typeIgnorableAlert textUser action
'.$row['page_id'].''.$row['time_display'].''.$row['time_close'].''.$row['type'].''.$row['trigger_id'].''.$row['trigger_type'].''.$row['ignorable'].''.$row['text'].''.$row['action'].'
'; + } + + + // Pridobimo naslove parapodatkov vezane na strani + private function getHeader($table_name='srv_advanced_paradata_page'){ + + $header = array(); + + $sql = sisplet_query("SHOW columns FROM ".$table_name.""); + while($row = mysqli_fetch_array($sql)){ + $header[] = $row['Field']; + } + + return $header; + } + + // Pridobimo parapodatke vezane na strani + private function getPageParadata($all=false){ + + $data = array(); + + $limit = $all ? '' : ' LIMIT '.$this->limit; + + $sql = sisplet_query("SELECT * FROM srv_advanced_paradata_page + WHERE ank_id='".$this->anketa."' + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + $data[] = $row; + } + + return $data; + } + + // Pridobimo parapodatke vezane na vprasanja + private function getQuestionParadata($all=false){ + + $data = array(); + + $limit = $all ? '' : ' LIMIT '.$this->limit; + + $sql = sisplet_query("SELECT q.* FROM srv_advanced_paradata_question q, srv_advanced_paradata_page p + WHERE p.ank_id='".$this->anketa."' AND q.page_id=p.id + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + $data[] = $row; + } + + return $data; + } + + // Pridobimo parapodatke vezane na vrednosti v vprasanju + private function getVrednostParadata($all=false){ + + $data = array(); + + $limit = $all ? '' : ' LIMIT '.$this->limit; + + $sql = sisplet_query("SELECT v.* FROM srv_advanced_paradata_vrednost v, srv_advanced_paradata_page p + WHERE p.ank_id='".$this->anketa."' AND v.page_id=p.id + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + $data[] = $row; + } + + return $data; + } + + // Pridobimo ostale parapodatke + private function getOtherParadata($all=false){ + + $data = array(); + + $limit = $all ? '' : ' LIMIT '.$this->limit; + + $sql = sisplet_query("SELECT o.* FROM srv_advanced_paradata_other o, srv_advanced_paradata_page p + WHERE p.ank_id='".$this->anketa."' AND o.page_id=p.id + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + $data[] = $row; + } + + return $data; + } + + // Pridobimo parapodatke premikov miske + private function getMovementParadata($all=false){ + + $data = array(); + + $limit = $all ? '' : ' LIMIT '.$this->limit; + + $sql = sisplet_query("SELECT m.* FROM srv_advanced_paradata_movement m, srv_advanced_paradata_page p + WHERE p.ank_id='".$this->anketa."' AND m.page_id=p.id + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + $data[] = $row; + } + + return $data; + } + + // Pridobimo parapodatke alertov + private function getAlertParadata($all=false){ + + $data = array(); + + $limit = $all ? '' : ' LIMIT '.$this->limit; + + $sql = sisplet_query("SELECT a.* FROM srv_advanced_paradata_alert a, srv_advanced_paradata_page p + WHERE p.ank_id='".$this->anketa."' AND a.page_id=p.id + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + $data[] = $row; + } + + return $data; + } + + + // Zapisemo v datoteko parapodatke vezane na strani + private function writePageParadata($fd, $header){ + + $sql = sisplet_query("SELECT * FROM srv_advanced_paradata_page + WHERE ank_id='".$this->anketa."' + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + + $data_line = ''; + foreach($header as $col){ + $data_line .= '\''.$row[$col].'\','; + } + $data_line = substr($data_line, 0, -1); + + fwrite($fd, $data_line."\r\n"); + } + } + + // Zapisemo v datoteko parapodatke vezane na vprasanja + private function writeQuestionParadata($fd, $header){ + + $sql = sisplet_query("SELECT q.* FROM srv_advanced_paradata_question q, srv_advanced_paradata_page p + WHERE p.ank_id='".$this->anketa."' AND q.page_id=p.id + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + + $data_line = ''; + foreach($header as $col){ + $data_line .= '\''.$row[$col].'\','; + } + $data_line = substr($data_line, 0, -1); + + fwrite($fd, $data_line."\r\n"); + } + } + + // Zapisemo v datoteko parapodatke vezane na vrednosti v vprasanju + private function writeVrednostParadata($fd, $header){ + + $sql = sisplet_query("SELECT v.* FROM srv_advanced_paradata_vrednost v, srv_advanced_paradata_page p + WHERE p.ank_id='".$this->anketa."' AND v.page_id=p.id + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + + $data_line = ''; + foreach($header as $col){ + $data_line .= '\''.$row[$col].'\','; + } + $data_line = substr($data_line, 0, -1); + + fwrite($fd, $data_line."\r\n"); + } + } + + // Zapisemo v datoteko ostale parapodatke + private function writeOtherParadata($fd, $header){ + + $sql = sisplet_query("SELECT o.* FROM srv_advanced_paradata_other o, srv_advanced_paradata_page p + WHERE p.ank_id='".$this->anketa."' AND o.page_id=p.id + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + + $data_line = ''; + foreach($header as $col){ + $data_line .= '\''.$row[$col].'\','; + } + $data_line = substr($data_line, 0, -1); + + fwrite($fd, $data_line."\r\n"); + } + } + + // Zapisemo v datoteko parapodatke premikov miske + private function writeMovementParadata($fd, $header){ + + $sql = sisplet_query("SELECT m.* FROM srv_advanced_paradata_movement m, srv_advanced_paradata_page p + WHERE p.ank_id='".$this->anketa."' AND m.page_id=p.id + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + + $data_line = ''; + foreach($header as $col){ + $data_line .= '\''.$row[$col].'\','; + } + $data_line = substr($data_line, 0, -1); + + fwrite($fd, $data_line."\r\n"); + } + } + + // Zapisemo v datoteko parapodatke alertov + private function writeAlertParadata($fd, $header){ + + $sql = sisplet_query("SELECT a.* FROM srv_advanced_paradata_alert a, srv_advanced_paradata_page p + WHERE p.ank_id='".$this->anketa."' AND a.page_id=p.id + ORDER BY id DESC ".$limit.""); + while($row = mysqli_fetch_array($sql)){ + + $data_line = ''; + foreach($header as $col){ + $data_line .= '\''.$row[$col].'\','; + } + $data_line = substr($data_line, 0, -1); + + fwrite($fd, $data_line."\r\n"); + } + } +} \ No newline at end of file diff --git a/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php b/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php new file mode 100644 index 0000000..267231a --- /dev/null +++ b/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php @@ -0,0 +1,309 @@ + 0){ + $this->anketa = $anketa; + }*/ + + $this->anketa = (int)$_REQUEST['anketa']; + //$this->anketa = $anketa_id; + + if($this->anketa > 0){ + SurveyInfo::getInstance()->SurveyInit($this->anketa); + $this->collectParadata = (SurveyInfo::getInstance()->checkSurveyModule('advanced_paradata')) ? true : false; + } + else + throw new Exception('Survey ID not set in class.SurveyAdvancedParadataLog.php !'); + } + + // Vrne instanco classa - da mamo singleton + public static function getInstance () { + + if (!self::$instance) + self::$instance = new SurveyAdvancedParadataLog(); + + return self::$instance; + } + + // Vrne ce zbiramo napredne parapodatke + public function paradataEnabled(){ + return $this->collectParadata; + } + + // Vrne ce zbiramo post time + public function collectPostTime(){ + + $collectPostTime = true; + + $sql = sisplet_query("SELECT collect_post_time FROM srv_advanced_paradata_settings WHERE ank_id='".$this->anketa."'"); + if(mysqli_num_rows($sql) > 0){ + + $row = mysqli_fetch_array($sql); + + if($row['collect_post_time'] == '0') + $collectPostTime = false; + } + + return $collectPostTime; + } + + + // Ustvarimo polje v bazi za session (vezan na load posamezne strani) in nastavimo session_id za js + public function prepareLogging () { + + $user_agent = $_SERVER['HTTP_USER_AGENT']; + + // Vstavimo v bazo novo polje za session na strani + $sql = sisplet_query("INSERT INTO srv_advanced_paradata_page (ank_id, load_time, user_agent) VALUES ('".$this->anketa."', NOW(3), '".$user_agent."')"); + + if (!$sql){ + echo mysqli_error($GLOBALS['connect_db']); + } + else{ + // Nastavimo session_id + $this->session_id = mysqli_insert_id($GLOBALS['connect_db']); + + // Nastavimo session_id se za JS + echo ''; + } + } + + // Zapiše log v bazo + public function logData ($event_type, $event, $data) { + + switch ($event_type) { + + case 'page': + $this->logDataPage($event, $data); + break; + + case 'question': + $this->logDataQuestion($event, $data); + break; + + case 'vrednost': + $this->logDataVrednost($event, $data); + break; + + case 'other': + $this->logDataOther($event, $data); + break; + + case 'movement': + $this->logDataMovement($event, $data); + break; + + case 'alert': + $this->logDataAlert($event, $data); + break; + } + } + + // Zabelezimo dogodek na nivoju strani + private function logDataPage($event, $data){ + + $update = ''; + + // Nastavimo katere parametre updatamo + switch($event){ + case 'load_page': + $update = " gru_id = '".$data['page']."', + usr_id = '".$data['usr_id']."', + recnum = '".$data['recnum']."', + language = '".$data['language']."', + load_time = '".$data['timestamp']."', + devicePixelRatio = '".$data['data']['devicePixelRatio']."', + width = '".$data['data']['width']."', + height = '".$data['data']['height']."', + availWidth = '".$data['data']['availWidth']."', + availHeight = '".$data['data']['availHeight']."', + jquery_windowW = '".$data['data']['jquery_windowW']."', + jquery_windowH = '".$data['data']['jquery_windowH']."', + jquery_documentW = '".$data['data']['jquery_documentW']."', + jquery_documentH = '".$data['data']['jquery_documentH']."'"; + break; + + case 'unload_page': + $update = " post_time='".$data['timestamp']."' "; + break; + } + + $sql = sisplet_query("UPDATE srv_advanced_paradata_page SET ".$update." WHERE id='$this->session_id'"); + if (!$sql) echo mysqli_error($GLOBALS['connect_db']); + + /*var_dump($data); + echo "UPDATE srv_advanced_paradata_page SET ".$update." WHERE id='$this->session_id'";*/ + } + + // Zabelezimo dogodek na nivoju vprasanja + private function logDataQuestion($event, $data){ + + // Preverimo, ce gre ya vprasanje v ifu - potem se preveri da se zapise samo 1x + $sqlU = sisplet_query("SELECT p.id + FROM srv_advanced_paradata_page p, srv_advanced_paradata_question q + WHERE p.usr_id='".$data['usr_id']."' AND p.id=q.page_id AND q.spr_id='".$data['data']['spr_id']."' + "); + + // Ce se nimamo vnosa za vprasanje in userja zapisemo + if(mysqli_num_rows($sqlU) == 0){ + + $sql = sisplet_query("INSERT INTO srv_advanced_paradata_question + (page_id, spr_id, vre_order) + VALUES + ('".$this->session_id."', '".$data['data']['spr_id']."', '".$data['data']['vre_order']."')"); + if (!$sql) echo mysqli_error($GLOBALS['connect_db']); + } + } + + // Zabelezimo dogodek na nivoju vrednosti vprasanja + private function logDataVrednost($event, $data){ + + $value = isset($data['data']['value']) ? $data['data']['value'] : ''; + + $sql = sisplet_query("INSERT INTO srv_advanced_paradata_vrednost + (page_id, spr_id, vre_id, time, event, value) + VALUES + ('".$this->session_id."', '".$data['data']['spr_id']."', '".$data['data']['vre_id']."', '".$data['timestamp']."', '".$event."', '".$value."')"); + if (!$sql) echo mysqli_error($GLOBALS['connect_db']); + } + + // Zabelezimo ostale dogodke + private function logDataOther($event, $data){ + + $value = isset($data['data']['value']) ? $data['data']['value'] : ''; + $pos_x = isset($data['data']['pos_x']) ? $data['data']['pos_x'] : ''; + $pos_y = isset($data['data']['pos_y']) ? $data['data']['pos_y'] : ''; + $div_type = isset($data['data']['div_type']) ? $data['data']['div_type'] : ''; + $div_id = isset($data['data']['div_id']) ? $data['data']['div_id'] : ''; + $div_class = isset($data['data']['div_class']) ? $data['data']['div_class'] : ''; + + $sql = sisplet_query("INSERT INTO srv_advanced_paradata_other + (page_id, time, event, value, pos_x, pos_y, div_type, div_id, div_class) + VALUES + ('".$this->session_id."', '".$data['timestamp']."', '".$event."', '".$value."', '".$pos_x."', '".$pos_y."', '".$div_type."', '".$div_id."', '".$div_class."')"); + if (!$sql) echo mysqli_error($GLOBALS['connect_db']); + } + + // Zabelezimo premike miske + private function logDataMovement($event, $data){ + + $time_start_raw = mysqli_real_escape_string($GLOBALS['connect_db'], $data['data']['time_start']); + $time_start = date("Y-m-d H:i:s", $time_start_raw/1000).'.'.substr($time_start_raw, -3); + + $time_end_raw = mysqli_real_escape_string($GLOBALS['connect_db'], $data['data']['time_end']); + $time_end = date("Y-m-d H:i:s", $time_end_raw/1000).'.'.substr($time_end_raw, -3); + + $pos_x_start = isset($data['data']['pos_x_start']) ? $data['data']['pos_x_start'] : ''; + $pos_y_start = isset($data['data']['pos_y_start']) ? $data['data']['pos_y_start'] : ''; + $pos_x_end = isset($data['data']['pos_x_end']) ? $data['data']['pos_x_end'] : ''; + $pos_y_end = isset($data['data']['pos_y_end']) ? $data['data']['pos_y_end'] : ''; + $distance = isset($data['data']['distance']) ? $data['data']['distance'] : ''; + + $sql = sisplet_query("INSERT INTO srv_advanced_paradata_movement + (page_id, time_start, time_end, pos_x_start, pos_y_start, pos_x_end, pos_y_end, distance) + VALUES + ('".$this->session_id."', '".$time_start."', '".$time_end."', '".$pos_x_start."', '".$pos_y_start."', '".$pos_x_end."', '".$pos_y_end."', '".$distance."')"); + if (!$sql) echo mysqli_error($GLOBALS['connect_db']); + } + + // Zabelezimo alerte + private function logDataAlert($event, $data){ + + $type = isset($data['data']['type']) ? $data['data']['type'] : ''; + $trigger_id = isset($data['data']['trigger_id']) ? $data['data']['trigger_id'] : 0; + $trigger_type = isset($data['data']['trigger_type']) ? $data['data']['trigger_type'] : ''; + $ignorable = isset($data['data']['ignorable']) ? $data['data']['ignorable'] : 0; + $text = isset($data['data']['text']) ? $data['data']['text'] : ''; + $action = isset($data['data']['action']) ? $data['data']['action'] : ''; + + $timestamp_display_raw = isset($data['data']['time_display']) ? $data['data']['time_display'] : ''; + $timestamp_display = date("Y-m-d H:i:s", $timestamp_display_raw/1000).'.'.substr($timestamp_display_raw, -3); + + $sql = sisplet_query("INSERT INTO srv_advanced_paradata_alert + (page_id, time_display, time_close, type, trigger_id, trigger_type, ignorable, text, action) + VALUES + ('".$this->session_id."', '".$timestamp_display."', '".$data['timestamp']."', '".$type."', '".$trigger_id."', '".$trigger_type."', '".$ignorable."', '".$text."', '".$action."')"); + if (!$sql) echo mysqli_error($GLOBALS['connect_db']); + } + + + // Izpise link na javascript datoteko v header htmlja + public function linkJavaScript() { + global $site_url; + + // Osnovni js za belezenje parapodatkov + echo ' '."\n"; + + // Belezenje post tima (upocasni prehode cez strani) + if($this->collectPostTime()) + echo ' '."\n"; + + // JS za belezenje alertov + echo ' '."\n"; + } + + // Izpise trenutno grupo v JS + public function displayGrupa ($grupa) { + + echo ''; + } + + + // Ajax klici + public function ajax() { + + if ($_GET['a'] == 'logData') { + $this->ajax_logData(); + } + } + + // Logiranje eventa + private function ajax_logData () { + + $this->session_id = $_POST['session_id']; + + $event_type = mysqli_real_escape_string($GLOBALS['connect_db'], $_POST['event_type']); + $event = mysqli_real_escape_string($GLOBALS['connect_db'], $_POST['event']); + + $timestamp_raw = mysqli_real_escape_string($GLOBALS['connect_db'], $_POST['timestamp']); + $timestamp = date("Y-m-d H:i:s", $timestamp_raw/1000).'.'.substr($timestamp_raw, -3); + + $data_array = array( + 'page' => mysqli_real_escape_string($GLOBALS['connect_db'], $_POST['page']), + 'usr_id' => mysqli_real_escape_string($GLOBALS['connect_db'], $_POST['usr_id']), + 'recnum' => mysqli_real_escape_string($GLOBALS['connect_db'], $_POST['recnum']), + 'language' => mysqli_real_escape_string($GLOBALS['connect_db'], $_POST['language']), + 'timestamp' => $timestamp, + 'data' => $_POST['data'] + ); + + var_dump($_POST); + + $this->logData($event_type, $event, $data_array); + } +} + +?> \ No newline at end of file diff --git a/admin/survey/modules/mod_advanced_paradata/docs/Specifikacija parapodatkov.xml b/admin/survey/modules/mod_advanced_paradata/docs/Specifikacija parapodatkov.xml new file mode 100644 index 0000000..4481add --- /dev/null +++ b/admin/survey/modules/mod_advanced_paradata/docs/Specifikacija parapodatkov.xml @@ -0,0 +1,165 @@ + + + + + + + + + True | False + + + + + + + + + + + + + + + + h_res, v_res + + + + + + h_size, v_size + + + + + + portrait | landscape + + + + + + x_coord, y_coord, z_coord + + + + q_id_3, q_id_1, q_id_2 + + + val_3, val_1, val_2, val_5, val_4 + var_id_3, var_id_4, var_id_2, var_id_1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + nonresponse | num range | validation + + + question | variable | validation + q_id | var_id | validaton_id + + + True | False + + + Message text + + + ok | cancel + + + + + + + + single | double | right | middle | tap + + + X, Y + + + + + + + + + + + + + + + + + diff --git a/admin/survey/modules/mod_advanced_paradata/js/advanced_paradata.js b/admin/survey/modules/mod_advanced_paradata/js/advanced_paradata.js new file mode 100644 index 0000000..eb93c09 --- /dev/null +++ b/admin/survey/modules/mod_advanced_paradata/js/advanced_paradata.js @@ -0,0 +1,556 @@ +// Glavna funkcija, ki se vedno klice za logiranje +function logEvent(event_type, event, data){ + + //console.log(event_type + ' ' + event + ' ' + _session_id); + + // Pridobimo id sessiona na strani + var session_id = _session_id; + + // Pridobimo id ankete + var anketa = $('#srv_meta_anketa_id').val(); + + // Pridobimo trenutno stran + if (typeof srv_meta_grupa_id != 'undefined'){ + var page = srv_meta_grupa_id; + } + else if ($('#outercontainer').hasClass('intro')){ + var page = '-1'; + } + else if ($('#outercontainer').hasClass('concl')){ + var page = '-2'; + } + else{ + var page = '0'; + } + + // Pridobimo user id, recnum in jezik + var user = _usr_id; + var recnum = _recnum; + var language = _lang; + + // Zabelezimo cas dogodka + var timestamp = Date.now(); + + // Opcijski parameter data + data = data || ''; + + + // Pri submit oz unload eventu mora biti klic sinhron + if(event == 'unload_page'){ + $.ajax({ + type: 'POST', + url: '../main/survey/ajax.php?t=parapodatki&a=logData', + data: { + session_id: session_id, + anketa: anketa, + page: page, + usr_id: user, + recnum: recnum, + language: language, + + event_type: event_type, + event: event, + timestamp: timestamp, + + data: data + }, + /*success: success, + dataType: dataType,*/ + async: false + }); + } + else{ + $.post('../main/survey/ajax.php?t=parapodatki&a=logData', { + session_id: session_id, + anketa: anketa, + page: page, + usr_id: user, + recnum: recnum, + language: language, + + event_type: event_type, + event: event, + timestamp: timestamp, + + data: data + }); + } +} + + +// EVENTI, KI JIH SPREMLJAMO +$(function () { + + // LOAD PAGE + window.addEventListener('load', function () { + + var event_type = 'page'; + var event = 'load_page'; + + // Belezimo parametre za velikost in zoom + var data = { + devicePixelRatio: window.devicePixelRatio, + width: window.screen.width, + height: window.screen.height, + availWidth: window.screen.availWidth, + availHeight: window.screen.availHeight, + jquery_windowW: $(window).width(), + jquery_windowH: $(window).height(), + jquery_documentW: $(document).width(), + jquery_documentH: $(document).height(), + } + + // Logiramo load + logEvent(event_type, event, data); + + // Logiramo vidna vprasanja + //visibleQuestions(); + }); + + + // RESIZE + window.addEventListener('resize', function () { + + var data = { + pos_x: $(window).width(), + pos_y: $(window).height(), + value: window.devicePixelRatio + } + + var event_type = 'other'; + var event = 'resize'; + + // Logiramo scroll + logEvent(event_type, event, data); + + // Logiramo vidna vprasanja + //visibleQuestions(); + }); + + // PINCH ZOOM + var pinch_scaling = false; + var pinch_distance = 0; + window.addEventListener('touchstart', function (e) { + + // Zaznamo 2 prsta + if (e.touches.length === 2) { + pinch_scaling = true; + + // Izracunamo razdaljo med prstoma + pinch_distance = Math.hypot( + e.touches[0].screenX - e.touches[1].screenX, + e.touches[0].screenY - e.touches[1].screenY + ); + } + }); + window.addEventListener('touchend', function (e) { + + if(pinch_scaling){ + pinch_scaling = false; + + // Izracunamo razdaljo med prstoma + var pinch_distance2 = Math.hypot( + e.touches[0].screenX - e.changedTouches[0].screenX, + e.touches[0].screenY - e.changedTouches[0].screenY + ); + + // Preracunamo razliko v razdalji + var diff = pinch_distance2 - pinch_distance; + var zoom = Math.round((diff / pinch_distance * 100)); + + var data = { + value: zoom + } + + var event_type = 'other'; + var event = 'pinch_resize'; + + // Logiramo scroll + logEvent(event_type, event, data); + } + }); + + + // ORIENTATION CHANGE + window.addEventListener('orientationchange', function () { + + var value = ''; + + if(window.orientation == 90 || window.orientation == -90) + value = 'landscape'; + else + value = 'portrait'; + + var data = { + value: value + } + + var event_type = 'other'; + var event = 'orientation_change'; + + // Logiramo scroll + logEvent(event_type, event, data); + }); + + // SCROLL + var scroll_time_prev = 0; + window.addEventListener('scroll', function () { + + // Dobimo trenuten cas + var scroll_time = new Date().getTime(); + + // Ce je ze poteklo dovolj casa od prejsnjega zaznavanja + if ((scroll_time - scroll_time_prev > 50) || scroll_time_prev == 0) { + + var event_type = 'other'; + var event = 'scroll_page'; + + var data = { + pos_x: (window.pageXOffset || document.documentElement.scrollLeft) - (document.documentElement.clientLeft || 0), + pos_y: (window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0) + } + + // Logiramo scroll + logEvent(event_type, event, data); + + // Logiramo vidna vprasanja + //visibleQuestions(); + + // Shranimo cas za interval + scroll_time_prev = scroll_time; + } + }); + + // BLUR (leave to another tab etc..) + window.addEventListener('blur', function () { + + var event_type = 'other'; + var event = 'blur'; + + logEvent(event_type, event); + }); + + // FOCUS + window.addEventListener('focus', function () { + + var event_type = 'other'; + var event = 'focus'; + + logEvent(event_type, event); + }); + + // MOUSE CLICK + window.addEventListener('click', function (event) { + + var div_id = $(event.target).attr('id'); + + // Ce je id prazen najdemo prvega parenta z id-jem + if(div_id == null){ + div_id = $(event.target).closest('[id]').attr('id') + ' (parent)'; + } + + var data = { + pos_x: event.pageX, + pos_y: event.pageY, + div_type: event.target.tagName, + div_id: div_id, + div_class: $(event.target).attr('class') + } + + var event_type = 'other'; + var event_name = 'click'; + + logEvent(event_type, event_name, data); + + // Posebej shranimo se mouse movement do tega klika + movementClickEvent(event); + }); + + + + // INPUT TEXT, TEXTAREA FOCUS + $('input[type=text], textarea').bind('focus', function () { + + // Ce gre za textbox v selectu ga ignoriramo + if(!$(this).parent().hasClass('chzn-search')){ + + var event_type = 'vrednost'; + var event = 'text_enter'; + + var id = $(this).attr('id'); + var id_array = id.split('_'); + var spr_id = id_array[1]; + var vre_id = id_array[3]; + + var data = { + spr_id: spr_id, + vre_id: vre_id, + value: $(this).val() + } + + logEvent(event_type, event, data); + + + // Preverimo ce gre za polje drugo - potem oznacimo tudi checkbox/radio + if($(this).parent().parent().parent().hasClass('tip_1') || $(this).parent().parent().parent().hasClass('tip_2')){ + + event = 'radio_checkbox_change'; + + data = { + spr_id: spr_id, + vre_id: vre_id, + value: 1 + } + + logEvent(event_type, event, data); + } + } + }); + // INPUT TEXT, TEXTAREA BLUR + $('input[type=text], textarea').bind('blur', function () { + + // Ce gre za textbox v selectu ga ignoriramo + if(!$(this).parent().hasClass('chzn-search')){ + + var event_type = 'vrednost'; + var event = 'text_leave'; + + var id = $(this).attr('id'); + var id_array = id.split('_'); + var spr_id = id_array[1]; + var vre_id = id_array[3]; + + var data = { + spr_id: spr_id, + vre_id: vre_id, + value: $(this).val() + } + + logEvent(event_type, event, data); + } + }); + + // INPUT RADIO, CHECKBOX CHANGE + $('input[type=radio], input[type=checkbox]').bind('click', function () { + + var event_type = 'vrednost'; + var event = 'radio_checkbox_change'; + + var id = $(this).attr('id'); + var id_array = id.split('_'); + + // Ce gre za tabelo + if(id_array[2] == 'grid' || id_array[0] == 'grid'){ + var spr_id = id_array[1]; + var vre_id = id_array[3]; + + // Ce je 'value' gre za missing + if(spr_id == 'missing'){ + spr_id = id_array[3]; + vre_id = id_array[5]; + } + } + // Navadni radio oz. checkbox + else{ + var spr_id = id_array[1]; + var vre_id = id_array[3]; + + // Ce je 'value' gre za missing + if(spr_id == 'value'){ + spr_id = id_array[3]; + vre_id = id_array[5]; + } + } + + var val; + if ($(this).is(':checked')) + val = 1; + else + val = 0 + + var data = { + spr_id: spr_id, + vre_id: vre_id, + value: val + } + + logEvent(event_type, event, data); + }); + + // SELECT CHANGE + $('select').bind('change', function () { + + var event_type = 'vrednost'; + var event = 'select_change'; + + var id = $(this).attr('id'); + var id_array = id.split('_'); + var spr_id = id_array[1]; + var vre_id = $(this).val(); + + var data = { + spr_id: spr_id, + vre_id: vre_id, + value: vre_id + } + + logEvent(event_type, event, data); + }); + + + + // MOUSE MOVE + var movements = []; + var currentMovement = { + timeStart: 0, + timeEnd: 0, + duration: 0, + + startPosX: 0, + startPosY: 0, + endPosX: 0, + endPosY: 0, + + distance_traveled: 0, + prevPosX: 0, + prevPosY: 0 + } + + // Lovimo vse preimke miske + window.addEventListener('mousemove', function (event) { + var clicked = false; + movementTrack(event, clicked); + }); + + // Belezimo premik v array objektov + var time_prev = new Date().getTime(); + function movementTrack(event, clicked){ + + // Dobimo trenuten cas + var time = new Date().getTime(); + + // Ce je ze poteklo dovolj casa od prejsnjega zaznavanja + if (time - time_prev > 50 || clicked) { + + // Preverimo, ce je to ze nov premik - zaenkrat tretiramo nov premik ce je pavze vec kot 300ms + if(time - currentMovement.timeEnd > 300 || clicked){ + + // Dodamo trenuten premik v array premikov - trik da ne insertamo reference ampak dejansko kopijo objekta + if(currentMovement.timeStart !== 0 && currentMovement.startPosX !== undefined && currentMovement.endPosX !== undefined){ + movements.push(JSON.parse(JSON.stringify(currentMovement))); + } + + // Resetiramo trenuten premik in mu nastavimo vse parametre + currentMovement.timeStart = time; + currentMovement.timeEnd = time; + + currentMovement.startPosX = event.pageX; + currentMovement.startPosY = event.pageY; + + currentMovement.endPosX = event.pageX; + currentMovement.endPosY = event.pageY; + + currentMovement.distance_traveled = 0; + currentMovement.prevPosX = event.pageX; + currentMovement.prevPosY = event.pageY; + } + // Gre se za star premik - samo posodobimo end time in end position + else{ + currentMovement.timeEnd = time; + currentMovement.duration = time - currentMovement.timeStart; + + currentMovement.endPosX = event.pageX; + currentMovement.endPosY = event.pageY; + + // Izracunamo razdaljo prepotovano od prejsnjega premika + var a = currentMovement.prevPosX - event.pageX; + var b = currentMovement.prevPosY - event.pageY; + var distance = Math.sqrt(a*a + b*b); + + currentMovement.distance_traveled += distance; + currentMovement.prevPosX = event.pageX; + currentMovement.prevPosY = event.pageY; + } + + // Shranimo cas za interval + time_prev = time; + + /*console.log(currentMovement);*/ + } + } + + // Poklicemo ob vsakem kliku in shranimo podatke o premikanju med klikoma + function movementClickEvent(event) { + + var event_type = 'movement'; + var event = 'mouse_move'; + + var clicked = true; + movementTrack(event, clicked); + + // Loop cez vse premike + for (var i=0; i= containerTop) && (elemTop <= containerBottom) + && (elemBottom <= containerBottom) && (elemTop >= containerTop) ); + }*/ +}) \ No newline at end of file diff --git a/admin/survey/modules/mod_advanced_paradata/js/advanced_paradata_postTime.js b/admin/survey/modules/mod_advanced_paradata/js/advanced_paradata_postTime.js new file mode 100644 index 0000000..cc9d46b --- /dev/null +++ b/admin/survey/modules/mod_advanced_paradata/js/advanced_paradata_postTime.js @@ -0,0 +1,20 @@ +// EVENT LEAVE PAGE, ki se mora izvajati sinhrono (drugace se pri nekaterih browserjih izgubi) +$(function () { + + // LEAVE PAGE (gledamo unload, beforeunload, klik na submit, klik na back) + var leavePageFunction_called = false; + var leavePageFunction = function (){ + var event_type = 'page'; + var event = 'unload_page'; + + if(!leavePageFunction_called){ + logEvent(event_type, event); + leavePageFunction_called = true; + } + } + window.addEventListener('beforeunload', leavePageFunction); + window.addEventListener('unload', leavePageFunction); + $("input.next:submit").bind('click', leavePageFunction); + $("input.prev:button").bind('click', leavePageFunction); + +}) \ No newline at end of file diff --git a/admin/survey/modules/mod_advanced_paradata/js/sledenjeOpozoril.js b/admin/survey/modules/mod_advanced_paradata/js/sledenjeOpozoril.js new file mode 100644 index 0000000..899bc5e --- /dev/null +++ b/admin/survey/modules/mod_advanced_paradata/js/sledenjeOpozoril.js @@ -0,0 +1,264 @@ + +var spr_id_variable = []; //za sledenje opozoril: polje, ki hrani spr_id, kjer se pojavijo opozorila +var tip_opozorila = []; //za sledenje opozoril: polje, ki hrani tip reminderja/opozorila +var spr_id_indeks = 0; //za sledenje opozoril: indeks za polja, ki hranita spr_id, kjer se pojavijo opozorila in tip reminderja +var opozorila_sum = []; //za sledenje opozoril +var opozorila_num = []; //za sledenje opozoril +var opozorila_validation = []; //za sledenje opozoril + +var tip_opozorila_temp = []; +var validacijaZabelezena = []; +var zacetnaValidacijaZabelezena = 1; //belezi, ce se je zabelezila validacija ne dinamicno, brez da bi respondent kliknu na bilo kateri odgovor in sel neposredno na naslednjo stran ankete +var spremenljivkaVal = []; //polje, ki belezi katere spremenljivke imajo opozorilo val + + + +// ZAZNAMO PROŽENJE ALERTA +$(function () { + + var time_display; + + // remember the normal alert + var oldAlert = (function(){ return this.alert; }()), + oldConfirm = (function(){ return this.confirm; }()); + + // inject ourself into the window.alert and window.confirm globals + alert = function (msg) { + time_display = Date.now(); + + oldAlert.call(window, msg); + window.onAlert(msg); + }; + confirm = function (msg) { + time_display = Date.now(); + + var result = oldConfirm.call(window, msg); + window.onConfirm(msg, result); + + return result; + }; + + // these just chill and listen for events + window.onAlert = function (text) { + logAlert({text:text, type:'alert box', ignorable:0, action:'ok', time_display:time_display}); + }; + window.onConfirm = function (text, result) { + var action = result ? 'yes' : 'no'; + logAlert({text:text, type:'confirm box', ignorable:1, action:action, time_display:time_display}); + }; +}); + + + +// Logiramo alert (ob submitu) +function logAlert(box_data){ + + //console.log("Trenutna dolzina polja: "+spr_id_variable.length); + //console.log(box_data); + + var spremenljivkaVal = []; //polje, ki shranjuje spr_id spremenljivk s sprozenim val opozorilom + var tip_opozorila_tmp = []; + + spr_id_variable.forEach(function(variable, index) { + + // ce tip opozorila vsebuje vejico, pomeni, da belezi dva opozorila hkrati + // razbij opozorilo na dva dela + if(tip_opozorila[variable].includes(",")){ + var opozorilo = tip_opozorila[variable].split(","); + opozorilo[1] = opozorilo[1].substring(1); //odstrani presledek na zacetku opozorila + + //$.post('../main/survey/ajax.php?t=parapodatki&a=logData', {usr_id: _usr_id, what: opozorilo[0], what2: opozorilo[1], gru_id: page, anketa: srv_meta_anketa_id, spr_id_variable: variable}); + var event_type = 'alert'; + var event = 'alert'; + + opozorilo_type[0] = opozorilo[0].substring(4); + opozorilo_trigger_type[0] = opozorilo[0].substring(0, 3); + opozorilo_type[1] = opozorilo[1].substring(4); + opozorilo_trigger_type[1] = opozorilo[1].substring(0, 3); + + var data = { + type: opozorilo_type[0] + ' ' + opozorilo_type[1] + ' (' + box_data.type + ')', + trigger_id: variable, + trigger_type: opozorilo_trigger_type[0] + ' ' + opozorilo_trigger_type[1], + text: box_data.text, + ignorable: box_data.ignorable, + action: box_data.action, + time_display: box_data.time_display + }; + + logEvent(event_type, event, data); + } + else{ + //$.post('../main/survey/ajax.php?t=parapodatki&a=logData', {usr_id: _usr_id, what: tip_opozorila[variable], gru_id: page, anketa: srv_meta_anketa_id, spr_id_variable: variable}); + var event_type = 'alert'; + var event = 'alert'; + + var opozorilo_type = tip_opozorila[variable].substring(4); + var opozorilo_trigger_type = tip_opozorila[variable].substring(0, 3); + + // Ce gre za multigrid zabelezimo samo id vprasanja + if(variable.substring(0, 12) == '#vrednost_if'){ + + var spremenljivka_id = $(""+variable).closest('.spremenljivka').attr('id').substring(14); + + //variable = spremenljivka_id + '_' + variable.substring(13); + variable = spremenljivka_id; + } + + var data = { + type: opozorilo_type + ' (' + box_data.type + ')', + trigger_id: variable, + trigger_type: opozorilo_trigger_type, + text: box_data.text, + ignorable: box_data.ignorable, + action: box_data.action, + time_display: box_data.time_display + }; + + logEvent(event_type, event, data); + } + + //console.log("Spr_id opozorila: "+variable+", indeks "+index+", tip:"+tip_opozorila[variable]+" za user: "+_usr_id+" zacetnaValidacijaZabelezena: "+zacetnaValidacijaZabelezena); + + //ce se ne belezi prvic validacije in tip opozorila je validacija + if(zacetnaValidacijaZabelezena == 0 && tip_opozorila[variable].includes("val")) + { + spremenljivkaVal.push(variable); + + //ce se belezi dvojno opozorilo + if(tip_opozorila[variable].includes(",")){ + tip_opozorila_tmp[variable] = opozorilo[0]; + } + else{ + tip_opozorila_tmp[variable] = tip_opozorila[variable]; + } + } + }); + + spr_id_variable = []; // pucanje polja + tip_opozorila = []; + + if(spremenljivkaVal.length != 0){ + spremenljivkaVal.forEach(function(valSprem) { + spr_id_variable.push(valSprem); + tip_opozorila[valSprem] = tip_opozorila_tmp[valSprem]; + }); + } + + //console.log("Polje spremenljivkaVal: "+spremenljivkaVal.length); +} + + + +function dodaj_opozorilo_val(bol, id){ + + var spr_id = id.replace('#spremenljivka_', ''); + + //console.log("Tip opozorila prej:" + tip_opozorila[spr_id]); + + if(zacetnaValidacijaZabelezena == 1){ + zacetnaValidacijaZabelezena = 0; + } + else{ + } + + if(!validacijaZabelezena[spr_id]){ + spr_id_variable.push(spr_id); + } + + + var tip_alerta = ''; + + tip_alerta = 'val'; + validacijaZabelezena[spr_id] = 1; + spremenljivkaVal[spr_id] = spr_id; + + tip_opozorila[spr_id] = tip_alerta + ' ' + bol + ' alert'; +} + +function dodaj_opozorilo(alert_sum, alert_num, alert_validation, bol, id){ + + //console.log("Dodaj opozorilo"); + + var spr_id = id.replace('#spremenljivka_', ''); + + var tip_alerta = ''; + + if(alert_sum) tip_alerta = 'sum'; + if(alert_num) tip_alerta = 'num'; + + if(tip_alerta == ''){ + + // ce ni se nobenega opozorila zabelezenega za to spremenljivko + if(tip_opozorila[spr_id] == undefined){ + tip_opozorila[spr_id] = bol+' alert'; + spr_id_variable.push(spr_id); + } + else{ + //drugace, ce je zabelezeno kaksno opozorilo, po navadi, ko je validation + tip_opozorila_temp[spr_id] = bol+' alert'; + + //ce je prejsnje opozorilo enako trenutnemu + if(tip_opozorila[spr_id] == tip_opozorila_temp[spr_id]){ + + tip_opozorila[spr_id] = tip_opozorila_temp[spr_id]; + tip_opozorila_temp[spr_id] = ''; + + spr_id_variable.push(spr_id); + } + // drugace imamo dva razlicna opozorila, ki ju je potrebno zabeleziti + else if(validacijaZabelezena[spr_id] == 1){ + + tip_opozorila[spr_id] = tip_opozorila[spr_id]+', '+bol+' alert'; + tip_opozorila_temp[spr_id] = ''; + + //console.log("Dvojno opozorilo"); + } + } + } + else{ + // ce ni se nobenega opozorila zabelezenega za to spremenljivko + if(tip_opozorila[spr_id] == undefined){ + + tip_opozorila[spr_id] = tip_alerta+' '+bol+' alert'; + spr_id_variable.push(spr_id); + } + //drugace, ce je zabelezeno kaksno opozorilo, po navadi, ko je validation + else{ + tip_opozorila_temp[spr_id] = tip_alerta+' '+bol+' alert'; + + // ce je prejsnje opozorilo enako trenutnemu + if(tip_opozorila[spr_id] == tip_opozorila_temp[spr_id]){ + tip_opozorila[spr_id] = tip_opozorila_temp[spr_id]; + tip_opozorila_temp[spr_id] = ''; + spr_id_variable.push(spr_id); + } + // drugace imamo dva razlicna opozorila, ki ju je potrebno zabeleziti + else if(validacijaZabelezena[spr_id] == 1){ + tip_opozorila[spr_id] = tip_opozorila[spr_id]+', '+tip_alerta+' '+bol+' alert'; + tip_opozorila_temp[spr_id] = ''; + } + } + } +} + +function odstrani_opozorilo(id, alert_sum, alert_num, alert_validation){ + + //console.log("Odstrani"); + + var spr_id = id.replace('#spremenljivka_', ''); + + tip_opozorila.splice(spr_id, 1); //odstrani opozorilo iz polja + + if(alert_validation){ + + //odstrani iz polja zabelezeno validacijo + spr_id_variable.forEach(function(variable, index) { + if(variable == spremenljivkaVal[variable]){ + spr_id_variable.splice(index, 1); + } + }); + + validacijaZabelezena[spr_id] = 0; + } +} diff --git a/admin/survey/modules/mod_chat/class.SurveyChat.php b/admin/survey/modules/mod_chat/class.SurveyChat.php new file mode 100644 index 0000000..4f65b13 --- /dev/null +++ b/admin/survey/modules/mod_chat/class.SurveyChat.php @@ -0,0 +1,82 @@ + 0){ + $this->anketa = $anketa; + } + } + + + // Nastavitve chat-a (na kateri strani se prikaze...) + public function displaySettings(){ + global $lang; + + $row = SurveyInfo::getInstance()->getSurveyRow(); + + + echo '
'.$lang['settings'].''; + + // Koda za embed tawk chat widgeta + $code = ''; + $sql = sisplet_query("SELECT * FROM srv_chat_settings WHERE ank_id='".$this->anketa."'"); + if(mysqli_num_rows($sql) > 0){ + + $row = mysqli_fetch_array($sql); + $code = $row['code']; + } + echo ''.$lang['srv_chat_code'].':'; + echo ''; + + echo '

'; + + // Prikaz vklopa chata + echo ''.$lang['srv_chat_type'].':'; + echo ''; + echo ''; + echo ''; + + echo '

'; + + echo '
'; + + + // Gumb shrani + echo '
'; + echo ''; + echo '
'; + echo '
'; + } + + + public function ajax() { + + if(isset($_GET['a']) && $_GET['a'] == 'save_settings'){ + + $code = isset($_POST['code']) ? $_POST['code'] : ''; + $chat_type = isset($_POST['chat_type']) ? $_POST['chat_type'] : '0'; + + $sql = sisplet_query("INSERT INTO srv_chat_settings + (ank_id, code, chat_type) VALUES ('".$this->anketa."', '".$code."', '".$chat_type."') + ON DUPLICATE KEY UPDATE code='".$code."', chat_type='".$chat_type."'"); + if (!$sql) echo mysqli_error($GLOBALS['connect_db']); + } + + } +} \ No newline at end of file diff --git a/admin/survey/modules/mod_fieldwork/class.SurveyFieldwork.php b/admin/survey/modules/mod_fieldwork/class.SurveyFieldwork.php new file mode 100644 index 0000000..1026a93 --- /dev/null +++ b/admin/survey/modules/mod_fieldwork/class.SurveyFieldwork.php @@ -0,0 +1,126 @@ +sid = $sid; + + SurveyInfo::SurveyInit($this->sid); + $this->surveySettings = SurveyInfo::getInstance()->getSurveyRow(); + SurveyDataSettingProfiles :: Init($this->sid); + + $d = new Dostop(); + $this->isAnketar = $d->isAnketar(); + + } + + public function action ($action) { + switch ($action) { + case "neki": + die(); + break; + default: + $this->nastavitve(); + break; + } + } + + private function nastavitve () { + global $lang; + +?> +
+ + + + +sid ."'"); + + if (mysqli_num_rows ($result) == 0) { + echo $lang['srv_fieldwork_no_devices']; + } + else { + + echo ''; + + while ($r = mysqli_fetch_assoc ($result)) { +?> + + + + + + + + + +'; + } +?> + +

+
+ +
+ + + +
+ + +
+ + +
+ + +
+
+
+ +
+
+ + +
+
+
+ + 0) { + echo 'Podatki so uspešno uvoženi v novo anketo, odpri jo'; + } + else { + echo 'Pri uvažanju je prišlo do težave.'; + } + } + + } + + private function doImport () { + // ko bom prenesel sem iz /utils/ + } +} diff --git a/admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php b/admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php new file mode 100644 index 0000000..a8942f7 --- /dev/null +++ b/admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php @@ -0,0 +1,276 @@ + 0){ + $this->anketa = $anketa; + } + + // Check if we have data for countries + $sql = sisplet_query("SELECT COUNT(*) AS cnt FROM countries_locations", 'obj'); + if($sql->cnt > 0){ + $this->countryDB = true; + } + } + + + public function displayData(){ + global $lang; + + // Zakesiramo podatke o lokacijah + $this->calculateLocations(); + //var_dump($this->data); + + + // Opozorilo o nenatancnosti + echo '

'.$lang['srv_geoip_warning'].'

'; + + + echo '
'; + echo '
'; + + // Izpis tabele frekvenc + echo '
Naziv napraveGesloID ankete na napraviNumerusBriši
x
'; + + // Prva vrstica + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + // Vrstice s podatki + if(isset($this->data['all'])){ + + foreach($this->data['all'] as $country => $country_freq){ + + if($country !== 'all'){ + + // Frekvenca po drzavi + $country_percent = ($this->data['freq'] > 0) ? round($country_freq['freq'] / $this->data['freq'], 3) * 100 : 0; + + echo ''; + echo ''; + $cities = mb_convert_encoding($this->data['all'][$country]['cities'], "UTF-8", "ISO-8859-1"); + echo '' : ''); + echo ''; + echo ''; + echo ''; + + // Se frekvence po mestih + foreach($this->data['all'][$country]['cities'] as $city => $city_data){ + + $city_percent = ($this->data['freq'] > 0) ? round($city_data['cnt'] / $this->data['freq'], 3) * 100 : 0; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + } + } + } + + // Zadnja vrstica + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'.$lang['srv_geoip_country'].''.$lang['srv_geoip_city'].''.$lang['srv_geoip_freq'].'%
'.($country == '' ? ''.$lang['srv_geoip_unknown'].'' : mb_convert_encoding($country, "UTF-8", "ISO-8859-1")).''.(isset($country_freq['showMap']) ? ''.$country_freq['freq'].''.$country_percent.' %
'.($city == '' ? ''.$lang['srv_geoip_unknown'].'' : mb_convert_encoding($city, "UTF-8", "ISO-8859-1")).''.$city_data['cnt'].''.$city_percent.' %
'.$lang['hour_total'].''.$this->data['freq'].'100%
'; + + echo ''; + + // Google maps on right of table + if(count($this->countriesLocationsData)>0){ + + echo '
'; + + if(count($this->countriesLocationsData) > 1) + $this->displayNavigationMaps(); + + echo '
'; + + echo '
'; + + $cities = mb_convert_encoding($this->data['all']['all']['cities'], "UTF-8", "ISO-8859-1"); + + echo ''; + } + echo ''; + } + + + // Loop cez response in zackesiramo ip-je in lokacije + private function calculateLocations(){ + global $site_path; + global $lang; + + // Inicializiramo reader s knjiznico ip lokacij + $reader = new Reader($site_path.'admin/survey/modules/mod_geoIP/db/GeoLite2-City.mmdb'); + //$reader = new Reader($site_path.'admin/survey/modules/mod_geoIP/db/GeoLite2-Country.mmdb'); + + + $sql = sisplet_query("SELECT ip, preview, testdata, last_status, lurker + FROM srv_user + WHERE ank_id='".$this->anketa."' AND testdata='0' AND preview='0' AND deleted='0' + "); + while($row = mysqli_fetch_array($sql)){ + + // Ce locimo glede na status + //$index = $row['last_status'].'_'.$row['lurker']; + $index = 'all'; + + // Poskusimo ustvariti objekt z lokacijo za IP + $unknown_location = false; + try { + $location_object = $reader->city($row['ip']); + } + catch (Exception $e) { + //echo 'Error: ', $e->getMessage(); + $unknown_location = true; + } + + // Ce ni ip-ja v bazi gre za neznano lokacijo + if($unknown_location){ + $location_data['country_name'] = $lang['srv_unknown']; + $location_data['country_code'] = ''; + $location_data['city'] = $lang['srv_unknown']; + $location_data['longitude'] = ''; + $location_data['latitude'] = ''; + } + // Drugace preberemo iz knjiznice podatke o lokaciji + else{ + $location_data['country_name'] = $location_object->country->name; + $location_data['country_code'] = $location_object->country->isoCode; + $location_data['city'] = $location_object->city->name; + $location_data['longitude'] = $location_object->location->longitude; + $location_data['latitude'] = $location_object->location->latitude; + } + + // Frekvence po drzavah + if(isset($this->data[$index][$location_data['country_name']]['freq'])){ + + $this->data[$index][$location_data['country_name']]['freq']++; + + if($location_data['country_name']!='') + $this->countriesLocationsData[$location_data['country_name']]['cnt']++; + } + else{ + $this->data[$index][$location_data['country_name']]['freq'] = 1; + + //store coordinates for country + if($this->countryDB && $location_data['country_name'] != '' && $location_data['country_name'] != $lang['srv_unknown']){ + + $sqlc = sisplet_query("SELECT latitude, longitude FROM countries_locations WHERE country_code='".$location_data['country_code']."'", 'obj'); + + $this->countriesLocationsData[$location_data['country_name']]['cnt'] = 1; + $this->countriesLocationsData[$location_data['country_name']]['lat'] = $sqlc->latitude; + $this->countriesLocationsData[$location_data['country_name']]['lng'] = $sqlc->longitude; + } + } + + // Frekvence po mestih + if(isset($this->data[$index][$location_data['country_name']]['cities'][$location_data['city']])){ + $this->data[$index][$location_data['country_name']]['cities'][$location_data['city']]['cnt']++; + $this->data[$index]['all']['cities'][$location_data['city']]['cnt']++; + } + else{ + $this->data[$index][$location_data['country_name']]['cities'][$location_data['city']]['cnt'] = 1; + $this->data[$index]['all']['cities'][$location_data['city']]['cnt'] = 1; + + if($location_data['city'] != '' && $location_data['city'] != $lang['srv_unknown']){ + $this->data[$index][$location_data['country_name']]['cities'][$location_data['city']]['lat'] = floatval($location_data['latitude']); + $this->data[$index][$location_data['country_name']]['cities'][$location_data['city']]['lng'] = floatval($location_data['longitude']); + $this->data[$index]['all']['cities'][$location_data['city']]['lat'] = floatval($location_data['latitude']); + $this->data[$index]['all']['cities'][$location_data['city']]['lng'] = floatval($location_data['longitude']); + } + } + + // Mesto ni znano, imamo pa koordinate + if($location_data['city'] == '' && isset($location_data['longitude']) && $location_data['longitude'] != '' && isset($location_data['latitude']) && $location_data['latitude'] != ''){ + + if(isset($this->data[$index][$location_data['country_name']]['cities'][$location_data['city']][''.floatval($location_data['latitude']).floatval($location_data['longitude'])])){ + $this->data[$index][$location_data['country_name']]['cities'][$location_data['city']][''.floatval($location_data['latitude']).floatval($location_data['longitude'])]['cnt']++; + $this->data[$index]['all']['cities'][$location_data['city']][''.floatval($location_data['latitude']).floatval($location_data['longitude'])]['cnt']++; + } + else{ + $this->data[$index][$location_data['country_name']]['cities'][$location_data['city']][''.floatval($location_data['latitude']).floatval($location_data['longitude'])]['cnt'] = 1; + $this->data[$index][$location_data['country_name']]['cities'][$location_data['city']][''.floatval($location_data['latitude']).floatval($location_data['longitude'])]['lat'] = floatval($location_data['latitude']); + $this->data[$index][$location_data['country_name']]['cities'][$location_data['city']][''.floatval($location_data['latitude']).floatval($location_data['longitude'])]['lng'] = floatval($location_data['longitude']); + $this->data[$index]['all']['cities'][$location_data['city']][''.floatval($location_data['latitude']).floatval($location_data['longitude'])]['cnt'] = 1; + $this->data[$index]['all']['cities'][$location_data['city']][''.floatval($location_data['latitude']).floatval($location_data['longitude'])]['lat'] = floatval($location_data['latitude']); + $this->data[$index]['all']['cities'][$location_data['city']][''.floatval($location_data['latitude']).floatval($location_data['longitude'])]['lng'] = floatval($location_data['longitude']); + } + } + + if(isset($location_data['latitude']) && $location_data['latitude'] != ''){ + $this->data[$index][$location_data['country_name']]['showMap'] = 1; + $this->data[$index]['all']['showMap'] = 1; + } + + // Frekvenca vseh + if(isset($this->data['freq'])) + $this->data['freq']++; + else + $this->data['freq'] = 1; + } + } + + function displayNavigationMaps() { + global $lang; + + $countries = mb_convert_encoding($this->countriesLocationsData, "UTF-8", "ISO-8859-1"); + $cities = mb_convert_encoding($this->data['all']['all']['cities'], "UTF-8", "ISO-8859-1"); + + echo '
'; + echo ''; + echo '
'; + + echo '
'; + echo '
'; + } +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaClass.php b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaClass.php new file mode 100644 index 0000000..5bc9a66 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaClass.php @@ -0,0 +1,561 @@ +anketa = $anketa; + + //global + global $lang; + global $global_user_id; + $this->lang = $lang; + $this->user_id = $global_user_id; + + return $this; + } + + private static $_instance; + + public static function init($anketa) + { + if (!static::$_instance) + return (new AjaxHierarhija($anketa)); + + return static::$_instance; + } + + /** + * Shranjuje št. in ime nivoja + * + * @return html -> select -> option + */ + public function postNivoji() + { + $nivo = $_POST['nivo']; + $ime = $_POST['ime']; + + // tracking - beleženje sprememb + $this->trackingChanges(); + + sisplet_query("INSERT INTO srv_hierarhija_ravni (anketa_id, user_id, level, ime) VALUES ('" . $this->anketa . "', '" . $this->user_id . "', '" . $nivo . "', '" . $ime . "')"); + $nivo_id = mysqli_insert_id($GLOBALS['connect_db']); + + return $nivo_id; + } + + + /** + * Shranjuje id nivoja, in šifrant za sledeči nivo + * + * @return JSON + */ + public function postSifranti() + { + $idNivoja = $_POST['idNivoja']; + $imeSifranta = $_POST['imeSifranta']; + + // tracking - beleženje sprememb + $this->trackingChanges(); + + // V podatke shranimo samo kadar pošljemo vrednost polja + if (!empty($imeSifranta)) { + $sql_hs = sisplet_query("INSERT INTO srv_hierarhija_sifranti (hierarhija_ravni_id, ime) VALUES ('" . $idNivoja . "', '" . $imeSifranta . "')"); + $this->sqlError($sql_hs); + } + + //izbrišemo šifrante + $sql_vsi_sifranti = sisplet_query("SELECT ime FROM srv_hierarhija_sifranti WHERE hierarhija_ravni_id='" . $idNivoja . "' ORDER BY ime"); + $sifranti = array(); + while ($row = mysqli_fetch_row($sql_vsi_sifranti)) { + $sifranti[] = $row[0]; + } + + // vrnemo json seznam vseh šifrantov za sledeči nivo + return json_encode($sifranti); + } + + /** + * Select box spremeni v ul in ponudi možnost brisanje šifrantov + * + * @return JSON + */ + public function brisiSifrante() + { + $idNivoja = $_POST['idNivoja']; + + //izbrišemo šifrante + $sql_vsi_sifranti = sisplet_query("SELECT * FROM srv_hierarhija_sifranti WHERE hierarhija_ravni_id='" . $idNivoja . "' ORDER BY ime"); + $sifranti = array(); + while ($row = mysqli_fetch_assoc($sql_vsi_sifranti)) { + $sifranti[] = [ + 'id' => $row['id'], + 'ime' => $row['ime'] + ]; + } + + // vrnemo json seznam vseh šifrantov za sledeči nivo + return json_encode($sifranti); + } + + /** + * Delete šifrant + */ + public function izbrisiSifrant() + { + $idSifranta = $_POST['idSifranta']; + + // tracking - beleženje sprememb + $this->trackingChanges(); + + // Najprej preveri, če je v strukturi že uporabljen omenjen šifrant v kolikor je potem ga ne sme dovoliti izbrisati + $sql_result = sisplet_query("SELECT ID FROM srv_hierarhija_struktura WHERE hierarhija_sifranti_id='" . $idSifranta . "'"); + + // V kolkor je kak vpis potem šifrant obstaja, drugače pa ga lahko izbrišemo + if (mysqli_num_rows($sql_result) > 0) { + echo 1; + } else { + //izbriši šifrant + sisplet_query("DELETE FROM srv_hierarhija_sifranti WHERE id='" . $idSifranta . "'"); + } + } + + /** + * Pridobi število že vpisanih nivojev + */ + public function stNnivojev() + { + $sql = sisplet_query("SELECT COUNT(id) FROM `srv_hierarhija_ravni` WHERE anketa_id='" . $this->anketa . "'"); + echo $sql->fetch_row()[0]; + } + + public function obnoviHierarhijo() + { + $hierarhija = (isset($_POST['hierarhija']) ? $_POST['hierarhija'] : null); + $uporabniki = (isset($_POST['uporabniki']) ? $_POST['uporabniki'] : null); + $id_shranjene_strukture = (isset($_POST['id']) ? $_POST['id'] : null); + + // tracking - beleženje sprememb + $this->trackingChanges(); + + // Pobrišemo dosedanjo hierarhijo + $this->izbrisiVseRavni(); + + // preverimo, če je json + if ($this->isJson($hierarhija)) + $hierarhija = $this->isJson($hierarhija, 1); + + $kopiranje = HierarhijaKopiranjeClass::getInstance($this->anketa)->ustvariRavniInSifranteLahkoTudiStrukturo($hierarhija, $id_shranjene_strukture, $uporabniki); + + if ($kopiranje) { + // Vkolikor je bilo kopiranje uspešno shranimo še podatke srv_hierarhija_shrani + + // Pridobimo vse ravni in šifrante, ki smo jih vpisali skupaj z ID-ji; + return json_encode($this->pridobiVseRavniSifrante()); + } + + return 'Napaka pri kopiranju hierarhije'; + } + + // izbriše shranjeno hierarhijo + public function izbrisiHierarhijo() + { + $hierarhija_id = $_POST['id']; + + if (empty($hierarhija_id)) { + echo 'Ni mogoče izbrisati error'; + return false; + } + + // tracking - beleženje sprememb + $this->trackingChanges(); + + // Preverimo, če je omenjena hierarhija že kje uporabljena + $uporabljena_hierarhija = sisplet_query("SELECT id FROM srv_hierarhija_options WHERE option_name='srv_hierarhija_shrani_id' AND option_value='" . $hierarhija_id . "'", "obj"); + + if (empty($uporabljena_hierarhija) || sizeof($uporabljena_hierarhija) == 0) { + $sql = sisplet_query("DELETE FROM srv_hierarhija_shrani WHERE id='" . $hierarhija_id . "'"); + $this->sqlError($sql); + + echo 'success'; + }else{ + echo 'nothing'; + } + + } + + // Uvozi hierarhijo + public function uvoziHierarhijo() + { + $izrisi = '
'; + $izrisi .= '

' . $this->lang['srv_hierarchy_import_code'] . '

'; + $izrisi .= '
'; + $izrisi .= '
' . $this->lang['srv_hierarchy_import_example'] . '
'; + $izrisi .= ' +
+
+ +
+
+ +
+
+ '; + + $izrisi .= '
'; + $izrisi .= '
'; + + // Gumb za zapret popup + $izrisi .= '
'; + $izrisi .= '' . $this->lang['srv_close_profile'] . '' . "\n\r"; + $izrisi .= '
'; + + return $izrisi; + } + + /** + * Pridobimo vse shranjene hierarhije + * + * @return $array + */ + public function seznamVsehShranjenihHierarhij() + { + $sql = sisplet_query("SELECT * FROM srv_hierarhija_shrani WHERE user_id='" . $this->user_id . "'"); + $this->sqlError($sql); + + $data = array(); + if ($sql->num_rows > 0) { + while ($row = $sql->fetch_object()) { + $data[] = [ + 'id' => $row->id, + 'ime' => $row->ime, + 'anketa' => $row->anketa_id, + 'hierarhija' => $row->hierarhija, + 'struktura' => (!is_null($row->struktura) ? 1 : 0), + 'stEvalvirancev' => (!is_null($row->st_uciteljev) ? $row->st_uciteljev : 0), + 'stUporabnikov' => (!is_null($row->st_vseh_uporabnikov) ? $row->st_vseh_uporabnikov : 0) + ]; + } + } + + return $data; + } + + /** + * Aktivno/trenutno hierarhijo shrani v srv_hierarhija_shrani v stringu + */ + public function updateAktivnoHierarhijo() + { + $id = $_POST['id']; + $hierarhija = $_POST['hierarhija']; + + // tracking - beleženje sprememb + $this->trackingChanges(); + + $sql_insert = sisplet_query("UPDATE srv_hierarhija_shrani SET hierarhija='" . $hierarhija . "' WHERE id='" . $id . "' AND anketa_id='" . $this->anketa . "'"); + $this->sqlError($sql_insert); + } + + private function trackingChanges() + { + TrackingClass::update($this->anketa, '21'); + } + + /** + * Pobrišemo vse ravni in nastavitve v podatkovni bazi + */ + public function izbrisiVseRavni() + { + //Pobrišemo vse nastavitve za omenjeno anketo + sisplet_query("DELETE FROM srv_hierarhija_options WHERE anketa_id='" . $this->anketa . "'"); + + sisplet_query("DELETE FROM srv_hierarhija_ravni WHERE anketa_id='" . $this->anketa . "'"); + } + + /** + * Pridobimo seznam vseh ravni skupaj s šifrani in vrnemo v obliki polja + * + * @param $anketa_id ; + * @return array(); + */ + public function pridobiVseRavniSifrante() + { + + $sql = sisplet_query("SELECT id, level, ime, unikaten FROM `srv_hierarhija_ravni` WHERE anketa_id='" . $this->anketa . "'"); + + $polje = array(); + if ($sql->num_rows > 0) { + while ($row = $sql->fetch_object()) { + + //Poiščemo še šifrante za omenjen nivo + $sql_sifranti = sisplet_query("SELECT id, ime FROM `srv_hierarhija_sifranti` WHERE hierarhija_ravni_id='" . $row->id . "' ORDER BY ime"); + $sifranti = array(); + if ($sql_sifranti->num_rows > 0) { + while ($sifrant = $sql_sifranti->fetch_object()) { + $sifranti[] = [ + 'id' => $sifrant->id, + 'ime' => $sifrant->ime + ]; + } + } + + + $polje[] = [ + 'st' => $row->level, + 'ime' => $row->ime, + 'id' => $row->id, + 'unikaten' => $row->unikaten, + 'sifranti' => $sifranti + ]; + } + } + + return $polje; + } + + /** + * Preimenuje ime hierarhije iz seznama hierarhij + */ + public function preimenujHierarhijo() + { + $hierarhija_id = $_POST['id']; + $ime = strip_tags($_POST['ime']); + + // tracking - beleženje sprememb + $this->trackingChanges(); + + if (!empty($ime)) { + $sql = sisplet_query("UPDATE srv_hierarhija_shrani SET ime='" . $ime . "' WHERE id='" . $hierarhija_id . "' AND anketa_id='" . $this->anketa . "'"); + $this->sqlError($sql); + } + } + + /** + * Popravi ime nivoja ali, da je unikaten in se ga lahko uporabi samo 1x , ko je enkrat že vnešeno v bazo + */ + public function postPopraviNivoSsifranti() + { + $id_nivoja = $_POST['id_nivoja']; + $vsebina = $_POST['besedilo']; + $unikaten = $_POST['unikaten']; + + // tracking - beleženje sprememb + $this->trackingChanges(); + + if (!empty($vsebina)) { + sisplet_query("UPDATE srv_hierarhija_ravni SET ime='$vsebina' WHERE id='$id_nivoja' AND anketa_id='" . $this->anketa . "'"); + } + + if (!is_null($unikaten)) { + sisplet_query("UPDATE srv_hierarhija_ravni SET unikaten='$unikaten' WHERE id='$id_nivoja' AND anketa_id='" . $this->anketa . "'"); + } + } + + /** + * Briši cel nivo skupaj s šifranti + * + * @return integer + */ + public function brisiCelNivoSkupajSsifranti() + { + $id_nivoja = $_POST['id_nivoja']; + + // tracking - beleženje sprememb + $this->trackingChanges(); + + # Najprej preverimo, če je za ta nivo že zgrajena hierarhija + $hierarhija = sisplet_query("SELECT * FROM srv_hierarhija_struktura WHERE hierarhija_ravni_id='$id_nivoja'"); + $this->sqlError($hierarhija); + if ($hierarhija->num_rows == 0) { + // sql level + $sql_level = sisplet_query("SELECT level FROM srv_hierarhija_ravni WHERE id='" . $id_nivoja . "'"); + $this->sqlError($sql_level); + + $nivo_brisi = sisplet_query("DELETE FROM srv_hierarhija_ravni WHERE id='" . $id_nivoja . "'"); + $this->sqlError($nivo_brisi); + + //Vse ostale preštevilčimo + $sql_prestevilci = sisplet_query("SELECT id, level FROM `srv_hierarhija_ravni` WHERE anketa_id='" . $this->anketa . "' AND level>'" . $sql_level->fetch_row()[0] . "'"); + if ($sql_prestevilci->num_rows > 0) { + while ($row = $sql_prestevilci->fetch_object()) { + sisplet_query("UPDATE `srv_hierarhija_ravni` SET level='" . ($row->level - 1) . "' WHERE anketa_id='" . $this->anketa . "' AND id='" . $row->id . "'"); + } + } + + + $sql = sisplet_query("SELECT COUNT(id) FROM `srv_hierarhija_ravni` WHERE anketa_id='" . $this->anketa . "'"); + echo $sql->fetch_row()[0]; + } else { + echo 0; + } + } + + /** + * Možnost dodajanja komentarja k hierarhiji + * + * @return html + */ + public function htmlPopUpKomentarKhierarhiji() + { + $shrani_id = (new HierarhijaQuery)->getRowOptions($this->anketa, 'srv_hierarhija_shrani_id'); + if (!is_null($shrani_id)) + $shrani_id = $shrani_id->option_value; + + // Če komenatar že obstaja + $sql_shrani = sisplet_query("SELECT komentar FROM srv_hierarhija_shrani WHERE id='" . $shrani_id . "'"); + $komentar = $sql_shrani->fetch_object()->komentar; + + echo '
'; + echo '

Komentar k hierarhiji

'; + echo '
'; + + echo '
'; + echo ''; + echo '
'; + + echo '
'; + echo '
'; + + // Gumb za zapret popup in potrdit + echo '
'; + echo '' . $this->lang['srv_potrdi'] . '' . "\n\r"; + echo '
'; + + echo '
'; + echo '' . $this->lang['srv_close_profile'] . '' . "\n\r"; + echo '
'; + } + + /** + * Post komentar k hierarhiji + * + * @return integer + */ + public function postKomentarKhierarhiji() + { + // tracking - beleĹľenje sprememb + $this->trackingChanges(); + + $komentar = (!empty($_POST['komentar']) ? $_POST['komentar'] : null); + $shrani_id = (!empty($_POST['id']) ? $_POST['id'] : null); + + if (is_null($shrani_id)) + return 'Ni ID-ja.'; + + sisplet_query("UPDATE srv_hierarhija_shrani SET komentar='" . $komentar . "' WHERE id='" . $shrani_id . "' AND anketa_id='" . $this->anketa . "'"); + + echo 1; + } + + /** + * PrikaĹľi popup za nalaganje logotipa + * + * @return render HTML + */ + public function htmlPopUpUploadLogo() + { + global $site_url; + + $shrani_id = (new HierarhijaQuery)->getRowOptions($this->anketa, 'srv_hierarhija_shrani_id'); + + if (!is_null($shrani_id)) + $shrani_id = $shrani_id->option_value; + + // ÄŚe komenatar Ĺľe obstaja + $logo = sisplet_query("SELECT logo FROM srv_hierarhija_shrani WHERE id='" . $shrani_id . "'", "obj")->logo; + + echo '
'; + echo '

Logotip

'; + echo '
'; + if (!empty($logo)) + echo ''; + + echo '
'; + echo ' +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ '; + echo '
'; + echo '
'; + echo '
'; + } + + + /** + * Preverimo, ÄŤe je JSON + * + * @param (string) $string + * @return return true ali error + */ + private function isJson($string, $polje = 0) + { + if (is_string($string)) { + $array = json_decode(stripslashes($string)); + + if (json_last_error() == JSON_ERROR_NONE) { + if ($polje) + return $array; + + return true; + } + } + + return false; + } + + private function sqlError($sql) + { + if (!$sql) { + echo mysqli_error($GLOBALS['connect_db']); + die(); + } + + } + + /** + * Naredi JSON format + * + * @return json response + */ + public function jsonSerialize() + { + return $this->json; + } + +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php new file mode 100644 index 0000000..652cfa9 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php @@ -0,0 +1,243 @@ +isAjax()) + return redirect('/admin/survey/'); + } + + public function popupNew($id = null){ + $user = null; + + if(!empty($id)) { + $user = sisplet_query("SELECT id, u.name, u.surname, u.email, d.ustanova, d.aai_email FROM srv_hierarhija_dostop AS d LEFT JOIN users AS u ON u.id=d.user_id WHERE id='".$id."'", "obj"); + + if(empty($user->email)) + $user = null; + } + + global $lang; + echo '
'; + + echo '
'; + if(!empty($user)){ + echo '

Urejanje uporabnika '.$user->name.' ' .$user->surname.' za dostop do SA modula

'; + }else { + echo '

Vpiši uporabnika za dostop do SA modula

'; + } + echo '
'; + + // EMAIL + echo '
'; + echo '
'; + if(!empty($user)){ + echo ''; + }else{ + echo ''; + echo ''; + echo ''; + } + echo '
'; + + // Organizzacija + echo '
'; + echo '
'; + echo ''; + echo '
'; + + // Email za AAI dostop + echo '
'; + echo '
'; + echo ''; + echo '
'; + + echo '
'; + echo '
'; + + // Gumb za zapret popup in potrdit + echo '
'; + echo '
'; + if(!empty($user)) { + echo '' . $lang['srv_potrdi'] . '' . "\n\r"; + }else { + echo '' . $lang['srv_potrdi'] . '' . "\n\r"; + } + echo '
'; + + echo '
'; + echo '' . $lang['srv_close_profile'] . '' . "\n\r"; + echo '
'; + echo '
'; + + echo '
'; + + } + + public function save(){ + $email = (!empty($_POST['email']) ? $_POST['email'] : null); + $user_id = (!empty($_POST['id']) ? $_POST['id'] : null); + $ustanova = (!empty($_POST['ustanova']) ? $_POST['ustanova'] : null); + $aai_email = (!empty($_POST['aai']) ? $_POST['aai'] : null); + + $uporabnik = sisplet_query("SELECT id, email FROM users WHERE email='".$email."'", "obj"); + if($uporabnik->id != $user_id) + return false; + + sisplet_query("INSERT INTO srv_hierarhija_dostop (user_id, dostop, ustanova, aai_email) VALUES ('".$uporabnik->id."', '1', '".$ustanova."', '".$aai_email."')"); + + echo 'success'; + } + + public function update(){ + $user_id = (!empty($_POST['id']) ? $_POST['id'] : null); + $ustanova = (!empty($_POST['ustanova']) ? $_POST['ustanova'] : null); + $aai_email = (!empty($_POST['aai']) ? $_POST['aai'] : null); + + sisplet_query("UPDATE srv_hierarhija_dostop SET ustanova='".$ustanova."' , aai_email='".$aai_email."' WHERE user_id='".$user_id."'"); + + echo 'success'; + } + + public function delete(){ + $user_id = (!empty($_POST['id']) ? $_POST['id'] : null); + + sisplet_query("DELETE FROM srv_hierarhija_dostop WHERE user_id='".$user_id."'"); + } + + public function checkUserEmail(){ + $email = (!empty($_POST['email']) ? $_POST['email'] : null); + + if(!validEmail($email)) { + echo json_encode([ + 'tip' => 'error', + 'sporocilo' => 'NapaÄŤen email.' + ]); + + return FALSE; + } + + $uporabnik = sisplet_query("SELECT id, email FROM users WHERE email='".$email."'", "obj"); + + if(empty($uporabnik)) { + echo json_encode([ + 'tip' => 'error', + 'sporocilo' => 'Uporabnika z omenjenim emailom ni v bazi.' + ]); + + return FALSE; + } + + echo json_encode([ + 'tip' => 'success', + 'sporocilo' => 'Email pravilen, ker uporabnik obstaja v bazi.', + 'id' => $uporabnik->id + ]); + } + + public function show(){ + global $lang; + global $global_user_id; + global $admin_type; + + $user_id = (!empty($_POST['id']) ? $_POST['id'] : null); + + if(is_null($user_id)) + return false; + + + echo '
'; + echo '

'.$lang['srv_ankete'].'

'; + + echo '
    '; + $sql = sisplet_query("SELECT srv_anketa.id, srv_anketa.naslov FROM srv_dostop, srv_anketa WHERE srv_dostop.uid='$user_id' AND srv_dostop.ank_id=srv_anketa.id ORDER BY srv_anketa.edit_time DESC"); + while ($row = mysqli_fetch_array($sql)) { + echo '
  • '.$row['naslov'].'
  • '; + } + + echo '
'; + echo '
'; + + $user = sisplet_query("SELECT id, u.name, u.surname, u.email, d.ustanova, d.aai_email, u.type, u.status, DATE_FORMAT(d.created_at, '%d.%m.%Y - %H:%i') AS created, DATE_FORMAT(d.updated_at, '%d.%m.%Y - %H:%i') AS updated FROM srv_hierarhija_dostop AS d LEFT JOIN users AS u ON u.id=d.user_id WHERE user_id='".$user_id."'", "obj"); + + echo '
'; + echo '

'.$lang['user2'].'

'; + echo '

'; + switch ($user->type){ + case 0: + echo $lang['admin_manager']; + break; + case 1: + echo $lang['admin_manager']; + break; + case 2: + echo $lang['admin_clan']; + break; + default: + echo $lang['admin_narocnik']; + } + echo '

'; + echo '

'; + switch ($user->status){ + case 0: + echo $lang['srv_user_banned']; + break; + case 1: + echo $lang['srv_user_notbanned']; + break; + } + echo '

'; + echo '

'.$user->email.'

'; + echo '

'.$user->name.'

'; + echo '

'.$user->surname.'

'; + echo '

'.$user->ustanova.'

'; + echo '

'.$user->aai_email.'

'; + echo '

'.$user->created.'

'; + echo '

'.$user->updated.'

'; + + // Gumb za zapret popup in potrdit + echo '
'; + echo '
'; + echo '' . $lang['srv_close_profile'] . '' . "\n\r"; + echo '
'; + echo '
'; + echo '
'; + + + } + + + /** + * Preverimo, če je ajax request + * + * @return boolean + */ + private function isAjax() + { + if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') + return true; + + return false; + } + +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxSuperSifraClass.php b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxSuperSifraClass.php new file mode 100644 index 0000000..478094d --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxSuperSifraClass.php @@ -0,0 +1,69 @@ +anketa = $anketa; + + //global + global $lang; + global $global_user_id; + $this->lang = $lang; + $this->user_id = $global_user_id; + + // tracking - beleženje sprememb + TrackingClass::update($this->anketa, '22'); + + return $this; + } + + private static $_instance; + + public static function init($anketa) + { + if (!static::$_instance) + return (new AjaxSuperSifra($anketa)); + + return static::$_instance; + } + + + /** + * Shrani superšifro in prikaži v tabeli + * + * @return + */ + public function shrani() + { + $kode = ((!empty($_POST['kode']) && is_array($_POST['kode'])) ? $_POST['kode'] : null); + + if(is_null($kode)) + return ''; + + $ss = HierarhijaQuery::saveSuperSifra($this->anketa, $kode); + + echo json_encode($ss); + } + + public function getAll() + { + echo json_encode(HierarhijaQuery::vseSuperkodeSpripadajocimiHierarhijami($this->anketa)); + } + +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php new file mode 100644 index 0000000..628977f --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php @@ -0,0 +1,834 @@ +anketa = $anketa; + + // global variable + global $lang; + global $global_user_id; + $this->lang = $lang; + $this->user_id = $global_user_id; + $this->hierarhija_type = HierarhijaHelper::preveriTipHierarhije($this->anketa); + + return $this; + } + + private static $_instance; + + public static function init($anketa) + { + if (!static::$_instance) + return (new AjaxUporabniki($anketa)); + + return static::$_instance; + } + + /** + * Pridobimo vse celotno strukturo za prikaz v dataTables + * + * @return $array - večdimenzionalni + */ + public function getDataTablesPodatkeZaPrikazTabele() + { + // če je admin + if ($this->hierarhija_type < 5) { + $podatki = (new HierarhijaQuery())->hierarhijaArrayDataTables($this->anketa); + } else { + $hierarhija = (new HierarhijaQuery()); + $uporabnik = $hierarhija->preveriPravicoUporabnika($this->anketa); + $struktura = $hierarhija->poisciHierarhijoNavzgor($uporabnik->struktura_id); + + $podatki = (new HierarhijaQuery())->hierarhijaArrayDataTables($this->anketa, $struktura); + } + + return $podatki; + } + + /** + * Preverimo, če je omenjen šifrant že napisan za ustrezen nivo + * + * @return $array or null + */ + public function preveriVpisSifrantaZaSledeciNivo() + { + $level = $_POST['level']; + $hierarhija_sifranti_id = $_POST['hierarhija_sifranti_id']; + + // Če je parent_id = potem moramo pogledati na prvi nivo IS NULL + if (empty($_POST['parent_id'])) { + $parent = "parent_id IS NULL"; + } else { + $parent = "parent_id='" . $_POST['parent_id'] . "'"; + } + + $sql = sisplet_query("SELECT * FROM srv_hierarhija_struktura WHERE hierarhija_sifranti_id='" . $hierarhija_sifranti_id . "' AND level='" . $level . "' AND " . $parent); + + // imamo zapis v bazi, potem pogledamo še če obstajajo uporabniki + if ($sql->num_rows > 0) { + + $podatki = []; + while ($row = $sql->fetch_object()) { + + $podatki = [ + 'id' => $row->id, + 'level' => $row->level, + 'parent_id' => $row->parent_id, + 'hierarhija_sifranti_id' => $row->hierarhija_sifranti_id + + ]; + + $sql_user = sisplet_query(" + SELECT + users.id as id, + users.email as email, + users.name as name, + users.surname as surname + FROM + srv_hierarhija_struktura_users as u + LEFT JOIN + users ON users.id = u.user_id + WHERE + u.hierarhija_struktura_id = '" . $row->id . "' + "); + + // V kolikor so v bazi uporabniki potem pridobimo vse in zapišemo v polje + if ($sql_user->num_rows > 0) { + while ($user = $sql_user->fetch_object()) { + $podatki['uporabniki'][] = [ + 'id' => $user->id, + 'email' => $user->email, + 'ime' => $user->name, + 'priimek' => $user->surname + ]; + } + } + + } + + return ($podatki); + } + + return 0; + } + + /** + * Posodobimo sifrante za JS tree, če brišemo element iz drevesne strukture + * + * @return array + */ + public function getPosodobiSifranteZaJsTree() + { + $id = $_POST['id']; + + # Pridobimo strukturo navzgor od trenutnega ID-ja za vse šifrante + $nivoji = HierarhijaQuery::posodobiSifranteVrednostiGledeNaTrenutenIdStrukture($id); + + # Pridobimo max st nivojev + $max_st = sisplet_query("SELECT MAX(level) AS max FROM srv_hierarhija_ravni WHERE anketa_id='$this->anketa'")->fetch_object()->max; + + # Preverimo na katerem ID-ju (nivoju) se nahaja uporabnik, ki je kliknil na strukturo + $user_db = HierarhijaOnlyQuery::queryStrukturaUsersLevel($this->anketa, $this->user_id); + if ($user_db->num_rows == 0 && $this->hierarhija_type < 5) { + $nivoji['user'] = [ + 'id_strukture' => 'admin', + 'max_level' => $max_st + ]; + } + + if ($user_db->num_rows > 0) { + $user_db = $user_db->fetch_object(); + $nivoji['user'] = [ + 'id_strukture' => $user_db->struktura_id, + 'level' => $user_db->level, + 'max_level' => $max_st + ]; + } + + return $nivoji; + } + + /** + * Shrani strukturo v bazo (novi šifranti in uporabniki za sledeči nivo + * + * @return string or intiger + */ + public function shraniStrukturoSifrantovInUporabnikov() + { + // tracking - beleženje sprememb + $this->trackingChanges(); + + $vnos = $_POST['vnos']; + $osebe = $_POST['osebe']; + $hierarhija_id = null; + + if (empty($vnos)) + return 0; + + // Najprev shranimo strukturo, da pridobimo id za vpis oseb + foreach ($vnos as $nivo => $vpis) { + // Vpišemo samo nivoje večje od 0, ker post request vsebuje tudi polje 0, ki za naš ni relavanto + + if ($nivo > 0 && is_array($vpis) && empty($vpis['id'])) { + $ravni_id = $vpis['hierarhija_ravni_id']; + $sifrant_id = $vpis['hierarhija_sifranti_id']; + $level = $vpis['level']; + + // Če je prvi nivo potem je parent_id NULL, za vse ostale primere pa moramo met parenta, če naprej v hierarhiji ni parenta potem uporabimo $hierarhija_id - predhodni element vpisa + if ($level == 1) + $parent_id = null; + elseif ($level > 1 && empty($vpis['parent_id'])) + $parent_id = $hierarhija_id; + else + $parent_id = $vpis['parent_id']; + + // Vpis nove strukture, kjer dobimo ID in uporabimo potem za parent id + $hierarhija_id = sisplet_query("INSERT INTO + srv_hierarhija_struktura (anketa_id, hierarhija_ravni_id, parent_id, hierarhija_sifranti_id, level) + VALUES + ('" . $this->anketa . "', '" . $ravni_id . "', " . var_export($parent_id, true) . ",'" . $sifrant_id . "', ' " . $level . "')", "id"); + + // Vpišemo še uporabnike, če obstaja + if (!empty($osebe[$vpis['level']]) && is_array($osebe[$vpis['level']])) { + // Osebe so nanizane v poljih, vsaka oseba je podana preko polja, kjer [ 0 => email, 1=>ime, 2=>priimek], obvezen je samo prvi element + foreach ($osebe[$vpis['level']] as $oseba) { + $this->dodajUporabnikaVbazo($oseba, $hierarhija_id); + } + } + + } elseif ($nivo > 0 && is_array($vpis) && !empty($vpis['id'])) { + // Vpišemo samo uporabnika + if (!empty($osebe[$vpis['level']]) && is_array($osebe[$vpis['level']])) { + // Osebe so nanizane v poljih, vsaka oseba je podana preko polja, kjer [ 0 => email, 1=>ime, 2=>priimek], obvezen je samo prvi element + foreach ($osebe[$vpis['level']] as $oseba) { + $this->dodajUporabnikaVbazo($oseba, $vpis['id']); + } + } + } + } + + // Podatke shranimo še v srv_hierarhija_shrani + (new HierarhijaAjax($this->anketa))->shraniStrukturoHierarhijeVString(); + + return 'success'; + } + + /** + * pridobimo pravice trenutnega uporabnika + * + * level 1 - super admin ima vse pravice, ponavadi je lastnik ankete oz. jo je ustvaril in vključil hierarhijo + * levle 10 - običajni uporabnik, ki je dodan na določen nivo hierarhije + * + * @return array + */ + public function getUserLevelPermission() + { + // vrne polje leve, struktura_id in parent_id + $hierarhija = (new HierarhijaQuery()); + $uporabnik = $hierarhija->preveriPravicoUporabnika($this->anketa); + + if (is_array($uporabnik) && $uporabnik['uporabnik'] == 1) { + echo json_encode($uporabnik); + die(); + } + + $struktura = $hierarhija->poisciHierarhijoNavzgor($uporabnik->struktura_id); + + return [ + 'uporabnik' => $uporabnik, + 'struktura' => $struktura + ]; + } + + /** + * Pridobimo nivoje in šifrane za sledečo raven pri tem če ni super admin ga omejimo + * + * @return array - ['nivoji', 'sifranti', 'maxLevel] + */ + public function getSifrantiZaHierarhijaUserType() + { + if ($this->hierarhija_type < 5) { + // Pridobimo vse ravni in šifrante + $podatki = (new HierarhijaQuery())->getSifrantAdmin($this->anketa); + } else { + // Pridobimo nivo uporabnika, ki se nahaja najvišje v strukturi + $uporabnik = (new HierarhijaQuery())->preveriPravicoUporabnika($this->anketa); + + // Pridobimo vse ravni in šifrante samo od uporabnikovega nivoja/level navzdol + $podatki = (new HierarhijaQuery())->getSifrantAdmin($this->anketa, 999, $uporabnik->level); + } + + // Pridobimo max število nivojev, ki jih lahko vnesemo + $podatki['maxLevel'] = sisplet_query("SELECT MAX(level) as level FROM srv_hierarhija_ravni WHERE anketa_id='" . $this->anketa . "'")->fetch_object()->level; + + return $podatki; + } + + /** + * Dodamo uporabnika v bazo za sledečo strukturo + */ + private function dodajUporabnikaVbazo($oseba, $struktura_id, $last = false) + { + global $pass_salt; + + // Podatki o uporabniku + $email = (is_array($oseba) ? trim($oseba[0]) : $oseba); + $update = false; + + //Iz emaila pridobimo podatke + preg_match('/(\w+)((?:\.)(\w+))?/', $email, $matches); + + $name = !empty($oseba[1]) ? trim($oseba[1]) : ucfirst(mb_strtolower($matches[1])); + + // V kolikor je primek ga + if(!empty($oseba[2])) { + $surname = trim($oseba[2]); + $update = true; + }elseif(!empty($matches[3])){ + $surname = ucfirst(mb_strtolower($matches[3])); + }else{ + $surname = ''; + } + + + if ($email != '' && validEmail($email)) { + $sql_user = sisplet_query("SELECT id FROM users WHERE email='$email'"); + + if (mysqli_num_rows($sql_user) == 0) { + sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from) VALUES ('$name', '$surname', '$email', '" . base64_encode((hash(SHA256, '' . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1')"); + $user_id = mysqli_insert_id($GLOBALS['connect_db']); + } else { + $row = mysqli_fetch_array($sql_user); + $user_id = $row['id']; + + // V kolikor smo mi vnesli ime in prrimek potem popravimo tudi v bazi + if($update) + sisplet_query("UPDATE users SET name='".$name."', surname='".$surname."' WHERE id='".$user_id."'"); + } + + // V kolikor smo dodali nov email na zadnji nivo potem samo zamenjamo z obstoječim + if ($last) { + $query = sisplet_query("UPDATE srv_hierarhija_struktura_users SET user_id='" . $user_id . "' WHERE hierarhija_struktura_id='" . $struktura_id . "'"); + } else { + $query = sisplet_query("INSERT INTO srv_hierarhija_struktura_users (hierarhija_struktura_id, user_id) VALUES ('" . $struktura_id . "', '" . $user_id . "')"); + } + if (!$query) echo mysqli_error($GLOBALS['connect_db']); + + // Preverimo, če je uporabnik že dodan in če ni ga nato šele dodamo + $user_search = sisplet_query("SELECT * FROM srv_hierarhija_users WHERE user_id='" . $user_id . "' AND anketa_id='$this->anketa'"); + if ($user_search->num_rows == 0) { + $user_query = sisplet_query("INSERT INTO srv_hierarhija_users (user_id, anketa_id, type) VALUES ('" . $user_id . "', '" . $this->anketa . "', 10)"); + if (!$user_query) echo mysqli_error($GLOBALS['connect_db']); + } + + // Preverimo, če ima uporabnik za omenjeno anketo že pravice in mu nato dodamo pravice + HierarhijaQuery::dostopZaUporabnika($this->anketa, $user_id, 'insert'); + } + + } + + /** + * Pridobi vse uporabnike za določen nivo + * uporablja se prid DataTables edit mode, da izpiše uporabnike pod vsak nivo + * + * @var $id - struktura id + * @return $array + */ + public function pridobiUporabnikeZaDolocenNivoId() + { + // id strukture, da preverimo kateri uporabnikise nahajajo na omenjeni strukturi + $id = $_POST['id']; + + $uporabniki = (new HierarhijaQuery())->pridobiVseUporabnikeZaSpecificnoStrukturo($id); + + if (!is_array($uporabniki) || sizeof($uporabniki) == 0) + return 0; + + //Preverimo max število nivojev/ravni za omenjeno anketo + $max_level = sisplet_query("SELECT MAX(level) AS level FROM srv_hierarhija_ravni WHERE anketa_id='" . $this->anketa . "'")->fetch_object()->level; + + return [ + 'uporabniki' => $uporabniki, + 'maxLevel' => $max_level + ]; + } + + /** + * Shrani uporabnike na določen nivo strukture - pri DataTables edit mode + */ + public function postUporabnikeZaDolocenNivoId() + { + // tracking - beleženje sprememb + $this->trackingChanges(); + + $uporabniki = json_decode(stripslashes($_POST['uporabniki'])); + $struktura_id = $_POST['struktura']; + + if (sizeof($uporabniki) == 0) + return 'uporabnik'; + + // pobrišemo vse že dodane uporabnike + sisplet_query("DELETE FROM srv_hierarhija_struktura_users WHERE hierarhija_struktura_id='" . $struktura_id . "'"); + + // vpišemo nove uporabnike + foreach ($uporabniki as $uporabnik) { + sisplet_query("INSERT INTO srv_hierarhija_struktura_users (hierarhija_struktura_id, user_id) VALUES ('" . $struktura_id . "', '" . $uporabnik . "')"); + } + } + + /** + * Prikaži popup za vnos uporabnikov + * + * @return html + */ + public function getUsersImportPopup(){ + + // tracking - beleženje sprememb + $this->trackingChanges(); + + echo '
'; + echo '

' . $this->lang['srv_hierarchy_import_user_title'] . '

'; + echo '
'; + echo $this->lang['srv_hierarchy_import_user_text']; + + echo '
'; + echo ''; + echo '
'; + echo 'Seznam uÄŤiteljev:'; + + $vsi_ucitelji = $this->getAllUserInJson(true); + + if(!empty($vsi_ucitelji)) { + echo '
    '; + foreach($vsi_ucitelji as $ucitelj) { + echo '
  • '.$ucitelj['label'].'
  • '; + } + echo '
'; + } + echo '
'; + echo '
'; + + echo '
'; + echo '
'; + + // Gumb za zapret popup in potrdit + echo '
'; + echo '' . $this->lang['srv_potrdi'] . '' . "\n\r"; + echo '
'; + + echo '
'; + echo '' . $this->lang['srv_close_profile'] . '' . "\n\r"; + echo '
'; + } + + /** + * POST: vnos podatkov za vpis uporabnikov* + */ + public function postImportUsers(){ + $users = (!empty($_POST['users']) ? json_decode(stripslashes($_POST['users'])) : null); + + if(is_null($users)) + return 'null'; + + // Vsakega uporabnika pridobimo v svoj array + $users = explode(PHP_EOL, $users); + + // Pridobimo ID za izbrano shranjeno hierarhijo + $id = HierarhijaQuery::getOptions($this->anketa, 'srv_hierarhija_shrani_id'); + + // Pridobimo podatke od prej, ÄŤe niso NULL + $ze_vpisani_uporabniki = HierarhijaQuery::getHierarhijaShraniRow($id, 'uporabniki_list'); + + // ÄŚe imamo obstojeÄŤe upoabnik, jih sedajali nove + $polje = []; + if(!empty($ze_vpisani_uporabniki)) + $polje = unserialize($ze_vpisani_uporabniki); + + foreach($users as $user){ + $user = trim($user); + + $uporabnik = explode(',', $user); + + if(validEmail($uporabnik[0])) { + preg_match('/(\w+)((?:\.)(\w+))?/', $uporabnik[0], $matches); + + $name = ( !empty($uporabnik[1]) ? trim($uporabnik[1]) : ucfirst(mb_strtolower($matches[1])) ); + $surname = ( !empty($uporabnik[2]) ? trim($uporabnik[2]) : ucfirst(mb_strtolower($matches[2])) ); + + $polje[] = [ + 'id' => $user, + 'label' => $name. ' '.$surname.' - ('.$uporabnik[0].')' + ]; + } + } + + sisplet_query("UPDATE srv_hierarhija_shrani SET uporabniki_list='".serialize($polje)."' WHERE id='" . $id . "' AND anketa_id='" . $this->anketa . "'"); + + echo json_encode($polje); + } + + /** + * Pridobimo vse uporabnike + * + * @return json + */ + public function getAllUserInJson($return = false) + { + $id = HierarhijaQuery::getOptions($this->anketa, 'srv_hierarhija_shrani_id'); + $uporabniki = HierarhijaQuery::getHierarhijaShraniRow($id, 'uporabniki_list'); + + if($return) + return unserialize($uporabniki); + + echo json_encode(unserialize($uporabniki)); + } + + + /** + * Pop up obrazec za dodajanje uporabnikov na doloÄŤen nivo + * + * @return html + */ + public function htmlPopUpDodajUporabnikeZaDolocenNivoId() + { + + // tracking - beleĹľenje sprememb + $this->trackingChanges(); + + $struktura_id = $_POST['struktura']; + $last = $_POST['last']; + + echo '
'; + echo '

' . ($last ? $this->lang['srv_hierarchy_add_new_user_popup_last'] : $this->lang['srv_hierarchy_add_new_user_popup']) . '

'; + echo '
'; + echo($last ? $this->lang['srv_hierarchy_edit_users_last'] : $this->lang['srv_hierarchy_edit_users']); + echo '
'; + if ($last) { + echo ''; + } else { + echo ''; + } + echo '
'; + + echo '
'; + echo '
'; + + // Gumb za zapret popup in potrdit + echo '
'; + echo '' . $this->lang['srv_potrdi'] . '' . "\n\r"; + echo '
'; + + echo '
'; + echo '' . $this->lang['srv_close_profile'] . '' . "\n\r"; + echo '
'; + } + + /** + * Pošlji ID uporabnikov za vpis na strukturo + * + * @return boolean + */ + public function postDodatneUporabnikeNaNivoId() + { + $struktura = $_POST['struktura']; + $uporabniki = $_POST['uporabniki']; + $last = $_POST['last']; + + if (empty($struktura) || empty($uporabniki)) + return false; + + $this->trackingChanges(); + + $uporabniki = json_decode(stripslashes($uporabniki)); + + foreach ($uporabniki as $uporabnik) { + $this->dodajUporabnikaVbazo($uporabnik, $struktura, $last); + } + + return true; + } + + /** + * Kopiraj vrstico iz DataTables v urejanje + * + * @return array $struktura + */ + public function kopirajVrsticoStruktureIzDataTablesVFormo() + { + $idLastStrukture = $_POST['id']; + if (empty($idLastStrukture)) + return false; + + // tracking - beleženje sprememb + $this->trackingChanges(); + + return (new HierarhijaQuery())->poisciHierarhijoNavzgor($idLastStrukture); + } + + /** + * Pop up zamenjaj uporabnika v strukturi + * + * @return html + */ + public function htmlPopUpZamenjajUporabnikaVstrukturi() + { + echo '
'; + echo '
'; + echo '

' . $this->lang['srv_hierarchy_title_find_and_replace_user'] . '

'; + + echo '
'; + echo $this->lang['srv_hierarchy_text_find_and_replace_user']; + + echo '
'; + echo ''; + echo ''; + echo '' . $this->lang['srv_hierarchy_error_wrong_email_format'] . ''; + echo '
'; + + echo '
'; + echo ''; + echo ''; + echo '' . $this->lang['srv_hierarchy_error_wrong_email_format'] . ''; + echo '
'; + + echo '
'; + + echo '
'; + + echo '
'; + + // Gumb za zapret popup in potrdit + echo '
'; + echo '' . $this->lang['srv_potrdi'] . '' . "\n\r"; + echo '
'; + + echo ''; + + echo '
'; + echo '' . $this->lang['srv_close_profile'] . '' . "\n\r"; + echo '
'; + echo '
'; + } + + /** + * testno preveri, kolikokrat bi bil email zamenjan + * + * @return integer + */ + public function getTestnoPreveriStZamenjavEmailVstrukturi() + { + $email_za_zamenjavo = $_POST['find_email']; + + $user = sisplet_query("SELECT id, email FROM users WHERE email='" . $email_za_zamenjavo . "'", "obj"); + + if (sizeof($user) == 0) + return 'Ni v baz'; + + // Pridobimo uporabnika samo na zadnjem nivoju + $users_upravicen_do_evalvacije = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND users.id="' . $user->id . '" AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ')'); + + if (mysqli_num_rows($users_upravicen_do_evalvacije) > 0) { + echo mysqli_num_rows($users_upravicen_do_evalvacije); + } else { + echo 0; + } + } + + /** + * Briši uporabnika iz strukture pri DataTables pogledu oz. če je že vpisan v bazo + */ + public function brisiUporabnikaIzStrukture() + { + // tracking - beleženje sprememb + $this->trackingChanges(); + + if (empty($_POST['uporabnik_id']) || !is_numeric($_POST['uporabnik_id']) || empty($_POST['struktura_id'])) { + echo 'Ni mogoče'; + return false; + } + + $uporabnik_id = $_POST['uporabnik_id']; + $struktura_id = $_POST['struktura_id']; + + // Uporabnika najprej izbrišemo iz strukture hierarhije + $sql_user = sisplet_query("DELETE FROM srv_hierarhija_struktura_users WHERE hierarhija_struktura_id='" . $struktura_id . "' AND user_id='" . $uporabnik_id . "'"); + $this->sqlError($sql_user); + + // Preverimo, če je uporabnik še kje drugje dodan v hierarhiji, drugače ga moramo odstraniti še iz srv_hierarhija_users, da nima dostopa do ankete ob aktivaciji in tudi da ne prejme emaila za dostop + $this->preveriCeJeUporabnikPrisotenSeKjeVStrukturi($uporabnik_id); + } + + /** + * Zamenjaj email uporabnika v strukturi z novim emailom + * + * @param + * @return + */ + public function postZamenjajEmailVstrukturi() + { + // tracking - beleženje sprememb + $this->trackingChanges(); + + $find_email = $_POST['find_email']; + $replace_email = $_POST['replace_email']; + + // Validacija, če email obstaja + if (empty($find_email) && !validEmail($find_email) || empty($replace_email) && !validEmail($replace_email)) + return 'Manjka email'; + + // Poiščemo ID uporabnika + $user = sisplet_query("SELECT id, email FROM users WHERE email='" . $find_email . "'", "obj"); + + // Pridobimo uporabnika samo na zadnjem nivoju + $users_upravicen_do_evalvacije = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND users.id="' . $user->id . '" AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ')'); + + // Dodamo novega uporabnika v + if (mysqli_num_rows($users_upravicen_do_evalvacije) > 0) { + while ($evalviranec = $users_upravicen_do_evalvacije->fetch_object()) { + $this->dodajUporabnikaVbazo($replace_email, $evalviranec->id, true); + } + } + + // Preverimo, če je uporabnik, ki smo ga želeli zamenjati prisoten še kje + $this->preveriCeJeUporabnikPrisotenSeKjeVStrukturi($user->id); + + return 1; + } + + /** + * Briši element vhiertarhiji, ki se prikaže v data tables ali jstree + * + * @param + * @return + */ + public function brisiZadnjiElementVstrukturiHierarhije() + { + $id = $_POST['id']; + + #V kolikor je anketa aktivna potem brisanje ni več možno + if (SurveyInfo::getSurveyModules('hierarhija') == 2) + return 2; + + + // tracking - beleženje sprememb + $this->trackingChanges(); + + # Omenjen Id je tudi parent id, zato brisanje ni mogoče + $parent_obstaja = sisplet_query("SELECT id, parent_id FROM srv_hierarhija_struktura WHERE parent_id='$id'"); + if ($parent_obstaja->num_rows > 0) { + echo 'obstaja'; + die(); + } + +// # Pridobimo vse ID strukture hierarhije, ki so pod to drevesno strukturo, da lahko potem izbrišemo vse te elemente +// $el = (new HierarhijaQuery())->pridobiIdStruktureDoKonca($id, $this->anketa); +// # Dodamo naš $id in sortiramo po zadnjih elementih, ter brišemo hierarhijo od spodaj navzgor. Do našega ID-ja +// array_push($el, $id); +// rsort($el); + + + # Preverimo, če je bil dodan uporabnik na to strukturo + $user_id = sisplet_query("SELECT user_id FROM srv_hierarhija_struktura_users WHERE hierarhija_struktura_id='" . $id . "'", "obj"); + + # Izbrišemo uporabnika, ki je bil pri določeni strukturi v hierarhiji + $sql_us = sisplet_query("DELETE FROM srv_hierarhija_struktura_users WHERE hierarhija_struktura_id='" . $id . "'"); + $this->sqlError($sql_us); + + // V kolikor je bil dodan uporabnik na strukturo potem tudi odstranimo vse pravice tega uporabnika, če ga ni več v strukturi + if (!is_null($user_id)) + $this->preveriCeJeUporabnikPrisotenSeKjeVStrukturi($user_id->user_id); + + # Izbrišemo strukturo + $sql_hi = sisplet_query("DELETE FROM srv_hierarhija_struktura WHERE id='" . $id . "' AND anketa_id='" . $this->anketa . "'"); + $this->sqlError($sql_hi); + + # Pobriši opcijo, če ni več strukture + $st_vpisov = sisplet_query("SELECT COUNT(ID) as vsota FROM srv_hierarhija_struktura WHERE anketa_id='" . $this->anketa . "'", "obj"); + if ($st_vpisov->vsota == 0) + (new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa, 'vpisana_struktura', null, true); + } + + /** + * Shrani hierarhijo in prido ID polja v bazi + * + * @return integer + */ + public function shraniHierarhijo() + { + $ime = $_POST['ime']; + + // Za decoding je potrebno json_decode(stripslashes($_POST['hierarhija'])), za shranjevanje v bazo pustomo kar json format + $hierarhija = $_POST['hierarhija']; + + echo sisplet_query("INSERT INTO srv_hierarhija_shrani (anketa_id, user_id, ime, hierarhija) VALUES ('$this->anketa', '$this->user_id','$ime', '$hierarhija')", "id"); + } + + /** + * Preverimo, če je user id prisoten še kje v strukturi, v kolikor ga ni potem odstranimo pravice dostopa do ankete in strukture + * + * @param $user_id + * @return boolean + */ + private function preveriCeJeUporabnikPrisotenSeKjeVStrukturi($user_id) + { + $uporabnik_db = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND users.id="' . $user_id . '"'); + + // Uporabnik je še prisoten + if (mysqli_num_rows($uporabnik_db) > 0) + return true; + + // Uporabnik ni prisoten in odstranimo vse pravice za dostop do ankete in hierarhije + // Preverimo, če je uporabnik med privilegiji za dostop do hierarhije + $user_search = sisplet_query("SELECT id FROM srv_hierarhija_users WHERE user_id='" . $user_id . "' AND anketa_id='" . $this->anketa . "' AND type='10'", 'obj'); + if (sizeof($user_search) > 0) + sisplet_query("DELETE FROM srv_hierarhija_users WHERE id='" . $user_search->id . "'"); + + + // Preverimo, če ima uporabnik ima pravice za dostop do ankete in potem tudi to odstranimo + HierarhijaQuery::dostopZaUporabnika($this->anketa, $user_id, 'delete'); + + return false; + } + + private function trackingChanges() + { + TrackingClass::update($this->anketa, '22'); + } + + private function sqlError($sql) + { + if (!$sql) { + echo mysqli_error($GLOBALS['connect_db']); + die(); + } + + } + + +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php new file mode 100644 index 0000000..0ed3956 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php @@ -0,0 +1,1063 @@ +anketa = $anketa; + + if (!(new Dostop())->checkDostop($this->anketa)) + return false; + + if (!$this->isAjax()) + return redirect('/admin/survey/'); + + global $lang; + global $global_user_id; + global $site_url; + $this->lang = $lang; + $this->user_id = $global_user_id; + $this->hierarhija_type = HierarhijaHelper::preveriTipHierarhije($this->anketa); + $this->site_url = $site_url; + + } + + /** + * Preverimo, če je ajax request + * + * @return boolean + */ + private function isAjax() + { + if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') + return true; + + return false; + } + + //AJAX POST requesti + public function ajax() + { + // Preverimo ustreznost ankete + if ($_GET['a'] == 'preveri-ustreznost-ankete') + return $this->preveriUstreznostCeJePrimernaZaHierarhijo(); + + if ($_GET['a'] == 'get-all-hierarchy-library') + return $this->pridobiVseAnketeKiSoVknjizniciZaHierarhijo(); + + + /********* HIERARHIJA UREJANJE **************/ + /** + * Shranjuje št. in ime nivoja + * + * @return html -> select -> option + */ + if ($_GET['a'] === 'post_nivoji') + echo AjaxHierarhija::init($this->anketa)->postNivoji(); + + /** + * Shranjuje id nivoja, in šifrant za sledeči nivo + * + * @return JSON + */ + if ($_GET['a'] === 'post_sifranti') + echo AjaxHierarhija::init($this->anketa)->postSifranti(); + + /** + * Select box spremeni v ul in ponudi možnost brisanje šifrantov + * + * @return JSON + */ + if ($_GET['a'] === 'brisi_sifrante') + echo AjaxHierarhija::init($this->anketa)->brisiSifrante(); + + /** + * Delete šifrant + */ + if ($_GET['a'] === 'izbrisi_sifrant') + return AjaxHierarhija::init($this->anketa)->izbrisiSifrant(); + + /** + * Pridobi število že vpisanih nivojev + */ + if ($_GET['a'] === 'st_nivojev') { + $sql = sisplet_query("SELECT COUNT(id) FROM `srv_hierarhija_ravni` WHERE anketa_id='" . $this->anketa . "'"); + echo $sql->fetch_row()[0]; + } + + /** + * Popravimo ime nivoja v bazi + */ + if ($_GET['a'] == 'popravi_nivo_hierarhija') + return AjaxHierarhija::init($this->anketa)->postPopraviNivoSsifranti(); + + /** + * Briši nivo v hierarhiji preko AJAX ukaza + */ + if ($_GET['a'] == 'brisi_nivo_hierarhija') + return AjaxHierarhija::init($this->anketa)->brisiCelNivoSkupajSsifranti(); + + if ($_GET['a'] === 'json_nivoji_podatki') { + echo json_encode(AjaxHierarhija::init($this->anketa)->pridobiVseRavniSifrante()); + } + + // Komentar k izbrani hierarhiji + if ($_GET['a'] == 'komentar-k-hierarhiji') { + if ($_GET['m'] == 'get') + return AjaxHierarhija::init($this->anketa)->htmlPopUpKomentarKhierarhiji(); + + if ($_GET['m'] == 'post') + return AjaxHierarhija::init($this->anketa)->postKomentarKhierarhiji(); + } + + // Naloži logo kj hierarhiji + if ($_GET['a'] == 'upload-logo') { + if ($_GET['m'] == 'get') + return AjaxHierarhija::init($this->anketa)->htmlPopUpUploadLogo(); + + if ($_GET['m'] == 'delete') + return Hierarhija::brisiLogo($this->anketa); + } + /********* END HIERARHIJA UREJANJE **************/ + + + /***************************** HIERARHIJA UPORABNIKI ***********************/ + //Brišemo iz DataTables ali JsTree + if ($_GET['a'] == 'brisi_element_v_hierarhiji') + echo AjaxUporabniki::init($this->anketa)->brisiZadnjiElementVstrukturiHierarhije(); + + // Pridobimo podatke o sifrantih iz baze + if ($_GET['a'] == 'posodobi_sifrante') + echo json_encode(AjaxUporabniki::init($this->anketa)->getPosodobiSifranteZaJsTree()); + + /** + * Shranimo hierarhijo + */ + if ($_GET['a'] == 'shrani_hierarhijo') + return AjaxUporabniki::init($this->anketa)->shraniHierarhijo(); + + + /** + * Shrani strukturo hierarhije v tabelo srv_hierarhija_shrani + * + * @param (int) shrani + * @param (int) id + */ + if ($_GET['a'] == 'shrani-strukturo-hierarhije') { + if ($_POST['id'] != $this->anketa && empty($_POST['shrani'])) + return 'Ni shranjeno'; + + // tracking - beleženje sprememb + $this->trackingChanges(); + + $this->shraniStrukturoHierarhijeVString(); + } + + /** + * Vrnemo JSON podatke hierarhije za jsTree + */ + if ($_GET['a'] == 'json_jstree') { + $struktura = (new HierarhijaQuery())->json_jstree($this->anketa); + + echo json_encode($struktura); + } + + /** + * Podatki, ko nalagamo prvi element hierarhije + */ + if ($_GET['a'] == 'json_jstree_first_level') { + $hierarhija = (new HierarhijaOnlyQuery())->queryStruktura($this->anketa, null, ' AND parent_id IS NULL')->fetch_object(); + + echo '

Hierarhija

'; + echo '' . $hierarhija->ravni_ime; + if ($this->hierarhija_type > 4) + echo ' - ' . $hierarhija->sifrant_ime; + echo ': '; + } + + /** + * Update hierarhije, ki je trenutno aktivna + */ + if ($_GET['a'] == 'update-aktivno-hierarhijo') + return AjaxHierarhija::init($this->anketa)->updateAktivnoHierarhijo(); + + + if ($_GET['a'] == 'json_shranjene_hierarhije') + echo json_encode(AjaxHierarhija::init($this->anketa)->seznamVsehShranjenihHierarhij()); + + // vse nastavitve povezane s hierarhijo + if ($_GET['a'] == 'hierarhija-options') { + + if ($_GET['m'] == 'get') { + if (!empty($_POST['option_name'])) { + echo (new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa, $_POST['option_name'], null, null, false); + return ''; + } + + return json_encode((new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa)); + } + + if ($_GET['m'] == 'save') { + $option = $_POST['option_name']; + $value = (!empty($_POST['option_value']) ? $_POST['option_value'] : 'false'); + + // tracking - beleženje sprememb + $this->trackingChanges(); + + if (!empty($option)) + (new HierarhijaQuery())->saveHierarhijaOptions($this->anketa, $option, $value); + } + } + + // pridobimo hierarhijo iz JSON in pobrišemo staro ali pa samo dopišemo nove nivoje in šifrante + if ($_GET['a'] == 'obnovi-hierarhijo') + echo AjaxHierarhija::init($this->anketa)->obnoviHierarhijo(); + + + // izbriše shranjeno hierarhijo + if ($_GET['a'] == 'izbrisi-hierarhijo') + return AjaxHierarhija::init($this->anketa)->izbrisiHierarhijo(); + + + // izbriši trenutno shranjene ravni + if ($_GET['a'] == 'izbrisi_vse_ravni') { + // tracking - beleženje sprememb + $this->trackingChanges(); + return AjaxHierarhija::init($this->anketa)->izbrisiVseRavni(); + } + + // preimenuj hierarhijo + if ($_GET['a'] == 'preimenuj-hierarhijo') { + $this->trackingChanges(); + return AjaxHierarhija::init($this->anketa)->preimenujHierarhijo(); + } + + // Uvoz hierarhije + if ($_GET['a'] == 'uvozi-hierarhijo') + echo AjaxHierarhija::init($this->anketa)->uvoziHierarhijo(); + + + // pridobimo celotno strukturo šifrantov za prikaz v tabeli + if ($_GET['a'] == 'get-datatables-data') { + $polje = [ + 'data' => AjaxUporabniki::init($this->anketa)->getDataTablesPodatkeZaPrikazTabele() + ]; + + echo json_encode($polje); + } + + // Ukazi za brisanje + if ($_GET['a'] == 'brisi') { + // Briši uporabnika iz baze srv_hierarhija_struktura_users in srv_hierarhija_users (tukaj ima pravico do ankete) + if ($_GET['m'] == 'uporabnika') + return AjaxUporabniki::init($this->anketa)->brisiUporabnikaIzStrukture(); + + } + + // pridobimo podatke iz srv_hierarhija_shrani + if ($_GET['a'] == 'pridobi-shranjeno-hierarhijo-bool') { + $id = (!empty($_POST['id']) ? $_POST['id'] : null); + $polje = (!empty($_POST['polje']) ? $_POST['polje'] : null); + + if (is_null($id)) + return ''; + + $polje = HierarhijaQuery::getHierarhijaShraniRow($id, $polje); + + + echo(!is_null($polje) ? 1 : 0); + } + + + /** + * Gradnja hierarhije + */ + if ($_GET['a'] == 'gradnja-hierarhije') { + /** + * Uvoz uporabnikov preko tekstovnega polaj + */ + if ($_GET['m'] == 'import-user') { + // PPrikaži popup za uvoz uporabnikov + if ($_GET['s'] == 'get') + return AjaxUporabniki::init($this->anketa)->getUsersImportPopup(); + + if ($_GET['s'] == 'getAll') + return AjaxUporabniki::init($this->anketa)->getAllUserInJson(); + + // Pošlji podatke za shranjevanje + if ($_GET['s'] == 'post') + return AjaxUporabniki::init($this->anketa)->postImportUsers(); + } + + + /** + * Preveri pravice uporabnika in v kolikor ni admin tudi njegove nivoje, ki so nad njim + * + * Preveri, če gre za admina in v tem primeru vrne samo uporabnik=1, drugače vrne objekt s podatki o levele, parent_id, struktura_id + * @return json + */ + if ($_GET['m'] == 'get-user-level') + echo json_encode(AjaxUporabniki::init($this->anketa)->getUserLevelPermission()); + + + /** + * Pridobimo nivoje in šifrane za sledečo raven, vrenomo polje ['nivoji', 'sifranti'] + * + * @return json + */ + if ($_GET['m'] == 'get-sifranti') + echo json_encode(AjaxUporabniki::init($this->anketa)->getSifrantiZaHierarhijaUserType()); + + + /** + * Preveri, če je omenjen šifrant že napisan na nivo in če je pridobi podatke o uporabnikih + * @return json object + */ + if ($_GET['m'] == 'preveri-sifrant-za-nivo') + echo json_encode(AjaxUporabniki::init($this->anketa)->preveriVpisSifrantaZaSledeciNivo()); + + + /** + * Shranimo vse nove šifrante in tudi uporabnike, ki so dodani k novim šifrantom + */ + if ($_GET['m'] == 'post-struktura') + AjaxUporabniki::init($this->anketa)->shraniStrukturoSifrantovInUporabnikov(); + + /** + * Pridobi uporabnike, ki so dodani na specifični nivo + * @params $id - struktura id + * @return json + */ + if ($_GET['m'] == 'get-uporabniki') + echo json_encode(AjaxUporabniki::init($this->anketa)->pridobiUporabnikeZaDolocenNivoId()); + + /** + * Pošljemo id uporabnikov in id strukture, da ponovno shranimo druge uporabnike v bazo + */ + if ($_GET['m'] == 'post-uporabniki') + return AjaxUporabniki::init($this->anketa)->postUporabnikeZaDolocenNivoId(); + + /** + * Popup z vsebino, kjer se urejajo uporabniki za posamezni nivo / textarea za dodajanje novega uporabnika + * + * @return html + */ + if ($_GET['m'] == 'uredi-uporabnike-v-strukturi') + return AjaxUporabniki::init($this->anketa)->htmlPopUpDodajUporabnikeZaDolocenNivoId(); + + + /** + * Pošljemo dodano dodane uporab + * + * @param + */ + if ($_GET['m'] == 'post-dodatne-uporabnike-k-strukturi') + return AjaxUporabniki::init($this->anketa)->postDodatneUporabnikeNaNivoId(); + + /** + * Kopiranje vrstice hierarhije iz DataTables ponovno v možnost urejanja + * + * @param (int) id - id zadnjega elementa strukture + * @return json + */ + if ($_GET['m'] == 'kopiranje-vrstice') + echo json_encode(AjaxUporabniki::init($this->anketa)->kopirajVrsticoStruktureIzDataTablesVFormo()); + + /** + * Poišči uporabnika glede na vpisan email in ga zamnjaj z novim emailom. + */ + if ($_GET['m'] == 'zamenjaj-uporabnika-v-strukturi') + return AjaxUporabniki::init($this->anketa)->htmlPopUpZamenjajUporabnikaVstrukturi(); + + /** + * Pridobimo število oseb, ki jih je potrebno zamenjati + */ + if ($_GET['m'] == 'post-st-zamenjav') + return AjaxUporabniki::init($this->anketa)->getTestnoPreveriStZamenjavEmailVstrukturi(); + + /** + * Uporabnika v strukturi zamenjaj z novim + * Zamenjamo samo na zadnjem nivoju, prejšnjega pa izbrišemo iz sistema + */ + if ($_GET['m'] == 'post-zamenjaj-uporabnika-z-novim') + echo AjaxUporabniki::init($this->anketa)->postZamenjajEmailVstrukturi(); + /***************************** HIERARHIJA UPORABNIKI ***********************/ + + } + + /** + * Aktivacija ankete in generiranje sistemskih vprašanj za Hierarhijo + */ + if ($_GET['a'] == 'aktivacija_ankete') { + if (SurveyInfo::getSurveyModules('hierarhija') == 1) { + // tracking - beleženje sprememb + $this->trackingChanges(); + + // Sistemsko vprašanje prestavimo na prvo mesto VLOGA v kolikor ni + $this->postaviVlogoNaPrvoMestoInIzbrisiCeJeKakNivo(); + + //pridobimo vse nivoje za omenjeno anketo, ker potrebujemo število nivojov in imena nivojev + $nivoji = (new HierarhijaOnlyQuery())->getRavni($this->anketa); + + //preštevilčimo vsa vprašnja na prvi strani za število nivojev pustimo samo vlogo na prvem mestu + (new HierarhijaAjax($this->anketa))->prestevilciBranching($nivoji->num_rows); + + //Pridobimo gru_id od vloge, ker je na isti strani + $grup_id = HierarhijaOnlyQuery::getGrupaId($this->anketa, 1); + + $vrstni_red = 2; + while ($nivo = $nivoji->fetch_object()) { + //vnesemo v srv_spremenljivke in srv_branching + $naslov = $nivo->level . ". " . $nivo->ime; + $variabla = 'nivo' . $nivo->level; + + $spr = [$grup_id, $naslov, $variabla, '3', $vrstni_red]; + $sql_sifranti = (new HierarhijaOnlyQuery())->getSamoSifrant($nivo->id); + + (new HierarhijaQuery())->insertSpremenljivkaBranching($spr, $sql_sifranti, $this->anketa); + + $vrstni_red++; + } + + //Popravimo vrednost pri anleketi, da je sedaj hierarhija enako 2 = je že bila aktivirana + $anketa_id = SurveyInfo::getInstance()->getSurveyColumn('id'); + sisplet_query("UPDATE srv_anketa_module SET vrednost='2' WHERE ank_id='" . $anketa_id . "'"); + + $b = new Branching($anketa_id); + $b->repare_branching(); + + // Shranimo podatke kdaj in kdo je aktiviral hierarhijo + (new HierarhijaQuery())->saveHierarhijaOptions($this->anketa, 'uporabnik_aktiviral_hierarhijo', $this->user_id); + (new HierarhijaQuery())->saveHierarhijaOptions($this->anketa, 'cas_aktivacije_hierarhije', date('d.m.Y, G:i')); + + // KO se izdelajo polja za anketo se potem tudi posreduje email za učitelje oz. zadnji nivo + Hierarhija::aktivacijaAnketePosljiEmail($this->anketa); + } + } + + /** + * Statusi in generiranje superšifre + */ + if($_GET['a'] == 'super-sifra'){ + + //Shrani superšifro + if ($_GET['m'] == 'shrani') + return AjaxSuperSifra::init($this->anketa)->shrani(); + + //Shrani superšifro + if ($_GET['m'] == 'getAll') + return AjaxSuperSifra::init($this->anketa)->getAll(); + + } + + /* Ostalo */ + if ($_GET['a'] == 'ostalo') { + //Obvesti managerje + if ($_GET['m'] == 'obvesti-managerje') { + // tracking - beleženje sprememb + $this->trackingChanges(); + + $this->obvestiManagerjeSendEmail(); + } + + if ($_GET['m'] == 'preview-mail') { + // tracking - beleženje sprememb + $this->trackingChanges(); + + return $this->predogledEmailaZaUciteljeAliManagerje(); + } + + if ($_GET['m'] == 'opcije') { + // tracking - beleženje sprememb + $this->trackingChanges(); + + return $this->posodobiAliVnesiVtabeloOpcije(); + } + + if ($_GET['m'] == 'poslji-email-samo-uciteljem') { + // tracking - beleženje sprememb + $this->trackingChanges(); + + return $this->posljiElektronskoSamoUciteljem(); + } + } + } + + /** + * Prestavimo vlogo na prvo stran in rvo mesto v kolikor, bi slučajno bila zmaknjena, kje drugje v anketi + */ + private function postaviVlogoNaPrvoMestoInIzbrisiCeJeKakNivo() + { + //Preverimo, če je sistemsko vprašanje vloga že ustvarjeno + $grup_ids = sisplet_query("SELECT id, vrstni_red FROM srv_grupa WHERE ank_id='" . $this->anketa . "' ORDER BY vrstni_red", "obj"); + + $prva_stran_group_id = null; + + // gremo po vseh straneh, da preverimo, če je kje vloga + foreach ($grup_ids as $grup_id) { + $sql_vpisane_spr = sisplet_query("SELECT id, gru_id, variable, vrstni_red FROM srv_spremenljivka WHERE gru_id='" . $grup_id->id . "' AND variable='vloga'", "obj"); + + // Pridobimo Group ID za prvo stran + if ($grup_id->vrstni_red == 1) + $prva_stran_group_id = $grup_id->id; + + // Vloga je na prvi strani vendar ne na prvem mestu, zato jo postavimo na prvo mesto ali, če je na katerikoli drugi strani jo tudi postzavimo na prvo mesto + if (!empty($sql_vpisane_spr) && ($sql_vpisane_spr->vrstni_red > 1 || $sql_vpisane_spr->gru_id != $prva_stran_group_id)) { + sisplet_query("UPDATE srv_branching SET vrstni_red = '1' WHERE ank_id='" . $this->anketa . "' AND element_spr='" . $sql_vpisane_spr->id . "'"); + sisplet_query("UPDATE srv_spremenljivka SET vrstni_red = '1', gru_id = '" . $prva_stran_group_id . "' WHERE id='" . $sql_vpisane_spr->id . "'"); + } + } + } + + private function trackingChanges() + { + TrackingClass::update($this->anketa, '20'); + } + + +// /** +// * Funkcija, ko poišče parent id, zanka gre od prvega nivoja do predzadnjega, ki je parent ID +// * +// * @param array $nivoId +// * @param int $velikost +// * @return int $parent_id +// */ +// protected $nivoId; +// protected $velikost; +// +// private function poisciPrentId($nivoId, $velikost) +// { +// $parent_id = null; +// for ($i = 0; $i < ($velikost - 1); $i++) { +// $nivo = explode('-', $nivoId[$i]); +// $search = ' AND hr.level=' . $nivo[0] . ' AND hs.id=' . $nivo[1] . (!empty($parent_id) ? " AND str.parent_id='$parent_id'" : ''); +// if ($i == 0) +// $search = ' AND hr.level=' . $nivo[0] . ' AND hs.id=' . $nivo[1]; +// $parent_id = (new HierarhijaOnlyQuery())->queryStruktura($this->anketa, null, $search)->fetch_object()->id; +// } +// +// return $parent_id; +// } + + protected $sql; + + public function sqlError($sql) + { + if (!$sql) { + echo mysqli_error($GLOBALS['connect_db']); + die(); + } + + } + + + /** + * Funkcija preštevilci vrstni red vprašanj samo na prvi strani, ker bomo tam dodajali sistemske spremenljivke, vlogo pustimo na prvem mestu + */ + protected $st_prestevilcenja; + + public function prestevilciBranching($st_prestevilcenja = 0, $vloga_prestevilci = false) + { + // Pridobi id srv_grupa - vsa sistemska vprašanaj bodo na strani 1 + $grup_id = HierarhijaOnlyQuery::getGrupaId($this->anketa, 1); + + if (empty($grup_id)) + die('Group ID is null!'); + + // Pogleda za že vnesene spremenljivke na prvi strani in povečamo vrstni red za št. nivojev, ki bodo naše sistemske spremenljivke srv_spremenljivke + $vpisane_spr = sisplet_query("SELECT id, gru_id, variable, vrstni_red FROM srv_spremenljivka WHERE gru_id='" . $grup_id . "' AND variable!='vloga' ORDER BY vrstni_red", "obj"); + + // povečamo vrstni red pri srv_spremenljivke + if (!is_null($vpisane_spr) && sizeof($vpisane_spr) > 0) { + // ker prvi je še vedno vloga, ko se aktivira anketo + $i = 2; + if (!empty($vpisane_spr->id)) { + $vrstni_red = $st_prestevilcenja + $i; + sisplet_query("UPDATE srv_spremenljivka SET vrstni_red='" . $vrstni_red . "' WHERE id='" . $vpisane_spr->id . "'"); + } else { + foreach ($vpisane_spr as $spr) { + $vrstni_red = $i + $st_prestevilcenja; + $sql_spremenljivka = sisplet_query("UPDATE srv_spremenljivka SET vrstni_red='" . $vrstni_red . "' WHERE id='" . $spr->id . "'"); + $this->sqlError($sql_spremenljivka); + $i++; + } + } + } + + $vloga_je = ''; + if (!$vloga_prestevilci) { + // Pridobi spremenljivka id za vlogo in ga ne šteje pri srv_branchingu + $sql_vloga_id = sisplet_query("SELECT id, gru_id, variable, vrstni_red FROM srv_spremenljivka WHERE gru_id='" . $grup_id . "' AND variable='vloga' ORDER BY vrstni_red LIMIT 0,1", "obj")->id; + $vloga_je = " AND element_spr!='" . $sql_vloga_id . "'"; + } + + // Pridobi branching brez vloge, ker vloga mora ostati na prvem mestu + $vpisan_branch = sisplet_query("SELECT * FROM srv_branching WHERE ank_id='$this->anketa' " . $vloga_je . " ORDER BY vrstni_red", "obj"); + + //povečamo vrstni red tudi pri srv_branching + if (!is_null($vpisan_branch) && sizeof($vpisan_branch) > 0) { + if (!empty($vpisan_branch->ank_id)) { + $vrstni_red = $st_prestevilcenja + 2; + sisplet_query("UPDATE srv_branching SET vrstni_red='" . $vrstni_red . "' WHERE element_spr='" . $vpisan_branch->element_spr . "' AND ank_id='" . $this->anketa . "'"); + } else { + foreach ($vpisan_branch as $branch) { + $vrstni_red = $branch->vrstni_red + ($st_prestevilcenja + 1); + $sql_branching = sisplet_query("UPDATE srv_branching SET vrstni_red='" . $vrstni_red . "' WHERE element_spr='" . $branch->element_spr . "' AND ank_id='" . $this->anketa . "'"); + $this->sqlError($sql_branching); + } + } + + } + } + + /** + * Preverimo, če je JSON + * + * @param (string) $string + * @return return true ali error + */ + public function isJson($string, $polje = 0) + { + if (is_string($string)) { + $array = json_decode(stripslashes($string)); + + if (json_last_error() == JSON_ERROR_NONE) { + if ($polje) + return $array; + + return true; + } + } + + return false; + } + + /** + * Iz vgnezdenega polja izdela vrstice z vsemi nivoji, če nekje ni podatka potem izdela prazna polja do konca + * @return array + */ + public function array_flatten($array, $koncniArray = []) + { + + foreach ($array as $key => $value) { + if (is_array($value) && $key != 0) + return $this->array_flatten($value, $koncniArray); + + } + $koncniArray[] = $array; + +// d($koncniArray); + return $koncniArray; + + foreach ($array as $key => $row) { + if (is_array($row)) { + return $this->array_flatten($row, $return); + } else { + $return[] = $row; + } +// if (count($row) == count($row, COUNT_RECURSIVE)) +// $row = $this->array_flatten($row); + + + $return[] = $array; + } + + return $return; + } + + + /** + * Shrani trenutno strukturo v srv_hierarhija_shrani + * + * @param + * @return + */ + public function shraniStrukturoHierarhijeVString() + { + // tracking - beleženje sprememb + $this->trackingChanges(); + + if (empty($this->anketa)) + return 'false'; + + // ID shranjene strukture + $id = (new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa, 'srv_hierarhija_shrani_id', null, null, false); + + // Celotno strukturo skopiramo v string/serialize() + $struktura_string = HierarhijaKopiranjeClass::getInstance($this->anketa)->get(true); + + // Kadar še nimamo vpisano strukturo ali izbrišemo vse uporabnike, vedno shranimo potem NULL + if (sizeof($struktura_string) == 0) + return sisplet_query("UPDATE srv_hierarhija_shrani SET struktura = NULL WHERE id='" . $id . "' AND anketa_id='" . $this->anketa . "'"); + + // Shrani strukturo + $sql_insert = sisplet_query("UPDATE srv_hierarhija_shrani SET struktura='" . $struktura_string . "' WHERE id='" . $id . "' AND anketa_id='" . $this->anketa . "'"); + $this->sqlError($sql_insert); + + // Prešteje število uporabnikov na zadnjem nivoju + $users_upravicen_do_evalvacije = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ')'); + $st_upravicencev_do_evalvacije = mysqli_num_rows($users_upravicen_do_evalvacije); + + // Število vseh uporabnikov v hierarhiji + $vseh_uporabnikov = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa); + $st_vseh_uporabnikov = mysqli_num_rows($vseh_uporabnikov); + + sisplet_query("UPDATE srv_hierarhija_shrani SET st_uciteljev='" . $st_upravicencev_do_evalvacije . "' WHERE id='" . $id . "' AND anketa_id='" . $this->anketa . "'"); + sisplet_query("UPDATE srv_hierarhija_shrani SET st_vseh_uporabnikov='" . $st_vseh_uporabnikov . "' WHERE id='" . $id . "' AND anketa_id='" . $this->anketa . "'"); + } + + public function sendMail($email, $content = null, $subject = null) + { + if (empty($email)) + return false; + + try { + $MA = new MailAdapter($this->anketa, $type='account'); + $MA->addRecipients($email); + $MA->sendMail(stripslashes($content), $subject); + } catch (Exception $e) { + print_r('Email ni bil poslan: ' . $e); + error_log("Email ni bil poslan: $e"); + } + } + + /** + * Pošlji email za managerje, ki so na hiearhiji + * + * @return string + */ + public function obvestiManagerjeSendEmail() + { + $managerji = (!empty($_POST['managerji']) ? $_POST['managerji'] : null); + + if (sizeof($managerji) > 0) { + foreach ($managerji as $user_id) { + $email = sisplet_query("SELECT email FROM users WHERE id='" . $user_id . "'", "obj")->email; + + $subject = 'Dostop do gradnje samooevalvacije - 1ka.si'; + $content = $this->lang['srv_hierarchy_manager_email_1']; + $content .= '

' . $this->lang['srv_hierarchy_manager_email_2'] . '»' . SurveyInfo::getInstance()->getSurveyColumn('naslov') . '«' . $this->lang['srv_hierarchy_manager_email_3'] . '' . $this->site_url . '

'; + + //ZakljuÄŤek emaila + $content .= '

' . $this->lang['srv_hierarchy_manager_email_4'] . '' . $this->site_url . '.' . $this->lang['srv_hierarchy_manager_email_5']; + $content .= '»' . $email . '«' . $this->lang['srv_hierarchy_manager_email_6'] . '

'; + + // Podpis + $signature = Common::getEmailSignature(); + $content .= $signature; + + $this->sendMail($email, $content, $subject); + } + } + + return 'success'; + } + + + /** + * Vrni html predogleda emaila za uÄŤitelje ali managerje + * + * @return html + */ + public function predogledEmailaZaUciteljeAliManagerje() + { + if (empty($_POST['vrsta'])) + return null; + + // Kodo za uÄŤence pokaĹľemo, samo kadar ni podatka v bazi + if (HierarhijaQuery::getOptionsPosljiKode($this->anketa) == 'nikomur' && SurveyInfo::getSurveyModules('hierarhija') < 2) { + + echo '
' . $this->lang['srv_hierarchy_preview_none'] . '
'; + + } else { + + $vrsta = $_POST['vrsta']; + + echo '
'; + echo '

' . ($vrsta == 1 ? $this->lang['srv_hierarchy_preview_email_teacher_header'] : $this->lang['srv_hierarchy_preview_email_manager_header']) . '

'; + echo '
'; + + // email uÄŤitelji + if ($vrsta == 1) { + $koda_za_resevanje_ankete = HierarhijaQuery::getOptionsPosljiKode($this->anketa); + + echo $this->lang['srv_hierarchy_teacher_email_1']; + echo '

' . $this->lang['srv_hierarchy_teacher_email_2'] . '»' . SurveyInfo::getSurveyTitle() . '«' . $this->lang['srv_hierarchy_teacher_email_3'] . '' . $this->site_url . 'sa

'; + + echo '
'; + echo ''; + echo ' + '; + + // Koda samo za ucence + if (SurveyInfo::getSurveyModules('hierarhija') == 2 || in_array($koda_za_resevanje_ankete, ['vsem', 'ucitelju'])) + echo ''; + + // V kolikor nimamo nikakršne izbere potem posredujemo kodo tudi za učence + if (in_array($koda_za_resevanje_ankete, ['vsem', 'ucencem'])) + echo ''; + + echo ''; + echo ''; + echo ''; + + echo ''; + echo ''; + + if (SurveyInfo::getSurveyModules('hierarhija') == 2 || in_array($koda_za_resevanje_ankete, ['vsem', 'ucitelju'])) + echo ''; + + if (in_array($koda_za_resevanje_ankete, ['vsem', 'ucencem'])) + echo ''; + echo ''; + + echo ''; + echo '
HierarhijaKoda za uÄŤiteljaKoda za uÄŤence
Struktura hierarhije # # # # # # # # # #

'; + + //Zaključek emaila + // V kolikor se emailpošlje samo učiteljem potem se skrije možnost za dostop učiteljem + $onemogocenDostopUcitelju = (new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa, 'onemogoci_dostop_uciteljem', NULL, NULL, FALSE); + + if (is_null($onemogocenDostopUcitelju) && in_array($koda_za_resevanje_ankete, ['ucitelju'])) { + echo '

' . $this->lang['srv_hierarchy_teacher_email_4'] . '' . $site_url . '' . $this->lang['srv_hierarchy_teacher_email_5']; + echo '»' . $uporabnik->email . '«' . $this->lang['srv_hierarchy_teacher_email_6'] . '

'; + } + + } + + + // email managerji + if ($vrsta == 2) { + echo $this->lang['srv_hierarchy_manager_email_1']; + echo '

' . $this->lang['srv_hierarchy_manager_email_2'] . '»' . SurveyInfo::getInstance()->getSurveyColumn('naslov') . '«' . $this->lang['srv_hierarchy_manager_email_3'] . '' . $this->site_url . '

'; + + //ZakljuÄŤek emaila + echo '

' . $this->lang['srv_hierarchy_manager_email_4'] . '' . $this->site_url . '.' . $this->lang['srv_hierarchy_manager_email_5']; + echo '»#elektronski naslov uporabnika#«' . $this->lang['srv_hierarchy_manager_email_6'] . '

'; + } + + // Podpis + $signature = Common::getEmailSignature(); + echo $signature . '

'; + + echo ''; + echo ''; + } + + // Gumb za zapret popup in potrdit + echo '
'; + echo '' . $this->lang['srv_close_profile'] . '' . "\n\r"; + echo '
'; + + } + + /** + * Preverimo, če vprašanja obstajajo in če vsebuje samo dovoljena vprašanja + * + * @return int 1 or 0; + */ + public function preveriUstreznostCeJePrimernaZaHierarhijo() + { + + if(!HierarhijaHelper::preveriDostop($this->anketa)){ + echo 'dostop'; + return false; + } + + + // Preverimo, če je že kakšno vprašanje v anketi ali ni nič + $napaka = HierarhijaQuery::preveriBranchingCeJeKakoVprasanje($this->anketa); + + // Izberemo prevzeto anketo, ker v bazi še ni vprašanj + if ($napaka == 1) + echo 'privzeta'; + + // Ne moremo aktivirati modula, ker vsebuje napačen tip + if ($napaka == 2) + echo 'napacen-tip'; + + if ($napaka == 3) + echo 'samo-besedilni-tip'; + + if ($napaka == 9) + echo 'ponovna-aktivacija'; + + if ($napaka == 'ok') + echo 'ok'; + + } + + /** + * Pridobimo vse ankete, ki so v knjižnici za hierarhijo + * + * @return HTML + */ + public function pridobiVseAnketeKiSoVknjizniciZaHierarhijo() + { + global $site_url; + global $hierarhija_folder_id; + + $ime_mape = sisplet_query("SELECT * FROM srv_library_folder where id='" . $hierarhija_folder_id . "'", "obj")->naslov; + $ankete_v_knjiznici = sisplet_query("SELECT * FROM srv_library_anketa WHERE folder='" . $hierarhija_folder_id . "'", "obj"); + + if (empty($ime_mape) && sizeof($ankete_v_knjiznici) == 0) { + echo 'Knjižnica je prazna.'; + return null; + } + + echo '

' . $ime_mape . '

'; + echo '
    '; + + if (is_array($ankete_v_knjiznici) && empty($ankete_v_knjiznici->ank_id)) { + foreach ($ankete_v_knjiznici as $anketa) { + $srv_anketa = sisplet_query("SELECT id, naslov FROM srv_anketa WHERE id='" . $anketa->ank_id . "'", "obj"); + + if(!empty($srv_anketa->naslov)) { + echo '
  • '; + echo ' '; + echo ''; + echo ' + + + + '; + echo ''; + echo '
  • '; + } + } + } elseif (is_object($ankete_v_knjiznici)) { + $srv_anketa = sisplet_query("SELECT id, naslov FROM srv_anketa WHERE id='" . $ankete_v_knjiznici->ank_id . "'", "obj"); + + if(!empty($srv_anketa->naslov)) { + echo '
  • '; + echo ' '; + echo ' + + + + '; + echo ''; + echo '
  • '; + } + } + + echo '
'; + + } + + /** + * Posodobi, vnesi ali briši iz tabele srv_hierarhija_options + * + * @return + */ + public function posodobiAliVnesiVtabeloOpcije() + { + $name = (!empty($_POST['name']) ? $_POST['name'] : null); + $value = (!empty($_POST['value']) ? $_POST['value'] : null); + $method = (!empty($_POST['method']) ? $_POST['method'] : null); + + if (empty($name)) + return false; + + if ($method == 'delete') { + sisplet_query("DELETE FROM srv_hierarhija_options WHERE anketa_id='" . $this->anketa . "' AND option_name='" . $name . "'"); + + // Pri ocijah izbrišemo "onemogoci_dostop_uciteljem" potem moramo v tabeli srv_dostop dodati dostop za vse te učitelje + if ($name == 'onemogoci_dostop_uciteljem') + $this->preveriDostopDoAnkete('insert'); + + echo 'Delete'; + return true; + } + + // Vsekakor preverimo, če podatek že obstaja v bazi + $obstaja = sisplet_query("SELECT id FROM srv_hierarhija_options WHERE anketa_id='" . $this->anketa . "' AND option_name='" . $name . "'", "obj"); + if (!is_null($obstaja) && sizeof($obstaja) > 0) + $method = 'put'; + + if ($method == 'put') { + sisplet_query("UPDATE srv_hierarhija_options SET option_value='" . $value . "' WHERE anketa_id='" . $this->anketa . "' AND option_name='" . $name . "'"); + echo 'Update'; + return true; + } + + sisplet_query("INSERT INTO srv_hierarhija_options (anketa_id, option_name, option_value) VALUES ($this->anketa, '" . $name . "', '" . $value . "')"); + + // Pri ocijah dodamoo "onemogoci_dostop_uciteljem" potem moramo v tabeli srv_dostop izbrisati vsem učiteljem dostop + if ($name == 'onemogoci_dostop_uciteljem') + $this->preveriDostopDoAnkete('delete'); + + echo 'Insert'; + } + + /** + * Prteverimo, če imajo učitelji na hierarhiji dostop drugače jih dodamo ali odstranimo + * + * @param string $tip + */ + + private function preveriDostopDoAnkete($tip = null) + { + // Vsi uporabniki na zadnjem nivoju + $users_na_zadnjem_nivoju = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ') GROUP BY users.id'); + + if ($tip == 'insert') { + while ($uporabnik = $users_na_zadnjem_nivoju->fetch_object()) { + HierarhijaQuery::dostopZaUporabnika($this->anketa, $uporabnik->user_id, 'insert'); + } + } + + if ($tip == 'delete') { + while ($uporabnik = $users_na_zadnjem_nivoju->fetch_object()) { + HierarhijaQuery::dostopZaUporabnika($this->anketa, $uporabnik->user_id, 'delete'); + } + } + } + + + /** + * Pošlji vabilo samo učiteljem, če jim predhodno ni bilo poslano + * + * @return string + */ + private function posljiElektronskoSamoUciteljem() + { + + Hierarhija::posljiEmailSkodamiUcencemAliSamoUciteljem($this->anketa); + + HierarhijaQuery::saveOptions($this->anketa, 'obvesti_samo_ucitelje', 1); + + return true; + } + + +} + + diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php new file mode 100644 index 0000000..a322a5d --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php @@ -0,0 +1,2617 @@ + array('seq' => '0', 'spr' => 'undefined', 'grd' => 'undefined')); # array drugih variable, kamor shranimo spr, grid_id, in sequenco + public $variabla2 = array('0' => array('seq' => '0', 'spr' => 'undefined', 'grd' => 'undefined')); # array drugih variable, kamor shranimo spr, grid_id, in sequenco + + public $variablesList = null; # Seznam vseh variabel nad katerimi lahko izvajamo meanse (zakeširamo) + + public $_CURRENT_STATUS_FILTER = ''; # filter po statusih, privzeto izvažamo 6 in 5 + + public $_HAS_TEST_DATA = false; # ali anketa vsebuje testne podatke + + public $doValues = true; # checkbox Prikaži vrednosti + + private $sessionData; # podatki ki so bili prej v sessionu - za nastavitve, ki se prenasajo v izvoze... + + + public function __construct($sid) + { + global $global_user_id; + + if (is_null($sid)) + $sid = $_GET['anketa']; + + // v kolikor ni ID ankete potem nič ne prikazujemo + if ((int)$sid <= 0) { + echo 'Invalid Survey ID!'; + exit(); + } + + // ID ankete + $this->anketa = $sid; + + // Preveri, če ia parameter id strukture + $this->pregledAnalizeSamoZaEnoStrukturo(); + + # polovimo vrsto tabel (aktivne / neaktivne) + SurveyInfo::getInstance()->SurveyInit($this->anketa); + if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) { + $this->db_table = '_active'; + } + + # Inicializiramo in polovimo nastavitve missing profila + SurveyStatusProfiles::Init($this->anketa); + SurveyUserSetting::getInstance()->Init($this->anketa, $global_user_id); + + $this->_CURRENT_STATUS_FILTER = STATUS_FIELD . ' ~ /6|5/'; + + SurveyStatusProfiles::Init($this->anketa); + SurveyMissingProfiles::Init($this->anketa, $global_user_id); + SurveyConditionProfiles::Init($this->anketa, $global_user_id); + SurveyZankaProfiles::Init($this->anketa, $global_user_id); + SurveyTimeProfiles::Init($this->anketa, $global_user_id); + SurveyVariablesProfiles::Init($this->anketa); + SurveyDataSettingProfiles:: Init($this->anketa); + + + // Poskrbimo za datoteko s podatki + $SDF = SurveyDataFile::get_instance(); + $SDF->init($this->anketa); + $SDF->prepareFiles(); + + $this->headFileName = $SDF->getHeaderFileName(); + $this->dataFileName = $SDF->getDataFileName(); + $this->dataFileStatus = $SDF->getStatus(); + + + // preberemo nastavitve iz baze (prej v sessionu) + SurveyUserSession::Init($this->anketa); + // V kolikor ni shranjeno polje v bazi potem pobrišemo trenutno, kar je nastavljeno, da se izognemo napakam, ki bi se pojavile v nadaljevanju + if (!empty(SurveyUserSession::getData()) && !is_array(SurveyUserSession::getData())) + SurveyUserSession::delete(); + + $this->sessionData = SurveyUserSession::getData(); + + if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') { + if (!empty($_GET['s'])) { + $this->sessionData['means']['struktura'] = (int)$_GET['s']; + } elseif (!empty($this->sessionData['means']['struktura'])) { + unset($this->sessionData['means']['struktura']); + } + + SurveyUserSession::saveData($this->sessionData); + } + + // V kolikor preverjamo anketo za učitelja z že izbranimi parametri potem pobrišemo nastavitve iz baze + if (!is_null($this->struktura)) + $this->sessionData['means']['filterHierarhija'] = array(); + + + if ($this->dataFileStatus == FILE_STATUS_NO_DATA || $this->dataFileStatus == FILE_STATUS_NO_FILE || $this->dataFileStatus == FILE_STATUS_SRV_DELETED) { + Common::noDataAlert(); + exit(); + } + + if ($this->headFileName !== null && $this->headFileName != '') { + $this->_HEADERS = unserialize(file_get_contents($this->headFileName)); + } + + // Kdar je variable2 prazna in podatki še niso shranjeni v bazi potem prikažemo vse odgovore; + if (!is_null($this->struktura) || (empty($this->sessionData['means']['means_variables']['variabla2']) || sizeof($this->sessionData['means']['means_variables']['variabla2']) < 1) && !empty($this->_HEADERS)) { + $polje = array(); + if (!empty($this->getVariableList(2))) { + foreach ($this->getVariableList(2) as $vprasanje) { + if ($vprasanje['canChoose']) { + $polje[] = [ + 'seq' => $vprasanje['sequence'], + 'spr' => $vprasanje['spr_id'], + 'grd' => 'undefined' + ]; + } + } + } + + $this->sessionData['means']['means_variables']['variabla2'] = $polje; + + if (!empty($this->struktura)) + $this->variabla2 = $polje; + + + // dodan js, da osveži vse elemente in vse izbrane spremenljivke shrani v bazo + echo ''; + } + + + # nastavimo vse filtre +// $this->setUpFilter(); + + # nastavimo uporabniške nastavitve + $this->readUserSettings(); + + if (!empty($this->struktura)) { + // posodobimo vse filtre, ki so bili izbrani + echo ''; + } + + } + + + /** + * Pogledamo, če imamo id strukture in potem prikažemo rezulatate samo teh reševanj + */ + private function pregledAnalizeSamoZaEnoStrukturo() + { + if (is_null($_GET['s']) || is_string((int)$_GET['s'])) + return null; + + $this->struktura = (int)$_GET['s']; + } + + + private function readUserSettings() + { + $sdsp = SurveyDataSettingProfiles:: getSetting(); + $this->doValues = $sdsp['doValues'] == '1' ? true : false; + } + + + public function ajax() + { + #nastavimo variable če so postane + $this->setPostVars(); + + # izvedemo akcijo + switch ($_GET['a']) { + case 'changeDropdown': + $this->displayDropdowns(); + break; + case 'change': + $this->displayData(); + break; + case 'add_new_variable': + $this->addNewVariable(); + break; + case 'changeMeansSubSetting': + $this->changeMeansSubSetting(); + break; + case 'changeMeansShowChart': + $this->changeMeansShowChart(); + break; + case 'posodobi-ucitelja': + $this->posodobiPodatkeZaUcitelja(); + break; + case 'posodobi-izbran-predmet': + $this->posodobiIzbranPredmet(); + break; + case 'posodobi-seznam-za-ucitelje': + $this->posodobiSeznamFiltrovUcitelja(); + breake; + case 'pobrisi-filter': + $this->pobrisiFilterUciteljevAliHierarhije(); + break; + default: + print_r("
");
+                print_r($_GET);
+                print_r($_POST);
+                break;
+        }
+
+    }
+
+    function Display()
+    {
+        global $lang;
+        
+        $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null);
+
+        // meni za izbiranlje za filtre
+        $this->displayHierarhijaAliUcitelji();
+
+        # ali imamo testne podatke
+        if ($this->_HAS_TEST_DATA) {
+            # izrišemo bar za testne podatke
+            $SSH = new SurveyStaticHtml($this->anketa);
+            $SSH->displayTestDataBar(true);
+        }
+
+        # preberemo prednastavljene variable iz seje, ÄŤe obstajajo
+        # v koolikor gledamo za specifiÄŤni  ID, potem prikaĹľemo trenutne podatke
+        if (is_null($_GET['s']))
+            $this->presetVariables();
+
+        // v kolikor gre za specifiÄŤno anketo potem naredimo skrito polje z ID-jem strukture tega uÄŤitelja
+        if (!is_null($this->struktura))
+            echo '';
+
+
+//        $this->DisplayLinks();
+//        $this->DisplayFilters();
+
+        // ruleta za izbiro po uÄŤiteljih
+        if ($hierarhija_type < 5) {
+            $prikazi_fitre = is_array($this->sessionData['means']['strukturaUcitelj']);
+            $prikazi_rezultate = (isset($this->sessionData['means']['uciteljFilter']) && $this->sessionData['means']['uciteljFilter'] == 'predmeti');
+
+            echo '
'; + // PrikaĹľemo seznam uÄŤiteljev za agregirane analize + $this->displayDropdownSeznamUciteljev(); + echo '
'; + + echo '
'; + $this->displayDropdownSeznamUciteljevZaSpecificniPredmet(); + echo '
'; + } + + + echo '
'; +// echo '
PrikaĹľi filtre
'; +// echo '
Skrij filtre
'; + echo '
'; + $this->displayDropdowns(); + echo '
'; + + // PrikaĹľemo izvoz, ÄŤe gre za uÄŤitelja + if ($_GET['a'] == 'hierarhija') { + $href_pdf = makeEncodedIzvozUrlString('izvoz.php?b=export&m=hierarhija_pdf_izpis&anketa=' . $this->anketa); + $href_rtf = 'index.php?anketa=' . $this->anketa . '&a=hierarhija&m=analize&r=custom'; + + echo ''; + + } + echo '
'; + + echo '
'; + $this->displayData(); + echo '
'; #id="div_means_data" + + } + + + /** + * Izpišemo opcijo za izbiro ali filtri hierarhije ali filtri po učiteljih + * + * @return html + */ + public function displayHierarhijaAliUcitelji() + { + $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); + global $lang; + + if ($hierarhija_type > 4) + return null; + + echo '

'; + $seja = SurveyUserSession::getData(['means']['imeHierarhije']); + if(!empty($this->sessionData['means']['imeHierarhije'])) + echo $this->sessionData['means']['imeHierarhije']; + echo '

'; + + + // V kolikor gre za filtre po hierarhiji ali za filtre samo po uÄŤiteljih + echo '
'; + echo '
'; + echo 'Filtriranje po: '; + echo 'sessionData['means']['strukturaUcitelj']) ? 'checked="checked"' : null) . '/> '; + echo 'sessionData['means']['strukturaUcitelj']) ? 'checked="checked"' : null) . '/> '; + + echo '
'; + echo 'Rezultati bodo prikazani: '; + echo 'sessionData['means']['uciteljFilter']) || $this->sessionData['means']['uciteljFilter'] == 'agregirano' ? 'checked="checked"' : null) . '/> '; + echo 'sessionData['means']['uciteljFilter'] == 'predmeti' ? 'checked="checked"' : null) . '/> '; + echo '
'; + + echo '
'; + + echo '
'; + echo 'PoroÄŤila po meri: '; + echo ''; + echo ''; + if($_GET['error'] == 'invalid') { + echo '
'.$lang['srv_hierarchy_analysis_error_invalid_data'].'
'; + } + echo '
'; + echo '
'; + } + + /** + * Izriše seznam vseh učiteljev, ki so v strukturi + * + * @return html + */ + private function displayDropdownSeznamUciteljev() + { + $vsi_uporabniki_upraviceni_do_evalvacije = (new \Hierarhija\Model\HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ') GROUP BY users.id'); + + echo ''; + echo ''; + } + + /** + * Izriše seznam vseh učiteljev in strukture - za 1 predmet + * + * @return html + */ + private function displayDropdownSeznamUciteljevZaSpecificniPredmet() + { + $struktura_uporabnikov = (new \Hierarhija\Model\HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ')'); + + echo ''; + echo ''; + } + + public function displayDropdowns() + { + global $lang; + $variables1 = $this->getVariableList(1); + $variables2 = $this->getVariableList(2); + + + // V kolikor je struktura 0 in post request je notri ID strukture potem zapišemo v globalno spremenljivko + if (is_null($this->struktura) && !empty($_POST['strukturaId'])) + $this->struktura = (int)$_POST['strukturaId']; + + // Pridobimo strukturo za specifično anketo + $imena_sifrantov_ucitelja = array(); + if (!is_null($this->struktura)) { + $this->sessionData['means']['filterHierarhija'] = array(); + $imena_sifrantov_ucitelja = $this->pridobiStrukturoZaUcitelja(); + } + + ### Levi meni za prikaz vloge + echo ''; + + ### Prikaz elementov hierarhije in nivojev, ki so že zaklenjeni + echo '
struktura) || is_array($this->sessionData['means']['struktura']) || isset($this->sessionData['means']['strukturaUcitelj'])) ? ' style="display:none;"' : '') . '>'; + echo $lang['srv_hierarchy_label_analyse']; + echo '
'; + + #### Pridobimo strukturo hierarhije + $struktura_hierarhije = $this->hierarhijaUporabnika(); //tukaj dobimo samo polja, do katerih ima uporabnik dovoljenje + + #### V kolikor je učitelj oz. poljuben uporabnik na določeni ravni potem preverimo max št nivojev + $max_st_nivojev = sisplet_query("SELECT MAX(level) AS max + FROM + srv_hierarhija_ravni AS r + LEFT JOIN + srv_hierarhija_sifranti AS s + ON + s.hierarhija_ravni_id = r.id + WHERE + r.anketa_id = '" . $this->anketa . "' + ORDER BY level", "obj")->max; + + // filter za vsak nivo shranimo v polje in v kolikor se filter ponovi potem izpišemo vedno samo enega + foreach ($this->_HEADERS as $h_key => $header) { + preg_match('/^(?:nivo)([0-9]+)/', $header['variable'], $match); + if ((int)$h_key > 0 && sizeof($match) > 0) { + echo '
'; + echo ''; + echo '
'; + + // Prikaz chosen za vse šifrante, ki jih imamo + echo ''; + echo '
'; + } + } + + echo ''; + + echo '
'; + + +# echo '
'; +# if ($this->isSelectedBothVariables()) { +# echo 'rotate'; +# } else { +# echo 'rotate'; +# } +# echo '
'; + + echo '
struktura) ? ' style="display:none;"' : '') . '>'; + if ((int)$this->variabla1['0']['seq'] > 0) { + echo ' '; + } + echo $lang['srv_means_label2']; + echo '
'; + + + # za vsako novo spremenljivko 2 nardimo svoj select + if (count($this->variabla2) > 0) { + if ((int)$this->variabla1['0']['seq'] > 0) { + echo ''; + } + + foreach ($this->variabla2 AS $_key => $variabla2) { + echo $_br; + echo ''; + echo ''; + if (count($this->variabla2) > 1) { + echo ''; + } else { + echo ' '; + } + + $_br = '
 '; + echo '
'; + } + } + echo '
'; + + echo ''; + if (count($this->variabla2) > 1) { + ### Skrijemo moĹľnost preklopa odgovorov v skupno tabelo + echo '
'; + echo ''; + echo '
'; + echo '
' . $lang['srv_hierarchy_analysis_show_questions'] . '
'; + echo ''; +// echo '
sessionData['means']['meansSeperateTables'] != true ? '' : ' class="displayNone"') . '>'; + } + echo '
sessionData['mean_charts']['showChart'] == true ? ' checked="checked"' : '') . '>
'; + echo '
'; + echo ''; + + echo '
'; + + + // Ikone za izvoz (so tukaj da se refreshajo ob ajax klicu) + $this->displayExport(); + } + + + /** + * Pridobimo hierarhijo uporabnika, ki je prijavljen + * + * @return (array) $hierarhija + */ + public function hierarhijaUporabnika() + { + # Podatki za pregled nivojev hierarhije + $hierarhija_type = \Hierarhija\HierarhijaHelper::preveriTipHierarhije($this->anketa); + + if (empty($hierarhija_type)) + return false; + + if ($hierarhija_type > 4) { + $struktura_user = (new \Hierarhija\Model\HierarhijaQuery())->pridobiHierarhijoNavzgor($this->anketa, true); + + $hierarhija = array(); + + foreach ($struktura_user as $key => $struktura) { + foreach ($struktura as $row) { + $nivo = trim($row['nivo'], 'nivo'); + + ### Gremo skozi hierarhijo in v kolikor ima uporabnik več izvedenih anket (za različne letnike) potem vpišemo vse unikatne nivoje hierarhije; + if (!in_array($nivo, $hierarhija) && + (is_array($hierarhija[$nivo]) && + !in_array($row['st_odgovora'], $hierarhija[$nivo]) || empty($hierarhija[$nivo])) + ) { + $hierarhija[$nivo][] = $row['st_odgovora']; + } +// else { +// +//// $st_last = 0; +// ### V kolikor obstaja element potem vedno prepišemo zadnjega vnešenega +//// if (isset($hierarhija[$nivo]) && sizeof($hierarhija[$nivo]) > 0) +//// $st_last = sizeof($hierarhija[$nivo]) - 1; +// +//// $hierarhija[$nivo][$st_last] = $row['st_odgovora']; //če se je nivo ponovil ga vedno vpišemo na prvo mesto +// +// } + + } + } + + return $hierarhija; + } + + return 'admin'; + } + + + /** + * Pridobimo strukturo za učitelja za specifično anketo in vrnemo imena vseh šifrantov, ker jih bomo uporabili za filtriranje + * + * @return (array) $imena_sifrantov + */ + public function pridobiStrukturoZaUcitelja() + { + $struktura = \Hierarhija\Model\HierarhijaQuery::posodobiSifranteVrednostiGledeNaTrenutenIdStrukture($this->struktura); + $imena_sifrantov = array(); + foreach ($struktura as $row) { + $sql = sisplet_query("SELECT ime FROM srv_hierarhija_sifranti WHERE id='" . $row['id_sifranta'] . "'", "obj"); + $imena_sifrantov[] = $sql->ime; + } + + return $imena_sifrantov; + } + + /** + * Osvežimo vse podatke, ki so potrebni za pridobitev pdoatkov + * + * @return html + */ + public function displayData($filter_hierarhija = null) + { + global $site_path; + + $br = ''; + $means = array(); + + if (!file_exists($site_path . EXPORT_FOLDER . '/export_data_' . $this->anketa . '.dat')) { + echo 'Ni odgovorov'; + die(); + } + + + # če ne uporabljamo privzetega časovnega profila izpišemo opozorilo + SurveyTimeProfiles::printIsDefaultProfile(false); + + # če imamo filter ifov ga izpišemo + SurveyConditionProfiles::getConditionString(); + + # če imamo filter spremenljivk ga izpišemo + SurveyVariablesProfiles::getProfileString($doNewLine, true); + + # če imamo rekodiranje + $SR = new SurveyRecoding($this->anketa); + $SR->getProfileString(); + + if ($this->getSelectedVariables(1) !== null && $this->getSelectedVariables(2) !== null) { + $variables1 = $this->getSelectedVariables(2); + $variables2 = $this->getSelectedVariables(1); + + $c1 = 0; + $c2 = 0; + + # odvisno ok checkboxa prikazujemo druge variable v isti tabeli ali v svoji + if ($this->sessionData['means']['meansSeperateTables'] == true || !isset($this->sessionData['means']['meansSeperateTables'])) { + #prikazujemo ločeno + if (is_array($variables2) && count($variables2) > 0) { + foreach ($variables2 AS $v_second) { + if (is_array($variables1) && count($variables1) > 0) { + foreach ($variables1 AS $v_first) { + $_means = $this->createMeans($v_first, $v_second); + if ($_means != null) { + $means[$c1][0] = $_means; + } + $c1++; + } + } + } + } + } else { + #prikazujemo v isti tabeli + if (is_array($variables2) && count($variables2) > 0) { + foreach ($variables2 AS $v_second) { + if (is_array($variables1) && count($variables1) > 0) { + foreach ($variables1 AS $v_first) { + $_means = $this->createMeans($v_first, $v_second); + if ($_means != null) { + $means[$c1][$c2] = $_means; + } + $c2++; + } + } + $c1++; + $c2 = 0; + } + } + } + + //ddd($means); + if (is_array($means) && count($means) > 0) { + $counter = 0; + foreach ($means AS $mean_sub_grup) { + echo($br); + $this->displayMeansTable($mean_sub_grup); + $br = '
'; + + // Zvezdica za vkljucitev v porocilo + $spr2 = $mean_sub_grup[0]['v1']['seq'] . '-' . $mean_sub_grup[0]['v1']['spr'] . '-' . $mean_sub_grup[0]['v1']['grd']; + $spr1 = $mean_sub_grup[0]['v2']['seq'] . '-' . $mean_sub_grup[0]['v2']['spr'] . '-' . $mean_sub_grup[0]['v2']['grd']; + SurveyAnalysis::Init($this->anketa); + SurveyAnalysis::addCustomReportElement($type = 6, $sub_type = 0, $spr1, $spr2); + + // Izrisemo graf za tabelo - zaenkrat samo admin + if ($this->sessionData['mean_charts']['showChart'] && $_GET['m'] != 'analysis_creport') { + $tableChart = new SurveyTableChart($this->anketa, $this, 'mean', $counter); + $tableChart->display(); + } + + $counter++; + } + } + + } else { + # dropdowni niso izbrani + } + + + if ($this->aliImaPravicoDoPrikazaOdprtihOdgovorov()) { + echo '
'; + + foreach ($this->_HEADERS AS $skey => $spremenljivka) { + if ($spremenljivka['tip'] == 21) { + if ($spremenljivka['cnt_all'] == 1) { + // če je enodimenzionalna prikažemo kot frekvence + // predvsem zaradi vprašanj tipa: language, email... + + $this->izrisiOdprteOdgovoreZaUcitelja($skey, $spremenljivka); +// $this->sumTextVertical($skey, 'sums'); +// + } else { + SurveyAnalysis::sumMultiText($skey, 'sums'); + } + } + } + + echo '
'; + } + } + + /** + * Preverimo, če je res učitelj in če ima pravico do odprtih odgovorov + * + * @return boolean + */ + public function aliImaPravicoDoPrikazaOdprtihOdgovorov() + { + global $global_user_id; + + // Pridobimo max število nivojev + $max_st = (new \Hierarhija\Model\HierarhijaOnlyQuery())->getRavni($this->anketa, 'MAX(level) AS max_level')->fetch_object()->max_level; + + $struktura = sisplet_query("SELECT s.level AS level FROM srv_hierarhija_struktura_users AS u LEFT JOIN srv_hierarhija_struktura AS s ON s.id=u.hierarhija_struktura_id WHERE s.anketa_id='" . $this->anketa . "' AND u.user_id='" . $global_user_id . "'", "obj"); + + if (is_array($struktura) && $struktura[0]->level == $max_st || $struktura->level == $max_st) + return true; + + return false; + } + + /* + * Pridobimo strukture za učitelja na vseh nivojih + */ + public function posodobiPodatkeZaUcitelja($user_id = null) + { + if (empty($_POST['user_id']) && is_null($user_id)) + return null; + + if (is_null($user_id)) + $user_id = $_POST['user_id']; + + // Pridobimo uporabnika za vse njegove predmete + $vsi_predmeti_uporabnika = (new \Hierarhija\Model\HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ') AND users.id="' . $user_id . '"'); + + $struktura_ids = []; + while ($row = $vsi_predmeti_uporabnika->fetch_object()) { + $struktura_ids[] = $row->id; + } + + // Pridobimo vse šifrante od učitelja navzgor - celo strukturo + $this->struktura_ucitelj = []; + foreach ($struktura_ids as $struktura_id) { + $struktura_baza = \Hierarhija\Model\HierarhijaQuery::posodobiSifranteVrednostiGledeNaTrenutenIdStrukture($struktura_id); + + foreach ($struktura_baza as $key => $row) { + // $struktura_id - je ID strukture na kateremse nahaja učitelj + // $key - je level na katerem je šifrant + // $row['id_sifranta'] - je ID sifranta kateri je na tem nivoju + $this->struktura_ucitelj[$struktura_id][$key]['sifrant'] = $row['id_sifranta']; + + // Šifrant preverimo glede na vrstni red + $this->struktura_ucitelj[$struktura_id][$key]['stevilka'] = $this->pridobiStZaSpecificniSifrant($row['hierarhija_ravni_id'], $row['id_sifranta']); + } + } + + // Filtriranje po učitelju + if (isset($this->struktura_ucitelj) && sizeof($this->struktura_ucitelj) > 0) + $this->sessionData['means']['strukturaUcitelj'] = $this->struktura_ucitelj; + + // Shranimo spremenjene nastavitve v bazo + SurveyUserSession::saveData($this->sessionData); + + return $this->struktura_ucitelj; + } + + /* +* Pridobimo strukture za učitelja na vseh nivojih +*/ + public function posodobiIzbranPredmet() + { + if (empty($_POST['strukutra_id'])) + return null; + + $struktura_id = $_POST['strukutra_id']; + + // Pridobimo vse šifrante od učitelja navzgor - celo strukturo + $this->struktura_ucitelj = []; + + $struktura_baza = \Hierarhija\Model\HierarhijaQuery::posodobiSifranteVrednostiGledeNaTrenutenIdStrukture($struktura_id); + + + foreach ($struktura_baza as $key => $row) { + // $struktura_id - je ID strukture na kateremse nahaja učitelj + // $key - je level na katerem je šifrant + // $row['id_sifranta'] - je ID sifranta kateri je na tem nivoju + $this->struktura_ucitelj[$struktura_id][$key]['sifrant'] = $row['id_sifranta']; + + // Šifrant preverimo glede na vrstni red + $this->struktura_ucitelj[$struktura_id][$key]['stevilka'] = $this->pridobiStZaSpecificniSifrant($row['hierarhija_ravni_id'], $row['id_sifranta']); + } + + + // Filtriranje po učitelju + if (isset($this->struktura_ucitelj) && sizeof($this->struktura_ucitelj) > 0){ + $this->sessionData['means']['strukturaUcitelj'] = $this->struktura_ucitelj; + + $user = sisplet_query("SELECT user_id FROM srv_hierarhija_struktura_users WHERE hierarhija_struktura_id='".$struktura_id."'", "obj")->user_id; + + $this->sessionData['means']['imeHierarhije'] = \Hierarhija\HierarhijaHelper::hierarhijaPrikazNaslovovpriUrlju($this->anketa, $struktura_id, $user); + } + + // Shranimo spremenjene nastavitve v bazo + SurveyUserSession::saveData($this->sessionData); + + + echo $this->sessionData['means']['imeHierarhije']; + } + + /** + * Posodobimo seznam filtrov za učitelja ali so samo učitelji ali so izlistani po predmetih: + */ + public function posodobiSeznamFiltrovUcitelja(){ + $this->sessionData['means']['uciteljFilter'] = (!empty($_POST['vrsta']) ? $_POST['vrsta'] : 'agregirano'); + + unset($this->sessionData['means']['imeHierarhije']); + + SurveyUserSession::saveData($this->sessionData); + + } + + /** + * Pobrišemo filter učitljev ali hierarhije, odvisno kaj je bilo izbrano + * + * @return bool + */ + public function pobrisiFilterUciteljevAliHierarhije() + { + if (empty($_POST['vrsta'])) + return null; + + $vrsta = $_POST['vrsta']; + + if ($vrsta == 'ucitelji') { + $this->struktura = []; + $this->sessionData['means']['strukturaUcitelj'] = []; + unset($this->sessionData['means']['filterHierarhija']); + } + + if ($vrsta == 'filtri') { + $this->struktura_ucitelj = null; + unset($this->sessionData['means']['strukturaUcitelj']); + } + + SurveyUserSession::saveData($this->sessionData); + } + + /** + * Pridobimo vrstni red šifranta iz tabele srv_hierarhija_sifranti + * + * @param int $sifrant_id + * @return int + */ + private function pridobiStZaSpecificniSifrant($ravni_id, $sifrant_id) + { + if (!is_numeric($sifrant_id) || !is_numeric($sifrant_id)) + return null; + + $sql = sisplet_query("SELECT id, ime FROM srv_hierarhija_sifranti WHERE hierarhija_ravni_id='" . $ravni_id . "' ORDER BY ime", "obj"); + + $st = 0; + foreach ($sql as $row) { + $st++; + if ($row->id == $sifrant_id) + break; + } + + return $st; + } + + static public $textAnswersMore = array('0' => '10', '10' => '30', '30' => '300', '300' => '600', '600' => '900', '900' => '100000'); + + static function getNumRecords() + { + if (isset($_POST['num_records']) && (int)$_POST['num_records'] > 0) { + $result = (int)self::$textAnswersMore[$_POST['num_records']]; + } else { + $result = (int)SurveyDataSettingProfiles:: getSetting('numOpenAnswers'); + } + return $result; + } + + /** + * Izriši odprrte odgovore za specifičnega učitelja + * + * @param int $variable - ID vpršanja, ki se nahaja v $_HEADERS + * @param array $data + * @return html + */ + public function izrisiOdprteOdgovoreZaUcitelja($variable, $data) + { + global $site_path; + global $global_user_id; + + if (!is_array($data)) + return null; + + + $polje_v_datoteki = '$' . $data['sequences']; +// $filter_za_specificno_anketo = $this->filterHierarhijeZaSpecificnegaUciteljaIzDatoteke(); + + // V sejo shranimo vse strukture, ki ima dotični učitelj + $this->posodobiPodatkeZaUcitelja($global_user_id); + + if (!empty($this->sessionData['means']['strukturaUcitelj'][$this->sessionData['means']['struktura']])) { + $ucitelj_filter = '&& ('; + $ostali_fitri = false; + foreach ($this->sessionData['means']['strukturaUcitelj'][$this->sessionData['means']['struktura']] as $key => $struktura) { + + $ucitelj_filter .= ($ostali_fitri ? ' && ' : null); + $ucitelj_filter .= '($1' . $key . ' == ' . $struktura['stevilka'] . ')'; + $ostali_fitri = true; + } + $ucitelj_filter .= ')'; + } + + + if (is_null($ucitelj_filter)) + return null; + + # začasna datoteka za hierarhijo odprti odgovori + $folder = $site_path . EXPORT_FOLDER . '/'; + $tmp_file = $folder . 'tmp_hierarhija_' . $this->anketa . '.tmp'; + + + // Na začetku datoteke dodamo dataFileName . ' >> ' . $tmp_file; + shell_exec($commandHierarhija); + + // Na koncu datoteke dodamo zaključek php dokumenta + $file_handler = fopen($tmp_file, "a"); + fwrite($file_handler, '?>'); + fclose($file_handler); + + include($tmp_file); + + if (file_exists($tmp_file)) + unlink($tmp_file); + + return $this->izrisiHtmlTabeloZaOdprtOdgovor($odprtiOdgovori); + + } + + /** + * Izrišemo tabelo za odprt odgovor + * + * @param array $odprtiOdgovori + * @return html + */ + private function izrisiHtmlTabeloZaOdprtOdgovor($odprtiOdgovori) + { + foreach ($odprtiOdgovori as $keyVprasanja => $tabela) { + $vprasanje = $this->_HEADERS[$keyVprasanja . '_0']; + + echo '
+ + + + + + + + + + '; + $st = 0; + foreach ($tabela as $keyOdgovor => $odgovori) { + if (!is_numeric($odgovori) && is_string($odgovori)) { + $st++; + echo ' + + + + '; + } + } + echo ' + + + + '; + echo ' +
+ ' . $vprasanje['variable'] . ' + + ' . $vprasanje['naslov'] . ' +
OdgovoriFrekvenca
  +
' . $odgovori . '
+
1
+ Skupaj' . $st . '
'; + } + } + + + /** Izriše tekstovne odgovore v vertikalni obliki + * + * @param unknown_type $spid + */ + public function sumTextVertical($spid, $_from) + { + global $lang; + + # dajemo v bufer, da da ne prikazujemo vprašanj brez veljavnih odgovorov če imamo tako nastavljeno + $spremenljivka = $this->_HEADERS[$spid]; + $_FREQUENCYS = SurveyAnalysis::getFrequencys(); + + # preverimo ali prikazujemo spremenljivko, glede na veljavne odgovore in nastavitev + // Izrisujemo naše odgovore + $only_valid = 0; + if (count($spremenljivka['grids']) > 0) { + foreach ($spremenljivka['grids'] AS $gid => $grid) { + + # dodamo dodatne vrstice z albelami grida + if (count($grid['variables']) > 0) + foreach ($grid['variables'] AS $vid => $variable) { + $_sequence = $variable['sequence']; # id kolone z podatki v text datoteki + $only_valid += (int)$_FREQUENCYS[$_sequence]['validCnt']; + } + + } + } + + // V kolikor ni odgovorov potem nič ne izrisujemo + if (SurveyDataSettingProfiles:: getSetting('hideEmpty') == 1 && $only_valid == 0) { + return; + } + + # dodamo opcijo kje izrisujemo legendo + # če je besedilo * in je samo ena kategorija je inline legd('da');enda false + $inline_legenda = ($this->_HEADERS[$spid]['cnt_all'] == 1 || in_array($spremenljivka['tip'], array(1, 8))) ? false : true; + + # koliko zapisov prikažemo naenkrat + $num_show_records = self::getNumRecords(); + + $options = array('inline_legenda' => $inline_legenda, 'isTextAnswer' => false, 'isOtherAnswer' => false, 'num_show_records' => $num_show_records); + +// if (self :: $show_spid_div == true) { +// echo '
'; +// self::displaySpremenljivkaIcons($spid); +// } + # tekst vprašanja + echo ''; + + // naslovna vrstica tabele + echo ''; + #variabla + echo ''; + + #odgovori + echo ''; + echo ''; + + // Druga vrstica glave pri odprtih odgovorih + echo ''; + #variabla + echo ''; + + #odgovori + echo ''; + // if (self::$_SHOW_LEGENDA && $inline_legenda){ + // echo ''; + // echo ''; + // } + echo ''; + echo ''; + if ($this->_HEADERS[$spid]['show_valid_percent'] == true) { + echo ''; + } + echo ''; + echo ''; + // end naslovne vrstice + + // Prikažemo naše odgovore + $_answersOther = array(); + $_grids_count = count($spremenljivka['grids']); + + if ($_grids_count > 0) + foreach ($spremenljivka['grids'] AS $gid => $grid) { + $_variables_count = count($grid['variables']); + if ($_variables_count > 0) + foreach ($grid['variables'] AS $vid => $variable) { + $_sequence = $variable['sequence']; # id kolone z podatki + + if ($variable['other'] != true) { + # dodamo dodatne vrstice z labelami grida + if ($_variables_count > 1) { + self::outputGridLabelVertical($gid, $grid, $vid, $variable, $spid, $options); + } + + $counter = 0; + $_kumulativa = 0; + + //self::$_FREQUENCYS[$_sequence] + + if (count($_FREQUENCYS[$_sequence]['valid']) > 0) { + $_valid_answers = SurveyAnalysis::sortTextValidAnswers($spid, $variable, $_FREQUENCYS[$_sequence]['valid']); + + foreach ($_valid_answers AS $vkey => $vAnswer) { + if ($counter < $num_show_records || self::$isArchive) { + if ($vAnswer['cnt'] > 0 || true) { # izpisujemo samo tiste ki nisno 0 + $options['isTextAnswer'] = true; + $counter = SurveyAnalysis::outputValidAnswerVertical($counter, $vkey, $vAnswer, $_sequence, $spid, $_kumulativa, $options); + } + } + } + # izpišemo sumo veljavnih + $counter = SurveyAnalysis::outputSumaValidAnswerVertical($counter, $_sequence, $spid, $options); + } + if (count($_FREQUENCYS[$_sequence]['invalid']) > 0) { + foreach ($_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) { + if ($iAnswer['cnt'] > 0) { # izpisujemo samo tiste ki nisno 0 + $counter = SurveyAnalysis::outputInvalidAnswerVertical($counter, $ikey, $iAnswer, $_sequence, $spid, $options); + } + } + # izpišemo sumo veljavnih + $counter = SurveyAnalysis::outputSumaInvalidAnswerVertical($counter, $_sequence, $spid, $options); + } + #izpišemo še skupno sumo +// $counter = self::outputSumaVertical($counter,$_sequence,$spid,$options); + } else { + $_answersOther[] = array('spid' => $spid, 'gid' => $gid, 'vid' => $vid, 'sequence' => $_sequence); + } + } + } + + echo '
'; + echo ''; + echo $spremenljivka['variable']; + echo ''; + echo ''; + echo $spremenljivka['naslov'] . ''; + echo '
'; + // echo self::showIcons($spid,$spremenljivka,$_from); + echo '' . $lang['srv_analiza_frekvence_titleAnswers'] . ''.$lang['srv_analiza_opisne_variable_expression'].''.$lang['srv_analiza_opisne_variable_skala'].'' . $lang['srv_analiza_frekvence_titleFrekvenca'] . '' . $lang['srv_analiza_frekvence_titleOdstotek'] . '' . $lang['srv_analiza_frekvence_titleVeljavni'] . '' . $lang['srv_analiza_frekvence_titleKumulativa'] . '
'; + # izpišemo še tekstovne odgovore za polja drugo + if (count($_answersOther) > 0 && self::$_FILTRED_OTHER) { + foreach ($_answersOther AS $oAnswers) { + echo '
'; + SurveyAnalysis::outputOtherAnswers($oAnswers); + echo '
'; + } + } + +// if (self :: $show_spid_div == true) { +// echo '
'; +// echo '
'; +// } + + } + + static function outputValidAnswerVertical($counter, $vkey, $vAnswer, $_sequence, $spid, &$_kumulativa, $_options = array()) + { + global $lang; + # opcije + + $options = array('isTextAnswer' => false, # ali je tekstovni odgovor + 'isOtherAnswer' => false, # ali je odgovor Drugo + 'inline_legenda' => true, # ali je legenda inline ali v headerju + ); + + foreach ($_options as $_oKey => $_option) { + $options[$_oKey] = $_option; + } + $cssBck = ' ' . self::$cssColors['0_' . ($counter & 1)]; + + $_valid = (self::$_FREQUENCYS[$_sequence]['validCnt'] > 0) ? 100 * $vAnswer['cnt'] / self::$_FREQUENCYS[$_sequence]['validCnt'] : 0; + $_percent = (self::$_FREQUENCYS[$_sequence]['allCnt'] > 0) ? 100 * $vAnswer['cnt'] / self::$_FREQUENCYS[$_sequence]['allCnt'] : 0; + $_kumulativa += $_valid; + + # ÄŤe smo v arhivih dodamovse odgovore vendar so nekateri skriti + if ($counter >= $options['num_show_records'] && self::$isArchive) { + $cssHide = ' class="displayNone"'; + } + echo ' 0 ? ' vkey="' . $vkey . '"' : '') . $cssHide . '>'; + echo ' '; + echo ''; + echo '
' . $vkey . '
'; + echo(($options['isTextAnswer'] == false && (string)$vkey != $vAnswer['text']) ? ' (' . $vAnswer['text'] . ')' : ''); + # if ( $counter+1 == $options['num_show_records'] && $options['num_show_records'] < count(self::$_FREQUENCYS[$_sequence]['valid'])) { + # echo '
'.$lang['srv_anl_more'].'
'; + # } + echo ''; + if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true) { + echo ' '; + echo ' '; + } + + echo ''; + echo (int)$vAnswer['cnt']; + echo ''; + echo ''; + echo self::formatNumber($_percent, SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_PERCENT'), '%'); + echo ''; + if (self::$_HEADERS[$spid]['show_valid_percent']) { + echo ''; + echo self::formatNumber($_valid, SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_PERCENT'), '%'); + echo ''; + } + echo ''; + echo self::formatNumber($_kumulativa, SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_PERCENT'), '%'); + + echo ''; + echo ''; + + # ÄŤe mamo veÄŤ + if ($counter + 1 == $options['num_show_records'] && $options['num_show_records'] < count(self::$_FREQUENCYS[$_sequence]['valid'])) { + if (self::$isArchive == false) { + echo ''; + echo ' '; + echo ''; + // Pri javni povezavi drugace izpisemo + if (self::$printPreview == false) { + echo '
' . $lang['srv_anl_more'] . '
'; + echo '
' . $lang['srv_anl_more'] . '
'; + } else { + echo '
' . $lang['srv_anl_more'] . '
'; + echo '
' . $lang['srv_anl_more'] . '
'; + } + echo ''; + if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true) { + echo ' '; + echo ' '; + } + echo '' . ''; + echo '' . ''; + if (self::$_HEADERS[$spid]['show_valid_percent']) { + echo '' . ''; + } + echo '' . ''; + echo ''; + } else { + #v arhivie dodamo vse odgovore vendar so skriti + echo ''; + echo ' '; + echo ''; + echo '
' . $lang['srv_anl_all'] . '
'; + echo '
' . $lang['srv_anl_all'] . '
'; + echo ''; + if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true) { + echo ' '; + echo ' '; + } + echo '' . ''; + echo '' . ''; + if (self::$_HEADERS[$spid]['show_valid_percent']) { + echo '' . ''; + } + echo '' . ''; + echo ''; + } + } + + $counter++; + return $counter; + } + + + // Izvoz pdf in rtf + function displayExport() + { + + if ($this->isSelectedBothVariables()) { + $vars1 = $this->getSelectedVariables(1); + $vars2 = $this->getSelectedVariables(2); + + $data1 = ''; + $data2 = ''; + + foreach ($vars1 as $var1) { + $data1 .= implode(',', array_values($var1)) . ','; + } + $data1 = substr($data1, 0, -1); + + foreach ($vars2 as $var2) { + $data2 .= implode(',', array_values($var2)) . ','; + } + $data2 = substr($data2, 0, -1); + + + $href_pdf = makeEncodedIzvozUrlString('izvoz.php?b=export&m=hierarhija_pdf_izpis&anketa=' . $this->anketa); +// $href_rtf = 'index.php?anketa=' . $this->anketa . '&a=hierarhija_superadmin&m=analize&r=custom'; + $href_rtf = makeEncodedIzvozUrlString('izvoz.php?b=export&m=hierarhija_rtf_izpis&anketa=' . $this->anketa); +// $href_xls = makeEncodedIzvozUrlString('izvoz.php?b=export&m=mean_izpis_xls&anketa=' . $this->anketa); + echo ''; + } + } + + public function setPostVars() + { + if (isset($_POST['sequence1']) && count($_POST['sequence1']) > 0) { + $i = 0; + if (is_array($_POST['sequence1']) && count($_POST['sequence1']) > 0) { + foreach ($_POST['sequence1'] AS $_seq1) { + $this->variabla1[$i]['seq'] = $_seq1; + $i++; + } + } + } + if (isset($_POST['spr1']) && count($_POST['spr1']) > 0) { + $i = 0; + if (is_array($_POST['spr1']) && count($_POST['spr1']) > 0) { + foreach ($_POST['spr1'] AS $_spr1) { + $this->variabla1[$i]['spr'] = $_spr1; + $i++; + } + } + } + if (isset($_POST['grid1']) && count($_POST['grid1']) > 0) { + $i = 0; + if (is_array($_POST['grid1']) && count($_POST['grid1']) > 0) { + foreach ($_POST['grid1'] AS $_grd1) { + $this->variabla1[$i]['grd'] = $_grd1; + $i++; + } + } + } + + if (isset($_POST['sequence2']) && count($_POST['sequence2']) > 0) { + $i = 0; + + if (is_array($_POST['sequence2']) && count($_POST['sequence2']) > 0) { + + foreach ($_POST['sequence2'] AS $_seq2) { + $this->variabla2[$i]['seq'] = $_seq2; + $i++; + } + } + } + if (isset($_POST['spr2']) && count($_POST['spr2']) > 0) { + $i = 0; + if (is_array($_POST['spr2']) && count($_POST['spr2']) > 0) { + foreach ($_POST['spr2'] AS $_spr2) { + $this->variabla2[$i]['spr'] = $_spr2; + $i++; + } + } + } + if (isset($_POST['grid2']) && is_array($_POST['grid2']) && count($_POST['grid2']) > 0) { + $i = 0; + if (count($_POST['grid2']) > 0) { + foreach ($_POST['grid2'] AS $_grd2) { + $this->variabla2[$i]['grd'] = $_grd2; + $i++; + } + } + } + + if (isset($_POST['filter_vrednosti']) && count($_POST['filter_vrednosti']) > 0) { + $this->filter_hierarhija = $_POST['filter_vrednosti']; + } + + if (is_null($_POST['filter_vrednosti'])) { + $this->filter_hierarhija = array(); + } + + // Preverimo, ÄŤe imamo strukturo za uporabnika in , ÄŤe do sedaj ni bil izbran še noben filter, potem vedno izberemo vse iz danjega nivoja + $struktura_ucitelja = $this->hierarhijaUporabnika(); + + if (empty($this->sessionData['means']['filterHierarhija']) && $struktura_ucitelja != 'admin' && is_array($struktura_ucitelja)) { + $st_nivojev = sizeof($struktura_ucitelja); + $this->filter_hierarhija['nivo' . $st_nivojev] = $struktura_ucitelja[$st_nivojev]; + } + + # variable shranimo v sejo, da jih obdrĹľimo tudi ÄŤe spreminjamo nastavitve ali razne filtre analiz + if (isset($this->variabla1) && count($this->variabla1) > 0) { + $this->sessionData['means']['means_variables']['variabla1'] = $this->variabla1; + } + if (isset($this->variabla2) && count($this->variabla2) > 0) { + $this->sessionData['means']['means_variables']['variabla2'] = $this->variabla2; + } + + // Filtriranje po šifrantih + if (isset($this->filter_hierarhija) && sizeof($this->filter_hierarhija) > 0) { + $this->sessionData['means']['filterHierarhija'] = $this->filter_hierarhija; + } + + // Shranimo spremenjene nastavitve v bazo + SurveyUserSession::saveData($this->sessionData); + } + + + /** + * funkcija vrne seznam primern variabel za meanse + */ + function getVariableList($dropdown) + { + if (isset($this->variablesList[$dropdown]) && is_array($this->variablesList[$dropdown]) && count($this->variablesList[$dropdown]) > 0) { + return $this->variablesList[$dropdown]; + } else { + # pobrišemo array() + $this->variablesList = array(); + + + # zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence) + foreach ($this->_HEADERS AS $skey => $spremenljivka) { + if ((int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'], array('email', 'ime', 'priimek', 'telefon', 'naziv', 'drugo'))) { + continue; + } + + $tip = $spremenljivka['tip']; + + $skala = (int)$spremenljivka['skala']; + # pri drugi, analizirani variabli morajo biti numeriÄŤne ali ordinalne, v ostalem pa niÄŤ) + # skala - 0 Ordinalna + # skala - 1 Nominalna + $_dropdown_condition = $dropdown == 1 + || ($dropdown == 2 + && ($skala == 0 # ordinalna + || $tip == 7 # number + || $tip == 6 + || $tip == 18 # vsota + || $tip == 20)) # multi number + ? true : false; + + //V kolikor gre za prvi meni, potem notri dodamo samo vlogo, ki jo bomo naknadno skrili pri prikazu + if ((is_numeric($tip) + && $tip != 4 #text + && $tip != 5 #label + && $tip != 9 #SN-imena + && $tip != 22 #compute + && $_dropdown_condition # ali ustreza pogoju za meanse + && $dropdown != 1) + || (is_numeric($tip) + && $tip == 1 + && $dropdown == 1) + ) { + + $cnt_all = (int)$spremenljivka['cnt_all']; + # radio in select in checkbox + if ($cnt_all == '1' || $tip == 1 || $tip == 3 || $tip == 2) { + + + # pri tipu radio ali select dodamo tisto variablo ki ni polje "drugo" + if (($tip == 1 || $tip == 3)) { + if (count($spremenljivka['grids']) == 1) { + + # ÄŤe imamo samo en grid ( lahko je veÄŤ variabel zaradi polja drugo. + $grid = $spremenljivka['grids'][0]; + if (count($grid['variables']) > 0) { + foreach ($grid['variables'] AS $vid => $variable) { + + //Tukaj zapišemo, samo ÄŤe gre za vlogo, ker bomo delali anlize po teh vrednostih + if (($variable['other'] != 1 && $dropdown == 2) || ($variable['variable'] == 'vloga' && $dropdown == 1)) { + # imampo samo eno sekvenco grids[0]variables[0] + $this->variablesList[$dropdown][] = array( + 'tip' => $tip, + 'spr_id' => $skey, + 'sequence' => $spremenljivka['grids'][0]['variables'][$vid]['sequence'], + 'variableNaslov' => '(' . $spremenljivka['variable'] . ') ' . strip_tags($spremenljivka['naslov']), + 'canChoose' => true, + 'sub' => 0); + + } + + } + } + } + } else if ($skala == 1 || true) { # ta pogoj skala == 1 je malo sumljiv. ne vem veÄŤ zakaj je tako + + # imampo samo eno sekvenco grids[0]variables[0] + $this->variablesList[$dropdown][] = array( + 'tip' => $tip, + 'spr_id' => $skey, + 'sequence' => $spremenljivka['grids'][0]['variables'][0]['sequence'], + 'variableNaslov' => '(' . $spremenljivka['variable'] . ') ' . strip_tags($spremenljivka['naslov']), + 'canChoose' => true, + 'sub' => 0); + } + } else if ($cnt_all > 1) { + + # imamo veÄŤ skupin ali podskupin, zato zlopamo skozi gride in variable + if (count($spremenljivka['grids']) > 0) { + $this->variablesList[$dropdown][] = array( + 'tip' => $tip, + + 'variableNaslov' => '(' . $spremenljivka['variable'] . ') ' . strip_tags($spremenljivka['naslov']), + 'canChoose' => false, + 'sub' => 0); + # ali imamo en grid, ali veÄŤ (tabele + if (count($spremenljivka['grids']) == 1) { + # ÄŤe imamo samo en grid ( lahko je veÄŤ variabel zaradi polja drugo. + $grid = $spremenljivka['grids'][0]; + if (count($grid['variables']) > 0) { + foreach ($grid['variables'] AS $vid => $variable) { + if ($variable['other'] != 1) { + $this->variablesList[$dropdown][] = array( + 'tip' => $tip, + 'spr_id' => $skey, + 'sequence' => $variable['sequence'], + 'variableNaslov' => '(' . $variable['variable'] . ') ' . strip_tags($variable['naslov']), + 'canChoose' => true, + 'sub' => 1); + } + } + } + + } else if ($tip == 16 || $tip == 18) { + # imamo multicheckbox + foreach ($spremenljivka['grids'] AS $gid => $grid) { + $sub = 0; + if ($grid['variable'] != '') { + $sub++; + $this->variablesList[$dropdown][] = array( + 'tip' => $tip, + 'spr_id' => $skey, + 'grd_id' => $gid, + 'sequence' => $grid['variables'][0]['sequence'], + 'variableNaslov' => '(' . $grid['variable'] . ') ' . strip_tags($grid['naslov']), + 'canChoose' => true, + 'sub' => 1); + } + } + } else { + # imamo veÄŤ gridov - tabele + foreach ($spremenljivka['grids'] AS $gid => $grid) { + $sub = 0; + if ($grid['variable'] != '') { + $sub++; + $this->variablesList[$dropdown][] = array( + 'tip' => $tip, + 'variableNaslov' => '(' . $grid['variable'] . ') ' . strip_tags($grid['naslov']), + 'canChoose' => false, + 'sub' => $sub); + } + if (count($grid['variables']) > 0) { + $sub++; + foreach ($grid['variables'] AS $vid => $variable) { + if ($variable['other'] != 1) { + $this->variablesList[$dropdown][] = array( + 'tip' => $tip, + 'spr_id' => $skey, + 'sequence' => $variable['sequence'], + 'variableNaslov' => '(' . $variable['variable'] . ') ' . strip_tags($variable['naslov']), + 'canChoose' => true, + 'sub' => $sub); + } + } + } + } + } + + } + } + } + } + return $this->variablesList[$dropdown]; + } + } + + function isSelectedBothVariables() + { + $selected1 = false; + $selected2 = false; + if (count($this->variabla1)) { + foreach ($this->variabla1 AS $var1) { + if ((int)$var1['seq'] > 0) { + $selected1 = true; + } + } + } + if (count($this->variabla2)) { + foreach ($this->variabla2 AS $var2) { + if ((int)$var2['seq'] > 0) { + $selected2 = true; + } + } + } + + return ($selected1 && $selected2); + } + + + function getSelectedVariables($which = 1) + { + $selected = array(); + if ($which == 1) { + if (count($this->variabla1) > 0) { + foreach ($this->variabla1 AS $var1) { + if ((int)$var1['seq'] > 0) { + $selected[] = $var1; + } + } + } + } else { + if (count($this->variabla2) > 0) { + foreach ($this->variabla2 AS $var2) { + if ((int)$var2['seq'] > 0) { + $selected[] = $var2; + } + } + } + } + + return count($selected) > 0 ? $selected : null; + } + + + public function createMeans($v_first, $v_second) + { + global $site_path; + + $folder = $site_path . EXPORT_FOLDER . '/'; + + if ($this->dataFileName != '' && file_exists($this->dataFileName)) { + + $spr1 = $this->_HEADERS[$v_first['spr']]; + $spr2 = $this->_HEADERS[$v_second['spr']]; + + $grid1 = $spr1['grids'][$v_first['grd']]; + $grid2 = $spr2['grids'][$v_second['grd']]; + + $sequence1 = $v_first['seq']; + $sequence2 = $v_second['seq']; + + # za checkboxe gledamo samo odgovore ki so bili 1 in za vse opcije + $sekvences1 = array(); + $sekvences2 = array(); + $spr_1_checkbox = false; + $spr_2_checkbox = false; + + if ($spr1['tip'] == 2 || $spr1['tip'] == 16) { + $spr_1_checkbox = true; + if ($spr1['tip'] == 2) { + $sekvences1 = explode('_', $spr1['sequences']); + } + if ($spr1['tip'] == 16) { + + foreach ($grid1['variables'] AS $_variables) { + $sekvences1[] = $_variables['sequence']; + } + } + } else { + $sekvences1[] = $sequence1; + } + + if ($spr2['tip'] == 2 || $spr2['tip'] == 16) { + $spr_2_checkbox = true; + if ($spr2['tip'] == 2) { + $sekvences2 = explode('_', $this->_HEADERS[$v_second['spr']]['sequences']); + } + if ($spr2['tip'] == 16) { + foreach ($grid2['variables'] AS $_variables) { + $sekvences2[] = $_variables['sequence']; + } + } + } else { + $sekvences2[] = $sequence2; + } + + # pogoji so Ĺľe dodani v _CURRENT_STATUS_FILTER + + # dodamo filter za loop-e + if (isset($this->_CURRENT_LOOP['filter']) && $this->_CURRENT_LOOP['filter'] != '') { + $status_filter = $this->_CURRENT_STATUS_FILTER . ' && ' . $this->_CURRENT_LOOP['filter']; + } else { + $status_filter = $this->_CURRENT_STATUS_FILTER; + } + + + # dodamo status filter za vse sekvence checkbox-a da so == 1 + if ($additional_status_filter != null) { + $status_filter .= $additional_status_filter; + } + + # odstranimo vse zapise, kjer katerakoli od variabel vsebuje missing + $_allMissing_answers = SurveyMissingValues::GetMissingValuesForSurvey(array(1, 2, 3)); + $_pageMissing_answers = $this->getInvalidAnswers(MISSING_TYPE_CROSSTAB); + # polovimo obe sequenci + $tmp_file = $folder . 'tmp_means_' . $this->anketa . '.tmp'; + + // Na zaÄŤetku datoteke dodamo 0) + foreach ($sekvences1 AS $sequence1) { + if (count($sekvences2) > 0) + foreach ($sekvences2 AS $sequence2) { + #skreira variable: $meansArray + $additional_filter = ''; + if ($spr_1_checkbox == true) { + $_seq_1_text = '' . $sequence1; + + # pri checkboxih gledamo samo kjer je 1 ( ne more bit missing) + $additional_filter = ' && ($' . $sequence1 . ' == 1)'; + } else { + $_seq_1_text = '$' . $sequence1; + + # dodamo še pogoj za missinge + foreach ($_pageMissing_answers AS $m_key1 => $missing1) { + $additional_filter .= ' && ($' . $sequence1 . ' != ' . $m_key1 . ')'; + } + } + + if ($spr_2_checkbox == true) { + $_seq_2_text = '' . $sequence2; + + # pri checkboxih gledamo samo kjer je 1 ( ne more bit missing) + $additional_filter .= ' && ($' . $sequence2 . ' == 1)'; + } else { + $_seq_2_text = '$' . $sequence2; + + # dodamo še pogoj za missinge + foreach ($_pageMissing_answers AS $m_key2 => $missing2) { + $additional_filter .= ' && ($' . $sequence2 . ' != ' . $m_key2 . ')'; + } + } + + # V kolikor smo izbrali filtre potem prikaĹľemo samo ustrezne rezultate glede na filtre + ## Postavimo filter za hierarhijo na null + $hierarhija_filter = $this->filterHierarhijeIzTekstovneDatoteke(); + + // V kolikor imamo filter po uÄŤiteljih + $ucitelj_filter = $this->filterHierarhijeZaSpecificnegaUciteljaIzDatoteke(); + + if (IS_WINDOWS) { + $command = 'awk -F"|" "BEGIN {{OFS=\"\"} {ORS=\"\n\"}} ' . $status_filter . $additional_filter . (!empty($ucitelj_filter) ? $ucitelj_filter : $hierarhija_filter) . ' { print \"$meansArray[\x27\",' . $_seq_2_text . ',\"\x27][\x27\",' . $_seq_1_text . ',\"\x27]++;\"}" ' . $this->dataFileName . ' >> ' . $tmp_file; + } else { + $command = 'awk -F"|" \'BEGIN {{OFS=""} {ORS="\n"}} ' . $status_filter . $additional_filter . (!empty($ucitelj_filter) ? $ucitelj_filter : $hierarhija_filter) . ' { print "$meansArray[\x27",' . $_seq_2_text . ',"\x27][\x27",' . $_seq_1_text . ',"\x27]++;"}\' ' . $this->dataFileName . ' >> ' . $tmp_file; + } + $out = shell_exec($command); + + } + + } + + // Na koncu datoteke dodamo zakljuÄŤek php dokumenta + $file_handler = fopen($tmp_file, "a"); + fwrite($file_handler, '?>'); + fclose($file_handler); + + include($tmp_file); + + if (file_exists($tmp_file)) { + unlink($tmp_file); + } + + # izraÄŤunamo povpreÄŤja + $means = array(); + $max_vrednost = array(); + $min_vrednost = array(); + $sumMin = null; + $sumMax = null; + $sumStdDeviation = null; + $_tmp_sumaMeans = 0; + $sum_std_dev = array(); + if (is_array($meansArray) && count($meansArray) > 0) { + foreach ($meansArray AS $f_key => $first) { + $tmp_sum = 0; + $tmp_cnt = 0; + $min = null; + $max = null; + + //$s_key je vrednost odgovora in zato vzamemo min in max + foreach ($first AS $s_key => $second) { + # preverimo da je vse numeric + if (is_numeric($s_key) && is_numeric($second)) { + $tmp_sum = $tmp_sum + ($s_key * $second); + $tmp_cnt = $tmp_cnt + $second; + } + + if (is_null($min) || $min > $s_key) + $min = $s_key; + + if (is_null($max) || $max < $s_key) + $max = $s_key; + + if (is_null($sumMin) || $sumMin > $s_key) + $sumMin = $s_key; + + if (is_null($sumMax) || $sumMax < $s_key) + $sumMax = $s_key; + } + + + $_tmp_sumaMeans += $tmp_sum; + $key = $f_key; + if ($tmp_cnt != 0) { + $means[$key] = bcdiv($tmp_sum, $tmp_cnt, 3); + } else { + $means[$key] = bcdiv(0, 1, 3); + } + + //raÄŤunamo še standardno deviacijo + $st_rezultatov = 0; + $std_dev = []; + $polje = []; + foreach ($first AS $s_key => $second) { + # preverimo da je vse numeric + if (is_numeric($s_key) && is_numeric($second)) { + $std_vmesna = pow(($s_key - $means[$key]), 2); + $std_dev[] = $std_vmesna * $second; + $st_rezultatov = $st_rezultatov + $second; + } + } + + //Prevzeto je standardna deviacija 0, ker pri uÄŤiteljih imamo samo 1 rezltat in ne moremo raÄŤunati po njem + $std_deviacija[$key] = 0; + + //izraÄŤunamo standardno diviacio za uÄŤence + if (array_sum($std_dev) > 0) + $std_deviacija[$key] = sqrt((array_sum($std_dev) / ($st_rezultatov - 1))); + + + //Vpišemo min in max vrednost za sledeÄŤe vprašanje + $max_vrednost[$key] = $max; + $min_vrednost[$key] = $min; + + } + + } + + + # inicializacija + $_all_options = array(); + $sumaVrstica = array(); + $sumaSkupna = 0; + $sumaMeans = 0; + + # poiščemo pripadajoÄŤo spremenljivko + $var_options = $this->_HEADERS[$v_second['spr']]['options']; + + # najprej poiščemo (zdruĹľimo) vse opcije ki so definirane kot opcije spremenljivke in vse ki so v meansih + if (count($var_options) > 0 && $spr_2_checkbox !== true) { + foreach ($var_options as $okey => $opt) { + $_all_options[$okey] = array('naslov' => $opt, 'type' => 'o'); + } + } + + # za checkboxe dodamo posebej vse opcije + if ($spr_2_checkbox == true) { + if ($spr2['tip'] == 2) { + $grid2 = $this->_HEADERS[$v_second['spr']]['grids']['0']; + } + + foreach ($grid2['variables'] As $vkey => $variable) { + if ($variable['other'] != 1) { + $_all_options[$variable['sequence']] = array('naslov' => $variable['naslov'], 'type' => 'o', 'vr_id' => $variable['variable']); + } + } + } + + # dodamo odgovore iz baze ki niso missingi + if (count($meansArray) > 0) { + foreach ($meansArray AS $_kvar1 => $_var1) { + # missingov ne dodajamo še zdaj, da ohranimo pravilen vrstni red + foreach ($_var1 AS $_kvar2 => $_var2) { + if (!isset($_allMissing_answers[$_kvar1]) || (isset($_allMissing_answers[$_kvar1]) && isset($_pageMissing_answers[$_kvar1]))) { + $sumaVrstica[$_kvar1] += $_var2; + } + } + # missingov ne dodajamo še zdaj, da ohranimo pravilen vrstni red + if (!isset($_allMissing_answers[$_kvar1]) && !isset($_all_options[$_kvar1])) { + $_all_options[$_kvar1] = array('naslov' => $_kvar1, 'type' => 't'); + } + + } + } + # dodamo še missinge, samo tiste ki so izbrani z profilom + foreach ($_allMissing_answers AS $miskey => $_missing) { + if (!isset($_pageMissing_answers[$miskey])) { + if ($spr_2_checkbox !== true) { + $_all_options[$miskey] = array('naslov' => $_missing, 'type' => 'm'); + } + } + } + $sumaSkupna = array_sum($sumaVrstica); + $sumaMeans = ($sumaSkupna > 0) ? $_tmp_sumaMeans / $sumaSkupna : 0;; + + # ÄŤe lovimo po enotah, moramo skupne enote za vsako kolono(vrstico) izraÄŤunati posebej + if ($this->crossNavVsEno == 1) { + $sumaSkupna = 0; + $sumaVrstica = array(); + + # sestavimo filtre za posamezno variablo da ni missing + if (count($sekvences1) > 0) { + $spr1_addFilter = ''; + + foreach ($sekvences1 AS $sequence1) { + # dodamo še pogoj za missinge + foreach ($_pageMissing_answers AS $m_key1 => $missing1) { + $spr1_addFilter .= ' && ($' . $sequence1 . ' != ' . $m_key1 . ')'; + } + } + } + if (count($sekvences2) > 0) { + $spr2_addFilter = ''; + + foreach ($sekvences2 AS $sequence2) { + # dodamo še pogoj za missinge + foreach ($_pageMissing_answers AS $m_key2 => $missing2) { + $spr2_addFilter .= ' && ($' . $sequence2 . ' != ' . $m_key2 . ')'; + } + } + } + + # polovimo obe sequenci + $tmp_file = $folder . 'tmp_means_' . $this->anketa . '.TMP'; + + + $file_handler = fopen($tmp_file, "w"); + fwrite($file_handler, "dataFileName . ' >> ' . $tmp_file; + } else { + $command_all = 'awk -F"|" \'BEGIN {{OFS=""} {ORS="\n"}} ' . $status_filter . $spr1_addFilter . $spr2_addFilter . ' { print "$sumaSkupna++;"}\' ' . $this->dataFileName . ' >> ' . $tmp_file; + } + + $out_all = shell_exec($command_all); + + + #za vsako variablo polovimo število enot + #najprej za stolpce + if (count($sekvences1) > 0) { + foreach ($sekvences1 AS $sequence1) { + if ($spr_1_checkbox == true) { + $_seq_1_text = '' . $sequence1; + # pri checkboxih lovimo samo tiste ki so 1 + $chckbox_filter1 = ' && ($' . $sequence1 . ' == 1)'; + } else { + $_seq_1_text = '$' . $sequence1; + } + + if (IS_WINDOWS) { + $command_1 = 'awk -F"|" "BEGIN {{OFS=\"\"} {ORS=\"\n\"}} ' . $status_filter . $chckbox_filter1 . $spr2_addFilter . ' { print \"$sumaVrstica[\x27\",' . $_seq_1_text . ',\"\x27]++;\"}" ' . $this->dataFileName . ' >> ' . $tmp_file; + } else { + $command_1 = 'awk -F"|" \'BEGIN {{OFS=""} {ORS="\n"}} ' . $status_filter . $chckbox_filter1 . $spr2_addFilter . ' { print "$sumaVrstica[\x27",' . $_seq_1_text . ',"\x27]++;"}\' ' . $this->dataFileName . ' >> ' . $tmp_file; + } + $out = shell_exec($command_1); + } + } + } + + # skupna standardna deviacija + if (!is_null($meansArray)) { + $sum_std_dev = array(); + foreach ($meansArray AS $row) { + foreach ($row AS $value => $st) { + if (is_numeric($value) && is_numeric($st)) { + $sum_vmesna = pow(($value - $sumaMeans), 2); + $sum_std_dev[] = $sum_vmesna * $st; + } + } + } + + $sum_std_deviacija = 0; + // IzraÄŤunamo skupno standardno deviacijo + if (array_sum($sum_std_dev) > 0) + $sum_std_deviacija = sqrt((array_sum($sum_std_dev) / ($sumaSkupna - 1))); + } + + $meansArr['v1'] = $v_first; # prva variabla + $meansArr['v2'] = $v_second; # druga variabla + $meansArr['result'] = $means; # povpreÄŤja + $meansArr['options'] = $_all_options; # vse opcije za variablo 2 + $meansArr['max'] = $max_vrednost; #Max vrednost pri odgovorih + $meansArr['min'] = $min_vrednost; #Min vrednost pri odgovorih + $meansArr['stdDeviation'] = $std_deviacija; + $meansArr['sumaMin'] = $sumMin; #Min vrednost pri vseh odgovorih + $meansArr['sumaMax'] = $sumMax; #Max vrednost pri vseh odgovorih + $meansArr['sumaStdDeviation'] = $sum_std_deviacija; + $meansArr['sumaVrstica'] = $sumaVrstica; #št odgovorov glede na vrstice + $meansArr['sumaSkupna'] = $sumaSkupna; #skupno št. odgovorov + $meansArr['sumaMeans'] = $sumaMeans; #skupno povpreÄŤje + + return $meansArr; + } + } + + /** + * Standardna diviacija + * + * @param (array) $a + * @return integer + */ + private function stats_standard_deviation(array $a, $sample = false) + { + $n = count($a); + if ($n === 0) { + trigger_error("The array has zero elements", E_USER_WARNING); + return false; + } + if ($sample && $n === 1) { + trigger_error("The array has only 1 element", E_USER_WARNING); + return false; + } + $mean = array_sum($a) / $n; + $carry = 0.0; + foreach ($a as $val) { + $d = ((double)$val) - $mean; + $carry += $d * $d; + }; + if ($sample) { + --$n; + } + return sqrt($carry / $n); + } + + /** + * Filter po hierarhiji za filtriranje pdoatkov iz tekstovne datoteke + * + * @return null || string + */ + public function filterHierarhijeIzTekstovneDatoteke() + { + if (!is_array($this->sessionData['means']['filterHierarhija']) || empty($this->sessionData['means']['filterHierarhija'])) + return null; + + $hierarhija_filter = null; + + if (is_array($this->sessionData['means']['filterHierarhija'])) { + foreach ($this->sessionData['means']['filterHierarhija'] as $nivo_key => $polje) { + $hierarhija_filter .= ' && ('; + + if (!is_null($polje) && is_array($polje)) { + foreach ($polje as $key => $vrednost) { + $nivo = trim($nivo_key, 'nivo'); + + if (sizeof($polje) > 1) { + if ($key != 0) + $hierarhija_filter .= ' || '; //OR uporabimo, kadar iščemo po veÄŤ spremenljivkah na istem nivoju + $hierarhija_filter .= '($1' . $nivo . ' == ' . $vrednost . ')'; + } else { + $hierarhija_filter .= '($1' . $nivo . ' == ' . $vrednost . ')'; + } + + } + } + + $hierarhija_filter .= ')'; + } + } + + return $hierarhija_filter; + } + + /** + * Filter hierarhije za specifiÄŤnega uÄŤitelja + * + * @return null || string + */ + public function filterHierarhijeZaSpecificnegaUciteljaIzDatoteke() + { + global $global_user_id; + +// $this->posodobiPodatkeZaUcitelja($global_user_id); + + if (!empty($this->struktura) || empty($this->sessionData['means']['strukturaUcitelj']) || sizeof($this->sessionData['means']['strukturaUcitelj']) == 0) + return null; + + + $ucitelj_filter = ' && ('; + + // Gremo po vsej strukturi, kjer se nahaja uÄŤitelj lahko je 1 ali pa jih je veÄŤ + // KljuÄŤ je ID strukture - srv_hierarhija_struktura table + $oklepaj = false; + foreach ($this->sessionData['means']['strukturaUcitelj'] as $key => $struktura) { + // Vse nadalne poizvedbe vsebujejo OR - kje je treba pridobiti podatke iz vseh struktur + $ucitelj_filter .= ($oklepaj ? ' || (' : ' ('); + + foreach ($struktura as $nivo => $vrednost) { + $ucitelj_filter .= ($nivo != key($struktura) ? ' && ' : null); + $ucitelj_filter .= '($1' . $nivo . ' == ' . $vrednost['stevilka'] . ')'; + } + + $ucitelj_filter .= ')'; + $oklepaj = true; + } + + $ucitelj_filter .= ' )'; + + return $ucitelj_filter; + + } + + + /** + * PrikaĹľe tabelo s povpreÄŤji, min, max in standardna deviacija + * + * @param $_means + * @return html + */ + function displayMeansTable($_means) + { + global $lang; + + #število vratic in število kolon + $cols = count($_means); + # preberemo kr iz prvega loopa + $rows = count($_means[0]['options']); + + + # ali prikazujemo vrednosti variable pri spremenljivkah + $show_variables_values = $this->doValues; + + $showSingleUnits = $this->sessionData['means']['meansJoinPercentage'] == true && $this->sessionData['means']['meansSeperateTables'] == false; + + # izrišemo tabelo + echo ''; + echo ''; + echo ''; + echo ''; + for ($i = 0; $i < $cols; $i++) { + echo ''; + if ($showSingleUnits == false) { + echo ''; + } + } + if ($showSingleUnits == true) { + echo ''; + } + echo ''; + + echo ''; + #echo ''; + # ime variable + # teksti labele: + $label2 = $this->getSpremenljivkaTitle($_means[0]['v2']); + if ($showSingleUnits == false) { + $span = ' colspan="5"'; + } + echo ''; + + for ($i = 0; $i < $cols; $i++) { + echo ''; + } + if ($showSingleUnits == true) { + echo ''; + } + echo ''; + echo ''; + + for ($i = 0; $i < $cols; $i++) { + #PovpreÄŤje + echo ''; + #enote + if ($showSingleUnits == false) { + echo ''; + } + + #Min + echo ''; + + #Max + echo ''; + + #Standardna deviacija + echo ''; + } + if ($showSingleUnits == true) { + echo ''; + } + + echo ''; + + if (count($_means[0]['options']) > 0) { + + foreach ($_means[0]['options'] as $ckey2 => $crossVariabla2) { + + $units_per_row = 0; + echo ''; + echo ''; + + # celice z vsebino + for ($i = 0; $i < $cols; $i++) { + echo ''; + if ($showSingleUnits == false) { + echo ''; + } else { + $units_per_row = max($units_per_row, (int)$_means[$i]['sumaVrstica'][$ckey2]); + } + + #Min - rezultati + echo ''; + + #Max - rezultati + echo ''; + + #Standardna deviacija - rezultati + echo ''; + + } + if ($showSingleUnits == true) { + echo ''; + } + echo ''; + $max_units += $units_per_row; + } + } + echo ''; + echo ''; + + for ($i = 0; $i < $cols; $i++) { + echo ''; + if ($showSingleUnits == false) { + echo ''; + } + + #Skupaj Min + echo ''; + + #Skupaj Max + echo ''; + + #Skupaj standardna deviacija + echo ''; + + } + if ($showSingleUnits == true) { + echo ''; + } + + echo ''; + echo '
xx '; + echo $label2; + echo ''; + $label1 = $this->getSpremenljivkaTitle($_means[$i]['v1']); + echo $label1; + echo ' 
'; + echo $lang['srv_means_label']; + echo '' . $lang['srv_hierarchy_label_st'] . ''; + echo $lang['srv_hierarchy_label_min']; + echo ''; + echo $lang['srv_hierarchy_label_max']; + echo ''; + echo $lang['srv_hierarchy_label_std_dev']; + echo '' . $lang['srv_hierarchy_label_st'] . '
'; + echo $crossVariabla2['naslov']; + # ÄŤe ni tekstovni odgovor dodamo key + if ($crossVariabla2['type'] !== 't') { + if ($show_variables_values == true) { + if ($crossVariabla2['vr_id'] == null) { + echo ' ( ' . $ckey2 . ' )'; + } else { + echo ' ( ' . $crossVariabla2['vr_id'] . ' )'; + } + } + } + echo ''; + echo $this->formatNumber($_means[$i]['result'][$ckey2], SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_RESIDUAL')); + echo ''; + echo (int)$_means[$i]['sumaVrstica'][$ckey2]; + echo ''; + echo $this->formatNumber($_means[$i]['min'][$ckey2], SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_RESIDUAL')); + echo ''; + echo $this->formatNumber($_means[$i]['max'][$ckey2], SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_RESIDUAL')); + echo ''; + echo $this->formatNumber($_means[$i]['stdDeviation'][$ckey2], SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_RESIDUAL')); + echo ''; + echo $units_per_row; + echo '
' . $lang['srv_means_label3'] . ''; + echo $this->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_RESIDUAL')); + echo ''; + echo (int)$_means[$i]['sumaSkupna']; + echo ''; + echo $this->formatNumber($_means[$i]['sumaMin'], SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_RESIDUAL')); + echo ''; + echo $this->formatNumber($_means[$i]['sumaMax'], SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_RESIDUAL')); + echo ''; + echo $this->formatNumber($_means[$i]['sumaStdDeviation'], SurveyDataSettingProfiles:: getSetting('NUM_DIGIT_RESIDUAL')); + echo ''; + echo $max_units; + echo '
'; + } + + /** Sestavi array nepravilnih odgovorov + * + */ + function getInvalidAnswers($type) + { + $result = array(); + $missingValuesForAnalysis = SurveyMissingProfiles:: GetMissingValuesForAnalysis($type); + + foreach ($missingValuesForAnalysis AS $k => $answer) { + $result[$k] = array('text' => $answer, 'cnt' => 0); + } + return $result; + } + + + /** Naredimo formatiran izpis + * + * @param $value + * @param $digit + * @param $sufix + */ + + static function formatNumber($value, $digit = 0, $sufix = "") + { + if ($value <> 0 && $value != null) + $result = round($value, $digit); + else + $result = "0"; + + # polovimo decimalna mesta in vejice za tisočice + + $decimal_point = SurveyDataSettingProfiles:: getSetting('decimal_point'); + $thousands = SurveyDataSettingProfiles:: getSetting('thousands'); + + $result = number_format($result, $digit, $decimal_point, $thousands) . $sufix; + + return $result; + } + + //Dodajamo novo variablo iz spustnega seznama, vendar bo v našem primeru tole zaprto + function addNewVariable() + { + global $lang; + $which = $_POST['which']; + $variables = $this->getVariableList($which); + $multiple = true; + + if ($which == '1') { + echo '
'; + echo ' '; + echo ''; + echo ''; + + } else { + # which = 2 + echo '
'; + echo ' '; + echo ''; + echo ''; + } + } + + function getSpremenljivkaTitle($v_first) + { + global $lang; + # podatki spremenljivk + $spremenljivka_id = $v_first['spr']; + $grid_id = $v_first['grd']; + $sekvenca = $v_first['seq']; + + $spremenljivka = $this->_HEADERS[$spremenljivka_id]; + $grid = $spremenljivka['grids'][$grid_id]; + + + # za multicheckboxe popravimo naslov, na podtip + $labela = null; + if ($spremenljivka['tip'] == '6' || $spremenljivka['tip'] == '7' || $spremenljivka['tip'] == '16' || $spremenljivka['tip'] == '17' || $spremenljivka['tip'] == '18' || $spremenljivka['tip'] == '19' || $spremenljivka['tip'] == '20' || $spremenljivka['tip'] == '21') { + foreach ($spremenljivka['grids'] AS $grids) { + foreach ($grids['variables'] AS $variable) { + if ($variable['sequence'] == $sekvenca) { + $labela .= ''; + $labela .= ''; + $labela .= strip_tags($spremenljivka['naslov']); + if ($show_variables_values == true) { + $labela .= ' (' . strip_tags($spremenljivka['variable']) . ')'; + } + $labela .= ''; + $labela .= ''; + + if ($spremenljivka['tip'] == '16') { + if (strip_tags($grid['naslov']) != $lang['srv_new_text']) { + $labela .= '
' . strip_tags($grid['naslov']); + } + $labela .= ' (' . strip_tags($grid['variable']) . ')'; + } else { + if (strip_tags($variable['naslov']) != $lang['srv_new_text']) { + $labela .= '
' . strip_tags($variable['naslov']); + } + if ($show_variables_values == true) { + $labela .= ' (' . strip_tags($variable['variable']) . ')'; + } + } + + } + } + } + } + if ($labela == null) { + $labela = ''; + $labela .= ''; + $labela .= strip_tags($spremenljivka['naslov']); + if ($show_variables_values == true) { + $labela .= ' (' . strip_tags($spremenljivka['variable']) . ')'; + } + $labela .= ''; + $labela .= '' . NEW_LINE; + } + return $labela; + } + + function changeMeansSubSetting() + { + $this->sessionData['means']['meansSeperateTables'] = ($_POST['chkMeansSeperate'] == 1); + $this->sessionData['means']['meansJoinPercentage'] = ($_POST['chkMeansJoinPercentage'] == 1); + + // Shranimo spremenjene nastavitve v bazo + SurveyUserSession::saveData($this->sessionData); + } + + function changeMeansShowChart() + { + $this->sessionData['mean_charts']['showChart'] = ($_POST['showChart'] == 'true'); + $this->sessionData['means']['meansSeperateTables'] = ($_POST['showChart'] == 'true') ? true : $this->sessionData['means']['meansSeperateTables']; + $this->sessionData['means']['meansJoinPercentage'] = ($_POST['showChart'] == 'true') ? true : $this->sessionData['means']['meansJoinPercentage']; + + // Shranimo spremenjene nastavitve v bazo + SurveyUserSession::saveData($this->sessionData); + } + + + function presetVariables() + { + # preberemo prednastavljene variable iz seje, ÄŤe obstajajo + if (isset($this->sessionData['means']['means_variables']['variabla1']) && count($this->sessionData['means']['means_variables']['variabla1']) > 0) { + $this->variabla1 = $this->sessionData['means']['means_variables']['variabla1']; + } + + if (isset($this->sessionData['means']['means_variables']['variabla2']) && count($this->sessionData['means']['means_variables']['variabla2']) > 0) { + + $this->variabla2 = $this->sessionData['means']['means_variables']['variabla2']; + + } + } +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php new file mode 100644 index 0000000..37bf787 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php @@ -0,0 +1,2261 @@ +anketa = $anketa; + $this->lang = $lang; + $this->hierarhija_type = HierarhijaHelper::preveriTipHierarhije($this->anketa); + $this->user = $global_user_id; + $this->admin_type = $admin_type; + $this->url = $site_url; + $this->modul = \SurveyInfo::getSurveyModules(); + } + + /** + * Inicializacija hierarhije + * + * @param + * + * @return + */ + public static function hierarhijaInit($anketa) + { + $new = new Hierarhija($anketa); + $new->DolociPraviceUporabniku(); + $new->izrisisSistemskoVprsanjeVloga(); + $new->hierarhijaSuperadminSifranti(); + } + + /** + * Uporabniku doloÄŤimo pravice, ÄŤe vkljuÄŤi anketo dobi type 1 - admin + * hierarhije + */ + public function dolociPraviceUporabniku() + { + if (is_null($this->hierarhija_type)) { + + // Preverimo, kdo je anketo ustvaril + $sql_dostop = sisplet_query("SELECT type FROM srv_hierarhija_users WHERE anketa_d='".$this->anketa."' AND user_id='".$this->user."'", "obj"); + + if(empty($sql_dostop)) + $user_query = sisplet_query("INSERT INTO srv_hierarhija_users (user_id, anketa_id, type) VALUES ('".$this->user."', '$this->anketa', 1)"); + + + if (!$user_query && $this->admin_type == 0) { + echo mysqli_error($GLOBALS['connect_db']); + } + } + } + + /** + * Ko se kativira anketa se doloÄŤi prvo sistemsko vprašanje VLOGA (uÄŤenece, + * uÄŤitelj) to vprašanje samo 1 izrišemo in potem nikoli veÄŤ + */ + public function izrisisSistemskoVprsanjeVloga() + { + //Preverimo, ÄŤe je sistemsko vprašanje vloga Ĺľe ustvarjeno + $grup_id = sisplet_query("SELECT id, vrstni_red FROM srv_grupa WHERE ank_id='" . $this->anketa . "' ORDER BY vrstni_red LIMIT 0,1", "obj"); + $sql_vpisane_spr = sisplet_query("SELECT id, gru_id, variable, vrstni_red FROM srv_spremenljivka WHERE gru_id='" . $grup_id->id . "' AND variable='vloga'"); + + //V kolikor je vloga Ĺľe vnešena in ni postavljena na prvo mesto, potem jo moramo premakniti na prvo mesto + if (mysqli_num_rows($sql_vpisane_spr) == 0) { + + //preštevilÄŤimo ostala vprašanja za 1 + (new HierarhijaAjax($this->anketa))->prestevilciBranching(0, TRUE); + + //vedno ustavimo vlogo (uÄŤenec - uÄŤitelj) + $vloga = [$grup_id->id, 'vloga', 'vloga', '2', '1']; + (new HierarhijaQuery())->insertSpremenljivkaBranching($vloga, NULL, $this->anketa, 1); + + } + } + + /** + * PrikaĹľe nastavitve za dodajanje nivojev in šifrantov - SUPERADMIN + * HIERARHIJA + * + * @return html page + */ + public function hierarhijaSuperadminSifranti() + { + $aktivna = $this->preveriCeJeAktivirana(); + $this->preverimoCeJeVnesenaStruktura(); + + if ($_GET['e'] == 'null') { + echo '
' . $this->lang['srv_hierarchy_element_missing'] . '
'; + } + + if ($aktivna && (is_null($this->hierarhija_type) || $this->hierarhija_type < 4)) { + echo '
'; + + // meni na levi strani + echo '
'; + echo '
' . $this->lang['srv_hierarchy_save_list'] . '
'; + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
+
+ {{ shranjena.ime }} + ({{ shranjena.stEvalvirancev }}) +
+
'; + echo ' +
+ {{ shranjena.ime }} + ({{ shranjena.stEvalvirancev }}) +
+
'; + echo '
'; + echo '
'; + echo '
+ Urejanje +
+ + +
+
'; + echo '
+ Uvoz/Izvoz + + + + +
'; + echo '
'; + + // Uvodno besedilo, ko se aktivira modul hierarhija$anketa + echo '
'; + echo '

' . $this->lang['srv_hierarchy_wellcome_title'] . '

'; + echo $this->lang['srv_hierarchy_wellcome_text'] . '

'; + echo ''; + echo '
'; + + + // OmogoÄŤimo predogled hierarhije + echo ''; + + + // naslov hierarhije + echo '
'; + echo '
'; + echo '

Hierarhija + + {{ (imeHierarhije.shrani.length > 30 ? (imeHierarhije.shrani.substring(0,30)+\' ...\') }} + {{ (imeHierarhije.aktivna.length > 30 ? (imeHierarhije.aktivna.substring(0,30)+\' ...\') : imeHierarhije.aktivna) }} + +

'; + echo '
'; + echo ''; + echo ''; + + // V kolikor imamo že strukturo prikažemo tudi številke + echo '
Hierarhija ima {{ shranjenaHierarhija[imeHierarhije.index].stEvalvirancev }} evalvacij in {{ shranjenaHierarhija[imeHierarhije.index].stUporabnikov }} uporabnikov.
'; + + // Dodajanje nivojev in njihovih nazivov + echo '
'; + echo '

' . $this->lang['srv_hierarchy_create_code'] . '

'; + echo '
+ Ustvari novo hierarhijo +
'; + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + // Vuejs dinamiÄŤno kreiranje novih nivojev + echo ''; + echo ''; + echo ''; + echo ''; + + echo '
' . $this->lang['srv_hierarchy_table_header_nivo_1'] . '' . $this->lang['srv_hierarchy_table_header_nivo_2'] . '
'; + echo '{{ novaHierarhijaSt }}.'; + echo ''; + echo ''; + echo '
' . $this->lang['srv_hierarchy_input_name_nivo'] . '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + + + // Selectbox s šifranti za posamezen nivo, vpis šifrantov dovolimo šele ko imamo vpisano prvo raven + echo '
'; + echo '
'; + echo '
'; + echo '

' . $this->lang['srv_hierarchy_code_lists'] . '

'; + + echo '
+
+ + +
+
'; + echo ' ' . Help::display('srv_hierarchy_edit_elements') . ''; + + echo '
'; + + echo '
'; + + // izris primera šifrantov + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + // Vuejs dinamiÄŤno kreiranje novih nivojev + echo ''; + echo ''; + echo ''; + + echo ''; + echo ''; + echo ''; + + echo '
' . $this->lang['srv_hierarchy_table_header_1'] . '' . $this->lang['srv_hierarchy_table_header_2'] . '' . $this->lang['srv_hierarchy_table_header_3'] . '' . $this->lang['srv_hierarchy_table_header_4'] . '
'; + echo ''; + echo ''; + + ## Vstavimo checkboc od kje naprej se lahko šifranti ponavljajo + echo ''; + echo ''; + echo ''; + echo '
' . $this->lang['srv_hierarchy_input_name_sifrant'] . '
'; + echo '
'; + echo '
'; + + // Naprej na naslednji korak + echo '
'; + // Shranjevanje hierarhije + echo '
'; + echo 'Shrani trenutno hierarhijo pod imenom: '; + echo ''; + echo '
'; + + echo '
+ Hierarhijo Ĺľelim shraniti pod novim imenom. +
'; + + echo '
'; + echo ''; + echo ''; + echo '
'; + echo '
'; + + echo '
'; + + + echo '
'; + echo ''; + echo ''; + + // popup za urejanje vrednosti + echo '
'; + echo '
'; + + // fade pri fullscreen urejanje spremenljivke + echo '
'; + echo '
'; + + } else { + echo '
'; + // Naslov + echo '
'; + echo '

Hierarhija: {{ imeHierarhije.aktivna }}

'; + echo ''; + echo ''; + echo '
'; + + echo '
'; + + // Podatki o aktivaciji hierarhije + $hierarhija_options = new HierarhijaQuery(); + $cas_aktivacije = $hierarhija_options->getDeleteHierarhijaOptions($this->anketa, 'cas_aktivacije_hierarhije', NULL, NULL, FALSE); + $uporabnik_aktivacije = $hierarhija_options->getDeleteHierarhijaOptions($this->anketa, 'uporabnik_aktiviral_hierarhijo', NULL, NULL, FALSE); + $uporabnik = HierarhijaQuery::getUserSurvey($uporabnik_aktivacije); + + echo '
'; + echo '

ÄŚas aktivacije: ' . $cas_aktivacije . '

'; + echo '

Hierarhijo je aktiviral uporabnik: ' . $uporabnik->name . ' ' . $uporabnik->surname . ' (' . $uporabnik->email . ') Podrobnosti

'; + echo '
'; + + echo '
'; + + // Tabela nivojev in šifrantov + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + // Vuejs dinamiÄŤno kreiranje novih nivojev + echo ''; + echo ''; + echo ''; + echo ''; + + echo '
' . $this->lang['srv_hierarchy_table_header_1'] . '' . $this->lang['srv_hierarchy_table_header_2'] . '
'; + echo '
'; + + echo '
'; + echo 'Izvoz šifrantov'; + echo '
'; + + echo '
'; + } + } + + /** + * V kolikor je hierarhija aktivirana potem jo ni mogoče več urejati + * + * @return boolean + */ + + private function preveriCeJeAktivirana() + { + + if ($this->modul['hierarhija'] == 2 && $this->hierarhija_type < 4) { + echo $this->lang['srv_hierarchy_active_text']; + return FALSE; + } + + return TRUE; + } + + /** + * Preverimo, če je bila struktura vnešena + * + * @return boolean + */ + + private function preverimoCeJeVnesenaStruktura() + { + + $hierarhija_opcije = (new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa, 'vpisana_struktura', NULL, NULL, FALSE); + + if (sizeof($hierarhija_opcije) > 0 && isset($hierarhija_opcije['vpisana_struktura']) && $hierarhija_opcije['vpisana_struktura'] == 1) { + $sql_str = sisplet_query("SELECT id FROM srv_hierarhija_struktura WHERE anketa_id='" . $this->anketa . "'"); + + if ($sql_str->num_rows == 0) { + (new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa, 'vpisana_struktura', $id = NULL, 1); + } + } + + } + + /** + * Ko se aktivira anketa se posreduje email učiteljem za reševanje ankete + */ + + public static function aktivacijaAnketePosljiEmail($anketa) + { + # Dobimo samo uporabnike na zadnjem nivoju + $users_upravicen_do_evalvacije = (new HierarhijaOnlyQuery())->queryStrukturaUsers($anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $anketa . ') GROUP BY users.id'); + + if ($users_upravicen_do_evalvacije->num_rows == 0) { + return FALSE; + } + + # Če imamo uporabnike potem gremo za vsak id uporabnika preverit kakšno ima strukturo + while ($uporabnik = $users_upravicen_do_evalvacije->fetch_object()) { + $vloga_poizvedba = self::spremenljivkaVloga('vloga', $anketa); + $url_hierarhija = self::hierarhijaUrl($anketa, $uporabnik->user_id); + + // generiramo kode za vse + foreach ($url_hierarhija as $struktura_id => $url) { + // generiranje kode + foreach ($vloga_poizvedba as $v) { + if ($v->variable == 1) { + $vloga = 'ucenec'; + } + + if ($v->variable == 2) { + $vloga = 'ucitelj'; + } + + // Url parametri hierarhije (nivoji in vloga) + $url_baza = 'vloga=' . $v->id . $url; + + // Url parametre vstavimo v tabelo in generiramo kodo, Pri kodi trenutno uporabimo brez šumnikov, kar zadošča za 60.466.176 različnih kod (36 unikatnih znakov), če bi primanjkovalo se doda šumnik in je nato 90.224.199 kod. + + $vpis_kode_loop = FALSE; + while (!$vpis_kode_loop) { + $vpis_kode_loop = sisplet_query("INSERT INTO + srv_hierarhija_koda + (koda, anketa_id, url, vloga, user_id, hierarhija_struktura_id, datetime) + VALUES + (CONCAT(SUBSTRING('abcdefghijklmnoprstuvzwxq0123456789', RAND()*34+1, 1), + SUBSTRING('abcdefghijklmnoprstuvzwxq0123456789', RAND()*34+1, 1), + SUBSTRING('abcdefghijklmnoprstuvzwxq0123456789', RAND()*34+1, 1), + SUBSTRING('abcdefghijklmnoprstuvzwxq0123456789', RAND()*34+1, 1), + SUBSTRING('abcdefghijklmnoprstuvzwxq0123456789', RAND()*34+1, 1) + ), '" . $anketa . "', '" . $url_baza . "', '" . $vloga . "', '" . $uporabnik->user_id . "', '" . $struktura_id . "', NOW())"); + + + } + } + } + } + + if (HierarhijaQuery::getOptionsPosljiKode($anketa) == 'nikomur') { + HierarhijaQuery::saveOptions($anketa, 'obvesti_samo_ucitelje', 0); + } else { + self::posljiEmailSkodamiUcencemAliSamoUciteljem($anketa); + } + + return TRUE; + } + + private static function spremenljivkaVloga($var, $anketa) + { + $spremenljivke = Cache::cache_all_srv_spremenljivka($anketa, TRUE); + + $spremenljivka_id = NULL; + foreach ($spremenljivke as $spr) { + if ($spr['variable'] == $var) { + $spremenljivka_id = $spr['id']; + } + } + + if (!is_null($spremenljivka_id)) { + return Cache::cache_all_srv_vrednost($spremenljivka_id); + } + + return NULL; + } + + private static function hierarhijaUrl($anketa, $user = NULL) + { + $hierarhija = (new HierarhijaQuery())->pridobiHierarhijoNavzgor($anketa, NULL, $user); + + // če hierarhija še ni narejena + if (is_null($hierarhija)) { + return []; + } + + $max_level = sisplet_query("SELECT MAX(level) AS level FROM srv_hierarhija_ravni WHERE anketa_id='" . $anketa . "'", "obj"); + + //najprej moramo priti do polja z ustreznimi nivjo + foreach ($hierarhija as $key => $array) { + + // če smo res na zadnjem nivoju + if ($max_level->level == sizeof($array)) { + //gremo po nivojih ter sestavimo URL naslov + $url_zacasni = NULL; + foreach ($array as $nivoji) { + $id = (new HierarhijaQuery())->getVrednostIdFromPivot($nivoji['id']); + $url_zacasni .= '&' . $nivoji['nivo'] . '=' . $id; + } + + //sestavljen url dodamo v polje, kot ključ uporabimo ID strukture hierarhije + $url[$key] = $url_zacasni; + } + } + + return $url; + } + + /** + * Funkcija za pošiljanja kode učiteljem pri hierarhiji + * + * @param (int) $anketa + * + * @return send email | error + */ + + public static function posljiEmailSkodamiUcencemAliSamoUciteljem($anketa) + { + global $site_url; + global $lang; + + $ucitelji = sisplet_query("SELECT user_id FROM srv_hierarhija_koda WHERE anketa_id='" . $anketa . "' AND vloga='ucitelj' GROUP BY user_id"); + $koda_za_resevanje_ankete = HierarhijaQuery::getOptionsPosljiKode($anketa); + + if (mysqli_num_rows($ucitelji) == 0) { + return 'Ni podatka o učiteljih'; + } + + + while ($ucitelj = $ucitelji->fetch_object()) { + $kode = sisplet_query("SELECT koda, hierarhija_struktura_id FROM srv_hierarhija_koda WHERE anketa_id='" . $anketa . "' AND vloga='ucitelj' AND user_id='" . $ucitelj->user_id . "'"); + + // Email naslov + $subject = 'Povezava do samooevalvacije za anketo: ' . SurveyInfo::getSurveyTitle(); + + // Email besedilo + $email = ' + + + + + '; + + $email .= $lang['srv_hierarchy_teacher_email_1']; + $email .= '

' . $lang['srv_hierarchy_teacher_email_2'] . '»' . SurveyInfo::getSurveyTitle() . '«' . $lang['srv_hierarchy_teacher_email_3'] . '' . $site_url . 'sa

'; + + $email .= '
'; + $email .= ''; + $email .= ' + '; + + if (SurveyInfo::getSurveyModules('hierarhija') == 2 || in_array($koda_za_resevanje_ankete, ['vsem', 'ucitelju'])) { + $email .= ''; + } + + // V kolikor nimamo nikakršne izbere potem posredujemo kodo tudi za učence + if (in_array($koda_za_resevanje_ankete, ['vsem', 'ucencem'])) { + $email .= ''; + } + + $email .= ''; + $email .= ''; + $email .= ''; + + // generiranje kode + while ($koda = mysqli_fetch_object($kode)) { + $email .= ''; + $email .= ''; + + if (SurveyInfo::getSurveyModules('hierarhija') == 2 || in_array($koda_za_resevanje_ankete, ['vsem', 'ucitelju'])) { + $email .= ''; + } + + // V kolikor prejme učitelj email tudi s kodami za učence + if (in_array($koda_za_resevanje_ankete, ['vsem', 'ucencem'])) { + $koda_ucenci = sisplet_query("SELECT koda FROM srv_hierarhija_koda WHERE anketa_id='" . $anketa . "' AND vloga='ucenec' AND user_id='" . $ucitelj->user_id . "' AND hierarhija_struktura_id='" . $koda->hierarhija_struktura_id . "'", "obj"); + $email .= ''; + } + + $email .= ''; + } + + $email .= ''; + $email .= '
HierarhijaKoda za uÄŤiteljaKoda za uÄŤence
' . HierarhijaHelper::hierarhijaPrikazNaslovovpriUrlju($anketa, $koda->hierarhija_struktura_id, TRUE) . '' . strtoupper($koda->koda) . '' . strtoupper($koda_ucenci->koda) . '
'; + + $user = sisplet_query("SELECT email FROM users WHERE id='" . $ucitelj->user_id . "'", "obj"); + + //Zaključek emaila + // V kolikor se emailpošlje samo učiteljem potem se skrije možnost za dostop učiteljem + $onemogocenDostopUcitelju = (new HierarhijaQuery())->getDeleteHierarhijaOptions($anketa, 'onemogoci_dostop_uciteljem', NULL, NULL, FALSE); + + + if (is_null($onemogocenDostopUcitelju) && is_null($koda_za_resevanje_ankete)) { + $email .= '

' . $lang['srv_hierarchy_teacher_email_4'] . '' . $site_url . '' . $lang['srv_hierarchy_teacher_email_5']; + $email .= '»' . $user->email . '«' . $lang['srv_hierarchy_teacher_email_6'] . '

'; + } + + // Podpis + $signature = Common::getEmailSignature(); + $email .= $signature; + + // Zaključek emaila + $email .= ''; + + + // Pošljemo email + try { + $MA = new MailAdapter($anketa, $type='invitation'); + $MA->addRecipients($user->email); + $MA->sendMail(stripslashes($email), $subject); + } catch (Exception $e) { + echo "Email za hierarhijo ni bil poslan: " . $e; + error_log("Email za hierarhijo ni bil poslan: " . $e); + } + + } + } + + /** + * Prikažemo podatke o hierarhiji pri izpolnjevanju + * + * @param array $get - pridobimo vse get parametre od respondenta + * + * @return eho html + */ + public static function displayPodatkeOhierarhijiZaRespondente($get = [], $only_hierarhija = FALSE) + { + global $lang; + $izpis = ''; + + if (!$only_hierarhija) { + $izpis .= '
'; + $izpis .= $lang['srv_hierarchy_main']; + } + + if (empty($get) || sizeof($get) == 0) { + return NULL; + } + + // Pridobimo ime glede na izbiro + $sifrant = []; + foreach ($get as $key => $param) { + if (preg_match('/nivo(\d+)/', $key, $match)) { + $sql = sisplet_query("SELECT naslov FROM srv_vrednost WHERE id='" . $param . "'", 'obj'); + $sifrant[$match[1]] = $sql->naslov; + } + } + + // Sortiramo po nivojih, da je vedno prvi najprej + ksort($sifrant); + $izpis .= ''; + foreach ($sifrant as $key => $sifra) { + $izpis .= ($key > 1 ? ' - ' : NULL) . $sifra; + } + $izpis .= ''; + + if (!$only_hierarhija) { + $izpis .= '
'; + } + + return $izpis; + } + + /** + * Iščemo v vrednost v 2 dimenzionalnem polju + * return $row/null + */ + public static function iskanjeArray($id, $array, $keyValue = 'id') + { + foreach ($array as $key => $value) { + if ($value[$keyValue] == $id) { + return $value; + } + } + + return NULL; + } + + + /********** SUPERADMIN HIERARHIJA END ***********/ + + /** + * Izvoz šifrantov iz trenutno aktivne hierahije + */ + public function izvozSifrantov() + { + $ravni = (new HierarhijaOnlyQuery())->getSifrantiRavni($this->anketa); + + // V kolikor nimamo šifrantov potem ne moremo nič izvažati + if (is_null($ravni)) { + return redirect('index.php?anketa=' . $this->anketa . '&a=hierarhija_superadmin&m=uredi-sifrante'); + } + + + $csv_polje = NULL; + while ($row = $ravni->fetch_object()) { + $csv_polje[] = [$row->level, $row->raven, $row->sifranti]; + } + + return Export::init()->csv('Hierarhija_izvoz', $csv_polje); + } + + /** + * Možnost uvoza hierarhije šifrantov + * + * @return html page + */ + public function hierarhijaSuperadminUvoz() + { + $aktivna = $this->preveriCeJeAktivirana(); + + #Shranimo CSV datoteko in naredimo strukturo hierarhije + if ($_GET['t'] == 'hierarhija-uvoz' && $aktivna) { + //preverimo, če je CSV format + if (FALSE === array_search($_FILES['uvozi-hierarhijo']['type'], [ + 'csv' => 'text/csv', + ], TRUE)) { + // V kolikor datoteka za uvoz ni v pravem formatu samo vrnemo na prvotno stran + return redirect('index.php?anketa=' . $this->anketa . '&a=hierarhija_superadmin&m=uredi-sifrante'); + } + + if (($datoteka = fopen($_FILES['uvozi-hierarhijo']['tmp_name'], "r")) !== FALSE) { + + //CSV preberemo in zapišemo v polje + while (($data = fgetcsv($datoteka, 10000, ",")) !== FALSE) { + $uvozi_hierarhijo[] = $data; + } + + $ravni = []; + $sifrant = []; + foreach ($uvozi_hierarhijo as $uvoz) { + //pridobimo samo unikatne nivoje in imena nivojev + if (!$this->in_mul_array($uvoz[1], $ravni)) { + $ravni[] = $uvoz; + } + + //Pridobimo vse šifrante samo vranostno preverimo, če bi se slučajno kak šifrant dvakrat ponovil + if (!$this->in_mul_array($uvoz[2], $sifrant)) { + $sifrant[] = $uvoz; + } + } + + // preden vnesemo novo hierarhijo izbrišemo že obstoječo + sisplet_query("DELETE FROM srv_hierarhija_ravni WHERE anketa_id='" . $this->anketa . "'"); + + //vpisemo vse ravni + foreach ($ravni as $raven) { + // Vpišem, samo če je prvi element polja številka, ker gre za številko ravni + if (!empty($raven[0]) && is_numeric($raven[0])) { + sisplet_query("INSERT INTO srv_hierarhija_ravni (anketa_id, user_id, level, ime) VALUES ('$this->anketa', '$this->user', '$raven[0]', '$raven[1]')"); + $raven_id = mysqli_insert_id($GLOBALS['connect_db']); + + //vpišemo vse šifre za sledečo raven + foreach ($sifrant as $sifra) { + if ($raven[0] == $sifra[0]) { + sisplet_query("INSERT INTO srv_hierarhija_sifranti (hierarhija_ravni_id, ime) VALUES ('" . $raven_id . "', '" . $sifra[2] . "')"); + } + } + } + } + + fclose($datoteka); + } + + return redirect('index.php?anketa=' . $this->anketa . '&a=hierarhija_superadmin&m=uredi-sifrante'); + } + } + + /** + * Preveri, če se spremenljivka nahaja v večdimenzionalnem polju + * + * @param string $value + * @param array $array + * + * @return boolean + */ + + public function in_mul_array($value, $array) + { + foreach ($array as $row) { + if (in_array($value, $row)) { + return TRUE; + } + } + return FALSE; + } + + /** + * Možnost nalaganja datoteke, tudi ko je hierarhija aktivna + */ + public function hierarhijaSuperadminUploadLogo() + { + global $site_path; + + // tracking - beleženje sprememb + TrackingClass::update($this->anketa, '20'); + + $finfo = new finfo(FILEINFO_MIME_TYPE); + if (FALSE === $ext = array_search($finfo->file($_FILES['logo']['tmp_name']), [ + 'jpg' => 'image/jpeg', + 'png' => 'image/png', + 'gif' => 'image/gif', + ], TRUE)) { + throw new RuntimeException('Datoteka ni v pravem formatu.'); + } + + $shrani_id = (!empty($_POST['id']) ? $_POST['id'] : NULL); + $path = $site_path . 'admin/survey/modules/mod_hierarhija/porocila/logo/'; + + // Predhodno datoteko pobrišemo + self::brisiLogo($this->anketa, $shrani_id); + + + $logo_ime = time() . '_' . slug($_FILES['logo']['name'], '_'); + if (!move_uploaded_file($_FILES['logo']['tmp_name'], sprintf($path . $logo_ime, sha1_file($_FILES['logo']['tmp_name']), $ext))) { + throw new RuntimeException('Ne morem premakniti datoteke.'); + } + + + $shrani_id = (!empty($_POST['id']) ? $_POST['id'] : NULL); + + sisplet_query("UPDATE srv_hierarhija_shrani SET logo='" . $logo_ime . "' WHERE id='" . $shrani_id . "' AND anketa_id='" . $this->anketa . "'"); + + return redirect('index.php?anketa=' . $this->anketa . '&a=hierarhija_superadmin&m=uredi-sifrante'); + } + + public static function brisiLogo($anketa, $id = NULL) + { + global $site_path; + + if (is_null($id)) { + $id = (!empty($_POST['id']) ? $_POST['id'] : NULL); + } + + $old_logo_name = sisplet_query("SELECT logo FROM srv_hierarhija_shrani WHERE id='" . $id . "' AND anketa_id='" . $anketa . "'", "obj")->logo; + + $datoteka_za_izbris = NULL; + + if (!empty($old_logo_name)) { + $datoteka_za_izbris = $site_path . 'admin/survey/modules/mod_hierarhija/porocila/logo/' . $old_logo_name; + } + + if (file_exists($datoteka_za_izbris)) { + unlink($datoteka_za_izbris); + } + + sisplet_query("UPDATE srv_hierarhija_shrani SET logo='' WHERE id='" . $id . "' AND anketa_id='" . $anketa . "'"); + } + + /** + * Uporabniko prikažemo opcijo za aktiviranje ankete in hierarhije + * + * V kolikor anketa še ni bila aktivirana potem ima uporabnik tudi možnost + * izklopiti hierarhijo + * + * @return + */ + public function aktivacijaHierarhijeInAnkete() + { + // Preveri če je kak uporabnik upravičen do evalvacije + $st_uporabnikov_upravicenih_do_evalvacije = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ') GROUP BY users.id'); + $st_uporabnikov_upravicenih_do_evalvacije = mysqli_num_rows($st_uporabnikov_upravicenih_do_evalvacije); + + if (SurveyInfo::getSurveyModules('hierarhija') == 1) { + // Aktivacija ankete, ki tudi aktivira hierarhij + echo '
'; + echo '

' . $this->lang['srv_hierarchy_activation_link']; + echo ' + + '; + echo '

'; + echo $this->lang['srv_hierarhy_activation_text']; + + if ($st_uporabnikov_upravicenih_do_evalvacije) { + echo '
'; + echo 'Ob aktiviciji ankete bodo upoštevane naslednje nastavitve:
'; + echo ''; + echo ''; + $nastavitve = [ + 'srv_hierarchy_code_for_teacher' => 'ne_poslji_kodo_ucitelju', + 'srv_hierarchy_code_for_students' => 'ne_poslji_kode_ucencem', + 'srv_hierarchy_code_teacher_has_access' => 'onemogoci_dostop_uciteljem', + ]; + foreach ($nastavitve as $prevod => $nastavitev) { + echo ''; + echo ''; + echo ''; + echo ''; + } + echo ''; + echo '
' . $this->lang[$prevod] . 'anketa, $nastavitev)) ? 'checked="checked"' : NULL) . '> + '; + echo 'anketa, $nastavitev) == 1 ? 'checked="checked"' : NULL) . '> +
'; + + echo '
'; + echo $this->lang['srv_hierarchy_code_text_bottom']; + echo '
'; + echo ''; + } else { + echo '
V bazi ni dodanega nobenega uÄŤitelja, zato aktivacija ni mogoÄŤa!
'; + } + + echo '
'; + + // izklop ankete + echo '
'; + echo '

' . $this->lang['srv_hierarchy_turnoff'] . '

'; + echo $this->lang['srv_hierarhy_turnoff_text']; + echo '
'; + echo ''; + echo $this->lang['srv_hierarchy_turnoff'] . ''; + echo '
'; + echo '
'; + + } else { + // Aktivirana anketa in hierarhija + echo '
'; + echo '

' . $this->lang['srv_hierarchy_active_hierarchy_and_survey'] . '

'; + echo $this->lang['srv_hierarchy_active_hierarchy_and_survey_text']; + + $row = SurveyInfo::getInstance()->getSurveyRow(); + echo ''; + echo '
'; + + // Podatki o aktivaciji hierarhije + $hierarhija_options = new HierarhijaQuery(); + $cas_aktivacije = $hierarhija_options->getDeleteHierarhijaOptions($this->anketa, 'cas_aktivacije_hierarhije', NULL, NULL, FALSE); + $uporabnik_aktivacije = $hierarhija_options->getDeleteHierarhijaOptions($this->anketa, 'uporabnik_aktiviral_hierarhijo', NULL, NULL, FALSE); + $uporabnik = HierarhijaQuery::getUserSurvey($uporabnik_aktivacije); + + echo '
'; + echo '

' . $this->lang['srv_hierarchy_active_information_user'] . '

'; + echo '

ÄŚas aktivacije: ' . $cas_aktivacije . '

'; + echo '

Aktivnost evalvacije: od ' . date('d.m.Y', strtotime($row['starts'])) . ' do ' . date('d.m.Y', strtotime($row['expire'])) . '

'; + echo '

Hierarhijo je aktiviral uporabnik: ' . $uporabnik->name . ' ' . $uporabnik->surname . ' (' . $uporabnik->email . ')

'; + + if (HierarhijaQuery::getOptions($this->anketa, 'onemogoci_dostop_uciteljem') == 1) { + echo '

' . $this->lang['srv_hierarchy_teacher_can_not_access'] . '

'; + } + + echo '

' . HierarhijaHelper::textGledeNaOpcije($this->anketa, 'srv_hierarchy_email_code') . '

'; + + $users_upravicen_do_evalvacije = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ') GROUP BY users.id'); + echo '
    '; + while ($uporabnik = $users_upravicen_do_evalvacije->fetch_object()) { + echo '
  • ' . $uporabnik->email . '
  • '; + } + echo '
'; + + // Obvesti učitelje, če niso bili obveščeni + $obvesti_Samo_ucitelje = HierarhijaQuery::getOptions($this->anketa, 'obvesti_samo_ucitelje'); + if (!is_null($obvesti_Samo_ucitelje) && $obvesti_Samo_ucitelje == 0) { + echo '
'; + } + + echo '
'; + + // Obveščanje managerjev + $managerji_ankete = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND hs.level<(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ')'); + if (mysqli_num_rows($managerji_ankete) > 0) { + echo '
'; + echo '

' . $this->lang['srv_hierarchy_active_information_about_manager'] . '

'; + echo '

' . $this->lang['srv_hierarchy_active_information_about_manager_text'] . '

'; + + echo '
'; + echo ''; + echo ''; + + echo '
    '; + while ($manager = $managerji_ankete->fetch_object()) { + echo '
  • '; + } + echo '
'; + + echo ''; + echo '
'; + echo '
'; + } + } + + } + + /** + * Uporabniko prikažemo opcijo za kopiranje ankete s šifranti in strukturo + */ + public function kopiranjeHierarhijeInAnkete() + { + + echo '
'; + echo '

' . $this->lang['srv_hierarchy_copy_link'] . '

'; + echo $this->lang['srv_hierarhy_copy_text']; + echo ''; + echo '

'; + echo $this->lang['srv_hierarhy_copy_text_2']; + echo ''; + echo '
'; + + } + + /** + * Prikaz in urejanje hierarhije + * + * @return html page + */ + public function displayHierarhijaUporabniki() + { + SurveySetting::getInstance()->Init($this->anketa); + $row = SurveyInfo::getInstance() + ->getSurveyRow(); //("SELECT * FROM srv_anketa WHERE id='$this->anketa'") + + $max_st_nivojev = (new HierarhijaOnlyQuery())->getSifrantiRavni($this->anketa, ', MAX(level) AS max', NULL); + + //preverimo število nivojev v kolikor jih ni potem nimamo še podatka o vnesenih šifrantih + if (!empty($max_st_nivojev) && !is_null($max_st_nivojev = $max_st_nivojev->fetch_object()->max) && SurveyInfo::getSurveyModules('hierarhija') == 1) { + // Pridobimo ime hierarhije + $aktivna_hierarhija_ime = (new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa, 'aktivna_hierarhija_ime', NULL, NULL, FALSE); + + echo '

Izgradnja hierarhije ' . (!empty($aktivna_hierarhija_ime) ? $aktivna_hierarhija_ime : '') . ' za anketo: ' . $row['naslov'] . '

'; + echo 'Ob aktiviranju bodo uporabniki na najnižjem nivoju prejeli kodo/šifro'; + + //vnosni obrazec za izgradnjo hierarhije + echo '
'; + + //pravice za gradnjo hierarhije v kolikor uporabnik ni super admin (type 5 ali več) ima tyle manjši kot 5 + if ($this->hierarhija_type > 4) { + + $sql = HierarhijaOnlyQuery::queryStrukturaUsersLevel($this->anketa, $this->user, 'ASC'); + //pridobimo največji nivo uporabnika ter id-je strukture + while ($struktura = $sql->fetch_object()) { + ## pridobimo največji nivo uporabnika ter id-je strukture za posamezen vpis + if (!isset($level) || $struktura->level < $level) { + $level = $struktura->level; + } + + $struktura_nivo[] = $struktura->parent_id; + $struktura_nivo[] = $struktura->struktura_id; + } + + $struktura_parent = (new HierarhijaOnlyQuery())->queryStruktura($this->anketa, NULL, NULL, 'id DESC'); + while ($obj = $struktura_parent->fetch_object()) { + //v polje vnesemo samo id strukture, ki je višja od trenutnega nivoja uporabnika + if (isset($obj) && in_array($obj->id, $struktura_nivo)) { + $struktura_nivo[] = $obj->parent_id; //tu povnimo parent_id, da lahko potem poiščemo celotno strukturo + $struktura_sifrant_id[] = $obj->sifrant_id; // narredimo polje z vsemi ID, sifrantov, ki so že vpisani za hierarhijo + } + } + + } + $results = (new HierarhijaQuery())->getSifrantAdmin($this->anketa); + + if (!is_null($results)) { + if (isset($level)) { + $this->vpisHierarhijeAdmin($results, $level, $struktura_sifrant_id); + } else { + $this->vpisHierarhijeAdmin($results); + } + } + + echo '
'; + + //prikaĹľi JS Tree s trenutno hierarhijo + $this->jsTreePrikazHierarhije(); + } elseif (!empty($max_st_nivojev) && SurveyInfo::getSurveyModules('hierarhija') == 2) { + echo '

' . $this->lang['srv_hierarchy_active_text'] . '

'; + $this->jsTreePrikazHierarhije(); + } else { + echo '

' . $this->lang['srv_hierarchy_nothing'] . '

'; + } + } + + /** + * Nariše drevesno strukturo hierarhi + * + * @return HTML view + */ + public function jsTreePrikazHierarhije() + { + + $hierarhija = (new HierarhijaOnlyQuery())->queryStruktura($this->anketa, NULL, ' AND parent_id IS NULL') + ->fetch_object(); + + echo '
'; + if (!is_null($hierarhija->ravni_ime)) { + echo '

Hierarhija

'; + echo '' . $hierarhija->ravni_ime; + if ($this->hierarhija_type > 4) { + echo ' - ' . $hierarhija->sifrant_ime; + } + echo ': '; + } + echo '
'; + + // LOAD jsTree na ta element + echo '
'; + + echo ''; + echo ''; + } + + /** + * Gradnja uporabnikov/hierarhije, kjer lahko uporabnik izbira kako želi + * imeti prikazana podatke + */ + public function izberiDodajanjeUporabnikovNaHierarhijo() + { + global $site_url; + + // za vse ostalo je ure uredi uporabnike - M_UREDI_UPORABNIKE + SurveySetting::getInstance()->Init($this->anketa); + $row = SurveyInfo::getInstance()->getSurveyRow(); + $hierarchy_status = SurveyInfo::getSurveyModules('hierarhija'); + + $max_st_nivojev = (new HierarhijaOnlyQuery())->getSifrantiRavni($this->anketa, ', MAX(level) AS max', NULL); + + //preverimo število nivojev v kolikor jih ni potem nimamo še podatka o vnesenih šifrantih + if (!empty($max_st_nivojev) && !is_null($max_st_nivojev = $max_st_nivojev->fetch_object()->max) && $hierarchy_status == 1) { + + // Preverimo, če so vpisani šifranti, drugače preusmerimo na vpis šifrantov + $sql = (new HierarhijaOnlyQuery())->getSifrantiRavni($this->anketa); // pridobimo vse nivoje in šifre za vpis uporabnikov + if ($sql->num_rows > 0) { + while ($obj = $sql->fetch_object()) { + if (empty($obj->sifranti)) { + return redirect($site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&a=' . A_HIERARHIJA_SUPERADMIN . '&m=' . M_ADMIN_UREDI_SIFRANTE . '&e=null'); + } + } + } + + // Preverimo na katerem nivoju se nahaja uporabnik + $uporabnik_level = HierarhijaOnlyQuery::queryStrukturaUsersLevel($this->anketa, $this->user, 'ASC') + ->fetch_object()->level; + + if ($this->hierarhija_type < 4 || $uporabnik_level != $max_st_nivojev) { + // Pridobimo ime hierarhije + $aktivna_hierarhija_ime = (new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa, 'aktivna_hierarhija_ime', NULL, NULL, FALSE); + + echo '

Izgradnja hierarhije ' . (!empty($aktivna_hierarhija_ime) ? $aktivna_hierarhija_ime : '') . ' za anketo: ' . $row['naslov'] . '

'; + echo '
'; + echo '
'; + echo $this->lang['srv_hierarchy_user_help_top_1']; + echo ' Vse uporabnike lahko uvozite tukaj '; + echo '

' . $this->lang['srv_hierarchy_user_help_top_2']; + echo '
'; + echo ''; + echo '
'; + + //vnosni obrazec za izgradnjo hierarhije + echo '
'; + + $results = (new HierarhijaQuery())->getSifrantAdmin($this->anketa); + + if (!is_null($results)) { + + // V kolikor je postavvljena spremenljivka $level, potem ni superadmin, ampak uporabnik na doloÄŤenem nivoju + if ($this->hierarhija_type > 4) { + $this->vpisHierarhijeUporabnikTabela($results); + } else { + $this->vpisHierarhijeAdminTabela($results); + } + + } + + echo '
'; + } + + //prikaĹľi JS Tree s trenutno hierarhijo + $this->jsTreePrikazHierarhije(); + } elseif (!empty($max_st_nivojev) && $hierarchy_status == 2) { + echo '

' . $this->lang['srv_hierarchy_active_text'] . '

'; + + if ($this->hierarhija_type < 5) { + $results = (new HierarhijaQuery())->getSifrantAdmin($this->anketa); + + // PrikaĹľemo samo datatables + echo '
'; + echo '
'; + echo '

Prikaz zgrajene hierarhije:

'; + echo ''; + +// echo ''; +// echo ''; + echo ''; + echo ''; + echo ' '; + foreach ($results['nivoji'] as $key => $nivo) { + echo ''; + } + echo ''; + echo ''; + echo ''; + echo ''; + echo '
' . $nivo['level'] . '.nivo: ' . $nivo['ime'] . '
'; + echo '
'; + echo '
'; + } + + $this->jsTreePrikazHierarhije(); + } else { + echo '

' . $this->lang['srv_hierarchy_nothing'] . '

'; + } + } + + /** + * Izris forme za gradnjo hierarhije uporabnik na doloÄŤenem nivoju + * + * @param array $results + * + * @return echo html + */ + private function vpisHierarhijeUporabnikTabela($results) + { + echo '
'; + + // Kadar nimamo vpisanih šifrantov + echo '
'; + echo $this->lang['srv_hierarchy_empty_drop_downs']; + echo '
'; + + echo '
'; + echo ''; + + echo ''; + echo ''; + foreach ($results['nivoji'] as $key => $nivo) { + $array_key = array_keys($results['nivoji']); + if ($key == end($array_key)) { + echo ''; + } else { + echo ''; + } + } + echo ''; + echo ''; + echo ''; + + echo ''; + echo ''; + + // ÄŚe je uporabnik izbran na doloÄŤen nivo, potem pred tem naredimo fiksna polja z input disabled + echo ''; + + echo ''; + echo ''; + echo ''; + echo ' + + '; + echo ''; + echo '
' . $nivo['level'] . '. nivo - ' . $nivo['ime'] . '' . $nivo['level'] . '. nivo - ' . $nivo['ime'] . 'Evalviranec
'; + echo '
{{ struktura.ime }}
'; + echo '
'; + // PrikaĹľemo Select2, samo ÄŤe je 1 nivo in celotne js oz. spletna stran naloĹľena - v kolikor je poÄŤasna povezava potem nekaj ÄŤasa potrebuje, da naloĹľi tudi select2 + echo '
'; + echo '
+ +
'; + echo '
+ + +
'; + echo '
'; + + // PrikaĹľemo Ĺľe dodane uporabnike in tudi uporabnike samo dodane v virtual dom + echo '
'; + echo 'Uporabnik/i:'; + echo '
    '; + // Seznam uporabnikov, ki so Ĺľe v bazi in jih samo prikliÄŤemo + echo '
  • {{ uporabnik.email }} + ({{ uporabnik.ime }} {{ uporabnik.priimek }}) + +
  • '; + // Seznam uporabnikov, ki jih še ni v bazi in so bili na novo dodani + echo '
  • {{ oseba[0] }} ({{ oseba[1] }} {{ oseba[2] }})
  • '; + echo '
'; + echo '
'; + echo '
'; + // Seznam uporabnikov, ki so Ĺľe v bazi in jih samo prikliÄŤemo + echo '
{{ uporabnik.email }} + ({{ uporabnik.ime }} {{ uporabnik.priimek }}) +
'; + // Seznam uporabnikov, ki jih še ni v bazi in so bili na novo dodani + echo '
{{ oseba[0] }} ({{ oseba[1] }} {{ oseba[2] }})
'; + echo '
+ +
'; + echo '
'; + + // moĹľnost vpisa osebe za doloÄŤen nivo + echo '
'; + echo '
'; + echo '

Vnos oseb za {{ osebe.nivo }}. nivo:

'; + echo '
'; + echo $this->lang['srv_hierarchy_add_users'] . ' +
+ + +
+
*Polje email je obvezno polje za zadnji nivo.
+
  • Elektronski naslov {{ email.naslov }} v vrstici {{ email.vrstica }} ni pravilen.
+ '; + echo '
'; + echo ''; + echo '
'; + echo '
'; + + + // PrikaĹľemo Datatables rezultate samo za zdanji nivo; + echo '
'; + echo '

Prikaz zgrajene hierarhije:

'; + echo ''; + echo ''; + echo ' '; + foreach ($results['nivoji'] as $key => $nivo) { + echo ''; + } + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
' . $nivo['level'] . '.nivo: ' . $nivo['ime'] . '
'; + echo '
'; + echo '
'; + } + + /** + * Izris forme za gradnjo hierarhije Superadmin + * + * @param array $results + * + * @return echo html + */ + private function vpisHierarhijeAdminTabela($results) + { + global $site_url; + + echo '
'; + // Kadar nimamo vpisanih šifrantov + echo '
'; + echo $this->lang['srv_hierarchy_empty_drop_downs']; + echo '
'; + + echo '
'; + echo ''; + echo ''; + foreach ($results['nivoji'] as $key => $nivo) { + $polje_kljuci = array_keys($results['nivoji']); + if ($key == end($polje_kljuci)) { + echo ''; + } else { + echo ''; + } + } + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ' + + '; + echo ''; + echo '
' . $nivo['level'] . '. nivo - ' . $nivo['ime'] . '' . $nivo['level'] . '. nivo - ' . $nivo['ime'] . 'Evalviranec
'; + // PrikaĹľemo Select2, samo ÄŤe je 1 nivo in celotne js oz. spletna stran naloĹľena - v kolikor je poÄŤasna povezava potem nekaj ÄŤasa potrebuje, da naloĹľi tudi select2 + echo '
'; + + echo '
+ +
'; + + echo '
+ + +
'; + + echo '
+ +
'; + + echo '
'; + + + // PrikaĹľemo Ĺľe dodane uporabnike in tudi uporabnike samo dodane v virtual dom + echo '
'; + echo 'Uporabnik/i:'; + echo '
    '; + // Seznam uporabnikov, ki so Ĺľe v bazi in jih samo prikliÄŤemo + echo '
  • {{ uporabnik.email }} + ({{ uporabnik.ime }} {{ uporabnik.priimek }}) + +
  • '; + // Seznam uporabnikov, ki jih še ni v bazi in so bili na novo dodani + echo '
  • {{ oseba[0] }} ({{ oseba[1] }} {{ oseba[2] }})
  • '; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + // Seznam uporabnikov, ki so Ĺľe v bazi in jih samo prikliÄŤemo + echo '
{{ uporabnik.email }} + ({{ uporabnik.ime }} {{ uporabnik.priimek }}) +
'; + // Seznam uporabnikov, ki jih še ni v bazi in so bili na novo dodani + echo '
{{ oseba[0] }} ({{ oseba[1] }} {{ oseba[2] }})
'; + echo '
'; + echo '
+ +
'; + echo ''; + echo '
'; + + // moĹľnost vpisa osebe za doloÄŤen nivo + echo '
'; + echo '
'; + echo '

Vnos oseb za {{ osebe.nivo }}. nivo ​– managerji z vpogledom v rezultate (?)

'; + echo '

​Vnos osebe na zadnjem nivoju - učitelj, ki bo evalviran (?)

'; + echo '
'; + echo '

' . $this->lang['srv_hierarchy_add_users'] . '

'; + echo '

' . $this->lang['srv_hierarchy_add_users_last'] . '

'; + echo '
'; + echo ' + +
+
*Polje email je obvezno polje za zadnji nivo.
+
  • Elektronski naslov {{ email.naslov }} v vrstici {{ email.vrstica }} ni pravilen.
'; + echo '
'; + echo ''; + echo '
'; + echo '
'; + + + // PrikaĹľemo Datatables rezultate samo za zdanji nivo; + echo '
'; + echo '

Prikaz zgrajene hierarhije:

'; + // Vklopimo prikaz pomoči in števila vnoso uporabnikov + echo '
'; + $this->prikaziStUporabnikovNaZadnjemNivojuHelp(); + echo '
'; + + echo '
+
' . $this->lang['srv_hierarchy_btn_find_and_replace'] . '
+
'; + echo ''; + echo ''; + echo ''; + echo ' '; + foreach ($results['nivoji'] as $key => $nivo) { + echo ''; + } + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
' . $nivo['level'] . '.nivo: ' . $nivo['ime'] . '
'; + echo '
'; + echo ''; + echo '
'; + echo '
'; + echo '
'; + } + + /** + * Prikažemo število vseh uporabnikov na zadnjem nivoju, število unikatnih + * učiteljev in število predmetov + * + * @return html + */ + private function prikaziStUporabnikovNaZadnjemNivojuHelp() + { + + $id = (new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa, 'srv_hierarhija_shrani_id', NULL, NULL, FALSE); + // Če ne dobimo ID-ja + if (empty($id)) { + return NULL; + } + + $sql_st_uciteljev = sisplet_query("SELECT st_uciteljev FROM srv_hierarhija_shrani WHERE id='" . $id . "' AND anketa_id='" . $this->anketa . "'", "obj"); + + // Prešteje število unikatnih učiteljev + $unikatni_uporabniki = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ') GROUP BY users.id'); + $st_unikatnih_uporabnikov = mysqli_num_rows($unikatni_uporabniki); + + // Prešteje število unikatnih predmetov + $unikatni_predmeti = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $this->anketa . ') GROUP BY hs.hierarhija_sifranti_id'); + $st_unikatnih_predmetov = mysqli_num_rows($unikatni_predmeti); + + echo $this->lang['srv_hierarchy_user_help_1_1']; + echo ' ' . $sql_st_uciteljev->st_uciteljev . ' '; + echo $this->lang['srv_hierarchy_user_help_1_2']; + echo ' ' . $st_unikatnih_uporabnikov . ' ' . $this->lang['srv_hierarchy_user_help_1_3'] . ' ' . $st_unikatnih_predmetov . ' ' . $this->lang['srv_hierarchy_user_help_1_4']; + + } + + /** + * Prikaže tabelo za gradnjo hierarhije uporabnikov + */ + public function displayHierarhijaUporabnikiTabela() + { + SurveySetting::getInstance()->Init($this->anketa); + $row = SurveyInfo::getInstance() + ->getSurveyRow(); //("SELECT * FROM srv_anketa WHERE id='$this->anketa'") + + $max_st_nivojev = (new HierarhijaOnlyQuery())->getSifrantiRavni($this->anketa, ', MAX(level) AS max', NULL); + + + //preverimo število nivojev v kolikor jih ni potem nimamo še podatka o vnesenih šifrantih + if (!empty($max_st_nivojev) && !is_null($max_st_nivojev = $max_st_nivojev->fetch_object()->max) && SurveyInfo::getSurveyModules('hierarhija') == 1) { + // Pridobimo ime hierarhije + $aktivna_hierarhija_ime = (new HierarhijaQuery())->getDeleteHierarhijaOptions($this->anketa, 'aktivna_hierarhija_ime', NULL, NULL, FALSE); + + echo '

Izgradnja hierarhije ' . (!empty($aktivna_hierarhija_ime) ? $aktivna_hierarhija_ime : '') . ' za anketo: ' . $row['naslov'] . '

'; + + //vnosni obrazec za izgradnjo hierarhije + echo '
'; + + //pravice za gradnjo hierarhije v kolikor uporabnik ni super admin (type večji kot 5) + if ($this->hierarhija_type > 4) { + + $sql = HierarhijaOnlyQuery::queryStrukturaUsersLevel($this->anketa, $this->user, 'ASC'); + //pridobimo največji nivo uporabnika ter id-je strukture + while ($struktura = $sql->fetch_object()) { + ## pridobimo največji nivo uporabnika ter id-je strukture za posamezen vpis + if (!isset($level) || $struktura->level < $level) { + $level = $struktura->level; + } + + $struktura_nivo[] = $struktura->parent_id; + $struktura_nivo[] = $struktura->struktura_id; + } + + $struktura_parent = (new HierarhijaOnlyQuery())->queryStruktura($this->anketa, NULL, NULL, 'id DESC'); + while ($obj = $struktura_parent->fetch_object()) { + //v polje vnesemo samo id strukture, ki je višja od trenutnega nivoja uporabnika + if (isset($obj) && in_array($obj->id, $struktura_nivo)) { + $struktura_nivo[] = $obj->parent_id; //tu povnimo parent_id, da lahko potem poiščemo celotno strukturo + $struktura_sifrant_id[] = $obj->sifrant_id; // narredimo polje z vsemi ID, sifrantov, ki so že vpisani za hierarhijo + } + } + + } + $results = (new HierarhijaQuery())->getSifrantAdmin($this->anketa); + + if (!is_null($results)) { + // echo '
'; + // echo ''; + // + // if (isset($level)) { + // $this->vpisHierarhijeTabela($results, $level, $struktura_sifrant_id); + // } else { + // $this->vpisHierarhijeTabela($results, null, null, $max_st_nivojev); + // } + + // echo ''; + // echo ''; + // + // if (isset($level)) { + // $this->vpisHierarhijeAdmin($results, $level, $struktura_sifrant_id); + // } else { + // $this->vpisHierarhijeAdmin($results); + // } + // + // + // echo '
+ // + //
+ // + //
+ //
'; + // + // echo '
+ // + //
+ // + //
+ //
*Polje email je obvezno polje za zadnji nivo.
+ //
'; + // + // echo '
+ // + //
'; + // echo '
'; + + } + + + echo '
'; + + //prikaĹľi JS Tree s trenutno hierarhijo + $this->jsTreePrikazHierarhije(); + } elseif (!empty($max_st_nivojev) && SurveyInfo::getSurveyModules('hierarhija') == 2) { + echo '

' . $this->lang['srv_hierarchy_active_text'] . '

'; + $this->jsTreePrikazHierarhije(); + } else { + echo '

' . $this->lang['srv_hierarchy_nothing'] . '

'; + } + + } + + public function statistikaHierjearhije() + { + if ($this->hierarhija_type < 5) { + return $this->statistikaAdminHierarhije(); + } + + if ($this->hierarhija_type == 10) { + return $this->statistikaUcitelj(); + } + + echo $this->lang['srv_hierarchy_only_teachers']; + } + + /** + * Prikaz statisti za vse ankete brez kod, ker administrator nima pravice do + * vpolgeda teh kod + */ + + public function statistikaAdminHierarhije() + { + echo '
'; + + if (SurveyInfo::getSurveyModules('hierarhija') == 2) { + echo '
'; + echo ''; + echo '
'; + } + + echo '
'; + echo ''; + echo ''; + echo ' + + + + + + '; + echo ''; + echo ' + '; + echo ' + + + + + + '; + echo ''; + echo ''; + + $body = HierarhijaIzvoz::getInstance($this->anketa)->getStatus(TRUE); + + if (is_null($body)) { + return ''; + } + + foreach ($body as $id_koda => $row) { + echo ''; + echo ''; + + // Izrišemo vse stolpce v omenjeni vrstici + foreach ($row as $key => $podatek) { + if ($key == 0 || $key == 1) { + + echo ''; + + } elseif ($key == 2 || $key == 8) { + + echo ''; + + } else { + + echo ''; + + } + + } + + echo ''; + } + + echo ''; + echo '
Izberi učitelja za generiranje super šifreHierarhijaEmail učiteljaKoda za učenceStatus učencevČasovni potek učencevKoda za učiteljaVnos učitelja (datum)
' . $this->lang['srv_userstatus_5ll'] . '' . $this->lang['srv_userstatus_5'] . '' . $this->lang['srv_userstatus_6'] . 'Prvi vnosZadnji vnos
+ + ' . $podatek . '' . $podatek . '' . $podatek . '
'; + echo '
'; + + echo '
+ + + + + + + + + +
'; + + echo '
'; + + // košarica s kodami + echo '
'; + echo ''; + + echo ''; + echo '
'; + } + + /** + * Prikaže tabelo s kodami za učitelja in učence skupaj s s statističnimi + * podatki + */ + + protected function statistikaUcitelj() + { + if (!$this->upravicenDoSamoevalvacije()) { + die(); + } + + echo ''; + echo ''; + echo ' + '; + echo ''; + + echo ' + + + + '; + echo ' + + + + + + + '; + echo ''; + echo ''; + + //v kolikor imamo več URL-jev se pravi za več predmetov potem moramo izpisati sklope za vse predmete + $url_hierarhija = self::hierarhijaUrl($this->anketa); + + // pridobimo podatke + + foreach ($url_hierarhija as $struktura_id => $url) { + // pridobimo podatke o rešenih anketah samo za to strukturo + $cas = $this->pridobiStatisticnePodatke($struktura_id, 'ucenec'); + $cas_ucitelj = $this->pridobiStatisticnePodatke($struktura_id, 'ucitelj'); + + $first_insert = NULL; + $last_insert = NULL; + $zacel_izpolnjevati = 0; + $delno_izpolnjena = 0; + $koncal_anketo = 0; + + if (!is_null($cas)) { + foreach ($cas as $key => $row) { + if ($row['cas'] < $first_insert || $key == 0) { + $first_insert = $row['cas']; + } + + if ($row['cas'] > $last_insert) { + $last_insert = $row['cas']; + } + + // Končal anketo + if ($row['status'] == 6 && $row['lurker'] == 0) { + $koncal_anketo++; + } + + // Delno izpolnjena + if ($row['status'] == 5 && $row['lurker'] == 0) { + $delno_izpolnjena++; + } + + if ($row['lurker'] == 1) { + $zacel_izpolnjevati++; + } + } + } + + echo ' + '; + + echo ''; + + echo ' + + + + + + '; + + // V kolikor je hierarhija aktivna potem prikažemo možnost pregleda analiz + if ($this->modul['hierarhija'] > 1) { + echo ''; + } + echo ''; + } + + echo ''; + echo '
HierarhijaKoda za uÄŤenceKoda za uÄŤiteljaStatus uÄŤencevÄŚasovni potek uÄŤencevVnos uÄŤitelja (datum)
' . $this->lang['srv_userstatus_5ll'] . '' . $this->lang['srv_userstatus_5'] . '' . $this->lang['srv_userstatus_6'] . 'Prvi vnosZadnji vnos
' . HierarhijaHelper::hierarhijaPrikazNaslovovpriUrlju($this->anketa, $struktura_id) . '' . strtoupper(HierarhijaOnlyQuery::getKodaRow($this->anketa, $struktura_id)->koda) . '' . strtoupper(HierarhijaOnlyQuery::getKodaRow($this->anketa, $struktura_id, 'ucitelj')->koda) . '' . (!empty($zacel_izpolnjevati) ? $zacel_izpolnjevati : '/') . '' . (!empty($delno_izpolnjena) ? $delno_izpolnjena : '/') . '' . (!empty($koncal_anketo) ? $koncal_anketo : '/') . '' . (!is_null($first_insert) ? date('d.m.Y, H:i', $first_insert) : '/') . '' . (!is_null($last_insert) ? date('d.m.Y, H:i', $last_insert) : '/') . '' . ((!is_null($cas_ucitelj['cas']) && $cas_ucitelj['status'] == 6 && $cas_ucitelj['lurker'] == 0) ? date('d.m.Y, H:i', $cas_ucitelj['cas']) : '/') . 'Poglej analizo
'; + } + + /** + * Preverimo, če je uporabnik upravičen do samoevalvacije - je na zadnjem + * nivoju hierarhije + * + * @return boolean + */ + + public function upravicenDoSamoevalvacije() + { + + $max_level = (new HierarhijaOnlyQuery())->getSifrantiRavni($this->anketa, ', MAX(level) AS max', NULL); + $user_level = HierarhijaOnlyQuery::queryStrukturaUsersLevel($this->anketa, $this->user, 'DESC'); + + if (!empty($user_level) && !empty($user_level) && $user_level->fetch_object()->level == $max_level->fetch_object()->max) { + return TRUE; + } + + return FALSE; + } + + /********** Prikaz in urejanje hierarhije END **********/ + + private function pridobiStatisticnePodatke($struktura_id, $vloga) + { + + $url = sisplet_query("SELECT url FROM srv_hierarhija_koda WHERE anketa_id='" . $this->anketa . "' AND hierarhija_struktura_id='" . $struktura_id . "' AND vloga='" . $vloga . "'", "obj")->url; + + // V kolikor anketa še ni bila aktivirana potem vrnemo null, ker nimamo še podatkov o izpolnjevanju + if (is_null($url)) { + return NULL; + } + + parse_str($url, $nivoji); + + $polje_iskanja = NULL; + foreach ($nivoji as $key => $nivo) { + if ($key == 'vloga') { + $polje_iskanja = $nivo; + } else { + $polje_iskanja .= ', ' . $nivo; + } + } + + $db_table = (SurveyInfo::getInstance() + ->getSurveyColumn('db_table') == 1) ? '_active' : ''; + + // tukaj pridobimo podatke o anketi za določeno strukturo + // preverimov prvi in zadnji nivo + $sql_user = sisplet_query("SELECT time_insert, last_status, lurker FROM srv_data_vrednost" . $db_table . " as sa LEFT JOIN srv_user as us ON (sa.usr_id=us.id) WHERE vre_id IN (" . $polje_iskanja . ") GROUP BY usr_id HAVING COUNT(usr_id)=" . sizeof($nivoji)); + $cas = []; + + // V kolikor ni zapisov vrnemo prazno + if ($sql_user->num_rows == 0) { + return NULL; + } + + while ($row = mysqli_fetch_object($sql_user)) { + $cas[] = [ + 'cas' => strtotime($row->time_insert), + 'status' => $row->last_status, + 'lurker' => $row->lurker, + ]; + } + + if ($vloga == 'ucitelj') { + return $cas[0]; + } + + + return (sizeof($cas) > 0 ? $cas : NULL); + } + /********** Prikaz in urejanje hierarhije END **********/ + + /** + * Prikaže glavni meni za super admina - userja, ki je aktiviral hierarhijo + * + * @return html + */ + public function displayHierarhijaNavigationSuperAdmin() + { + if (is_null($this->hierarhija_type)) { + $this->hierarhija_type = HierarhijaHelper::preveriTipHierarhije($this->anketa); + } + + // V kolikor nima pravic običjanega uporabnika potem ne prikažemo nič + if ($this->admin_type > 0 && (is_null($this->hierarhija_type) || $this->hierarhija_type > 4)) { + die(); + } + + $url = NULL; + if (!empty($_GET['m'])) { + $url = $_GET['m']; + } + + // preverimo status hierarhije + $hierarchy_status = SurveyInfo::getSurveyModules('hierarhija'); + + echo '
'; + echo ''; + echo '
'; + + } + + /** + * PrikaĹľe glavni meni vse uporabnike, ki imajo pravico za dostop do + * hierarhije + * + * @return html + */ + public function displayHierarhijaNavigation() + { + global $site_url; + // V kolikor nima pravic obiÄŤjanega uporabnika potem ne prikaĹľemo niÄŤ + if (is_null($this->hierarhija_type) || $this->hierarhija_type < 5) { + die(); + } + + $url = NULL; + if (!empty($_GET['m'])) { + $url = $_GET['m']; + } + + + $hierarchy_status = SurveyInfo::getSurveyModules('hierarhija'); + + echo '
'; + echo ''; + echo '
'; + + } + +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php new file mode 100644 index 0000000..3f283f6 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php @@ -0,0 +1,340 @@ +{'survey-'.$ank_id})) { + + $active = ''; + if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) { + $active = '_active'; + } + + // ID uporabnika, glede na njegov piškot + $srv_user = sisplet_query("SELECT id FROM srv_user WHERE cookie='".$get->{'survey-'.$ank_id}."'", "obj")->id; + + // Pridobimo vse odgovore - strukturo hierarhije + $vrednosti = sisplet_query("SELECT + v.naslov AS naslov, + ss.variable AS variable, + v.id AS spr_id + FROM + srv_data_vrednost".$active." AS sd + LEFT JOIN + srv_vrednost AS v + ON + sd.vre_id=v.id + LEFT JOIN + srv_spremenljivka AS ss + ON + v.spr_id=ss.id + WHERE sd.usr_id='".$srv_user."' ORDER BY ss.variable DESC", "obj"); + } + + // Zanka po vseh besedah v texstu, k so med lojtrama ( + foreach ($matches[0] as $key => $match) { + $iskanje = strtolower($matches[1][$key]); + + // Zamenjava nivojev (primer: nivo1, nivo2, ...) in vloge (učenec, učitelj) + if (! empty($get->{$iskanje})) { + $variabla = sisplet_query("SELECT naslov FROM srv_vrednost WHERE id='".$get->{$matches[1][$key]}."'", "obj"); + $text = str_ireplace($match, $variabla->naslov, $text); + } elseif ($iskanje === 'hierarhija') { + $hierarhija_pot = Hierarhija::displayPodatkeOhierarhijiZaRespondente($get, true); + $text = str_ireplace($match, $hierarhija_pot, $text); + } + + // Kadar nivoje menjamo na ostalih vprašanjih in nimamo več Get parametrov, potem pridobimo iz že shranjenih sistemskih odgovorov + if (! empty($vrednosti)) { + $url_variables = ''; + + foreach ($vrednosti as $vrednost) { + if ($vrednost->variable == $matches[1][$key]) { + $text = str_ireplace($match, $vrednost->naslov, $text); + } + + if (! empty($vrednost->variable)) { + $url_variables .= $vrednost->variable.'='.$vrednost->spr_id.'&'; + } + } + } + + // Ostranimo lojtro iz zadnjega nivoja, da lahko nato preverimo pa url naslovu v bazi + $url_variables = substr($url_variables, 0, strlen($url_variables) - 1); + + // zamenjava podatkov o učitelju/uporabniku - ime, priimek, email + if (in_array($iskanje, ['ime ucitelja', 'email ucitelja'])) { + // Pridobimo podatke u uporabniku za sledečo anketo + if (! empty($get->enc)) { + $url_variables = base64_decode($get->enc); + } + + $user = sisplet_query("SELECT u.email AS email, u.name AS name, u.surname AS surname FROM srv_hierarhija_koda AS h LEFT JOIN users AS u ON u.id=h.user_id WHERE h.anketa_id='".$ank_id."' AND h.url='".$url_variables."'", "obj"); + + $zamenjaj = $match; + + // email ne sme biti enak imenu ali priimku + if ($iskanje == 'ime ucitelja' && ! in_array($user->email, [$user->name, $user->surname])) { + $zamenjaj = $user->name." ".$user->surname; + } elseif ($iskanje == 'ime ucitelja') { + preg_match('/(\w+)((?:\.)(\w+))?/', $user->email, $ucitelj); + + $zamenjaj = self::velikaZacetnica($ucitelj[1]); + + if (! empty($ucitelj[3])) { + $zamenjaj .= " ".self::velikaZacetnica($ucitelj[3]); + } + } + + if ($iskanje == 'email ucitelja') { + $zamenjaj = $user->email; + } + + $text = str_ireplace($match, $zamenjaj, $text); + } + } + + return $text; + } + + /** + * Iz besedila najprej pretvorimo v male črke in nato veliko začetnico + * + * @param string $string + * + * @return string + */ + private static function velikaZacetnica($string) + { + return ucfirst(mb_strtolower($string, 'UTF-8')); + } + + /** + * Preverimo dostop določenega uporabnika do modula SA + * + * @param (int) $anketa + */ + public static function preveriDostop($anketa_id = 0) + { + global $admin_type; + + // Če ima dostop in je modul vključen + if (Common::checkModule('hierarhija') == '1') { + + //anketa še ni ustvarjena, potem mu je dostop omogočen + if ($anketa_id == 0 && self::aliImaDostopDoIzdelovanjaHierarhije()) { + return true; + } + + // Imamo anketa ID in smo znotraj ankete + if ($anketa_id > 0) { + + // Če je modul vključen potem lahko do hierarhije dostopajo samo (admini, oseba, ki je mod vključila in osebe, katerim je bil dodan dostop do urejanja hierarhije) + if (SurveyInfo::checkSurveyModule('hierarhija', $anketa_id) && ($admin_type == 1 || self::preveriTipHierarhije($anketa_id) < 5)) { + + return true; + + // Če modul še ni bil vključen imajo dostop samo uporabniki s predhodnimi pravicami + } elseif (! SurveyInfo::checkSurveyModule('hierarhija', $anketa_id) && self::aliImaDostopDoIzdelovanjaHierarhije()) { + + return true; + + } + } + } + + return false; + } + + /** + * Preverimo, če ima dostop do grajenja hierarhije, dostop omogočimo: + * AAI uporabnikom + * 1ka administrator + * Uporabniku, kateremu je bil dodeljen dostop do ankete + */ + public static function aliImaDostopDoIzdelovanjaHierarhije() + { + + global $site_url; + + $strani = [ + 'https://www.1ka.si/', + 'http://test.1ka.si/', + 'http://1ka.test/', + 'https://1ka.arnes.si/' + ]; + + // Če je domena prava in če je modul vključen na inštalaciji + $modul = Common::checkModule('hierarhija'); + if ($modul == '0' || $modul == '1' && ! in_array($site_url, $strani)) { + return false; + } + + // Ali je administrator + global $admin_type; + if ($admin_type == 0) { + return true; + } + + //AAI uporabnik + if (! empty($_COOKIE['aai']) && $_COOKIE['aai'] == 1) { + return true; + } + + // Ima dostop, ker je bil dodan v bazo uporabnikov za dostop do hierarhije + if (sizeof(sisplet_query("SHOW TABLES LIKE 'srv_hierarhija_dostop'", "array")) == 1) { + + global $global_user_id; + $dostop = sisplet_query("SELECT dostop FROM srv_hierarhija_dostop WHERE user_id='".$global_user_id."'", "obj"); + + if (! empty($dostop) && $dostop->dostop == 1) { + return true; + } + } + + return false; + } + + public static function preveriTipHierarhije($anketa) + { + global $global_user_id; + $type = null; + + if (is_null($anketa)) { + return null; + } + + if (! SurveyInfo::checkSurveyModule('hierarhija', $anketa)) { + return null; + } + + // V kolikor je tip hierarhije že v seji + if (! empty($_SESSION['hierarhija'][$anketa]['type']) && $_SESSION['hierarhija'][$anketa]['type'] > 5) { + return $_SESSION['hierarhija'][$anketa]['type']; + } + + $sql = sisplet_query("SELECT type FROM srv_hierarhija_users WHERE user_id='".$global_user_id."' AND anketa_id='".$anketa."'"); + + if (! empty($sql) && mysqli_num_rows($sql) > 0) { + $row = mysqli_fetch_object($sql); + $type = $row->type; + } + + $_SESSION['hierarhija'][$anketa]['type'] = $type; + + return $type; + } + + /** + * Preverimo, komu so bile poslane kode in vrnemo ustrezno besedilo + * + * @param int $anketa + * @param string $string + * + * @return text + */ + public static function textGledeNaOpcije($anketa, $string = null) + { + global $lang; + + if (is_null($string)) { + return null; + } + + $poslji_kode = HierarhijaQuery::getOptionsPosljiKode($anketa); + + return $lang[$string.'_'.$poslji_kode]; + } + + /** + * Izpišemo nivoje hierarhije za našega uporabnika za prikaz linkov + */ + public static function hierarhijaPrikazNaslovovpriUrlju( + $anketa, + $struktura_id, + $email = null + ) { + global $global_user_id; + + $predmet = (new HierarhijaOnlyQuery())->queryStruktura($anketa, null, ' AND str.id='.$struktura_id)->fetch_object(); + + // V kolikor pošiljamo email vabilo admin in je aktiviral ali je $email že user_id + if ($email && is_numeric($email)) { + $user_id = $email; + } elseif ($email) { + $user_id = sisplet_query("SELECT user_id FROM srv_hierarhija_struktura_users WHERE hierarhija_struktura_id='".$predmet->id."'")->fetch_object()->user_id; + } else { + $user_id = $global_user_id; + } + $veja_hierarhije = (new HierarhijaQuery())->pridobiHierarhijoNavzgor($anketa, null, $user_id); + + $ime_strukture = []; + foreach ($veja_hierarhije as $key_struktura => $value_sifranta) { + + ### Če ključ trenutnega predmeta ustreza ključi polja za to hierarhijo, potem izpišemo pot za ta predmet (ime, razred, itd...) + if ($key_struktura == $predmet->id) { + #### Sortiramo polje od nivoja 1 do 6, ker drugače imamo obratno + krsort($value_sifranta); + $st_vnosov = sizeof($value_sifranta); + + $nivo_ime = null; + foreach ($value_sifranta as $key => $element) { + + // Tukaj prikaže tudi najvišji nivo, če je potrebno, če želimo najviši nivo izpustu + if ($key < $st_vnosov) { + $zacas_ime = (new HierarhijaOnlyQuery())->getSamoSifrant($element['id'], true)->fetch_object(); + $nivo_ime .= $zacas_ime->ime; + if ($key != 0) { + $nivo_ime .= ' - '; + } + } + } + + // V kolikor nas zanima naslov samo za eno strukturo + if (! is_null($struktura_id)) { + return $nivo_ime; + } + + $ime_strukture[$key_struktura] = $nivo_ime; + } + } + + return $ime_strukture; + } +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php new file mode 100644 index 0000000..18bda68 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php @@ -0,0 +1,344 @@ +anketa = $anketa; + + global $global_user_id; + $this->user_id = $global_user_id; + + TrackingClass::update($anketa, '21'); + + if (!(new Dostop())->checkDostop($this->anketa)) { + return FALSE; + } + } + + public static function getInstance($anketa) + { + if (self::$_instance) { + return self::$_instance; + } + + return new HierarhijaIzvoz($anketa); + } + + /** + * Izvozimo vse uporabnike, do katerih imamo dostop + * + * @param bool $porocilo - v kolikor gre za poročilo vrnemo polje; + * @return response downlod CSV + */ + + public function csvIzvozVsehUporabnikov() + { + $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : NULL); + + if ($hierarhija_type < 5) { + $podatki = (new HierarhijaQuery())->hierarhijaArrayDataTables($this->anketa, NULL, TRUE); + } else { + $hierarhija = (new HierarhijaQuery()); + $uporabnik = $hierarhija->preveriPravicoUporabnika($this->anketa); + $struktura = $hierarhija->poisciHierarhijoNavzgor($uporabnik->struktura_id); + + $podatki = (new HierarhijaQuery())->hierarhijaArrayDataTables($this->anketa, $struktura, TRUE); + } + + // pridobimo prvo vrstico za izvoz + $ravni = sisplet_query("SELECT level, ime FROM srv_hierarhija_ravni WHERE anketa_id='" . $this->anketa . "' ORDER BY level", "obj"); + foreach ($ravni as $raven) { + $header[] = $raven->level . '. ' . $raven->ime; + } + $izvoz[] = $header; + + foreach ($podatki as $key => $row) { + foreach ($row as $podatek) { + $izvoz[$key + 1][] = str_replace('
', '', $podatek['label']); + } + } + + return Export::init($this->anketa)->csv('Izvoz uporabnikov', $izvoz); + } + + /** + * Pripravimo izvoz strukture za R poroÄŤilo ali CSV izvoz + * + * @param bool $porocilo + * @param bool $stevilke + * + * @return array|bool|void + */ + public function csvIzvozStruktureZaObdelavo($porocilo = false, $stevilke = false) + { + $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : NULL); + + if ($hierarhija_type > 4) { + return FALSE; + } + + //Pridobimo vso strukturo iz šifer + $strukture = sisplet_query("SELECT k.url AS url, u.name AS name, u.surname AS surname, u.email AS email FROM srv_hierarhija_koda AS k LEFT JOIN users AS u ON k.user_id=u.id WHERE anketa_id='" . $this->anketa . "'", "obj"); + + // pridobimo prvo vrstico za izvoz + $ravni = sisplet_query("SELECT level, ime FROM srv_hierarhija_ravni WHERE anketa_id='" . $this->anketa . "' ORDER BY level", "obj"); + $header[] = 'vloga'; + foreach ($ravni as $raven) { + $header[] = $raven->level . '. ' . $raven->ime; + } + //podatki o uÄŤitelju + $header[] = 'Ime in priimek'; + $header[] = 'Email'; + + $izvoz[] = $header; + + foreach ($strukture as $key => $struktura) { + parse_str($struktura->url, $url); + asort($url); + + // izvozimo strukturo za vsakega uÄŤitelja posebej + foreach ($url as $keySifrant => $row) { + if ($key == 0) { + $izvoz[$key + 1][] = $keySifrant; + } + + $podatek = sisplet_query("SELECT naslov, variable FROM srv_vrednost WHERE id='".$row."'", "obj"); + if($stevilke){ + $izvoz[$key + 2][] = $podatek->variable; + }else { +// $podatek = sisplet_query("SELECT naslov, variable FROM srv_vrednost WHERE id='".$row."'", "obj"); + $izvoz[$key + 2][] = $podatek->naslov; + } + } + + + // Dodamo še drugo vrstico ime in email + $izvoz[1][sizeof($url)] = 'ime'; + $izvoz[1][sizeof($url) + 1] = 'email'; + + //Podatki o uÄŤitelju + $izvoz[$key + 2][] = $struktura->name . ' ' . $struktura->surname; + $izvoz[$key + 2][] = $struktura->email; + + } + + if($porocilo) + return $izvoz; + + return Export::init($this->anketa) + ->csv('Izvoz strukture hierarhije', $izvoz); + } + + /** + * Izvoz tabele status z vsemi šiframi in ÄŤasi reševanja + * + * @return CSV download response + */ + public function csvIzvozStatusa() + { + + $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : NULL); + + if ($hierarhija_type > 4) { + return FALSE; + } + + $header[] = [ + 'Hierarhija', + 'Email uÄŤitelja', + 'Koda za uÄŤence', + 'Status uÄŤencev - zaÄŤel izpolnjevati', + 'Status uÄŤencev - delno izpolnjene', + 'Status uÄŤencev - konÄŤal anketo', + 'ÄŚasovni potek - prvi vnos', + 'ÄŚasovni potek - zadnji vnos', + 'Koda za uÄŤitelja', + 'Vnos uÄŤitelja', + ]; + + $body = $this->getStatus(); + + if (!is_null($body)) { + $izvoz = array_merge($header, $body); + } else { + $izvoz = $header; + } + + return Export::init($this->anketa)->csv('Status_izvoz', $izvoz); + } + + /** + * Pridobimo veÄŤdimenzionalno polje, kjer posamezna vrstica ima podatke o + * enem predmetu njegovih respondentih + * + * @param (boolean) $array - v kolikor vrnemo polje + * + * @return array|null + */ + public function getStatus($array = FALSE) + { + $izvoz = []; + + //v kolikor imamo veÄŤ URL-jev se pravi za veÄŤ predmetov potem moramo izpisati sklope za vse predmete + $max_st_nivojev = sisplet_query("SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id='" . $this->anketa . "'"); + + // V kolikor še ni niÄŤ vnosov + if ($max_st_nivojev->num_rows == 0) { + return NULL; + } + + $max_st_nivojev = $max_st_nivojev->fetch_row()[0]; + + // Pridobimo vse ID-je na zadnjem nivoju + $strukture = (new HierarhijaOnlyQuery())->queryStrukturaUsers($this->anketa); + + // Zanka po celotni strukturi za vsakega uÄŤitelja pridobimo vse response + foreach ($strukture as $struktura) { + + // PrikaĹľemo samo vpise, ki imajo vpisanega uÄŤitelja na zadnjem nivoju + if ($struktura['level'] == $max_st_nivojev) { + + // pridobimo podatke o rešenih anketah samo za to strukturo + $cas = $this->pridobiStatisticnePodatke($struktura['id'], 'ucenec'); + $cas_ucitelj = $this->pridobiStatisticnePodatke($struktura['id'], 'ucitelj'); + + $first_insert = NULL; + $last_insert = NULL; + $zacel_izpolnjevati = 0; + $delno_izpolnjena = 0; + $koncal_anketo = 0; + + if (!is_null($cas)) { + foreach ($cas as $key => $row) { + if ($row['cas'] < $first_insert || $key == 0) { + $first_insert = $row['cas']; + } + + if ($row['cas'] > $last_insert) { + $last_insert = $row['cas']; + } + + // KonÄŤal anketo + if ($row['status'] == 6 && $row['lurker'] == 0) { + $koncal_anketo++; + } + + // Delno izpolnjena + if ($row['status'] == 5 && $row['lurker'] == 0) { + $delno_izpolnjena++; + } + + if ($row['lurker'] == 1) { + $zacel_izpolnjevati++; + } + } + } + + $vrstica = [ + HierarhijaHelper::hierarhijaPrikazNaslovovpriUrlju($this->anketa, $struktura['id'], $struktura['email']), + $struktura['email'], + strtoupper(HierarhijaOnlyQuery::getKodaRow($this->anketa, $struktura['id'])->koda), + (!empty($zacel_izpolnjevati) ? $zacel_izpolnjevati : '/'), + (!empty($delno_izpolnjena) ? $delno_izpolnjena : '/'), + (!empty($koncal_anketo) ? $koncal_anketo : '/'), + (!is_null($first_insert) ? date('d.m.Y, H:i', $first_insert) : '/'), + (!is_null($last_insert) ? date('d.m.Y, H:i', $last_insert) : '/'), + strtoupper(HierarhijaOnlyQuery::getKodaRow($this->anketa, $struktura['id'], 'ucitelj')->koda), + ((!is_null($cas_ucitelj['cas']) && $cas_ucitelj['status'] == 6 && $cas_ucitelj['lurker'] == 0) ? date('d.m.Y, H:i', $cas_ucitelj['cas']) : '/'), + ]; + + $id_kode = HierarhijaOnlyQuery::getKodaRow($this->anketa, $struktura['id'])->koda; + + if ($array && !is_null($id_kode)) { + $izvoz[$id_kode] = $vrstica; + } else { + $izvoz[] = $vrstica; + } + } + + } + + return $izvoz; + } + + /** + * Pridobimo podatke o izpolnjevanju posameznega respondenta + * + * @param $struktura_id + * @param $vloga + * + * @return array|mixed|null + */ + private function pridobiStatisticnePodatke($struktura_id, $vloga) + { + + $url = sisplet_query("SELECT url FROM srv_hierarhija_koda WHERE anketa_id='" . $this->anketa . "' AND hierarhija_struktura_id='" . $struktura_id . "' AND vloga='" . $vloga . "'", "obj")->url; + + // V kolikor anketa še ni bila aktivirana potem vrnemo null, ker nimamo še podatkov o izpolnjevanju + if (is_null($url)) { + return NULL; + } + + parse_str($url, $nivoji); + + $polje_iskanja = NULL; + foreach ($nivoji as $key => $nivo) { + if ($key == 'vloga') { + $polje_iskanja = $nivo; + } else { + $polje_iskanja .= ', ' . $nivo; + } + } + + $db_table = (SurveyInfo::getInstance() + ->getSurveyColumn('db_table') == 1) ? '_active' : ''; + + // tukaj pridobimo podatke o anketi za doloÄŤeno strukturo + // preverimov prvi in zadnji nivo + $sql_user = sisplet_query("SELECT time_insert, last_status, lurker FROM srv_data_vrednost" . $db_table . " as sa LEFT JOIN srv_user as us ON (sa.usr_id=us.id) WHERE vre_id IN (" . $polje_iskanja . ") GROUP BY usr_id HAVING COUNT(usr_id)=" . sizeof($nivoji)); + $cas = []; + + // V kolikor ni zapisov vrnemo prazno + if ($sql_user->num_rows == 0) { + return NULL; + } + + while ($row = mysqli_fetch_object($sql_user)) { + $cas[] = [ + 'cas' => strtotime($row->time_insert), + 'status' => $row->last_status, + 'lurker' => $row->lurker, + ]; + } + + if ($vloga == 'ucitelj') { + return $cas[0]; + } + + + return (sizeof($cas) > 0 ? $cas : NULL); + } +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvozAnalize.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvozAnalize.php new file mode 100644 index 0000000..b79b8ba --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvozAnalize.php @@ -0,0 +1,470 @@ +false); // za shrambo parametrov in sporocil + var $pdf; + var $currentStyle; + var $db_table = ''; + + public $meansClass = null; //means class + + var $meanData1; + var $meanData2; + + var $sessionData; // podatki ki so bili prej v sessionu - za nastavitve, ki se prenasajo v izvoze... + + + /** + * @desc konstruktor + */ + function __construct ($anketa = null, $podstran = 'mean') + { + global $site_path; + global $global_user_id; + + // preverimo ali imamo stevilko ankete + if ( is_numeric($anketa) ) + { + $this->anketa['id'] = $anketa; + $this->anketa['podstran'] = $podstran; + // create new PDF document + $this->pdf = new enka_TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); + } + else + { + $this->pi['msg'] = "Anketa ni izbrana!"; + $this->pi['canCreate'] = false; + return false; + } + $_GET['a'] = A_ANALYSIS; + + // preberemo nastavitve iz baze (prej v sessionu) + SurveyUserSession::Init($this->anketa['id']); + $this->sessionData = SurveyUserSession::getData(); + + // ustvarimo means objekt + $this->meansClass = new HierarhijaAnalysis($anketa); + + if ( SurveyInfo::getInstance()->SurveyInit($this->anketa['id']) && $this->init()) + { + $this->anketa['uid'] = $global_user_id; + SurveyUserSetting::getInstance()->Init($this->anketa['id'], $this->anketa['uid']); + } + else + return false; + // ce smo prisli do tu je vse ok + $this->pi['canCreate'] = true; + + return true; + } + + // SETTERS && GETTERS + + function checkCreate() + { + return $this->pi['canCreate']; + } + function getFile($fileName) + { + //Close and output PDF document + ob_end_clean(); + $this->pdf->Output($fileName, 'I'); + } + + + function init() + { + global $lang; + + // array used to define the language and charset of the pdf file to be generated + $language_meta = Array(); + $language_meta['a_meta_charset'] = 'UTF-8'; + $language_meta['a_meta_dir'] = 'ltr'; + $language_meta['a_meta_language'] = 'sl'; + $language_meta['w_page'] = $lang['page']; + + //set some language-dependent strings + $this->pdf->setLanguageArray($language_meta); + + //set margins + $this->pdf->setPrintHeaderFirstPage(true); + $this->pdf->setPrintFooterFirstPage(true); + $this->pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); + $this->pdf->SetHeaderMargin(PDF_MARGIN_HEADER); + $this->pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + + // set header and footer fonts + $this->pdf->setHeaderFont(Array(FNT_HEADER_TEXT, "I", FNT_HEADER_SIZE)); + $this->pdf->setFooterFont(Array(FNT_HEADER_TEXT, 'I', FNT_HEADER_SIZE)); + + + // set document information + $this->pdf->SetAuthor('An Order Form'); + $this->pdf->SetTitle('An Order'); + $this->pdf->SetSubject('An Order'); + + // set default header data + $this->pdf->SetHeaderData(null, null, "www.1ka.si", $this->encodeText(SurveyInfo::getInstance()->getSurveyAkronim())); + + //set auto page breaks + $this->pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + + $this->pdf->SetFont(FNT_MAIN_TEXT, '', FNT_MAIN_SIZE); + //set image scale factor + $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + return true; + } + + function encodeText($text) + { // popravimo sumnike ce je potrebno + $text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8'); + $text = str_replace(array("š","š","č"),array("š","š","ÄŤ"),$text); + return strip_tags($text); + } + + function createPdf() + { + global $site_path; + global $lang; + + + // izpisemo prvo stran + //$this->createFrontPage(); + + $this->pdf->AddPage(); + + $this->pdf->setFont('','B','11'); + $this->pdf->MultiCell(150, 5, $lang['srv_hierarchy_analysis_export'], 0, 'L', 0, 1, 0 ,0, true); + + $this->pdf->setDrawColor(128, 128, 128); + $this->pdf->setFont('','','6'); + + # polovimo nastavtve missing profila + //SurveyConditionProfiles:: getConditionString(); + + + $this->meanData1 = $this->sessionData['means']['means_variables']['variabla1']; + $this->meanData2 = $this->sessionData['means']['means_variables']['variabla2']; + + $means = array(); + # ÄŤe ne uporabljamo privzetega ÄŤasovnega profila izpišemo opozorilo + //$doNewLine = SurveyTimeProfiles :: printIsDefaultProfile(false); + + # ÄŤe imamo filter ifov ga izpišemo + //$doNewLine = SurveyConditionProfiles:: getConditionString($doNewLine ); + + # ÄŤe imamo filter spremenljivk ga izpišemo + //$doNewLine = SurveyVariablesProfiles:: getProfileString($doNewLine , true) || $doNewLine; + + if ($this->meanData1 !== null && $this->meanData2 !== null) { + $variables1 = $this->meanData2; + $variables2 = $this->meanData1; + $c1=0; + $c2=0; + + if(is_array($variables2) && count($variables2) > 0){ + #prikazujemo loÄŤeno + if ($this->sessionData['means']['meansSeperateTables'] == true || $this->sessionData['mean_charts']['showChart'] == '1') { + foreach ($variables2 AS $v_second) { + if (is_array($variables1) && count($variables1) > 0) { + foreach ($variables1 AS $v_first) { + $_means = $this->meansClass->createMeans($v_first, $v_second); + if ($_means != null) { + $means[$c1][0] = $_means; + } + $c1++; + } + } + } + } + #prikazujemo skupaj + else { + foreach ($variables2 AS $v_second) { + if (is_array($variables1) && count($variables1) > 0) { + foreach ($variables1 AS $v_first) { + $_means = $this->meansClass->createMeans($v_first, $v_second); + if ($_means != null) { + $means[$c1][$c2] = $_means; + } + $c2++; + } + } + $c1++; + $c2=0; + } + } + } + + + if (is_array($means) && count($means) > 0) { + + $count = 0; + foreach ($means AS $mean_sub_grup) { + + if($this->sessionData['mean_charts']['showChart'] == '1'){ + if($count > 0){ + $this->pdf->AddPage(); + } + + $this->pdf->ln(10); + + $this->displayMeansTable($mean_sub_grup); + $this->displayChart($count); + } + else{ + if($count%2 == 0 && $count > 0){ + $this->pdf->AddPage(); + } + + $this->pdf->ln(10); + $this->displayMeansTable($mean_sub_grup); + $this->pdf->ln(10); + } + + $count++; + } + } + } + } + + public function displayMeansTable($_means) { + global $lang; + + #število vratic in število kolon + $cols = count($_means); + # preberemo kr iz prvega loopa + $rows = count($_means[0]['options']); + + // sirina ene celice + $singleWidth = round( 180 / $cols / 5 ); + + // visina prve vrstice + $firstHeight = 0; + for ($i = 0; $i < $cols; $i++) { + + $label1 = $this->meansClass->getSpremenljivkaTitle($_means[$i]['v1']); + + /*$linecount = $this->pdf->getNumLines($this->encodeText($label1), $singleWidth*2); + $height = ( $linecount == 1 ? 4.7 : (4.7 + ($linecount-1)*3.3) ); + $firstHeight = ($height > $firstHeight) ? $height : $firstHeight;*/ + $firstHeight = ($firstHeight > $this->getCellHeight($this->encodeText($label1), $singleWidth*2)) ? $firstHeight : $this->getCellHeight($this->encodeText($label1), $singleWidth*2); + } + + + // prva vrstica + $this->pdf->setFont('','B','6'); + + $label2 = $this->meansClass->getSpremenljivkaTitle($_means[0]['v2']); + $this->pdf->MultiCell(80, $firstHeight, $this->encodeText($label2), 'TLR', 'C', 0, 0, 0 ,0, true); + + for ($i = 0; $i < $cols; $i++) { + + $label1 = $this->meansClass->getSpremenljivkaTitle($_means[$i]['v1']); + $this->pdf->MultiCell($singleWidth*5, $firstHeight, $this->encodeText($label1), 1, 'C', 0, 0, 0 ,0, true); + } + $this->pdf->MultiCell(1, $firstHeight, $this->encodeText(''), 0, 'C', 0, 1, 0 ,0, true); + + $this->pdf->setFont('','','6'); + + // druga vrstica + $this->pdf->MultiCell(80, 7, $this->encodeText(''), 'BLR', 'C', 0, 0, 0 ,0, true); + + for ($i = 0; $i < $cols; $i++) { + + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($lang['srv_means_label']), 1, 'C', 0, 0, 0 ,0, true); + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($lang['srv_hierarchy_label_st']), 1, 'C', 0, 0, 0 ,0, true); + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($lang['srv_hierarchy_label_min']), 1, 'C', 0, 0, 0 ,0, true); + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($lang['srv_hierarchy_label_max']), 1, 'C', 0, 0, 0 ,0, true); + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($lang['srv_hierarchy_label_std_dev']), 1, 'C', 0, 0, 0 ,0, true); + } + $this->pdf->MultiCell(1, 7, $this->encodeText(''), 0, 'C', 0, 1, 0 ,0, true); + + + // vrstice s podatki + if (count($_means[0]['options']) > 0) { + foreach ($_means[0]['options'] as $ckey2 =>$crossVariabla2) { + + $variabla = $crossVariabla2['naslov']; + # ÄŤe ni tekstovni odgovor dodamo key + if ($crossVariabla2['type'] !== 't' ) { + if ($crossVariabla2['vr_id'] == null) { + $variabla .= ' ( '.$ckey2.' )'; + } else { + $variabla .= ' ( '.$crossVariabla2['vr_id'].' )'; + } + } + $this->pdf->MultiCell(80, 7, $this->encodeText($variabla), 1, 'C', 0, 0, 0 ,0, true); + + # celice z vsebino + for ($i = 0; $i < $cols; $i++) { + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['result'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true); + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText((int)$_means[$i]['sumaVrstica'][$ckey2]), 1, 'C', 0, 0, 0 ,0, true); + + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['min'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true); + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['max'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true); + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['stdDeviation'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true); + + } + $this->pdf->MultiCell(1, 7, $this->encodeText(''), 0, 'C', 0, 1, 0 ,0, true); + } + } + + // SKUPAJ + $this->pdf->MultiCell(80, 7, $this->encodeText($lang['srv_means_label3']), 1, 'C', 0, 0, 0 ,0, true); + + for ($i = 0; $i < $cols; $i++) { + + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true); + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText((int)$_means[$i]['sumaSkupna']), 1, 'C', 0, 0, 0 ,0, true); + + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['sumaMin'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true); + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['sumaMax'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true); + $this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['sumaStdDeviation'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true); + + } + $this->pdf->MultiCell(1, 7, $this->encodeText(''), 0, 'C', 0, 1, 0 ,0, true); + } + + function displayChart($counter){ + global $lang; + + $variables1 = $this->meanData1; + $variables2 = $this->meanData2; + + $pos1 = floor($counter / count($variables2)); + $pos2 = $counter % count($variables2); + + $chartID = implode('_', $variables1[$pos1]).'_'.implode('_', $variables2[$pos2]); + $chartID .= '_counter_'.$counter; + + + $settings = $this->sessionData['mean_charts'][$chartID]; + $imgName = $settings['name']; + + $size = getimagesize('pChart/Cache/'.$imgName); + $height = $size[1] / 4; + + if($this->pdf->getY() + $height > 250) + { + $this->pdf->AddPage(); + } + else + $this->pdf->setY($this->pdf->getY() + 15); + + + $this->pdf->Image('pChart/Cache/'.$imgName, $x='', $y='', $w=200, $h, $type='PNG', $link='', $align='N', $resize=true, $dpi=1600, $palign='C', $ismask=false, $imgmask=false, $border=0); + + + $this->pdf->setY($this->pdf->getY() + 5); + } + + /*Skrajsa tekst in doda '...' na koncu*/ + function snippet($text,$length=64,$tail="...") + { + $text = trim($text); + $txtl = strlen($text); + if($txtl > $length) + { + for($i=1;$text[$length-$i]!=" ";$i++) + { + if($i == $length) + { + return substr($text,0,$length) . $tail; + } + } + $text = substr($text,0,$length-$i+1) . $tail; + } + return $text; + } + + function drawLine() + { + $cy = $this->pdf->getY(); + $this->pdf->Line(15, $cy , 195, $cy , $this->currentStyle); + } + + function setUserId($usrId) {$this->anketa['uid'] = $usrId;} + function getUserId() {return ($this->anketa['uid'])?$this->anketa['uid']:false;} + + function formatNumber($value,$digit=0,$sufix="") + { + if ( $value <> 0 && $value != null ) + $result = round($value,$digit); + else + $result = "0"; + $result = number_format($result, $digit, ',', '.').$sufix; + + return $result; + } + + function getCellHeight($string, $width){ + + $this->pdf->startTransaction(); + // get the number of lines calling you method + $linecount = $this->pdf->MultiCell($width, 0, $string, 0, 'L', 0, 0, '', '', true, 0, false, true, 0); + // restore previous object + $this->pdf = $this->pdf->rollbackTransaction(); + + $height = ($linecount <= 1) ? 4.7 : $linecount * ($this->pdf->getFontSize() * $this->pdf->getCellHeightRatio()) + 2; + + return $height; + } + +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaKopiranjeClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaKopiranjeClass.php new file mode 100644 index 0000000..27dd880 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaKopiranjeClass.php @@ -0,0 +1,418 @@ +anketa = $anketa; + + global $global_user_id; + $this->user_id = $global_user_id; + } + + public static function getInstance($anketa) + { + if (self::$_instance) + return self::$_instance; + + return new HierarhijaKopiranjeClass($anketa); + } + + /** + * Pridobimo celotno polje in tudi moĹľnsz serialize v string za shranjevanje v bazo uporabimo + * + * @param (boolean) $seialize + * @return array | string + */ + public function get($serialize = false) + { + $struktura = $this->getStrukturaInUporabniki(); + + if ($serialize && !empty($struktura)) + return serialize($struktura); + + return $struktura; + } + + protected $polje_primerjava; + + /** + * Shranimo polje in uporabni + * + * @param (array) $struktura + * @return + */ + + public function save($struktura) + { + // Ustvarimo sistemsko vprašanje v kolikor kopiramo tudi strukturo k vlogi + (new Hierarhija($this->anketa))->izrisisSistemskoVprsanjeVloga(); + + // Shranimo strukturo + $this->insert($struktura, 0); + + } + + /** + * Vpišemo elemente v bazo + * + * @param (array) $polje - polje struktura, ki ga pridobimo iz baze + * @param (int) $parent_id - id parenta iz prejšnje strukture, po kateri iščemo + * @param (int) $new_parent_id - ID vpisa strukture, ki ga uporabimo za vpis parenta + */ + private function insert(array $polje, $parent_id, $new_parent_id = null) + { + if (isset($parent_id) && is_array($polje) && sizeof($polje) > 0) { + foreach ($polje as $raven) { + + if ($raven['parent_id'] == $parent_id) { + + // Pridobimo nove podatke s primerjavo s starimi ID-ji od prej, da shranimo strukturo + $hierarhija_ravni_id = (int)$this->primerjava['ravni'][$raven['ravni_id']]; + $hierarhija_sifrant_id = (int)$this->primerjava['sifranti'][$raven['sifrant_id']]; + $level = (int)$raven['level']; + + $sql_raven = sisplet_query(" + INSERT INTO srv_hierarhija_struktura + (hierarhija_ravni_id, parent_id, hierarhija_sifranti_id, level, anketa_id) + VALUES + ('" . $hierarhija_ravni_id . "', " . var_export($new_parent_id, true) . " , '" . $hierarhija_sifrant_id . "', '" . $level . "', '" . $this->anketa . "') + "); + $this->sqlError($sql_raven); + + // Pridobimo ID vpisa strukture + $id_strukture = mysqli_insert_id($GLOBALS['connect_db']); + + // Vpišemo uporabnike v kolikor jih imammo + if (isset($raven['uporabniki']) && sizeof($raven['uporabniki']) > 0) { + foreach ($raven['uporabniki'] as $uporabnik) { + $sql_user = sisplet_query("INSERT INTO srv_hierarhija_struktura_users (hierarhija_struktura_id, user_id) + VALUES ('" . $id_strukture . "', '" . $uporabnik . "')"); + $this->sqlError($sql_user); + + // OmogoÄŤimo tudi dostop uporabnikom do hierarhije s pravicami 10, najprej pa preverimo ÄŤe je Ĺľe vpisan, ker ne dovolimo duplikatov + $sql_uporabnik_obstaja = sisplet_query("SELECT type FROM srv_hierarhija_users WHERE anketa_id='".$this->anketa."' AND user_id='".$uporabnik."'"); + + if(mysqli_num_rows($sql_uporabnik_obstaja)) { + $sql_hierarhija_user = sisplet_query("INSERT INTO srv_hierarhija_users (user_id, anketa_id, type) VALUES ('" . $uporabnik . "', '" . $this->anketa . "', 10)"); + $this->sqlError($sql_hierarhija_user); + } + + // OmogoÄŤimo dostop omenjenim uporabnikom + HierarhijaQuery::dostopZaUporabnika($this->anketa, $uporabnik, 'insert'); + } + } + + // Vpišemo še vse child elemente, ki so v drevesni strukturi + $this->insert($polje, $raven['id'], $id_strukture); + + + } + } + + } + + } + + + /** + * Pridobimo vrednost za primerjavo; + * + * @param (array) $primerjava + * @return $this; + */ + private $primerjava; + + public function compare($primerjava) + { + $this->primerjava = $primerjava; + return $this; + } + + /** + * Pridobimo strukturo v obliki multi arraya in potem dodamo še uporabnike + * + * @return (array) + */ + protected function getStrukturaInUporabniki() + { + + $sql_vsa_hierarhija = (new HierarhijaOnlyQuery())->queryStruktura($this->anketa); + + // Izdelamo polje iz sql poizvedbe, da bomo v nadaljevanju izdelali vgnezdeno polje + $struktura = []; + while ($obj = $sql_vsa_hierarhija->fetch_object()) { + $struktura[] = [ + 'id' => $obj->id, + 'ravni_id' => $obj->ravni_id, + 'parent_id' => (is_null($obj->parent_id) ? 0 : $obj->parent_id), + 'sifrant_id' => $obj->sifrant_id, + 'level' => $obj->level, + 'uporabniki' => $this->getVseUporabnikeZaStrukturo($obj->id) + ]; + } + + return $struktura; + } + + + /** + * Pridobimo ID vseh uporabnikov, ki so na doloÄŤeni strukturi + * + * @param (int) $id + * @return null | (array) + */ + + protected function getVseUporabnikeZaStrukturo($id) + { + $sql_uporabniki = sisplet_query("SELECT hierarhija_struktura_id, user_id FROM srv_hierarhija_struktura_users WHERE hierarhija_struktura_id='" . $id . "'"); + + if ($sql_uporabniki->num_rows == 0) + return null; + + $uporabniki = []; + while ($obj = $sql_uporabniki->fetch_object()) { + $uporabniki[] = $obj->user_id; + } + + return $uporabniki; + } + + /** + * Iz strukture hierarhije izdelamo vgnezdena polja kot je drevesna struktura + * + * @param (array) $elements + * @param (int) $parentId + * @return array + */ + protected function createTreeArray(array $elements, $parentId = 0) + { + $polje = []; + + foreach ($elements as $element) { + // Najprej poiščemoprvi nivo + if ($element['parent_id'] == $parentId) { + $naslednji = $this->createTreeArray($elements, $element['id']); + + // V kolikor imamo naslednji element polja, ga zapišemo + if ($naslednji) + $element['child'] = $naslednji; + + $polje[] = $element; + } + } + + return $polje; + } + + public function kopirajHierarhijo($hierarhija, $uporabniki = 0) + { + // preverimo, ÄŤe je json + if ($this->isJson($hierarhija)) + $hierarhija = $this->isJson($hierarhija, 1); + + // v kolikor Ĺľelimo kopirati tudi uporabnike/strukturo potem zbiramo stare in nove vrednosti + if ($uporabniki == 1) + $primerjava = [ + 'ravni' => [], + 'sifranti' => [], + ]; + + // vpisemo vse ravni in šifrante + if (!empty($hierarhija) && is_array($hierarhija) && sizeof($hierarhija) > 0) { + + foreach ($hierarhija as $ravni) { + $sql_ravni = sisplet_query("INSERT INTO srv_hierarhija_ravni (anketa_id, user_id, level, ime) VALUES ('$this->anketa', '" . $this->user_id . "', '" . $ravni['st'] . "', '" . $ravni['ime'] . "')"); + $this->sqlError($sql_ravni); + $id_ravni = mysqli_insert_id($GLOBALS['connect_db']); + + if ($uporabniki == 1 && isset($primerjava)) + $primerjava['ravni'][$ravni['id']] = $id_ravni; + + // V kolikor so tudi šifranti vpišemo še šifrante + if (!empty($ravni['sifranti']) && sizeof($ravni['sifranti']) > 0 && !empty($id_ravni)) { + foreach ($ravni['sifranti'] as $sifrant) { + if (!empty($sifrant['ime'])) { + $sql_hs = sisplet_query("INSERT INTO srv_hierarhija_sifranti (hierarhija_ravni_id, ime) VALUES ('" . $id_ravni . "', '" . $sifrant['ime'] . "')"); + $this->sqlError($sql_hs); + + if ($uporabniki == 1 && isset($primerjava['sifranti'])) { + $primerjava['sifranti'][$sifrant['id']] = mysqli_insert_id($GLOBALS['connect_db']); + } + + } + } + } + } + + } + + if ($uporabniki == 1 && isset($primerjava) && sizeof($primerjava['ravni']) > 0 && $id_shranjene_strukture > 0) { + $struktura = HierarhijaQuery::getHierarhijaShraniRow($id_shranjene_strukture, 'struktura'); + $struktura = unserialize($struktura); + + $this->compare($primerjava)->save($struktura); + } + + } + + /** + * Ustvarimo ravni in šifrante ter lahko tudi strukturo z uporabniki + * + * Funkcija omogoÄŤa kopiranje/ustvarjanje novih ravni in šifrantov, ki jih dobi preko veÄŤdimenzionalnega polja, + * lahko pa tudi kopira strukturo in uporabnike, tako da primerja nove ID-je ravni/sifrantov s starimi in gre postari strukturi ter + * zamenja stare ID-je z novimi ter zapiše tudi uporabnike + * + * @param (array) $hierarhija - multi array + * @param (int) $id_shranjene_strukture - pridobimo id vrstice iz tabele srv_hierarhija_shrani + * @param (int) $uporabniki - ali se kopirajo tudi uporabniki + * @return boolean + */ + public function ustvariRavniInSifranteLahkoTudiStrukturo($hierarhija, $id_shranjene_strukture = null, $uporabniki = 0) + { + // v kolikor Ĺľelimo kopirati tudi uporabnike/strukturo potem zbiramo stare in nove vrednosti + if ($uporabniki == 1) + $primerjava = [ + 'ravni' => [], + 'sifranti' => [], + ]; + + // Nimamo hierarhije + if (empty($hierarhija)) + return false; + + // vpisemo vse ravni in šifrante + if (!empty($hierarhija) && is_array($hierarhija) && sizeof($hierarhija) > 0) { + + foreach ($hierarhija as $ravni) { + $ravni = (array)$ravni; + + $id_ravni = sisplet_query("INSERT INTO srv_hierarhija_ravni (anketa_id, user_id, level, ime) VALUES ('".$this->anketa."', '".$this->user_id."', '" . $ravni['st'] . "', '" . $ravni['ime'] . "')", "id"); + + if ($uporabniki == 1 && isset($primerjava)) + $primerjava['ravni'][$ravni['id']] = $id_ravni; + + // V kolikor so tudi šifranti vpišemo še šifrante + if (!empty($ravni['sifranti']) && sizeof($ravni['sifranti']) > 0 && !empty($id_ravni)) { + foreach ($ravni['sifranti'] as $sifrant) { + $sifrant = (array)$sifrant; + + if (!empty($sifrant['ime'])) { + $sql_hs = sisplet_query("INSERT INTO srv_hierarhija_sifranti (hierarhija_ravni_id, ime) VALUES ('" . $id_ravni . "', '" . $sifrant['ime'] . "')"); + $this->sqlError($sql_hs); + + if ($uporabniki == 1 && isset($primerjava['sifranti'])) { + $primerjava['sifranti'][$sifrant['id']] = mysqli_insert_id($GLOBALS['connect_db']); + } + + } + } + } + } + + } + + if ($uporabniki == 1 && isset($primerjava) && sizeof($primerjava['ravni']) > 0 && $id_shranjene_strukture > 0) { + $struktura = HierarhijaQuery::getHierarhijaShraniRow($id_shranjene_strukture, 'struktura'); + $struktura = unserialize($struktura); + + if (!empty($struktura) && sizeof($primerjava['ravni']) > 0) { + $this->compare($primerjava)->save($struktura); + } + } + + return true; + } + + /** + * Kopira celotrno strukturo iz stare ankete na novo anketo + * + * @param int $old_id + */ + public function kopirajCelotroStrukturoKNoviAnketi($old_id) + { + // pridobimo ID trenutne hierarhije še s tarim ID-jem ankete + // $old_id - ID trenutne ankete, preden jo skopiramo + $id_shranjene_strukture = (new HierarhijaQuery())->getDeleteHierarhijaOptions($old_id, 'srv_hierarhija_shrani_id', null, null, false); + $shranjeni_podatki_stare_ankete = sisplet_query("SELECT * FROM srv_hierarhija_shrani WHERE id='" . $id_shranjene_strukture . "'", "obj"); + + // Kopiramo podatke iz srv_hierarhija_shrani + $ime_strukture_pri_novi_anketi = $shranjeni_podatki_stare_ankete->ime . '_' . date('H:i:s'); + $id_stranjene_nove_ankete = sisplet_query("INSERT INTO + srv_hierarhija_shrani + (anketa_id, user_id, ime, hierarhija, struktura, st_uciteljev, st_vseh_uporabnikov, komentar) + VALUES + ( + $this->anketa, + $this->user_id, + '" . $ime_strukture_pri_novi_anketi . "', + '" . $shranjeni_podatki_stare_ankete->hierarhija . "', + '" . $shranjeni_podatki_stare_ankete->struktura . "', + '" . $shranjeni_podatki_stare_ankete->st_uciteljev . "', + '" . $shranjeni_podatki_stare_ankete->st_vseh_uporabnikov . "', + '" . $shranjeni_podatki_stare_ankete->komentar . "' + ) + ", "id"); + + // podatke shranimo še med opcije za specifiÄŤno anketo + sisplet_query("INSERT INTO srv_hierarhija_options (anketa_id, option_name, option_value) VALUES ($this->anketa, 'srv_hierarhija_shrani_id', $id_stranjene_nove_ankete)"); + sisplet_query("INSERT INTO srv_hierarhija_options (anketa_id, option_name, option_value) VALUES ($this->anketa, 'aktivna_hierarhija_ime', '" . $ime_strukture_pri_novi_anketi . "')"); + + if ($this->isJson($shranjeni_podatki_stare_ankete->hierarhija)) { + $hierarhija = json_decode($shranjeni_podatki_stare_ankete->hierarhija); + } else { + $hierarhija = unserialize($shranjeni_podatki_stare_ankete->hierarhija); + } + + // $new_id je ID nove ankete, ki je bila skopirana + return $this->ustvariRavniInSifranteLahkoTudiStrukturo($hierarhija, $id_shranjene_strukture, 1); + + } + + /** + * Preverimo, ÄŤe je JSON + * + * @param (string) $string + * @return return true ali error + */ + public function isJson($string, $polje = 0) + { + if (is_string($string)) { + $array = json_decode(stripslashes($string)); + + if (json_last_error() == JSON_ERROR_NONE) { + if ($polje) + return $array; + + return true; + } + } + + return false; + } + + public function sqlError($sql) + { + if (!$sql) { + echo mysqli_error($GLOBALS['connect_db']); + die(); + } + + } + +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaPorocilaClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaPorocilaClass.php new file mode 100644 index 0000000..87745a2 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaPorocilaClass.php @@ -0,0 +1,321 @@ +anketa = $anketa; + + global $site_path; + $this->site_path = $site_path; + + } + + public function izvoz($vrsta = 'word') + { + if (!empty($_GET['t']) && in_array($_GET['t'], ['word', 'pdf'])) + $vrsta = $_GET['t']; + + // Samo za debug + if (false && $admin_type == 0) { + + // R parametri za PDF + if ($vrsta == 'pdf') { + $script = $this->site_path . self::scriptFolder . 'test_1ka_pdf.R'; + $content_type = 'text/x-csv; charset=utf-8'; + $file_name = 'test.pdf'; + }else{ + // R parametri, za DOC,DOCX + $script = $this->site_path . self::scriptFolder . 'test_1ka.R'; + $content_type = 'application/octet-stream'; + $file_name = 'test.docx'; + } + + $out = exec('Rscript ' . $script . ' 2>&1', $output, $return_var); + + // Testiranje - izpis errorjev + echo '
'; + echo 'Rscript ' . $script; + //echo '
'.$out.'
'; + var_dump($output); + echo '
'; + + + // Pripravimo file za download + if (file_exists($this->site_path . self::resultFolder . $file_name)) { + + $file = $this->site_path . self::resultFolder . $file_name; + + header('Content-Description: File Transfer'); + header('Content-Disposition: attachment; filename=' . basename($file_name)); + header('Content-Type: '.$content_type); + header("Content-Transfer-Encoding: Binary"); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + header('Content-Length: ' . filesize($file)); + + ob_clean(); + flush(); + + readfile($file); + } + + } + + // Pripravi CSV s podatki + $this->pripraviCSV(); + $this->pripraviCSVuciteljev(); + + // R parametri, za DOC,DOCX + $script = $this->site_path . self::scriptFolder . 'Hierarhija_1ka.R'; + $content_type = 'application/octet-stream'; + //Ime ankete + $ime = slug(SurveyInfo::getSurveyTitle(), '_'); + $file_name = 'SAMOEVALVACIJSKO_POROCILO__' . $ime . '.docx'; + + // R parametri za PDF + if ($vrsta == 'pdf') { + $script = $this->site_path . self::scriptFolder . 'Hierarhija_1ka_pdf.R'; + $content_type = 'text/x-csv; charset=utf-8'; + $file_name = 'SAMOEVALVACIJSKO_POROCILO_' . $ime . '.pdf'; + } + + $shrani_id = HierarhijaQuery::getOptions($this->anketa, 'srv_hierarhija_shrani_id'); + $logo = sisplet_query("SELECT logo FROM srv_hierarhija_shrani WHERE id='" . $shrani_id . "' AND anketa_id='" . $this->anketa . "'", "obj")->logo; + + // 1 - odgovori v anketami + // 2 - seznam uciteljev in predmetov + // 3 - ime datoteke v katero shranimo (pdf, docx) + // 4 - logo + $param = 'hierarhija_' . $this->anketa . '.csv hierarhija_ucitelji_' . $this->anketa . '.csv '. $file_name . ' ' . $logo; + + $out = exec('Rscript ' . $script . ' ' . $param . ' 2>&1', $output, $return_var); + + // Testiranje - izpis errorjev + if ($admin_type == 0) { + echo '
'; + echo 'Rscript ' . $script; + //echo '
'.$out.'
'; + var_dump($output); + echo '
'; + } + + // Pripravimo file za download + if (file_exists($this->site_path . self::resultFolder . $file_name)) { + + $file = $this->site_path . self::resultFolder . $file_name; + + header('Content-Description: File Transfer'); + header('Content-Disposition: attachment; filename=' . basename($file_name)); + header('Content-Type: '.$content_type); + header("Content-Transfer-Encoding: Binary"); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + header('Content-Length: ' . filesize($file)); + + ob_clean(); + flush(); + + readfile($file); + } + + // Na koncu pobrisemo zacasne datoteke + $this->deleteTemp(); + + // Ugasnemo skripto:) + die(); + } + + /** + * Pripravimo CSV izvoz vseh podatkov + */ + private function pripraviCSV() + { + $temp_folder = $this->site_path . self::tempFolder; + + $SDF = SurveyDataFile::get_instance(); + $SDF->init($this->anketa); + $_headFileName = $SDF->getHeaderFileName(); + $_dataFileName = $SDF->getDataFileName(); + $_fileStatus = $SDF->getStatus(); + + if(count(file($_dataFileName)) < 3){ + global $site_url; + echo 'Premalo podatkov'; + redirect($site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&a=' . A_HIERARHIJA_SUPERADMIN . '&m=' . M_ANALIZE.'&error=invalid'); + die(); + } + + if ($_headFileName != null && $_headFileName != '') { + $_HEADERS = unserialize(file_get_contents($_headFileName)); + } else { + echo 'Error! Empty file name!'; + } + + // Zaenkrat dopuscamo samo status 6 in brez lurkerjev + $status_filter = '(' . STATUS_FIELD . ' ~ /6|5/)&&(' . LURKER_FIELD . '==0)'; + //$status_filter = '('.STATUS_FIELD.'==6)&&('.LURKER_FIELD.'==0)'; + + //$start_sequence = $_HEADERS['_settings']['dataSequence']; + $start_sequence = 2; + $end_sequence = $_HEADERS['_settings']['metaSequence'] - 1; + + $field_delimit = ';'; + + // Pridobi filtre +// $hierarhija_analize = (new \HierarhijaAnalysis($this->anketa)); +// $hierarhija_filter = $hierarhija_analize->filterHierarhijeIzTekstovneDatoteke(); +// $ucitelj_filter = $hierarhija_analize->filterHierarhijeZaSpecificnegaUciteljaIzDatoteke(); +// (!empty($ucitelj_filter) ? $ucitelj_filter : $hierarhija_filter) // preveri izpis conzole + + // Filtriramo podatke po statusu in jih zapisemo v temp folder + $out = shell_exec('awk -F"|" \'BEGIN {{OFS=","} {ORS="\n"}} ' . $status_filter . '\' ' . $_dataFileName . ' | cut -d \'|\' -f ' . $start_sequence . '-' . $end_sequence . ' >> ' . $temp_folder . 'temp_data_' . $this->anketa . '.dat'); +// dump('awk -F"|" \'BEGIN {{OFS=","} {ORS="\n"}} '.$status_filter.'\' '.$_dataFileName.' | cut -d \'|\' -f '.$start_sequence.'-'.$end_sequence.' >> '.$temp_folder.'temp_data_'.$this->anketa.'.dat'); + + + // Ustvarimo koncni CSV + if ($fd = fopen($temp_folder . 'temp_data_' . $this->anketa . '.dat', "r")) { + + $fd2 = fopen($temp_folder . 'hierarhija_' . $this->anketa . '.csv', "w+"); + + $convertType = 1; // kateri tip konvertiranja uporabimo + $convertTypes[1] = array('charSet' => 'windows-1250', + 'delimit' => ';', + 'newLine' => "\n", + 'BOMchar' => "\xEF\xBB\xBF"); + # dodamo boomchar za utf-8 + fwrite($fd2, $convertTypes[$convertType]['BOMchar']); + + # naredimo header row + foreach ($_HEADERS AS $spid => $spremenljivka) { + if (count($spremenljivka['grids']) > 0) { + foreach ($spremenljivka['grids'] AS $gid => $grid) { + foreach ($grid['variables'] AS $vid => $variable) { + if ($spremenljivka['tip'] !== 'sm' && !($variable['variable'] == 'uid' && $variable['naslov'] == 'User ID')) { + $output1 .= strip_tags($variable['variable']) . $field_delimit; + $output2 .= '"' . strip_tags($variable['naslov']) . '"' . $field_delimit; + } + } + } + } + } + + fwrite($fd2, $output1 . "\r\n"); + fwrite($fd2, $output2 . "\r\n"); + + while ($line = fgets($fd)) { + + $temp = array(); + $temp = explode('|', $line); + + // Zamenjamo številke z vrednostmi predmetov hierarhije + $grupaId = HierarhijaOnlyQuery::getGrupaId($this->anketa); + + // Pripravimo polje po katerem iščemo nivoje + $stRavni = sisplet_query("SELECT count('id') as st FROM srv_hierarhija_ravni WHERE anketa_id = '" . $this->anketa . "'", "obj")->st; + $isci_po_polju = "'nivo1'"; + for ($i = 2; $i <= $stRavni; $i++) { + $isci_po_polju .= ",'nivo" . $i . "'"; + } + + $elementi_hierarhije = sisplet_query("SELECT id, variable FROM srv_spremenljivka WHERE gru_id='" . $grupaId . "' AND variable IN (" . $isci_po_polju . ") ORDER BY vrstni_red", "obj"); + + // od 8 elementa v txt datoteki se zaÄŤne naprej hierarhija + $line_explode = explode('|', $line); + // številka prvega elementa, ki ga bomo zamenjali - vloga + $st = 9; + foreach ($elementi_hierarhije as $element) { + $ime_strukture = sisplet_query("SELECT naslov FROM srv_vrednost WHERE spr_id='" . $element->id . "' AND variable='" . $line_explode[$st] . "'", "obj")->naslov; + $line_explode[$st] = $ime_strukture; + $st++; + } + + $line = join('|', $line_explode); + $line = '"' . str_replace(array("\r", "\n", "\"", "|"), array("", "", "", '";"'), $line) . '"'; + + + // Spremenimo encoding v windows-1250 + //$line = iconv("UTF-8","Windows-1250//TRANSLIT", $line); + + fwrite($fd2, $line); + fwrite($fd2, "\r\n"); + + } + + fclose($fd2); + } + fclose($fd); + + + // Na koncu pobrisemo temp datoteke + if (file_exists($temp_folder . '/temp_data_' . $this->anketa . '.dat')) { + unlink($temp_folder . '/temp_data_' . $this->anketa . '.dat'); + } + } + + /** + * Izvoz hierarhije uÄŤiteljev z imenomin priimkom ter elektronskim naslovom + */ + private function pripraviCSVuciteljev(){ + $ucitelji = HierarhijaIzvoz::getInstance($this->anketa)->csvIzvozStruktureZaObdelavo(true); + + $temp_folder = $this->site_path . self::tempFolder; + $file = fopen($temp_folder . 'hierarhija_ucitelji_' . $this->anketa . '.csv', "w+"); + + $convertType = 1; // kateri tip konvertiranja uporabimo + $convertTypes[1] = array('charSet' => 'windows-1250', + 'delimit' => ';', + 'newLine' => "\n", + 'BOMchar' => "\xEF\xBB\xBF"); + # dodamo boomchar za utf-8 + fwrite($file, $convertTypes[$convertType]['BOMchar']); + + foreach($ucitelji as $ucitelj){ + fputcsv($file, $ucitelj); + } + + fclose($file); + } + + private function deleteTemp() + { + $temp_folder = $this->site_path . self::tempFolder; + + // Pobriše CSV datoteko + if (file_exists($temp_folder . '/hierarhija' . $this->anketa . '.csv')) + unlink($temp_folder . '/hierarhija' . $this->anketa . '.csv'); + + // Pobriše CSV datoteko uciteljev + if (file_exists($temp_folder . '/hierarhija_ucitelji_' . $this->anketa . '.csv')) + unlink($temp_folder . '/hierarhija_ucitelji_' . $this->anketa . '.csv'); + + // Pobrisemo še vse v rezultatih + $files = glob($this->site_path . self::resultFolder . '*'); + foreach ($files as $file) { + if (is_file($file)) + unlink($file); + } + } +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/css/mod_hierarhija.css b/admin/survey/modules/mod_hierarhija/css/mod_hierarhija.css new file mode 100644 index 0000000..28ff332 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/mod_hierarhija.css @@ -0,0 +1,755 @@ +.clear { + clear: both; +} + +/* JsTree */ + /*righ click */ +.vakata-context { + z-index: 10052 !important; +} +#admin_hierarhija_jstree{ + padding-bottom: 20px; +} + +/* SUPERADMIN HIERARHIJA */ +.hierarhija-levi-meni{ + float: left; + display:block; + padding: 10px 8px; + margin: 20px 10px 0 0; + width: 140px; + min-height: 250px; + background-color: #eff2f7; +} +.hierarhija-levi-meni>div{ + font-weight: bold; + padding-bottom: 10px; +} +.hierarhija-levi-meni>div.h-tabela{ + padding: 2px; + background: #FFF; + min-height: 240px; + border: 1px solid #e2e2e2; + max-height: 340px; + overflow: auto; +} +.hierarhija-levi-meni>div>table{ + font-weight: normal; + width: 100%; + cursor: pointer; +} +.hierarhija-levi-meni>div>table td.h-ime-shranjeno{ + padding-bottom: 5px; + border-bottom: 1px solid #e2e2e2; +} + +td.h-ime-shranjeno:hover { + color: #0C377A !important; +} + +.hierarhija_fieldset { + padding-bottom: 1em; + float: left; + display: block; +} + +.h-sa-div-inline { + display: inline-block; + float: left; + min-width: 12em; + padding-right: 2em; +} + +.h-sa-div-inline label { + clear: both; + display: block; +} + +.h-sa-div-inline.nivo select { + width: 10em; +} + +.h-sa-div-inline.submit { + padding-top: 1.5em; + padding-left: 1em; +} + +.h-sa-list { + padding-top: 1em; +} + +.h-sa-nivo-primer select { + margin: 5px; +} + +.izgradnja_hierarhije { + width: auto; + display: block; +} + +.h-form-field { + padding: 1.3em 0; +} + +.h-form-field label { + width: 22em; + padding: 0 1em; + display: block; + float: left; + text-align: right; +} + +.h-form-options { + display: block; + float: left; + min-width: 25em; +} + +.h-form-options textarea { + height: 6em; + width: 40em; +} + +.h-required { + border: 1px solid red !important; +} + +.h-email-user { + min-width: 0; + margin-right: 10px; +} + +.h-opozorilo { + float: left; + color: red; + font-style: italic; + display: none; +} + +.hierarhija-filter { + min-width: 75px; + display: block; + float: left; +} + +.upload-file { + border: solid #8a9fbf 1px; + background: #fff; + font-size: 11px; + display: block !important; + width: 100%; + max-width: 360px; + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + box-shadow: 0 0 0 2px #fff; +} + +.upload-file:hover { + border: solid #fa4913 1px; +} + +.upload-file .NFI-button { + height: 22px; + line-height: 22px; + background: #8a9fbf; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); + color: #fff; + width: 30%; + font-weight: 700; +} + +.upload-file .NFI-button:hover { + background: #fa4913; +} + +.upload-file .NFI-filename { + width: 66%; + height: 20px; + margin: 0 !important; + padding: 0 !important; + display: block !important; + -webkit-appearance: none !important; + -moz-appearance: none !important; + appearance: none !important; + border: none !important; +} + +/* MENI HIERARHIJA UÄŚITELJ IN SUPERADMIN */ +.hierarhija-navigacija ul { + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + border: 1px solid #B9C5D9; + background-color: #eff2f7; + font-weight: bold; +} + +.hierarhija-navigacija li { + float: left; +} + +.hierarhija-navigacija li a { + display: block; + color: #8a9fbf; + text-align: center; + padding: 10px 12px; + text-decoration: none; +} + +.hierarhija-navigacija li a:hover:not(.active) { + color: #1f356c; + background-color: #ddd; +} + +.hierarhija-navigacija li a.active { + color: white; + background-color: #fa4913; +} + +.hierarhija-desni-link{ + float: right !important; + display: inline-block; +} + +.hierarhija-desni-link a{ + display: inline-block !important; +} + + +/* end meni hierarhija - superadmin */ + +.hierarhija-status-ucitelji { + padding-top: 20px; +} + +table.hierarhija-status-ucitelji, table.hierarhija-status-admin { + border-spacing: 0; +} + +.hierarhija-status-ucitelji th, .hierarhija-status-admin th { + padding: 8px 10px; + text-align: left; + border: 1px solid #ddd; +} + +.hierarhija-status-ucitelji td, .hierarhija-status-admin td { + padding: 8px 10px; + text-align: left; + border: 1px solid #ddd; +} + +.hierarhija-plus { + display: inline-block; + float: left; + cursor: pointer; + background-image: url('../../../img_new/sprites.png'); + background-position: -220px -54px; + width: 15px; + height: 14px; +} +.hierarhija-minus { + display: inline-block; + float: left; + cursor: pointer; + background-image: url('/admin/survey/img_new/sprites.png'); + background-position: 0px -58px; + width: 15px; + height: 14px; +} +.hierarhija-izvoz { + display: inline-block; + float: left; + cursor: pointer; + background-image: url('/admin/survey/img_new/sprites.png'); + background-position: -687px -759px; + width: 14px; + height: 20px; +} +.hierarhija-uvoz { + display: inline-block; + float: left; + cursor: pointer; + background-image: url('/admin/survey/img_new/sprites.png'); + background-position: -3px -866px; + width: 20px; + height: 20px; +} + +.hierarhija-nov-nivo, .hierarhija-urejanje { + cursor: pointer; + display: block; + float: left; + margin: 0 10px; +} + +.hierarhija-elementi { + float: left; + margin: 0 10px; + display: inline-block; +} + +.hierarhija-inline { + float: left; + display: inline-block; + margin-right: 2px; +} + +.sifranti-brisanje{ + display: block; + float: left; + clear: both; +} +.sifranti-brisanje>.brisi-x{ + float: left; + padding: 4px 0px; + margin: -2px 5px; +} +.sifranti-razmik{ + padding: 10px 5px; +} +.sifranti-razmik>ul{ + padding: 0; +} + +/* ON - OFF gumb */ +.onoffswitch { + position: relative; + width: 56px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} + +.onoffswitch-checkbox { + display: none; +} + +.onoffswitch-label { + display: block; + overflow: hidden; + cursor: pointer; + border: 2px solid #999999; + border-radius: 18px; +} + +.onoffswitch-inner { + display: block; + width: 200%; + margin-left: -100%; + transition: margin 0.3s ease-in 0s; +} + +.onoffswitch-inner:before, .onoffswitch-inner:after { + display: block; + float: left; + width: 50%; + height: 15px; + padding: 0; + line-height: 15px; + font-size: 14px; + color: white; + font-family: Trebuchet, Arial, sans-serif; + font-weight: bold; + box-sizing: border-box; +} + +.onoffswitch-inner:before { + content: "Da"; + padding-left: 10px; + background-color: #647faa; + color: #FFFFFF; +} + +.onoffswitch-inner:after { + content: "Ne"; + padding-right: 10px; + background-color: #EEEEEE; + color: #999999; + text-align: right; +} + +.onoffswitch-switch { + display: block; + width: 14px; + margin: 0.5px; + background: #FFFFFF; + position: absolute; + top: 0; + bottom: 0; + right: 37px; + border: 2px solid #999999; + border-radius: 18px; + transition: all 0.3s ease-in 0s; +} + +.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner { + margin-left: 0; +} + +.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { + right: 0; +} + +.editable-hierarhija{ + border: 1px dashed #0C377A !important; +} + +#div_odprto_vprasanje > table { + margin: 35px 0 !important; +} + +/* x briši*/ +.brisi-x{ + background-image: url(/admin/survey/img_new/sprites.png) !important; + background-position: -440px -54px; + width: 12px; + height: 18px; + cursor: pointer; + float: right; +} +.brisi-x:hover{ + background-position: -452px -54px; +} + +/*urejanje ikone datatables*/ +.ikona{ + background-image: url(/admin/survey/img_new/sprites.png) !important; + cursor: pointer; + display: inline-block; + margin-left: 9px; + width: 16px; + height: 20px; + background-repeat: no-repeat; +} +.ikona-kopiraj{ + background-position: -32px -54px; + width: 19px; + height: 20px; +} +.ikona-brisi{ + background-position: -16px -54px; +} +.ikona-uporabniki{ + background-position: 0 -54px; +} +/* end ON - OFF */ + +/***** TOOGLE RADIO BUTTON *****/ +.wrapper { + /*margin: 100px 0;*/ +} +.toggle_radio{ + position: relative; + background: rgba(12,92,196, .6); + margin: 4px auto; + overflow: hidden; + padding: 0 !important; + -webkit-border-radius: 50px; + -moz-border-radius: 50px; + border-radius: 50px; + position: relative; + height: 26px; + width: 354px; +} +.toggle_radio > * { + float: left; +} +.toggle_radio input[type=radio]{ + display: none; + /*position: fixed;*/ +} +.toggle_radio label{ + color: rgba(255,255,255,.9); + z-index: 0; + display: block; + width: 170px; + height: 20px; + margin: 3px 3px; + -webkit-border-radius: 50px; + -moz-border-radius: 50px; + border-radius: 50px; + cursor: pointer; + z-index: 1; + text-align: center; + margin-top: -7px; +} +.toggle_option_slider{ + width: 172px; + height: 20px; + position: absolute; + top: 3px; + -webkit-border-radius: 50px; + -moz-border-radius: 50px; + border-radius: 50px; + background: #ffe6d6 !important; +} + +#seznam_toggle:checked ~ .toggle_option_slider{ + background: rgba(255,255,255,.3); + left: 3px; +} +#tabela_toggle:checked ~ .toggle_option_slider{ + background: rgba(255,255,255,.3); + left: 179px; +} +/***** END TOOGLE RADIO BUTTON *****/ + + +/***** Hierarhija prikaz v tabeli in izbira opcij *****/ +.prikaz-sifrantov{ + width: 100%; + clear: both; +} +.prikaz-sifrantov .gumb{ + padding: 20px 0; +} +.prikaz-sifrantov .tabela, .prikaz-sifrantov .gumb{ + display: inline-block; + float: left; +} +.table-prikaz-izbranih-sifrantov{ + border-spacing: 0; + padding: 0 35px 25px; +} + +table.tabela-obroba{ + border-spacing: 0; +} +.tabela-obroba th{ + color: gray; + background-color: #EFF2F7; +} +.tabela-obroba th, .tabela-obroba td{ + padding: 8px 10px; + border: 1px solid #ddd; +} + +.tabela-vpis-sifrantov #gumb td{ + text-align:right; + border: none; +} + +.tabela-vpis-sifrantov #gumb td button{ + margin: 10px 10px 0; +} + +.table-prikaz-izbranih-sifrantov th{ + padding: 0 15px; +} + +.table-prikaz-izbranih-sifrantov td{ + padding: 8px 10px; + border: 1px solid #ddd; +} +.table-prikaz-izbranih-sifrantov span{ + float: right; + cursor: pointer; +} + +.inline-element-hierarhije{ + width: 30%; + display: inline-block; + float: left; + padding: 0 15px; +} + +.inline-element-hierarhije .gumb{ + padding-top: 20px; +} + +.custom-datatables, .custom-datatables th, .custom-datatables td{ + border: 1px solid #ddd !important; +} + +#vpis-sifrantov-admin-tabela_wrapper #vpis-sifrantov-admin-tabela_filter, +#hierarhija-status-admin_wrapper #hierarhija-status-admin_filter{ + padding: 10px 0 20px !important; +} +#vpis-sifrantov-admin-tabela>tbody>tr{ + vertical-align: top; +} + +.h-uporabnik { + display: inline-block; + float: right; + padding: 4px 0 0 16px; + cursor: pointer; +} +.h-select2{ + min-width: 100px; + display: inline-block; + float: left; +} + +.h-uporabnik-prikazi{ + clear: both; + display: block; + padding-top: 10px; + font-size: 11px; +} +.h-uporabnik-prikazi ul{ + list-style: inherit !important; + padding-left: 15px !important; +} + +/***** END Hierarhija prikaz v tabeli in izbira opcij *****/ + +/***** DataTables pot do slik *****/ +table.dataTable thead th{ + background-color: #EFF2F7 !important; +} +table.dataTable thead .sorting_asc{ + background: url('/admin/survey/modules/mod_hierarhija/img/sort_asc.png') no-repeat top right; +} + +table.dataTable thead .sorting_desc{ + background: url('/admin/survey/modules/mod_hierarhija/img/sort_desc.png') no-repeat top right; +} + +table.dataTable thead .sorting{ + background: url('/admin/survey/modules/mod_hierarhija/img/sort_both.png') no-repeat top right; +} + +table.dataTable thead .sorting_asc_disabled{ + background: url('/admin/survey/modules/mod_hierarhija/img/sort_asc_disabled.png') no-repeat top right; +} + +table.dataTable thead .sorting_desc_disabled { + background: url('/admin/survey/modules/mod_hierarhija/img/sort_desc_disabled.png') no-repeat top right; +} +tr.aktivno-urejanje { + background: #ffe6d6 !important; +} +/***** END DataTables pot do slik *****/ + + + +/***** button groups *****/ +.btn{ + display: inline-block; + padding: .2rem .6rem; + font-size: .8rem; + font-weight: 400; + line-height: 1.5; + text-align: center; + white-space: nowrap; + vertical-align: middle; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border: 1px solid transparent; + border-radius: .25rem; +} +/* moder */ +.btn-moder{ + color: #ffffff; + background-color: #3d5f95; + background-image: none; + border-color: #24467C; +} +.btn-moder:hover { + color: #3d5f95; + background-color: #ffffff; + border-color: #3d5f95; +} + +/* moder outline */ +.btn-moder-outline{ + color: #3d5f95; + background-color: #ffffff; + background-image: none; + border-color: #24467C; +} +.btn-moder-outline:hover { + color: #fff; + background-color: #3d5f95; + border-color: #24467C; +} + +/* rdeÄŤ */ +.btn-rdec{ + color: #fff; + background-color: #fa4913; + border-color: #E13000; + background-image: none; +} +.btn-rdec:hover { + color: #fa4913; + background-color: #ffffff; + border-color: #fa4913; +} + +/* rdeÄŤ outline */ +.btn-rdec-outline{ + color: #fa4913; + background-color: #ffffff; + background-image: none; + border-color: #fa4913; +} +.btn-rdec-outline:hover { + color: #fff; + background-color: #fa4913; + border-color: #fa4913; +} +/***** END button groups *****/ + +/***** Sweet alert 1ka barvna modifikacija *****/ +/* error */ +.sweet-alert .sa-icon.sa-error{ + border-color: #fa4913 !important; +} +.sweet-alert .sa-icon.sa-error .sa-line{ + background-color: #fa4913 !important; +}an + +/* warning - klicaj */ +.sweet-alert .sa-icon.sa-warning { + border-color: #ffe6d6 !important; +} +.sweet-alert .sa-icon.sa-warning .sa-line{ + background-color: #ffe6d6 !important; +} + +.sweet-alert button { + color: #3d5f95 !important; + background-color: #ffffff !important; + background-image: none !important; + border: 1px solid #3d5f95 !important; +} +.sweet-alert button:hover { + color: #fff !important; + background-color: #3d5f95 !important; + border-color: #3d5f95 !important; +} +/***** END Sweet alert 1ka barvna modifikacija *****/ + +div.qtip-content { + font-size: 9px; +} +.qtip-wrapper, .qtip-contentWrapper{ + border: 0 !important; +} +.qtip-borderTop, .qtip-borderBottom{ + display: none !important; +} +.qtip-title{ + color: #0C377A !important; + background-color: #D8DFEA !important; +} +.qtip-content{ + padding: 12px 9px !important; + background-color: #f7f7f7 !important; + border: 1px #D8DFEA solid; +} + +/* OkvirÄŤke */ +.okvircek{ + width: 522px; + border: 1px dashed #B9C5D9; + padding: 3px 25px 18px; +} diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/datatables.min.css b/admin/survey/modules/mod_hierarhija/css/vendor/datatables.min.css new file mode 100644 index 0000000..aca8f9d --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/datatables.min.css @@ -0,0 +1,21 @@ +/* + * This combined file was created by the DataTables downloader builder: + * https://datatables.net/download + * + * To rebuild or modify this file with the latest versions of the included + * software please visit: + * https://datatables.net/download/#dt/dt-1.10.12,r-2.1.0,sc-1.4.2 + * + * Included libraries: + * DataTables 1.10.12, Responsive 2.1.0, Scroller 1.4.2 + */ + +table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc{cursor:pointer;*cursor:hand}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("DataTables-1.10.12/images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("DataTables-1.10.12/images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("DataTables-1.10.12/images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("DataTables-1.10.12/images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("DataTables-1.10.12/images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{-webkit-box-sizing:content-box;box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table,.dataTables_wrapper.no-footer div.dataTables_scrollBody table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}} + + +table.dataTable.dtr-inline.collapsed>tbody>tr>td.child,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty{cursor:default !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty:before{display:none !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td:first-child,table.dataTable.dtr-inline.collapsed>tbody>tr>th:first-child{position:relative;padding-left:30px;cursor:pointer}table.dataTable.dtr-inline.collapsed>tbody>tr>td:first-child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th:first-child:before{top:9px;left:4px;height:14px;width:14px;display:block;position:absolute;color:white;border:2px solid white;border-radius:14px;box-shadow:0 0 3px #444;box-sizing:content-box;text-align:center;font-family:'Courier New', Courier, monospace;line-height:14px;content:'+';background-color:#31b131}table.dataTable.dtr-inline.collapsed>tbody>tr.parent>td:first-child:before,table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th:first-child:before{content:'-';background-color:#d33333}table.dataTable.dtr-inline.collapsed>tbody>tr.child td:before{display:none}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td:first-child,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th:first-child{padding-left:27px}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td:first-child:before,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th:first-child:before{top:5px;left:4px;height:14px;width:14px;border-radius:14px;line-height:14px;text-indent:3px}table.dataTable.dtr-column>tbody>tr>td.control,table.dataTable.dtr-column>tbody>tr>th.control{position:relative;cursor:pointer}table.dataTable.dtr-column>tbody>tr>td.control:before,table.dataTable.dtr-column>tbody>tr>th.control:before{top:50%;left:50%;height:16px;width:16px;margin-top:-10px;margin-left:-10px;display:block;position:absolute;color:white;border:2px solid white;border-radius:14px;box-shadow:0 0 3px #444;box-sizing:content-box;text-align:center;font-family:'Courier New', Courier, monospace;line-height:14px;content:'+';background-color:#31b131}table.dataTable.dtr-column>tbody>tr.parent td.control:before,table.dataTable.dtr-column>tbody>tr.parent th.control:before{content:'-';background-color:#d33333}table.dataTable>tbody>tr.child{padding:0.5em 1em}table.dataTable>tbody>tr.child:hover{background:transparent !important}table.dataTable>tbody>tr.child ul{display:inline-block;list-style-type:none;margin:0;padding:0}table.dataTable>tbody>tr.child ul li{border-bottom:1px solid #efefef;padding:0.5em 0}table.dataTable>tbody>tr.child ul li:first-child{padding-top:0}table.dataTable>tbody>tr.child ul li:last-child{border-bottom:none}table.dataTable>tbody>tr.child span.dtr-title{display:inline-block;min-width:75px;font-weight:bold}div.dtr-modal{position:fixed;box-sizing:border-box;top:0;left:0;height:100%;width:100%;z-index:100;padding:10em 1em}div.dtr-modal div.dtr-modal-display{position:absolute;top:0;left:0;bottom:0;right:0;width:50%;height:50%;overflow:auto;margin:auto;z-index:102;overflow:auto;background-color:#f5f5f7;border:1px solid black;border-radius:0.5em;box-shadow:0 12px 30px rgba(0,0,0,0.6)}div.dtr-modal div.dtr-modal-content{position:relative;padding:1em}div.dtr-modal div.dtr-modal-close{position:absolute;top:6px;right:6px;width:22px;height:22px;border:1px solid #eaeaea;background-color:#f9f9f9;text-align:center;border-radius:3px;cursor:pointer;z-index:12}div.dtr-modal div.dtr-modal-close:hover{background-color:#eaeaea}div.dtr-modal div.dtr-modal-background{position:fixed;top:0;left:0;right:0;bottom:0;z-index:101;background:rgba(0,0,0,0.6)}@media screen and (max-width: 767px){div.dtr-modal div.dtr-modal-display{width:95%}} + + +div.DTS{display:block !important}div.DTS tbody th,div.DTS tbody td{white-space:nowrap}div.DTS div.DTS_Loading{z-index:1}div.DTS div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, #fff 10px, #fff 20px)}div.DTS div.dataTables_scrollBody table{z-index:2}div.DTS div.dataTables_paginate,div.DTS div.dataTables_length{display:none} + + diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/32px.png b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/32px.png new file mode 100644 index 0000000..d6fd721 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/32px.png differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/40px.png b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/40px.png new file mode 100644 index 0000000..4fc88e4 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/40px.png differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/style.css b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/style.css new file mode 100644 index 0000000..afae08c --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/style.css @@ -0,0 +1,1075 @@ +/* jsTree default dark theme */ +.jstree-node, +.jstree-children, +.jstree-container-ul { + display: block; + margin: 0; + padding: 0; + list-style-type: none; + list-style-image: none; +} +.jstree-node { + white-space: nowrap; +} +.jstree-anchor { + display: inline-block; + color: black; + white-space: nowrap; + padding: 0 4px 0 1px; + margin: 0; + vertical-align: top; +} +.jstree-anchor:focus { + outline: 0; +} +.jstree-anchor, +.jstree-anchor:link, +.jstree-anchor:visited, +.jstree-anchor:hover, +.jstree-anchor:active { + text-decoration: none; + color: inherit; +} +.jstree-icon { + display: inline-block; + text-decoration: none; + margin: 0; + padding: 0; + vertical-align: top; + text-align: center; +} +.jstree-icon:empty { + display: inline-block; + text-decoration: none; + margin: 0; + padding: 0; + vertical-align: top; + text-align: center; +} +.jstree-ocl { + cursor: pointer; +} +.jstree-leaf > .jstree-ocl { + cursor: default; +} +.jstree .jstree-open > .jstree-children { + display: block; +} +.jstree .jstree-closed > .jstree-children, +.jstree .jstree-leaf > .jstree-children { + display: none; +} +.jstree-anchor > .jstree-themeicon { + margin-right: 2px; +} +.jstree-no-icons .jstree-themeicon, +.jstree-anchor > .jstree-themeicon-hidden { + display: none; +} +.jstree-rtl .jstree-anchor { + padding: 0 1px 0 4px; +} +.jstree-rtl .jstree-anchor > .jstree-themeicon { + margin-left: 2px; + margin-right: 0; +} +.jstree-rtl .jstree-node { + margin-left: 0; +} +.jstree-rtl .jstree-container-ul > .jstree-node { + margin-right: 0; +} +.jstree-wholerow-ul { + position: relative; + display: inline-block; + min-width: 100%; +} +.jstree-wholerow-ul .jstree-leaf > .jstree-ocl { + cursor: pointer; +} +.jstree-wholerow-ul .jstree-anchor, +.jstree-wholerow-ul .jstree-icon { + position: relative; +} +.jstree-wholerow-ul .jstree-wholerow { + width: 100%; + cursor: pointer; + position: absolute; + left: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.vakata-context { + display: none; +} +.vakata-context, +.vakata-context ul { + margin: 0; + padding: 2px; + position: absolute; + background: #f5f5f5; + border: 1px solid #979797; + box-shadow: 2px 2px 2px #999999; +} +.vakata-context ul { + list-style: none; + left: 100%; + margin-top: -2.7em; + margin-left: -4px; +} +.vakata-context .vakata-context-right ul { + left: auto; + right: 100%; + margin-left: auto; + margin-right: -4px; +} +.vakata-context li { + list-style: none; + display: inline; +} +.vakata-context li > a { + display: block; + padding: 0 2em 0 2em; + text-decoration: none; + width: auto; + color: black; + white-space: nowrap; + line-height: 2.4em; + text-shadow: 1px 1px 0 white; + border-radius: 1px; +} +.vakata-context li > a:hover { + position: relative; + background-color: #e8eff7; + box-shadow: 0 0 2px #0a6aa1; +} +.vakata-context li > a.vakata-context-parent { + background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); + background-position: right center; + background-repeat: no-repeat; +} +.vakata-context li > a:focus { + outline: 0; +} +.vakata-context .vakata-context-hover > a { + position: relative; + background-color: #e8eff7; + box-shadow: 0 0 2px #0a6aa1; +} +.vakata-context .vakata-context-separator > a, +.vakata-context .vakata-context-separator > a:hover { + background: white; + border: 0; + border-top: 1px solid #e2e3e3; + height: 1px; + min-height: 1px; + max-height: 1px; + padding: 0; + margin: 0 0 0 2.4em; + border-left: 1px solid #e0e0e0; + text-shadow: 0 0 0 transparent; + box-shadow: 0 0 0 transparent; + border-radius: 0; +} +.vakata-context .vakata-contextmenu-disabled a, +.vakata-context .vakata-contextmenu-disabled a:hover { + color: silver; + background-color: transparent; + border: 0; + box-shadow: 0 0 0; +} +.vakata-context li > a > i { + text-decoration: none; + display: inline-block; + width: 2.4em; + height: 2.4em; + background: transparent; + margin: 0 0 0 -2em; + vertical-align: top; + text-align: center; + line-height: 2.4em; +} +.vakata-context li > a > i:empty { + width: 2.4em; + line-height: 2.4em; +} +.vakata-context li > a .vakata-contextmenu-sep { + display: inline-block; + width: 1px; + height: 2.4em; + background: white; + margin: 0 0.5em 0 0; + border-left: 1px solid #e2e3e3; +} +.vakata-context .vakata-contextmenu-shortcut { + font-size: 0.8em; + color: silver; + opacity: 0.5; + display: none; +} +.vakata-context-rtl ul { + left: auto; + right: 100%; + margin-left: auto; + margin-right: -4px; +} +.vakata-context-rtl li > a.vakata-context-parent { + background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); + background-position: left center; + background-repeat: no-repeat; +} +.vakata-context-rtl .vakata-context-separator > a { + margin: 0 2.4em 0 0; + border-left: 0; + border-right: 1px solid #e2e3e3; +} +.vakata-context-rtl .vakata-context-left ul { + right: auto; + left: 100%; + margin-left: -4px; + margin-right: auto; +} +.vakata-context-rtl li > a > i { + margin: 0 -2em 0 0; +} +.vakata-context-rtl li > a .vakata-contextmenu-sep { + margin: 0 0 0 0.5em; + border-left-color: white; + background: #e2e3e3; +} +#jstree-marker { + position: absolute; + top: 0; + left: 0; + margin: -5px 0 0 0; + padding: 0; + border-right: 0; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid; + width: 0; + height: 0; + font-size: 0; + line-height: 0; +} +#jstree-dnd { + line-height: 16px; + margin: 0; + padding: 4px; +} +#jstree-dnd .jstree-icon, +#jstree-dnd .jstree-copy { + display: inline-block; + text-decoration: none; + margin: 0 2px 0 0; + padding: 0; + width: 16px; + height: 16px; +} +#jstree-dnd .jstree-ok { + background: green; +} +#jstree-dnd .jstree-er { + background: red; +} +#jstree-dnd .jstree-copy { + margin: 0 2px 0 2px; +} +.jstree-default-dark .jstree-node, +.jstree-default-dark .jstree-icon { + background-repeat: no-repeat; + background-color: transparent; +} +.jstree-default-dark .jstree-anchor, +.jstree-default-dark .jstree-wholerow { + transition: background-color 0.15s, box-shadow 0.15s; +} +.jstree-default-dark .jstree-hovered { + background: #555555; + border-radius: 2px; + box-shadow: inset 0 0 1px #555555; +} +.jstree-default-dark .jstree-clicked { + background: #5fa2db; + border-radius: 2px; + box-shadow: inset 0 0 1px #666666; +} +.jstree-default-dark .jstree-no-icons .jstree-anchor > .jstree-themeicon { + display: none; +} +.jstree-default-dark .jstree-disabled { + background: transparent; + color: #666666; +} +.jstree-default-dark .jstree-disabled.jstree-hovered { + background: transparent; + box-shadow: none; +} +.jstree-default-dark .jstree-disabled.jstree-clicked { + background: #333333; +} +.jstree-default-dark .jstree-disabled > .jstree-icon { + opacity: 0.8; + filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); + /* Firefox 10+ */ + filter: gray; + /* IE6-9 */ + -webkit-filter: grayscale(100%); + /* Chrome 19+ & Safari 6+ */ +} +.jstree-default-dark .jstree-search { + font-style: italic; + color: #ffffff; + font-weight: bold; +} +.jstree-default-dark .jstree-no-checkboxes .jstree-checkbox { + display: none !important; +} +.jstree-default-dark.jstree-checkbox-no-clicked .jstree-clicked { + background: transparent; + box-shadow: none; +} +.jstree-default-dark.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered { + background: #555555; +} +.jstree-default-dark.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked { + background: transparent; +} +.jstree-default-dark.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered { + background: #555555; +} +.jstree-default-dark > .jstree-striped { + min-width: 100%; + display: inline-block; + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==") left top repeat; +} +.jstree-default-dark > .jstree-wholerow-ul .jstree-hovered, +.jstree-default-dark > .jstree-wholerow-ul .jstree-clicked { + background: transparent; + box-shadow: none; + border-radius: 0; +} +.jstree-default-dark .jstree-wholerow { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.jstree-default-dark .jstree-wholerow-hovered { + background: #555555; +} +.jstree-default-dark .jstree-wholerow-clicked { + background: #5fa2db; + background: -webkit-linear-gradient(top, #5fa2db 0%, #5fa2db 100%); + background: linear-gradient(to bottom, #5fa2db 0%, #5fa2db 100%); +} +.jstree-default-dark .jstree-node { + min-height: 24px; + line-height: 24px; + margin-left: 24px; + min-width: 24px; +} +.jstree-default-dark .jstree-anchor { + line-height: 24px; + height: 24px; +} +.jstree-default-dark .jstree-icon { + width: 24px; + height: 24px; + line-height: 24px; +} +.jstree-default-dark .jstree-icon:empty { + width: 24px; + height: 24px; + line-height: 24px; +} +.jstree-default-dark.jstree-rtl .jstree-node { + margin-right: 24px; +} +.jstree-default-dark .jstree-wholerow { + height: 24px; +} +.jstree-default-dark .jstree-node, +.jstree-default-dark .jstree-icon { + background-image: url("32px.png"); +} +.jstree-default-dark .jstree-node { + background-position: -292px -4px; + background-repeat: repeat-y; +} +.jstree-default-dark .jstree-last { + background: transparent; +} +.jstree-default-dark .jstree-open > .jstree-ocl { + background-position: -132px -4px; +} +.jstree-default-dark .jstree-closed > .jstree-ocl { + background-position: -100px -4px; +} +.jstree-default-dark .jstree-leaf > .jstree-ocl { + background-position: -68px -4px; +} +.jstree-default-dark .jstree-themeicon { + background-position: -260px -4px; +} +.jstree-default-dark > .jstree-no-dots .jstree-node, +.jstree-default-dark > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default-dark > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -36px -4px; +} +.jstree-default-dark > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -4px -4px; +} +.jstree-default-dark .jstree-disabled { + background: transparent; +} +.jstree-default-dark .jstree-disabled.jstree-hovered { + background: transparent; +} +.jstree-default-dark .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-default-dark .jstree-checkbox { + background-position: -164px -4px; +} +.jstree-default-dark .jstree-checkbox:hover { + background-position: -164px -36px; +} +.jstree-default-dark.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, +.jstree-default-dark .jstree-checked > .jstree-checkbox { + background-position: -228px -4px; +} +.jstree-default-dark.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, +.jstree-default-dark .jstree-checked > .jstree-checkbox:hover { + background-position: -228px -36px; +} +.jstree-default-dark .jstree-anchor > .jstree-undetermined { + background-position: -196px -4px; +} +.jstree-default-dark .jstree-anchor > .jstree-undetermined:hover { + background-position: -196px -36px; +} +.jstree-default-dark > .jstree-striped { + background-size: auto 48px; +} +.jstree-default-dark.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); + background-position: 100% 1px; + background-repeat: repeat-y; +} +.jstree-default-dark.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-dark.jstree-rtl .jstree-open > .jstree-ocl { + background-position: -132px -36px; +} +.jstree-default-dark.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -100px -36px; +} +.jstree-default-dark.jstree-rtl .jstree-leaf > .jstree-ocl { + background-position: -68px -36px; +} +.jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-node, +.jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -36px -36px; +} +.jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -4px -36px; +} +.jstree-default-dark .jstree-themeicon-custom { + background-color: transparent; + background-image: none; + background-position: 0 0; +} +.jstree-default-dark > .jstree-container-ul .jstree-loading > .jstree-ocl { + background: url("throbber.gif") center center no-repeat; +} +.jstree-default-dark .jstree-file { + background: url("32px.png") -100px -68px no-repeat; +} +.jstree-default-dark .jstree-folder { + background: url("32px.png") -260px -4px no-repeat; +} +.jstree-default-dark > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; +} +#jstree-dnd.jstree-default-dark { + line-height: 24px; + padding: 0 4px; +} +#jstree-dnd.jstree-default-dark .jstree-ok, +#jstree-dnd.jstree-default-dark .jstree-er { + background-image: url("32px.png"); + background-repeat: no-repeat; + background-color: transparent; +} +#jstree-dnd.jstree-default-dark i { + background: transparent; + width: 24px; + height: 24px; + line-height: 24px; +} +#jstree-dnd.jstree-default-dark .jstree-ok { + background-position: -4px -68px; +} +#jstree-dnd.jstree-default-dark .jstree-er { + background-position: -36px -68px; +} +.jstree-default-dark.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); +} +.jstree-default-dark.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-dark-small .jstree-node { + min-height: 18px; + line-height: 18px; + margin-left: 18px; + min-width: 18px; +} +.jstree-default-dark-small .jstree-anchor { + line-height: 18px; + height: 18px; +} +.jstree-default-dark-small .jstree-icon { + width: 18px; + height: 18px; + line-height: 18px; +} +.jstree-default-dark-small .jstree-icon:empty { + width: 18px; + height: 18px; + line-height: 18px; +} +.jstree-default-dark-small.jstree-rtl .jstree-node { + margin-right: 18px; +} +.jstree-default-dark-small .jstree-wholerow { + height: 18px; +} +.jstree-default-dark-small .jstree-node, +.jstree-default-dark-small .jstree-icon { + background-image: url("32px.png"); +} +.jstree-default-dark-small .jstree-node { + background-position: -295px -7px; + background-repeat: repeat-y; +} +.jstree-default-dark-small .jstree-last { + background: transparent; +} +.jstree-default-dark-small .jstree-open > .jstree-ocl { + background-position: -135px -7px; +} +.jstree-default-dark-small .jstree-closed > .jstree-ocl { + background-position: -103px -7px; +} +.jstree-default-dark-small .jstree-leaf > .jstree-ocl { + background-position: -71px -7px; +} +.jstree-default-dark-small .jstree-themeicon { + background-position: -263px -7px; +} +.jstree-default-dark-small > .jstree-no-dots .jstree-node, +.jstree-default-dark-small > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default-dark-small > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -39px -7px; +} +.jstree-default-dark-small > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -7px -7px; +} +.jstree-default-dark-small .jstree-disabled { + background: transparent; +} +.jstree-default-dark-small .jstree-disabled.jstree-hovered { + background: transparent; +} +.jstree-default-dark-small .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-default-dark-small .jstree-checkbox { + background-position: -167px -7px; +} +.jstree-default-dark-small .jstree-checkbox:hover { + background-position: -167px -39px; +} +.jstree-default-dark-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, +.jstree-default-dark-small .jstree-checked > .jstree-checkbox { + background-position: -231px -7px; +} +.jstree-default-dark-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, +.jstree-default-dark-small .jstree-checked > .jstree-checkbox:hover { + background-position: -231px -39px; +} +.jstree-default-dark-small .jstree-anchor > .jstree-undetermined { + background-position: -199px -7px; +} +.jstree-default-dark-small .jstree-anchor > .jstree-undetermined:hover { + background-position: -199px -39px; +} +.jstree-default-dark-small > .jstree-striped { + background-size: auto 36px; +} +.jstree-default-dark-small.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); + background-position: 100% 1px; + background-repeat: repeat-y; +} +.jstree-default-dark-small.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-dark-small.jstree-rtl .jstree-open > .jstree-ocl { + background-position: -135px -39px; +} +.jstree-default-dark-small.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -103px -39px; +} +.jstree-default-dark-small.jstree-rtl .jstree-leaf > .jstree-ocl { + background-position: -71px -39px; +} +.jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-node, +.jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -39px -39px; +} +.jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -7px -39px; +} +.jstree-default-dark-small .jstree-themeicon-custom { + background-color: transparent; + background-image: none; + background-position: 0 0; +} +.jstree-default-dark-small > .jstree-container-ul .jstree-loading > .jstree-ocl { + background: url("throbber.gif") center center no-repeat; +} +.jstree-default-dark-small .jstree-file { + background: url("32px.png") -103px -71px no-repeat; +} +.jstree-default-dark-small .jstree-folder { + background: url("32px.png") -263px -7px no-repeat; +} +.jstree-default-dark-small > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; +} +#jstree-dnd.jstree-default-dark-small { + line-height: 18px; + padding: 0 4px; +} +#jstree-dnd.jstree-default-dark-small .jstree-ok, +#jstree-dnd.jstree-default-dark-small .jstree-er { + background-image: url("32px.png"); + background-repeat: no-repeat; + background-color: transparent; +} +#jstree-dnd.jstree-default-dark-small i { + background: transparent; + width: 18px; + height: 18px; + line-height: 18px; +} +#jstree-dnd.jstree-default-dark-small .jstree-ok { + background-position: -7px -71px; +} +#jstree-dnd.jstree-default-dark-small .jstree-er { + background-position: -39px -71px; +} +.jstree-default-dark-small.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg=="); +} +.jstree-default-dark-small.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-dark-large .jstree-node { + min-height: 32px; + line-height: 32px; + margin-left: 32px; + min-width: 32px; +} +.jstree-default-dark-large .jstree-anchor { + line-height: 32px; + height: 32px; +} +.jstree-default-dark-large .jstree-icon { + width: 32px; + height: 32px; + line-height: 32px; +} +.jstree-default-dark-large .jstree-icon:empty { + width: 32px; + height: 32px; + line-height: 32px; +} +.jstree-default-dark-large.jstree-rtl .jstree-node { + margin-right: 32px; +} +.jstree-default-dark-large .jstree-wholerow { + height: 32px; +} +.jstree-default-dark-large .jstree-node, +.jstree-default-dark-large .jstree-icon { + background-image: url("32px.png"); +} +.jstree-default-dark-large .jstree-node { + background-position: -288px 0px; + background-repeat: repeat-y; +} +.jstree-default-dark-large .jstree-last { + background: transparent; +} +.jstree-default-dark-large .jstree-open > .jstree-ocl { + background-position: -128px 0px; +} +.jstree-default-dark-large .jstree-closed > .jstree-ocl { + background-position: -96px 0px; +} +.jstree-default-dark-large .jstree-leaf > .jstree-ocl { + background-position: -64px 0px; +} +.jstree-default-dark-large .jstree-themeicon { + background-position: -256px 0px; +} +.jstree-default-dark-large > .jstree-no-dots .jstree-node, +.jstree-default-dark-large > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default-dark-large > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -32px 0px; +} +.jstree-default-dark-large > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: 0px 0px; +} +.jstree-default-dark-large .jstree-disabled { + background: transparent; +} +.jstree-default-dark-large .jstree-disabled.jstree-hovered { + background: transparent; +} +.jstree-default-dark-large .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-default-dark-large .jstree-checkbox { + background-position: -160px 0px; +} +.jstree-default-dark-large .jstree-checkbox:hover { + background-position: -160px -32px; +} +.jstree-default-dark-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, +.jstree-default-dark-large .jstree-checked > .jstree-checkbox { + background-position: -224px 0px; +} +.jstree-default-dark-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, +.jstree-default-dark-large .jstree-checked > .jstree-checkbox:hover { + background-position: -224px -32px; +} +.jstree-default-dark-large .jstree-anchor > .jstree-undetermined { + background-position: -192px 0px; +} +.jstree-default-dark-large .jstree-anchor > .jstree-undetermined:hover { + background-position: -192px -32px; +} +.jstree-default-dark-large > .jstree-striped { + background-size: auto 64px; +} +.jstree-default-dark-large.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); + background-position: 100% 1px; + background-repeat: repeat-y; +} +.jstree-default-dark-large.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-dark-large.jstree-rtl .jstree-open > .jstree-ocl { + background-position: -128px -32px; +} +.jstree-default-dark-large.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -96px -32px; +} +.jstree-default-dark-large.jstree-rtl .jstree-leaf > .jstree-ocl { + background-position: -64px -32px; +} +.jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-node, +.jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -32px -32px; +} +.jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: 0px -32px; +} +.jstree-default-dark-large .jstree-themeicon-custom { + background-color: transparent; + background-image: none; + background-position: 0 0; +} +.jstree-default-dark-large > .jstree-container-ul .jstree-loading > .jstree-ocl { + background: url("throbber.gif") center center no-repeat; +} +.jstree-default-dark-large .jstree-file { + background: url("32px.png") -96px -64px no-repeat; +} +.jstree-default-dark-large .jstree-folder { + background: url("32px.png") -256px 0px no-repeat; +} +.jstree-default-dark-large > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; +} +#jstree-dnd.jstree-default-dark-large { + line-height: 32px; + padding: 0 4px; +} +#jstree-dnd.jstree-default-dark-large .jstree-ok, +#jstree-dnd.jstree-default-dark-large .jstree-er { + background-image: url("32px.png"); + background-repeat: no-repeat; + background-color: transparent; +} +#jstree-dnd.jstree-default-dark-large i { + background: transparent; + width: 32px; + height: 32px; + line-height: 32px; +} +#jstree-dnd.jstree-default-dark-large .jstree-ok { + background-position: 0px -64px; +} +#jstree-dnd.jstree-default-dark-large .jstree-er { + background-position: -32px -64px; +} +.jstree-default-dark-large.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg=="); +} +.jstree-default-dark-large.jstree-rtl .jstree-last { + background: transparent; +} +@media (max-width: 768px) { + #jstree-dnd.jstree-dnd-responsive { + line-height: 40px; + font-weight: bold; + font-size: 1.1em; + text-shadow: 1px 1px white; + } + #jstree-dnd.jstree-dnd-responsive > i { + background: transparent; + width: 40px; + height: 40px; + } + #jstree-dnd.jstree-dnd-responsive > .jstree-ok { + background-image: url("40px.png"); + background-position: 0 -200px; + background-size: 120px 240px; + } + #jstree-dnd.jstree-dnd-responsive > .jstree-er { + background-image: url("40px.png"); + background-position: -40px -200px; + background-size: 120px 240px; + } + #jstree-marker.jstree-dnd-responsive { + border-left-width: 10px; + border-top-width: 10px; + border-bottom-width: 10px; + margin-top: -10px; + } +} +@media (max-width: 768px) { + .jstree-default-dark-responsive { + /* + .jstree-open > .jstree-ocl, + .jstree-closed > .jstree-ocl { border-radius:20px; background-color:white; } + */ + } + .jstree-default-dark-responsive .jstree-icon { + background-image: url("40px.png"); + } + .jstree-default-dark-responsive .jstree-node, + .jstree-default-dark-responsive .jstree-leaf > .jstree-ocl { + background: transparent; + } + .jstree-default-dark-responsive .jstree-node { + min-height: 40px; + line-height: 40px; + margin-left: 40px; + min-width: 40px; + white-space: nowrap; + } + .jstree-default-dark-responsive .jstree-anchor { + line-height: 40px; + height: 40px; + } + .jstree-default-dark-responsive .jstree-icon, + .jstree-default-dark-responsive .jstree-icon:empty { + width: 40px; + height: 40px; + line-height: 40px; + } + .jstree-default-dark-responsive > .jstree-container-ul > .jstree-node { + margin-left: 0; + } + .jstree-default-dark-responsive.jstree-rtl .jstree-node { + margin-left: 0; + margin-right: 40px; + } + .jstree-default-dark-responsive.jstree-rtl .jstree-container-ul > .jstree-node { + margin-right: 0; + } + .jstree-default-dark-responsive .jstree-ocl, + .jstree-default-dark-responsive .jstree-themeicon, + .jstree-default-dark-responsive .jstree-checkbox { + background-size: 120px 240px; + } + .jstree-default-dark-responsive .jstree-leaf > .jstree-ocl { + background: transparent; + } + .jstree-default-dark-responsive .jstree-open > .jstree-ocl { + background-position: 0 0px !important; + } + .jstree-default-dark-responsive .jstree-closed > .jstree-ocl { + background-position: 0 -40px !important; + } + .jstree-default-dark-responsive.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -40px 0px !important; + } + .jstree-default-dark-responsive .jstree-themeicon { + background-position: -40px -40px; + } + .jstree-default-dark-responsive .jstree-checkbox, + .jstree-default-dark-responsive .jstree-checkbox:hover { + background-position: -40px -80px; + } + .jstree-default-dark-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, + .jstree-default-dark-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, + .jstree-default-dark-responsive .jstree-checked > .jstree-checkbox, + .jstree-default-dark-responsive .jstree-checked > .jstree-checkbox:hover { + background-position: 0 -80px; + } + .jstree-default-dark-responsive .jstree-anchor > .jstree-undetermined, + .jstree-default-dark-responsive .jstree-anchor > .jstree-undetermined:hover { + background-position: 0 -120px; + } + .jstree-default-dark-responsive .jstree-anchor { + font-weight: bold; + font-size: 1.1em; + text-shadow: 1px 1px white; + } + .jstree-default-dark-responsive > .jstree-striped { + background: transparent; + } + .jstree-default-dark-responsive .jstree-wholerow { + border-top: 1px solid #666666; + border-bottom: 1px solid #000000; + background: #333333; + height: 40px; + } + .jstree-default-dark-responsive .jstree-wholerow-hovered { + background: #555555; + } + .jstree-default-dark-responsive .jstree-wholerow-clicked { + background: #5fa2db; + } + .jstree-default-dark-responsive .jstree-children .jstree-last > .jstree-wholerow { + box-shadow: inset 0 -6px 3px -5px #111111; + } + .jstree-default-dark-responsive .jstree-children .jstree-open > .jstree-wholerow { + box-shadow: inset 0 6px 3px -5px #111111; + border-top: 0; + } + .jstree-default-dark-responsive .jstree-children .jstree-open + .jstree-open { + box-shadow: none; + } + .jstree-default-dark-responsive .jstree-node, + .jstree-default-dark-responsive .jstree-icon, + .jstree-default-dark-responsive .jstree-node > .jstree-ocl, + .jstree-default-dark-responsive .jstree-themeicon, + .jstree-default-dark-responsive .jstree-checkbox { + background-image: url("40px.png"); + background-size: 120px 240px; + } + .jstree-default-dark-responsive .jstree-node { + background-position: -80px 0; + background-repeat: repeat-y; + } + .jstree-default-dark-responsive .jstree-last { + background: transparent; + } + .jstree-default-dark-responsive .jstree-leaf > .jstree-ocl { + background-position: -40px -120px; + } + .jstree-default-dark-responsive .jstree-last > .jstree-ocl { + background-position: -40px -160px; + } + .jstree-default-dark-responsive .jstree-themeicon-custom { + background-color: transparent; + background-image: none; + background-position: 0 0; + } + .jstree-default-dark-responsive .jstree-file { + background: url("40px.png") 0 -160px no-repeat; + background-size: 120px 240px; + } + .jstree-default-dark-responsive .jstree-folder { + background: url("40px.png") -40px -40px no-repeat; + background-size: 120px 240px; + } + .jstree-default-dark-responsive > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; + } +} +.jstree-default-dark { + background: #333; +} +.jstree-default-dark .jstree-anchor { + color: #999; + text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5); +} +.jstree-default-dark .jstree-clicked, +.jstree-default-dark .jstree-checked { + color: white; +} +.jstree-default-dark .jstree-hovered { + color: white; +} +#jstree-marker.jstree-default-dark { + border-left-color: #999; + background: transparent; +} +.jstree-default-dark .jstree-anchor > .jstree-icon { + opacity: 0.75; +} +.jstree-default-dark .jstree-clicked > .jstree-icon, +.jstree-default-dark .jstree-hovered > .jstree-icon, +.jstree-default-dark .jstree-checked > .jstree-icon { + opacity: 1; +} +.jstree-default-dark.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); +} +.jstree-default-dark.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-dark-small.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg=="); +} +.jstree-default-dark-small.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-dark-large.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg=="); +} +.jstree-default-dark-large.jstree-rtl .jstree-last { + background: transparent; +} diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/style.min.css b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/style.min.css new file mode 100644 index 0000000..d123edd --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/style.min.css @@ -0,0 +1 @@ +.jstree-node,.jstree-children,.jstree-container-ul{display:block;margin:0;padding:0;list-style-type:none;list-style-image:none}.jstree-node{white-space:nowrap}.jstree-anchor{display:inline-block;color:#000;white-space:nowrap;padding:0 4px 0 1px;margin:0;vertical-align:top}.jstree-anchor:focus{outline:0}.jstree-anchor,.jstree-anchor:link,.jstree-anchor:visited,.jstree-anchor:hover,.jstree-anchor:active{text-decoration:none;color:inherit}.jstree-icon{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-icon:empty{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-ocl{cursor:pointer}.jstree-leaf>.jstree-ocl{cursor:default}.jstree .jstree-open>.jstree-children{display:block}.jstree .jstree-closed>.jstree-children,.jstree .jstree-leaf>.jstree-children{display:none}.jstree-anchor>.jstree-themeicon{margin-right:2px}.jstree-no-icons .jstree-themeicon,.jstree-anchor>.jstree-themeicon-hidden{display:none}.jstree-rtl .jstree-anchor{padding:0 1px 0 4px}.jstree-rtl .jstree-anchor>.jstree-themeicon{margin-left:2px;margin-right:0}.jstree-rtl .jstree-node{margin-left:0}.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-wholerow-ul{position:relative;display:inline-block;min-width:100%}.jstree-wholerow-ul .jstree-leaf>.jstree-ocl{cursor:pointer}.jstree-wholerow-ul .jstree-anchor,.jstree-wholerow-ul .jstree-icon{position:relative}.jstree-wholerow-ul .jstree-wholerow{width:100%;cursor:pointer;position:absolute;left:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vakata-context{display:none}.vakata-context,.vakata-context ul{margin:0;padding:2px;position:absolute;background:#f5f5f5;border:1px solid #979797;box-shadow:2px 2px 2px #999}.vakata-context ul{list-style:none;left:100%;margin-top:-2.7em;margin-left:-4px}.vakata-context .vakata-context-right ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context li{list-style:none;display:inline}.vakata-context li>a{display:block;padding:0 2em;text-decoration:none;width:auto;color:#000;white-space:nowrap;line-height:2.4em;text-shadow:1px 1px 0 #fff;border-radius:1px}.vakata-context li>a:hover{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==);background-position:right center;background-repeat:no-repeat}.vakata-context li>a:focus{outline:0}.vakata-context .vakata-context-hover>a{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context .vakata-context-separator>a,.vakata-context .vakata-context-separator>a:hover{background:#fff;border:0;border-top:1px solid #e2e3e3;height:1px;min-height:1px;max-height:1px;padding:0;margin:0 0 0 2.4em;border-left:1px solid #e0e0e0;text-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;border-radius:0}.vakata-context .vakata-contextmenu-disabled a,.vakata-context .vakata-contextmenu-disabled a:hover{color:silver;background-color:transparent;border:0;box-shadow:0 0 0}.vakata-context li>a>i{text-decoration:none;display:inline-block;width:2.4em;height:2.4em;background:0 0;margin:0 0 0 -2em;vertical-align:top;text-align:center;line-height:2.4em}.vakata-context li>a>i:empty{width:2.4em;line-height:2.4em}.vakata-context li>a .vakata-contextmenu-sep{display:inline-block;width:1px;height:2.4em;background:#fff;margin:0 .5em 0 0;border-left:1px solid #e2e3e3}.vakata-context .vakata-contextmenu-shortcut{font-size:.8em;color:silver;opacity:.5;display:none}.vakata-context-rtl ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context-rtl li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7);background-position:left center;background-repeat:no-repeat}.vakata-context-rtl .vakata-context-separator>a{margin:0 2.4em 0 0;border-left:0;border-right:1px solid #e2e3e3}.vakata-context-rtl .vakata-context-left ul{right:auto;left:100%;margin-left:-4px;margin-right:auto}.vakata-context-rtl li>a>i{margin:0 -2em 0 0}.vakata-context-rtl li>a .vakata-contextmenu-sep{margin:0 0 0 .5em;border-left-color:#fff;background:#e2e3e3}#jstree-marker{position:absolute;top:0;left:0;margin:-5px 0 0 0;padding:0;border-right:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid;width:0;height:0;font-size:0;line-height:0}#jstree-dnd{line-height:16px;margin:0;padding:4px}#jstree-dnd .jstree-icon,#jstree-dnd .jstree-copy{display:inline-block;text-decoration:none;margin:0 2px 0 0;padding:0;width:16px;height:16px}#jstree-dnd .jstree-ok{background:green}#jstree-dnd .jstree-er{background:red}#jstree-dnd .jstree-copy{margin:0 2px}.jstree-default-dark .jstree-node,.jstree-default-dark .jstree-icon{background-repeat:no-repeat;background-color:transparent}.jstree-default-dark .jstree-anchor,.jstree-default-dark .jstree-wholerow{transition:background-color .15s,box-shadow .15s}.jstree-default-dark .jstree-hovered{background:#555;border-radius:2px;box-shadow:inset 0 0 1px #555}.jstree-default-dark .jstree-clicked{background:#5fa2db;border-radius:2px;box-shadow:inset 0 0 1px #666}.jstree-default-dark .jstree-no-icons .jstree-anchor>.jstree-themeicon{display:none}.jstree-default-dark .jstree-disabled{background:0 0;color:#666}.jstree-default-dark .jstree-disabled.jstree-hovered{background:0 0;box-shadow:none}.jstree-default-dark .jstree-disabled.jstree-clicked{background:#333}.jstree-default-dark .jstree-disabled>.jstree-icon{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-dark .jstree-search{font-style:italic;color:#fff;font-weight:700}.jstree-default-dark .jstree-no-checkboxes .jstree-checkbox{display:none!important}.jstree-default-dark.jstree-checkbox-no-clicked .jstree-clicked{background:0 0;box-shadow:none}.jstree-default-dark.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered{background:#555}.jstree-default-dark.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked{background:0 0}.jstree-default-dark.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered{background:#555}.jstree-default-dark>.jstree-striped{min-width:100%;display:inline-block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==) left top repeat}.jstree-default-dark>.jstree-wholerow-ul .jstree-hovered,.jstree-default-dark>.jstree-wholerow-ul .jstree-clicked{background:0 0;box-shadow:none;border-radius:0}.jstree-default-dark .jstree-wholerow{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.jstree-default-dark .jstree-wholerow-hovered{background:#555}.jstree-default-dark .jstree-wholerow-clicked{background:#5fa2db;background:-webkit-linear-gradient(top,#5fa2db 0,#5fa2db 100%);background:linear-gradient(to bottom,#5fa2db 0,#5fa2db 100%)}.jstree-default-dark .jstree-node{min-height:24px;line-height:24px;margin-left:24px;min-width:24px}.jstree-default-dark .jstree-anchor{line-height:24px;height:24px}.jstree-default-dark .jstree-icon{width:24px;height:24px;line-height:24px}.jstree-default-dark .jstree-icon:empty{width:24px;height:24px;line-height:24px}.jstree-default-dark.jstree-rtl .jstree-node{margin-right:24px}.jstree-default-dark .jstree-wholerow{height:24px}.jstree-default-dark .jstree-node,.jstree-default-dark .jstree-icon{background-image:url(32px.png)}.jstree-default-dark .jstree-node{background-position:-292px -4px;background-repeat:repeat-y}.jstree-default-dark .jstree-last{background:0 0}.jstree-default-dark .jstree-open>.jstree-ocl{background-position:-132px -4px}.jstree-default-dark .jstree-closed>.jstree-ocl{background-position:-100px -4px}.jstree-default-dark .jstree-leaf>.jstree-ocl{background-position:-68px -4px}.jstree-default-dark .jstree-themeicon{background-position:-260px -4px}.jstree-default-dark>.jstree-no-dots .jstree-node,.jstree-default-dark>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -4px}.jstree-default-dark>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -4px}.jstree-default-dark .jstree-disabled{background:0 0}.jstree-default-dark .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-dark .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-dark .jstree-checkbox{background-position:-164px -4px}.jstree-default-dark .jstree-checkbox:hover{background-position:-164px -36px}.jstree-default-dark.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-dark .jstree-checked>.jstree-checkbox{background-position:-228px -4px}.jstree-default-dark.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-dark .jstree-checked>.jstree-checkbox:hover{background-position:-228px -36px}.jstree-default-dark .jstree-anchor>.jstree-undetermined{background-position:-196px -4px}.jstree-default-dark .jstree-anchor>.jstree-undetermined:hover{background-position:-196px -36px}.jstree-default-dark>.jstree-striped{background-size:auto 48px}.jstree-default-dark.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-dark.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark.jstree-rtl .jstree-open>.jstree-ocl{background-position:-132px -36px}.jstree-default-dark.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-100px -36px}.jstree-default-dark.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-68px -36px}.jstree-default-dark.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-dark.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -36px}.jstree-default-dark.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -36px}.jstree-default-dark .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-dark>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-dark .jstree-file{background:url(32px.png) -100px -68px no-repeat}.jstree-default-dark .jstree-folder{background:url(32px.png) -260px -4px no-repeat}.jstree-default-dark>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-dark{line-height:24px;padding:0 4px}#jstree-dnd.jstree-default-dark .jstree-ok,#jstree-dnd.jstree-default-dark .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-dark i{background:0 0;width:24px;height:24px;line-height:24px}#jstree-dnd.jstree-default-dark .jstree-ok{background-position:-4px -68px}#jstree-dnd.jstree-default-dark .jstree-er{background-position:-36px -68px}.jstree-default-dark.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-default-dark.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-small .jstree-node{min-height:18px;line-height:18px;margin-left:18px;min-width:18px}.jstree-default-dark-small .jstree-anchor{line-height:18px;height:18px}.jstree-default-dark-small .jstree-icon{width:18px;height:18px;line-height:18px}.jstree-default-dark-small .jstree-icon:empty{width:18px;height:18px;line-height:18px}.jstree-default-dark-small.jstree-rtl .jstree-node{margin-right:18px}.jstree-default-dark-small .jstree-wholerow{height:18px}.jstree-default-dark-small .jstree-node,.jstree-default-dark-small .jstree-icon{background-image:url(32px.png)}.jstree-default-dark-small .jstree-node{background-position:-295px -7px;background-repeat:repeat-y}.jstree-default-dark-small .jstree-last{background:0 0}.jstree-default-dark-small .jstree-open>.jstree-ocl{background-position:-135px -7px}.jstree-default-dark-small .jstree-closed>.jstree-ocl{background-position:-103px -7px}.jstree-default-dark-small .jstree-leaf>.jstree-ocl{background-position:-71px -7px}.jstree-default-dark-small .jstree-themeicon{background-position:-263px -7px}.jstree-default-dark-small>.jstree-no-dots .jstree-node,.jstree-default-dark-small>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-small>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -7px}.jstree-default-dark-small>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -7px}.jstree-default-dark-small .jstree-disabled{background:0 0}.jstree-default-dark-small .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-dark-small .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-dark-small .jstree-checkbox{background-position:-167px -7px}.jstree-default-dark-small .jstree-checkbox:hover{background-position:-167px -39px}.jstree-default-dark-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-dark-small .jstree-checked>.jstree-checkbox{background-position:-231px -7px}.jstree-default-dark-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-dark-small .jstree-checked>.jstree-checkbox:hover{background-position:-231px -39px}.jstree-default-dark-small .jstree-anchor>.jstree-undetermined{background-position:-199px -7px}.jstree-default-dark-small .jstree-anchor>.jstree-undetermined:hover{background-position:-199px -39px}.jstree-default-dark-small>.jstree-striped{background-size:auto 36px}.jstree-default-dark-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-dark-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-small.jstree-rtl .jstree-open>.jstree-ocl{background-position:-135px -39px}.jstree-default-dark-small.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-103px -39px}.jstree-default-dark-small.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-71px -39px}.jstree-default-dark-small.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-dark-small.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-small.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -39px}.jstree-default-dark-small.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -39px}.jstree-default-dark-small .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-dark-small>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-dark-small .jstree-file{background:url(32px.png) -103px -71px no-repeat}.jstree-default-dark-small .jstree-folder{background:url(32px.png) -263px -7px no-repeat}.jstree-default-dark-small>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-dark-small{line-height:18px;padding:0 4px}#jstree-dnd.jstree-default-dark-small .jstree-ok,#jstree-dnd.jstree-default-dark-small .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-dark-small i{background:0 0;width:18px;height:18px;line-height:18px}#jstree-dnd.jstree-default-dark-small .jstree-ok{background-position:-7px -71px}#jstree-dnd.jstree-default-dark-small .jstree-er{background-position:-39px -71px}.jstree-default-dark-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-default-dark-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-large .jstree-node{min-height:32px;line-height:32px;margin-left:32px;min-width:32px}.jstree-default-dark-large .jstree-anchor{line-height:32px;height:32px}.jstree-default-dark-large .jstree-icon{width:32px;height:32px;line-height:32px}.jstree-default-dark-large .jstree-icon:empty{width:32px;height:32px;line-height:32px}.jstree-default-dark-large.jstree-rtl .jstree-node{margin-right:32px}.jstree-default-dark-large .jstree-wholerow{height:32px}.jstree-default-dark-large .jstree-node,.jstree-default-dark-large .jstree-icon{background-image:url(32px.png)}.jstree-default-dark-large .jstree-node{background-position:-288px 0;background-repeat:repeat-y}.jstree-default-dark-large .jstree-last{background:0 0}.jstree-default-dark-large .jstree-open>.jstree-ocl{background-position:-128px 0}.jstree-default-dark-large .jstree-closed>.jstree-ocl{background-position:-96px 0}.jstree-default-dark-large .jstree-leaf>.jstree-ocl{background-position:-64px 0}.jstree-default-dark-large .jstree-themeicon{background-position:-256px 0}.jstree-default-dark-large>.jstree-no-dots .jstree-node,.jstree-default-dark-large>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-large>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px 0}.jstree-default-dark-large>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 0}.jstree-default-dark-large .jstree-disabled{background:0 0}.jstree-default-dark-large .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-dark-large .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-dark-large .jstree-checkbox{background-position:-160px 0}.jstree-default-dark-large .jstree-checkbox:hover{background-position:-160px -32px}.jstree-default-dark-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-dark-large .jstree-checked>.jstree-checkbox{background-position:-224px 0}.jstree-default-dark-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-dark-large .jstree-checked>.jstree-checkbox:hover{background-position:-224px -32px}.jstree-default-dark-large .jstree-anchor>.jstree-undetermined{background-position:-192px 0}.jstree-default-dark-large .jstree-anchor>.jstree-undetermined:hover{background-position:-192px -32px}.jstree-default-dark-large>.jstree-striped{background-size:auto 64px}.jstree-default-dark-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-dark-large.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-large.jstree-rtl .jstree-open>.jstree-ocl{background-position:-128px -32px}.jstree-default-dark-large.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-96px -32px}.jstree-default-dark-large.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-64px -32px}.jstree-default-dark-large.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-dark-large.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-large.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px -32px}.jstree-default-dark-large.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 -32px}.jstree-default-dark-large .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-dark-large>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-dark-large .jstree-file{background:url(32px.png) -96px -64px no-repeat}.jstree-default-dark-large .jstree-folder{background:url(32px.png) -256px 0 no-repeat}.jstree-default-dark-large>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-dark-large{line-height:32px;padding:0 4px}#jstree-dnd.jstree-default-dark-large .jstree-ok,#jstree-dnd.jstree-default-dark-large .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-dark-large i{background:0 0;width:32px;height:32px;line-height:32px}#jstree-dnd.jstree-default-dark-large .jstree-ok{background-position:0 -64px}#jstree-dnd.jstree-default-dark-large .jstree-er{background-position:-32px -64px}.jstree-default-dark-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-default-dark-large.jstree-rtl .jstree-last{background:0 0}@media (max-width:768px){#jstree-dnd.jstree-dnd-responsive{line-height:40px;font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}#jstree-dnd.jstree-dnd-responsive>i{background:0 0;width:40px;height:40px}#jstree-dnd.jstree-dnd-responsive>.jstree-ok{background-image:url(40px.png);background-position:0 -200px;background-size:120px 240px}#jstree-dnd.jstree-dnd-responsive>.jstree-er{background-image:url(40px.png);background-position:-40px -200px;background-size:120px 240px}#jstree-marker.jstree-dnd-responsive{border-left-width:10px;border-top-width:10px;border-bottom-width:10px;margin-top:-10px}}@media (max-width:768px){.jstree-default-dark-responsive .jstree-icon{background-image:url(40px.png)}.jstree-default-dark-responsive .jstree-node,.jstree-default-dark-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-responsive .jstree-node{min-height:40px;line-height:40px;margin-left:40px;min-width:40px;white-space:nowrap}.jstree-default-dark-responsive .jstree-anchor{line-height:40px;height:40px}.jstree-default-dark-responsive .jstree-icon,.jstree-default-dark-responsive .jstree-icon:empty{width:40px;height:40px;line-height:40px}.jstree-default-dark-responsive>.jstree-container-ul>.jstree-node{margin-left:0}.jstree-default-dark-responsive.jstree-rtl .jstree-node{margin-left:0;margin-right:40px}.jstree-default-dark-responsive.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-default-dark-responsive .jstree-ocl,.jstree-default-dark-responsive .jstree-themeicon,.jstree-default-dark-responsive .jstree-checkbox{background-size:120px 240px}.jstree-default-dark-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-responsive .jstree-open>.jstree-ocl{background-position:0 0!important}.jstree-default-dark-responsive .jstree-closed>.jstree-ocl{background-position:0 -40px!important}.jstree-default-dark-responsive.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-40px 0!important}.jstree-default-dark-responsive .jstree-themeicon{background-position:-40px -40px}.jstree-default-dark-responsive .jstree-checkbox,.jstree-default-dark-responsive .jstree-checkbox:hover{background-position:-40px -80px}.jstree-default-dark-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-dark-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-dark-responsive .jstree-checked>.jstree-checkbox,.jstree-default-dark-responsive .jstree-checked>.jstree-checkbox:hover{background-position:0 -80px}.jstree-default-dark-responsive .jstree-anchor>.jstree-undetermined,.jstree-default-dark-responsive .jstree-anchor>.jstree-undetermined:hover{background-position:0 -120px}.jstree-default-dark-responsive .jstree-anchor{font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}.jstree-default-dark-responsive>.jstree-striped{background:0 0}.jstree-default-dark-responsive .jstree-wholerow{border-top:1px solid #666;border-bottom:1px solid #000;background:#333;height:40px}.jstree-default-dark-responsive .jstree-wholerow-hovered{background:#555}.jstree-default-dark-responsive .jstree-wholerow-clicked{background:#5fa2db}.jstree-default-dark-responsive .jstree-children .jstree-last>.jstree-wholerow{box-shadow:inset 0 -6px 3px -5px #111}.jstree-default-dark-responsive .jstree-children .jstree-open>.jstree-wholerow{box-shadow:inset 0 6px 3px -5px #111;border-top:0}.jstree-default-dark-responsive .jstree-children .jstree-open+.jstree-open{box-shadow:none}.jstree-default-dark-responsive .jstree-node,.jstree-default-dark-responsive .jstree-icon,.jstree-default-dark-responsive .jstree-node>.jstree-ocl,.jstree-default-dark-responsive .jstree-themeicon,.jstree-default-dark-responsive .jstree-checkbox{background-image:url(40px.png);background-size:120px 240px}.jstree-default-dark-responsive .jstree-node{background-position:-80px 0;background-repeat:repeat-y}.jstree-default-dark-responsive .jstree-last{background:0 0}.jstree-default-dark-responsive .jstree-leaf>.jstree-ocl{background-position:-40px -120px}.jstree-default-dark-responsive .jstree-last>.jstree-ocl{background-position:-40px -160px}.jstree-default-dark-responsive .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-dark-responsive .jstree-file{background:url(40px.png) 0 -160px no-repeat;background-size:120px 240px}.jstree-default-dark-responsive .jstree-folder{background:url(40px.png) -40px -40px no-repeat;background-size:120px 240px}.jstree-default-dark-responsive>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}}.jstree-default-dark{background:#333}.jstree-default-dark .jstree-anchor{color:#999;text-shadow:1px 1px 0 rgba(0,0,0,.5)}.jstree-default-dark .jstree-clicked,.jstree-default-dark .jstree-checked{color:#fff}.jstree-default-dark .jstree-hovered{color:#fff}#jstree-marker.jstree-default-dark{border-left-color:#999;background:0 0}.jstree-default-dark .jstree-anchor>.jstree-icon{opacity:.75}.jstree-default-dark .jstree-clicked>.jstree-icon,.jstree-default-dark .jstree-hovered>.jstree-icon,.jstree-default-dark .jstree-checked>.jstree-icon{opacity:1}.jstree-default-dark.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-default-dark.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-default-dark-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-default-dark-large.jstree-rtl .jstree-last{background:0 0} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/throbber.gif b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/throbber.gif new file mode 100644 index 0000000..cd75035 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default-dark/throbber.gif differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/32px.png b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/32px.png new file mode 100644 index 0000000..1532715 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/32px.png differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/40px.png b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/40px.png new file mode 100644 index 0000000..1959347 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/40px.png differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/style.css b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/style.css new file mode 100644 index 0000000..b2b14fc --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/style.css @@ -0,0 +1,1031 @@ +/* jsTree default theme */ +.jstree-node, +.jstree-children, +.jstree-container-ul { + display: block; + margin: 0; + padding: 0; + list-style-type: none; + list-style-image: none; +} +.jstree-node { + white-space: nowrap; +} +.jstree-anchor { + display: inline-block; + color: black; + white-space: nowrap; + padding: 0 4px 0 1px; + margin: 0; + vertical-align: top; +} +.jstree-anchor:focus { + outline: 0; +} +.jstree-anchor, +.jstree-anchor:link, +.jstree-anchor:visited, +.jstree-anchor:hover, +.jstree-anchor:active { + text-decoration: none; + color: inherit; +} +.jstree-icon { + display: inline-block; + text-decoration: none; + margin: 0; + padding: 0; + vertical-align: top; + text-align: center; +} +.jstree-icon:empty { + display: inline-block; + text-decoration: none; + margin: 0; + padding: 0; + vertical-align: top; + text-align: center; +} +.jstree-ocl { + cursor: pointer; +} +.jstree-leaf > .jstree-ocl { + cursor: default; +} +.jstree .jstree-open > .jstree-children { + display: block; +} +.jstree .jstree-closed > .jstree-children, +.jstree .jstree-leaf > .jstree-children { + display: none; +} +.jstree-anchor > .jstree-themeicon { + margin-right: 2px; +} +.jstree-no-icons .jstree-themeicon, +.jstree-anchor > .jstree-themeicon-hidden { + display: none; +} +.jstree-rtl .jstree-anchor { + padding: 0 1px 0 4px; +} +.jstree-rtl .jstree-anchor > .jstree-themeicon { + margin-left: 2px; + margin-right: 0; +} +.jstree-rtl .jstree-node { + margin-left: 0; +} +.jstree-rtl .jstree-container-ul > .jstree-node { + margin-right: 0; +} +.jstree-wholerow-ul { + position: relative; + display: inline-block; + min-width: 100%; +} +.jstree-wholerow-ul .jstree-leaf > .jstree-ocl { + cursor: pointer; +} +.jstree-wholerow-ul .jstree-anchor, +.jstree-wholerow-ul .jstree-icon { + position: relative; +} +.jstree-wholerow-ul .jstree-wholerow { + width: 100%; + cursor: pointer; + position: absolute; + left: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.vakata-context { + display: none; +} +.vakata-context, +.vakata-context ul { + margin: 0; + padding: 2px; + position: absolute; + background: #f5f5f5; + border: 1px solid #979797; + box-shadow: 2px 2px 2px #999999; +} +.vakata-context ul { + list-style: none; + left: 100%; + margin-top: -2.7em; + margin-left: -4px; +} +.vakata-context .vakata-context-right ul { + left: auto; + right: 100%; + margin-left: auto; + margin-right: -4px; +} +.vakata-context li { + list-style: none; + display: inline; +} +.vakata-context li > a { + display: block; + padding: 0 2em 0 2em; + text-decoration: none; + width: auto; + color: black; + white-space: nowrap; + line-height: 2.4em; + text-shadow: 1px 1px 0 white; + border-radius: 1px; +} +.vakata-context li > a:hover { + position: relative; + background-color: #e8eff7; + box-shadow: 0 0 2px #0a6aa1; +} +.vakata-context li > a.vakata-context-parent { + background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); + background-position: right center; + background-repeat: no-repeat; +} +.vakata-context li > a:focus { + outline: 0; +} +.vakata-context .vakata-context-hover > a { + position: relative; + background-color: #e8eff7; + box-shadow: 0 0 2px #0a6aa1; +} +.vakata-context .vakata-context-separator > a, +.vakata-context .vakata-context-separator > a:hover { + background: white; + border: 0; + border-top: 1px solid #e2e3e3; + height: 1px; + min-height: 1px; + max-height: 1px; + padding: 0; + margin: 0 0 0 2.4em; + border-left: 1px solid #e0e0e0; + text-shadow: 0 0 0 transparent; + box-shadow: 0 0 0 transparent; + border-radius: 0; +} +.vakata-context .vakata-contextmenu-disabled a, +.vakata-context .vakata-contextmenu-disabled a:hover { + color: silver; + background-color: transparent; + border: 0; + box-shadow: 0 0 0; +} +.vakata-context li > a > i { + text-decoration: none; + display: inline-block; + width: 2.4em; + height: 2.4em; + background: transparent; + margin: 0 0 0 -2em; + vertical-align: top; + text-align: center; + line-height: 2.4em; +} +.vakata-context li > a > i:empty { + width: 2.4em; + line-height: 2.4em; +} +.vakata-context li > a .vakata-contextmenu-sep { + display: inline-block; + width: 1px; + height: 2.4em; + background: white; + margin: 0 0.5em 0 0; + border-left: 1px solid #e2e3e3; +} +.vakata-context .vakata-contextmenu-shortcut { + font-size: 0.8em; + color: silver; + opacity: 0.5; + display: none; +} +.vakata-context-rtl ul { + left: auto; + right: 100%; + margin-left: auto; + margin-right: -4px; +} +.vakata-context-rtl li > a.vakata-context-parent { + background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); + background-position: left center; + background-repeat: no-repeat; +} +.vakata-context-rtl .vakata-context-separator > a { + margin: 0 2.4em 0 0; + border-left: 0; + border-right: 1px solid #e2e3e3; +} +.vakata-context-rtl .vakata-context-left ul { + right: auto; + left: 100%; + margin-left: -4px; + margin-right: auto; +} +.vakata-context-rtl li > a > i { + margin: 0 -2em 0 0; +} +.vakata-context-rtl li > a .vakata-contextmenu-sep { + margin: 0 0 0 0.5em; + border-left-color: white; + background: #e2e3e3; +} +#jstree-marker { + position: absolute; + top: 0; + left: 0; + margin: -5px 0 0 0; + padding: 0; + border-right: 0; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid; + width: 0; + height: 0; + font-size: 0; + line-height: 0; +} +#jstree-dnd { + line-height: 16px; + margin: 0; + padding: 4px; +} +#jstree-dnd .jstree-icon, +#jstree-dnd .jstree-copy { + display: inline-block; + text-decoration: none; + margin: 0 2px 0 0; + padding: 0; + width: 16px; + height: 16px; +} +#jstree-dnd .jstree-ok { + background: green; +} +#jstree-dnd .jstree-er { + background: red; +} +#jstree-dnd .jstree-copy { + margin: 0 2px 0 2px; +} +.jstree-default .jstree-node, +.jstree-default .jstree-icon { + background-repeat: no-repeat; + background-color: transparent; +} +.jstree-default .jstree-anchor, +.jstree-default .jstree-wholerow { + transition: background-color 0.15s, box-shadow 0.15s; +} +.jstree-default .jstree-hovered { + background: #e7f4f9; + border-radius: 2px; + box-shadow: inset 0 0 1px #cccccc; +} +.jstree-default .jstree-clicked { + background: #beebff; + border-radius: 2px; + box-shadow: inset 0 0 1px #999999; +} +.jstree-default .jstree-no-icons .jstree-anchor > .jstree-themeicon { + display: none; +} +.jstree-default .jstree-disabled { + background: transparent; + color: #666666; +} +.jstree-default .jstree-disabled.jstree-hovered { + background: transparent; + box-shadow: none; +} +.jstree-default .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-default .jstree-disabled > .jstree-icon { + opacity: 0.8; + filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); + /* Firefox 10+ */ + filter: gray; + /* IE6-9 */ + -webkit-filter: grayscale(100%); + /* Chrome 19+ & Safari 6+ */ +} +.jstree-default .jstree-search { + font-style: italic; + color: #8b0000; + font-weight: bold; +} +.jstree-default .jstree-no-checkboxes .jstree-checkbox { + display: none !important; +} +.jstree-default.jstree-checkbox-no-clicked .jstree-clicked { + background: transparent; + box-shadow: none; +} +.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered { + background: #e7f4f9; +} +.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked { + background: transparent; +} +.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered { + background: #e7f4f9; +} +.jstree-default > .jstree-striped { + min-width: 100%; + display: inline-block; + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==") left top repeat; +} +.jstree-default > .jstree-wholerow-ul .jstree-hovered, +.jstree-default > .jstree-wholerow-ul .jstree-clicked { + background: transparent; + box-shadow: none; + border-radius: 0; +} +.jstree-default .jstree-wholerow { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.jstree-default .jstree-wholerow-hovered { + background: #e7f4f9; +} +.jstree-default .jstree-wholerow-clicked { + background: #beebff; + background: -webkit-linear-gradient(top, #beebff 0%, #a8e4ff 100%); + background: linear-gradient(to bottom, #beebff 0%, #a8e4ff 100%); +} +.jstree-default .jstree-node { + min-height: 24px; + line-height: 24px; + margin-left: 24px; + min-width: 24px; +} +.jstree-default .jstree-anchor { + line-height: 24px; + height: 24px; +} +.jstree-default .jstree-icon { + width: 24px; + height: 24px; + line-height: 24px; +} +.jstree-default .jstree-icon:empty { + width: 24px; + height: 24px; + line-height: 24px; +} +.jstree-default.jstree-rtl .jstree-node { + margin-right: 24px; +} +.jstree-default .jstree-wholerow { + height: 24px; +} +.jstree-default .jstree-node, +.jstree-default .jstree-icon { + background-image: url("32px.png"); +} +.jstree-default .jstree-node { + background-position: -292px -4px; + background-repeat: repeat-y; +} +.jstree-default .jstree-last { + background: transparent; +} +.jstree-default .jstree-open > .jstree-ocl { + background-position: -132px -4px; +} +.jstree-default .jstree-closed > .jstree-ocl { + background-position: -100px -4px; +} +.jstree-default .jstree-leaf > .jstree-ocl { + background-position: -68px -4px; +} +.jstree-default .jstree-themeicon { + background-position: -260px -4px; +} +.jstree-default > .jstree-no-dots .jstree-node, +.jstree-default > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -36px -4px; +} +.jstree-default > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -4px -4px; +} +.jstree-default .jstree-disabled { + background: transparent; +} +.jstree-default .jstree-disabled.jstree-hovered { + background: transparent; +} +.jstree-default .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-default .jstree-checkbox { + background-position: -164px -4px; +} +.jstree-default .jstree-checkbox:hover { + background-position: -164px -36px; +} +.jstree-default.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, +.jstree-default .jstree-checked > .jstree-checkbox { + background-position: -228px -4px; +} +.jstree-default.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, +.jstree-default .jstree-checked > .jstree-checkbox:hover { + background-position: -228px -36px; +} +.jstree-default .jstree-anchor > .jstree-undetermined { + background-position: -196px -4px; +} +.jstree-default .jstree-anchor > .jstree-undetermined:hover { + background-position: -196px -36px; +} +.jstree-default > .jstree-striped { + background-size: auto 48px; +} +.jstree-default.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); + background-position: 100% 1px; + background-repeat: repeat-y; +} +.jstree-default.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default.jstree-rtl .jstree-open > .jstree-ocl { + background-position: -132px -36px; +} +.jstree-default.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -100px -36px; +} +.jstree-default.jstree-rtl .jstree-leaf > .jstree-ocl { + background-position: -68px -36px; +} +.jstree-default.jstree-rtl > .jstree-no-dots .jstree-node, +.jstree-default.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -36px -36px; +} +.jstree-default.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -4px -36px; +} +.jstree-default .jstree-themeicon-custom { + background-color: transparent; + background-image: none; + background-position: 0 0; +} +.jstree-default > .jstree-container-ul .jstree-loading > .jstree-ocl { + background: url("throbber.gif") center center no-repeat; +} +.jstree-default .jstree-file { + background: url("32px.png") -100px -68px no-repeat; +} +.jstree-default .jstree-folder { + background: url("32px.png") -260px -4px no-repeat; +} +.jstree-default > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; +} +#jstree-dnd.jstree-default { + line-height: 24px; + padding: 0 4px; +} +#jstree-dnd.jstree-default .jstree-ok, +#jstree-dnd.jstree-default .jstree-er { + background-image: url("32px.png"); + background-repeat: no-repeat; + background-color: transparent; +} +#jstree-dnd.jstree-default i { + background: transparent; + width: 24px; + height: 24px; + line-height: 24px; +} +#jstree-dnd.jstree-default .jstree-ok { + background-position: -4px -68px; +} +#jstree-dnd.jstree-default .jstree-er { + background-position: -36px -68px; +} +.jstree-default.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); +} +.jstree-default.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-small .jstree-node { + min-height: 18px; + line-height: 18px; + margin-left: 18px; + min-width: 18px; +} +.jstree-default-small .jstree-anchor { + line-height: 18px; + height: 18px; +} +.jstree-default-small .jstree-icon { + width: 18px; + height: 18px; + line-height: 18px; +} +.jstree-default-small .jstree-icon:empty { + width: 18px; + height: 18px; + line-height: 18px; +} +.jstree-default-small.jstree-rtl .jstree-node { + margin-right: 18px; +} +.jstree-default-small .jstree-wholerow { + height: 18px; +} +.jstree-default-small .jstree-node, +.jstree-default-small .jstree-icon { + background-image: url("32px.png"); +} +.jstree-default-small .jstree-node { + background-position: -295px -7px; + background-repeat: repeat-y; +} +.jstree-default-small .jstree-last { + background: transparent; +} +.jstree-default-small .jstree-open > .jstree-ocl { + background-position: -135px -7px; +} +.jstree-default-small .jstree-closed > .jstree-ocl { + background-position: -103px -7px; +} +.jstree-default-small .jstree-leaf > .jstree-ocl { + background-position: -71px -7px; +} +.jstree-default-small .jstree-themeicon { + background-position: -263px -7px; +} +.jstree-default-small > .jstree-no-dots .jstree-node, +.jstree-default-small > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default-small > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -39px -7px; +} +.jstree-default-small > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -7px -7px; +} +.jstree-default-small .jstree-disabled { + background: transparent; +} +.jstree-default-small .jstree-disabled.jstree-hovered { + background: transparent; +} +.jstree-default-small .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-default-small .jstree-checkbox { + background-position: -167px -7px; +} +.jstree-default-small .jstree-checkbox:hover { + background-position: -167px -39px; +} +.jstree-default-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, +.jstree-default-small .jstree-checked > .jstree-checkbox { + background-position: -231px -7px; +} +.jstree-default-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, +.jstree-default-small .jstree-checked > .jstree-checkbox:hover { + background-position: -231px -39px; +} +.jstree-default-small .jstree-anchor > .jstree-undetermined { + background-position: -199px -7px; +} +.jstree-default-small .jstree-anchor > .jstree-undetermined:hover { + background-position: -199px -39px; +} +.jstree-default-small > .jstree-striped { + background-size: auto 36px; +} +.jstree-default-small.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); + background-position: 100% 1px; + background-repeat: repeat-y; +} +.jstree-default-small.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-small.jstree-rtl .jstree-open > .jstree-ocl { + background-position: -135px -39px; +} +.jstree-default-small.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -103px -39px; +} +.jstree-default-small.jstree-rtl .jstree-leaf > .jstree-ocl { + background-position: -71px -39px; +} +.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-node, +.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -39px -39px; +} +.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -7px -39px; +} +.jstree-default-small .jstree-themeicon-custom { + background-color: transparent; + background-image: none; + background-position: 0 0; +} +.jstree-default-small > .jstree-container-ul .jstree-loading > .jstree-ocl { + background: url("throbber.gif") center center no-repeat; +} +.jstree-default-small .jstree-file { + background: url("32px.png") -103px -71px no-repeat; +} +.jstree-default-small .jstree-folder { + background: url("32px.png") -263px -7px no-repeat; +} +.jstree-default-small > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; +} +#jstree-dnd.jstree-default-small { + line-height: 18px; + padding: 0 4px; +} +#jstree-dnd.jstree-default-small .jstree-ok, +#jstree-dnd.jstree-default-small .jstree-er { + background-image: url("32px.png"); + background-repeat: no-repeat; + background-color: transparent; +} +#jstree-dnd.jstree-default-small i { + background: transparent; + width: 18px; + height: 18px; + line-height: 18px; +} +#jstree-dnd.jstree-default-small .jstree-ok { + background-position: -7px -71px; +} +#jstree-dnd.jstree-default-small .jstree-er { + background-position: -39px -71px; +} +.jstree-default-small.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg=="); +} +.jstree-default-small.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-large .jstree-node { + min-height: 32px; + line-height: 32px; + margin-left: 32px; + min-width: 32px; +} +.jstree-default-large .jstree-anchor { + line-height: 32px; + height: 32px; +} +.jstree-default-large .jstree-icon { + width: 32px; + height: 32px; + line-height: 32px; +} +.jstree-default-large .jstree-icon:empty { + width: 32px; + height: 32px; + line-height: 32px; +} +.jstree-default-large.jstree-rtl .jstree-node { + margin-right: 32px; +} +.jstree-default-large .jstree-wholerow { + height: 32px; +} +.jstree-default-large .jstree-node, +.jstree-default-large .jstree-icon { + background-image: url("32px.png"); +} +.jstree-default-large .jstree-node { + background-position: -288px 0px; + background-repeat: repeat-y; +} +.jstree-default-large .jstree-last { + background: transparent; +} +.jstree-default-large .jstree-open > .jstree-ocl { + background-position: -128px 0px; +} +.jstree-default-large .jstree-closed > .jstree-ocl { + background-position: -96px 0px; +} +.jstree-default-large .jstree-leaf > .jstree-ocl { + background-position: -64px 0px; +} +.jstree-default-large .jstree-themeicon { + background-position: -256px 0px; +} +.jstree-default-large > .jstree-no-dots .jstree-node, +.jstree-default-large > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default-large > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -32px 0px; +} +.jstree-default-large > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: 0px 0px; +} +.jstree-default-large .jstree-disabled { + background: transparent; +} +.jstree-default-large .jstree-disabled.jstree-hovered { + background: transparent; +} +.jstree-default-large .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-default-large .jstree-checkbox { + background-position: -160px 0px; +} +.jstree-default-large .jstree-checkbox:hover { + background-position: -160px -32px; +} +.jstree-default-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, +.jstree-default-large .jstree-checked > .jstree-checkbox { + background-position: -224px 0px; +} +.jstree-default-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, +.jstree-default-large .jstree-checked > .jstree-checkbox:hover { + background-position: -224px -32px; +} +.jstree-default-large .jstree-anchor > .jstree-undetermined { + background-position: -192px 0px; +} +.jstree-default-large .jstree-anchor > .jstree-undetermined:hover { + background-position: -192px -32px; +} +.jstree-default-large > .jstree-striped { + background-size: auto 64px; +} +.jstree-default-large.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); + background-position: 100% 1px; + background-repeat: repeat-y; +} +.jstree-default-large.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-default-large.jstree-rtl .jstree-open > .jstree-ocl { + background-position: -128px -32px; +} +.jstree-default-large.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -96px -32px; +} +.jstree-default-large.jstree-rtl .jstree-leaf > .jstree-ocl { + background-position: -64px -32px; +} +.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-node, +.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -32px -32px; +} +.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: 0px -32px; +} +.jstree-default-large .jstree-themeicon-custom { + background-color: transparent; + background-image: none; + background-position: 0 0; +} +.jstree-default-large > .jstree-container-ul .jstree-loading > .jstree-ocl { + background: url("throbber.gif") center center no-repeat; +} +.jstree-default-large .jstree-file { + background: url("32px.png") -96px -64px no-repeat; +} +.jstree-default-large .jstree-folder { + background: url("32px.png") -256px 0px no-repeat; +} +.jstree-default-large > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; +} +#jstree-dnd.jstree-default-large { + line-height: 32px; + padding: 0 4px; +} +#jstree-dnd.jstree-default-large .jstree-ok, +#jstree-dnd.jstree-default-large .jstree-er { + background-image: url("32px.png"); + background-repeat: no-repeat; + background-color: transparent; +} +#jstree-dnd.jstree-default-large i { + background: transparent; + width: 32px; + height: 32px; + line-height: 32px; +} +#jstree-dnd.jstree-default-large .jstree-ok { + background-position: 0px -64px; +} +#jstree-dnd.jstree-default-large .jstree-er { + background-position: -32px -64px; +} +.jstree-default-large.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg=="); +} +.jstree-default-large.jstree-rtl .jstree-last { + background: transparent; +} +@media (max-width: 768px) { + #jstree-dnd.jstree-dnd-responsive { + line-height: 40px; + font-weight: bold; + font-size: 1.1em; + text-shadow: 1px 1px white; + } + #jstree-dnd.jstree-dnd-responsive > i { + background: transparent; + width: 40px; + height: 40px; + } + #jstree-dnd.jstree-dnd-responsive > .jstree-ok { + background-image: url("40px.png"); + background-position: 0 -200px; + background-size: 120px 240px; + } + #jstree-dnd.jstree-dnd-responsive > .jstree-er { + background-image: url("40px.png"); + background-position: -40px -200px; + background-size: 120px 240px; + } + #jstree-marker.jstree-dnd-responsive { + border-left-width: 10px; + border-top-width: 10px; + border-bottom-width: 10px; + margin-top: -10px; + } +} +@media (max-width: 768px) { + .jstree-default-responsive { + /* + .jstree-open > .jstree-ocl, + .jstree-closed > .jstree-ocl { border-radius:20px; background-color:white; } + */ + } + .jstree-default-responsive .jstree-icon { + background-image: url("40px.png"); + } + .jstree-default-responsive .jstree-node, + .jstree-default-responsive .jstree-leaf > .jstree-ocl { + background: transparent; + } + .jstree-default-responsive .jstree-node { + min-height: 40px; + line-height: 40px; + margin-left: 40px; + min-width: 40px; + white-space: nowrap; + } + .jstree-default-responsive .jstree-anchor { + line-height: 40px; + height: 40px; + } + .jstree-default-responsive .jstree-icon, + .jstree-default-responsive .jstree-icon:empty { + width: 40px; + height: 40px; + line-height: 40px; + } + .jstree-default-responsive > .jstree-container-ul > .jstree-node { + margin-left: 0; + } + .jstree-default-responsive.jstree-rtl .jstree-node { + margin-left: 0; + margin-right: 40px; + } + .jstree-default-responsive.jstree-rtl .jstree-container-ul > .jstree-node { + margin-right: 0; + } + .jstree-default-responsive .jstree-ocl, + .jstree-default-responsive .jstree-themeicon, + .jstree-default-responsive .jstree-checkbox { + background-size: 120px 240px; + } + .jstree-default-responsive .jstree-leaf > .jstree-ocl { + background: transparent; + } + .jstree-default-responsive .jstree-open > .jstree-ocl { + background-position: 0 0px !important; + } + .jstree-default-responsive .jstree-closed > .jstree-ocl { + background-position: 0 -40px !important; + } + .jstree-default-responsive.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -40px 0px !important; + } + .jstree-default-responsive .jstree-themeicon { + background-position: -40px -40px; + } + .jstree-default-responsive .jstree-checkbox, + .jstree-default-responsive .jstree-checkbox:hover { + background-position: -40px -80px; + } + .jstree-default-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, + .jstree-default-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, + .jstree-default-responsive .jstree-checked > .jstree-checkbox, + .jstree-default-responsive .jstree-checked > .jstree-checkbox:hover { + background-position: 0 -80px; + } + .jstree-default-responsive .jstree-anchor > .jstree-undetermined, + .jstree-default-responsive .jstree-anchor > .jstree-undetermined:hover { + background-position: 0 -120px; + } + .jstree-default-responsive .jstree-anchor { + font-weight: bold; + font-size: 1.1em; + text-shadow: 1px 1px white; + } + .jstree-default-responsive > .jstree-striped { + background: transparent; + } + .jstree-default-responsive .jstree-wholerow { + border-top: 1px solid rgba(255, 255, 255, 0.7); + border-bottom: 1px solid rgba(64, 64, 64, 0.2); + background: #ebebeb; + height: 40px; + } + .jstree-default-responsive .jstree-wholerow-hovered { + background: #e7f4f9; + } + .jstree-default-responsive .jstree-wholerow-clicked { + background: #beebff; + } + .jstree-default-responsive .jstree-children .jstree-last > .jstree-wholerow { + box-shadow: inset 0 -6px 3px -5px #666666; + } + .jstree-default-responsive .jstree-children .jstree-open > .jstree-wholerow { + box-shadow: inset 0 6px 3px -5px #666666; + border-top: 0; + } + .jstree-default-responsive .jstree-children .jstree-open + .jstree-open { + box-shadow: none; + } + .jstree-default-responsive .jstree-node, + .jstree-default-responsive .jstree-icon, + .jstree-default-responsive .jstree-node > .jstree-ocl, + .jstree-default-responsive .jstree-themeicon, + .jstree-default-responsive .jstree-checkbox { + background-image: url("40px.png"); + background-size: 120px 240px; + } + .jstree-default-responsive .jstree-node { + background-position: -80px 0; + background-repeat: repeat-y; + } + .jstree-default-responsive .jstree-last { + background: transparent; + } + .jstree-default-responsive .jstree-leaf > .jstree-ocl { + background-position: -40px -120px; + } + .jstree-default-responsive .jstree-last > .jstree-ocl { + background-position: -40px -160px; + } + .jstree-default-responsive .jstree-themeicon-custom { + background-color: transparent; + background-image: none; + background-position: 0 0; + } + .jstree-default-responsive .jstree-file { + background: url("40px.png") 0 -160px no-repeat; + background-size: 120px 240px; + } + .jstree-default-responsive .jstree-folder { + background: url("40px.png") -40px -40px no-repeat; + background-size: 120px 240px; + } + .jstree-default-responsive > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; + } +} diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/style.min.css b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/style.min.css new file mode 100644 index 0000000..d219660 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/style.min.css @@ -0,0 +1 @@ +.jstree-node,.jstree-children,.jstree-container-ul{display:block;margin:0;padding:0;list-style-type:none;list-style-image:none}.jstree-node{white-space:nowrap}.jstree-anchor{display:inline-block;color:#000;white-space:nowrap;padding:0 4px 0 1px;margin:0;vertical-align:top}.jstree-anchor:focus{outline:0}.jstree-anchor,.jstree-anchor:link,.jstree-anchor:visited,.jstree-anchor:hover,.jstree-anchor:active{text-decoration:none;color:inherit}.jstree-icon{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-icon:empty{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-ocl{cursor:pointer}.jstree-leaf>.jstree-ocl{cursor:default}.jstree .jstree-open>.jstree-children{display:block}.jstree .jstree-closed>.jstree-children,.jstree .jstree-leaf>.jstree-children{display:none}.jstree-anchor>.jstree-themeicon{margin-right:2px}.jstree-no-icons .jstree-themeicon,.jstree-anchor>.jstree-themeicon-hidden{display:none}.jstree-rtl .jstree-anchor{padding:0 1px 0 4px}.jstree-rtl .jstree-anchor>.jstree-themeicon{margin-left:2px;margin-right:0}.jstree-rtl .jstree-node{margin-left:0}.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-wholerow-ul{position:relative;display:inline-block;min-width:100%}.jstree-wholerow-ul .jstree-leaf>.jstree-ocl{cursor:pointer}.jstree-wholerow-ul .jstree-anchor,.jstree-wholerow-ul .jstree-icon{position:relative}.jstree-wholerow-ul .jstree-wholerow{width:100%;cursor:pointer;position:absolute;left:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vakata-context{display:none}.vakata-context,.vakata-context ul{margin:0;padding:2px;position:absolute;background:#f5f5f5;border:1px solid #979797;box-shadow:2px 2px 2px #999}.vakata-context ul{list-style:none;left:100%;margin-top:-2.7em;margin-left:-4px}.vakata-context .vakata-context-right ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context li{list-style:none;display:inline}.vakata-context li>a{display:block;padding:0 2em;text-decoration:none;width:auto;color:#000;white-space:nowrap;line-height:2.4em;text-shadow:1px 1px 0 #fff;border-radius:1px}.vakata-context li>a:hover{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==);background-position:right center;background-repeat:no-repeat}.vakata-context li>a:focus{outline:0}.vakata-context .vakata-context-hover>a{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context .vakata-context-separator>a,.vakata-context .vakata-context-separator>a:hover{background:#fff;border:0;border-top:1px solid #e2e3e3;height:1px;min-height:1px;max-height:1px;padding:0;margin:0 0 0 2.4em;border-left:1px solid #e0e0e0;text-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;border-radius:0}.vakata-context .vakata-contextmenu-disabled a,.vakata-context .vakata-contextmenu-disabled a:hover{color:silver;background-color:transparent;border:0;box-shadow:0 0 0}.vakata-context li>a>i{text-decoration:none;display:inline-block;width:2.4em;height:2.4em;background:0 0;margin:0 0 0 -2em;vertical-align:top;text-align:center;line-height:2.4em}.vakata-context li>a>i:empty{width:2.4em;line-height:2.4em}.vakata-context li>a .vakata-contextmenu-sep{display:inline-block;width:1px;height:2.4em;background:#fff;margin:0 .5em 0 0;border-left:1px solid #e2e3e3}.vakata-context .vakata-contextmenu-shortcut{font-size:.8em;color:silver;opacity:.5;display:none}.vakata-context-rtl ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context-rtl li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7);background-position:left center;background-repeat:no-repeat}.vakata-context-rtl .vakata-context-separator>a{margin:0 2.4em 0 0;border-left:0;border-right:1px solid #e2e3e3}.vakata-context-rtl .vakata-context-left ul{right:auto;left:100%;margin-left:-4px;margin-right:auto}.vakata-context-rtl li>a>i{margin:0 -2em 0 0}.vakata-context-rtl li>a .vakata-contextmenu-sep{margin:0 0 0 .5em;border-left-color:#fff;background:#e2e3e3}#jstree-marker{position:absolute;top:0;left:0;margin:-5px 0 0 0;padding:0;border-right:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid;width:0;height:0;font-size:0;line-height:0}#jstree-dnd{line-height:16px;margin:0;padding:4px}#jstree-dnd .jstree-icon,#jstree-dnd .jstree-copy{display:inline-block;text-decoration:none;margin:0 2px 0 0;padding:0;width:16px;height:16px}#jstree-dnd .jstree-ok{background:green}#jstree-dnd .jstree-er{background:red}#jstree-dnd .jstree-copy{margin:0 2px}.jstree-default .jstree-node,.jstree-default .jstree-icon{background-repeat:no-repeat;background-color:transparent}.jstree-default .jstree-anchor,.jstree-default .jstree-wholerow{transition:background-color .15s,box-shadow .15s}.jstree-default .jstree-hovered{background:#e7f4f9;border-radius:2px;box-shadow:inset 0 0 1px #ccc}.jstree-default .jstree-clicked{background:#beebff;border-radius:2px;box-shadow:inset 0 0 1px #999}.jstree-default .jstree-no-icons .jstree-anchor>.jstree-themeicon{display:none}.jstree-default .jstree-disabled{background:0 0;color:#666}.jstree-default .jstree-disabled.jstree-hovered{background:0 0;box-shadow:none}.jstree-default .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default .jstree-disabled>.jstree-icon{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default .jstree-search{font-style:italic;color:#8b0000;font-weight:700}.jstree-default .jstree-no-checkboxes .jstree-checkbox{display:none!important}.jstree-default.jstree-checkbox-no-clicked .jstree-clicked{background:0 0;box-shadow:none}.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered{background:#e7f4f9}.jstree-default.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked{background:0 0}.jstree-default.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered{background:#e7f4f9}.jstree-default>.jstree-striped{min-width:100%;display:inline-block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==) left top repeat}.jstree-default>.jstree-wholerow-ul .jstree-hovered,.jstree-default>.jstree-wholerow-ul .jstree-clicked{background:0 0;box-shadow:none;border-radius:0}.jstree-default .jstree-wholerow{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.jstree-default .jstree-wholerow-hovered{background:#e7f4f9}.jstree-default .jstree-wholerow-clicked{background:#beebff;background:-webkit-linear-gradient(top,#beebff 0,#a8e4ff 100%);background:linear-gradient(to bottom,#beebff 0,#a8e4ff 100%)}.jstree-default .jstree-node{min-height:24px;line-height:24px;margin-left:24px;min-width:24px}.jstree-default .jstree-anchor{line-height:24px;height:24px}.jstree-default .jstree-icon{width:24px;height:24px;line-height:24px}.jstree-default .jstree-icon:empty{width:24px;height:24px;line-height:24px}.jstree-default.jstree-rtl .jstree-node{margin-right:24px}.jstree-default .jstree-wholerow{height:24px}.jstree-default .jstree-node,.jstree-default .jstree-icon{background-image:url(32px.png)}.jstree-default .jstree-node{background-position:-292px -4px;background-repeat:repeat-y}.jstree-default .jstree-last{background:0 0}.jstree-default .jstree-open>.jstree-ocl{background-position:-132px -4px}.jstree-default .jstree-closed>.jstree-ocl{background-position:-100px -4px}.jstree-default .jstree-leaf>.jstree-ocl{background-position:-68px -4px}.jstree-default .jstree-themeicon{background-position:-260px -4px}.jstree-default>.jstree-no-dots .jstree-node,.jstree-default>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -4px}.jstree-default>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -4px}.jstree-default .jstree-disabled{background:0 0}.jstree-default .jstree-disabled.jstree-hovered{background:0 0}.jstree-default .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default .jstree-checkbox{background-position:-164px -4px}.jstree-default .jstree-checkbox:hover{background-position:-164px -36px}.jstree-default.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default .jstree-checked>.jstree-checkbox{background-position:-228px -4px}.jstree-default.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default .jstree-checked>.jstree-checkbox:hover{background-position:-228px -36px}.jstree-default .jstree-anchor>.jstree-undetermined{background-position:-196px -4px}.jstree-default .jstree-anchor>.jstree-undetermined:hover{background-position:-196px -36px}.jstree-default>.jstree-striped{background-size:auto 48px}.jstree-default.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default.jstree-rtl .jstree-last{background:0 0}.jstree-default.jstree-rtl .jstree-open>.jstree-ocl{background-position:-132px -36px}.jstree-default.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-100px -36px}.jstree-default.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-68px -36px}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -36px}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -36px}.jstree-default .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default .jstree-file{background:url(32px.png) -100px -68px no-repeat}.jstree-default .jstree-folder{background:url(32px.png) -260px -4px no-repeat}.jstree-default>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default{line-height:24px;padding:0 4px}#jstree-dnd.jstree-default .jstree-ok,#jstree-dnd.jstree-default .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default i{background:0 0;width:24px;height:24px;line-height:24px}#jstree-dnd.jstree-default .jstree-ok{background-position:-4px -68px}#jstree-dnd.jstree-default .jstree-er{background-position:-36px -68px}.jstree-default.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-default.jstree-rtl .jstree-last{background:0 0}.jstree-default-small .jstree-node{min-height:18px;line-height:18px;margin-left:18px;min-width:18px}.jstree-default-small .jstree-anchor{line-height:18px;height:18px}.jstree-default-small .jstree-icon{width:18px;height:18px;line-height:18px}.jstree-default-small .jstree-icon:empty{width:18px;height:18px;line-height:18px}.jstree-default-small.jstree-rtl .jstree-node{margin-right:18px}.jstree-default-small .jstree-wholerow{height:18px}.jstree-default-small .jstree-node,.jstree-default-small .jstree-icon{background-image:url(32px.png)}.jstree-default-small .jstree-node{background-position:-295px -7px;background-repeat:repeat-y}.jstree-default-small .jstree-last{background:0 0}.jstree-default-small .jstree-open>.jstree-ocl{background-position:-135px -7px}.jstree-default-small .jstree-closed>.jstree-ocl{background-position:-103px -7px}.jstree-default-small .jstree-leaf>.jstree-ocl{background-position:-71px -7px}.jstree-default-small .jstree-themeicon{background-position:-263px -7px}.jstree-default-small>.jstree-no-dots .jstree-node,.jstree-default-small>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-small>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -7px}.jstree-default-small>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -7px}.jstree-default-small .jstree-disabled{background:0 0}.jstree-default-small .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-small .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-small .jstree-checkbox{background-position:-167px -7px}.jstree-default-small .jstree-checkbox:hover{background-position:-167px -39px}.jstree-default-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-small .jstree-checked>.jstree-checkbox{background-position:-231px -7px}.jstree-default-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-small .jstree-checked>.jstree-checkbox:hover{background-position:-231px -39px}.jstree-default-small .jstree-anchor>.jstree-undetermined{background-position:-199px -7px}.jstree-default-small .jstree-anchor>.jstree-undetermined:hover{background-position:-199px -39px}.jstree-default-small>.jstree-striped{background-size:auto 36px}.jstree-default-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-small.jstree-rtl .jstree-open>.jstree-ocl{background-position:-135px -39px}.jstree-default-small.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-103px -39px}.jstree-default-small.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-71px -39px}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -39px}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -39px}.jstree-default-small .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-small>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-small .jstree-file{background:url(32px.png) -103px -71px no-repeat}.jstree-default-small .jstree-folder{background:url(32px.png) -263px -7px no-repeat}.jstree-default-small>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-small{line-height:18px;padding:0 4px}#jstree-dnd.jstree-default-small .jstree-ok,#jstree-dnd.jstree-default-small .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-small i{background:0 0;width:18px;height:18px;line-height:18px}#jstree-dnd.jstree-default-small .jstree-ok{background-position:-7px -71px}#jstree-dnd.jstree-default-small .jstree-er{background-position:-39px -71px}.jstree-default-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-default-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-large .jstree-node{min-height:32px;line-height:32px;margin-left:32px;min-width:32px}.jstree-default-large .jstree-anchor{line-height:32px;height:32px}.jstree-default-large .jstree-icon{width:32px;height:32px;line-height:32px}.jstree-default-large .jstree-icon:empty{width:32px;height:32px;line-height:32px}.jstree-default-large.jstree-rtl .jstree-node{margin-right:32px}.jstree-default-large .jstree-wholerow{height:32px}.jstree-default-large .jstree-node,.jstree-default-large .jstree-icon{background-image:url(32px.png)}.jstree-default-large .jstree-node{background-position:-288px 0;background-repeat:repeat-y}.jstree-default-large .jstree-last{background:0 0}.jstree-default-large .jstree-open>.jstree-ocl{background-position:-128px 0}.jstree-default-large .jstree-closed>.jstree-ocl{background-position:-96px 0}.jstree-default-large .jstree-leaf>.jstree-ocl{background-position:-64px 0}.jstree-default-large .jstree-themeicon{background-position:-256px 0}.jstree-default-large>.jstree-no-dots .jstree-node,.jstree-default-large>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-large>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px 0}.jstree-default-large>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 0}.jstree-default-large .jstree-disabled{background:0 0}.jstree-default-large .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-large .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-large .jstree-checkbox{background-position:-160px 0}.jstree-default-large .jstree-checkbox:hover{background-position:-160px -32px}.jstree-default-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-large .jstree-checked>.jstree-checkbox{background-position:-224px 0}.jstree-default-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-large .jstree-checked>.jstree-checkbox:hover{background-position:-224px -32px}.jstree-default-large .jstree-anchor>.jstree-undetermined{background-position:-192px 0}.jstree-default-large .jstree-anchor>.jstree-undetermined:hover{background-position:-192px -32px}.jstree-default-large>.jstree-striped{background-size:auto 64px}.jstree-default-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-large.jstree-rtl .jstree-last{background:0 0}.jstree-default-large.jstree-rtl .jstree-open>.jstree-ocl{background-position:-128px -32px}.jstree-default-large.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-96px -32px}.jstree-default-large.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-64px -32px}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px -32px}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 -32px}.jstree-default-large .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-large>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-large .jstree-file{background:url(32px.png) -96px -64px no-repeat}.jstree-default-large .jstree-folder{background:url(32px.png) -256px 0 no-repeat}.jstree-default-large>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-large{line-height:32px;padding:0 4px}#jstree-dnd.jstree-default-large .jstree-ok,#jstree-dnd.jstree-default-large .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-large i{background:0 0;width:32px;height:32px;line-height:32px}#jstree-dnd.jstree-default-large .jstree-ok{background-position:0 -64px}#jstree-dnd.jstree-default-large .jstree-er{background-position:-32px -64px}.jstree-default-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-default-large.jstree-rtl .jstree-last{background:0 0}@media (max-width:768px){#jstree-dnd.jstree-dnd-responsive{line-height:40px;font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}#jstree-dnd.jstree-dnd-responsive>i{background:0 0;width:40px;height:40px}#jstree-dnd.jstree-dnd-responsive>.jstree-ok{background-image:url(40px.png);background-position:0 -200px;background-size:120px 240px}#jstree-dnd.jstree-dnd-responsive>.jstree-er{background-image:url(40px.png);background-position:-40px -200px;background-size:120px 240px}#jstree-marker.jstree-dnd-responsive{border-left-width:10px;border-top-width:10px;border-bottom-width:10px;margin-top:-10px}}@media (max-width:768px){.jstree-default-responsive .jstree-icon{background-image:url(40px.png)}.jstree-default-responsive .jstree-node,.jstree-default-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-responsive .jstree-node{min-height:40px;line-height:40px;margin-left:40px;min-width:40px;white-space:nowrap}.jstree-default-responsive .jstree-anchor{line-height:40px;height:40px}.jstree-default-responsive .jstree-icon,.jstree-default-responsive .jstree-icon:empty{width:40px;height:40px;line-height:40px}.jstree-default-responsive>.jstree-container-ul>.jstree-node{margin-left:0}.jstree-default-responsive.jstree-rtl .jstree-node{margin-left:0;margin-right:40px}.jstree-default-responsive.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-default-responsive .jstree-ocl,.jstree-default-responsive .jstree-themeicon,.jstree-default-responsive .jstree-checkbox{background-size:120px 240px}.jstree-default-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-responsive .jstree-open>.jstree-ocl{background-position:0 0!important}.jstree-default-responsive .jstree-closed>.jstree-ocl{background-position:0 -40px!important}.jstree-default-responsive.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-40px 0!important}.jstree-default-responsive .jstree-themeicon{background-position:-40px -40px}.jstree-default-responsive .jstree-checkbox,.jstree-default-responsive .jstree-checkbox:hover{background-position:-40px -80px}.jstree-default-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-responsive .jstree-checked>.jstree-checkbox,.jstree-default-responsive .jstree-checked>.jstree-checkbox:hover{background-position:0 -80px}.jstree-default-responsive .jstree-anchor>.jstree-undetermined,.jstree-default-responsive .jstree-anchor>.jstree-undetermined:hover{background-position:0 -120px}.jstree-default-responsive .jstree-anchor{font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}.jstree-default-responsive>.jstree-striped{background:0 0}.jstree-default-responsive .jstree-wholerow{border-top:1px solid rgba(255,255,255,.7);border-bottom:1px solid rgba(64,64,64,.2);background:#ebebeb;height:40px}.jstree-default-responsive .jstree-wholerow-hovered{background:#e7f4f9}.jstree-default-responsive .jstree-wholerow-clicked{background:#beebff}.jstree-default-responsive .jstree-children .jstree-last>.jstree-wholerow{box-shadow:inset 0 -6px 3px -5px #666}.jstree-default-responsive .jstree-children .jstree-open>.jstree-wholerow{box-shadow:inset 0 6px 3px -5px #666;border-top:0}.jstree-default-responsive .jstree-children .jstree-open+.jstree-open{box-shadow:none}.jstree-default-responsive .jstree-node,.jstree-default-responsive .jstree-icon,.jstree-default-responsive .jstree-node>.jstree-ocl,.jstree-default-responsive .jstree-themeicon,.jstree-default-responsive .jstree-checkbox{background-image:url(40px.png);background-size:120px 240px}.jstree-default-responsive .jstree-node{background-position:-80px 0;background-repeat:repeat-y}.jstree-default-responsive .jstree-last{background:0 0}.jstree-default-responsive .jstree-leaf>.jstree-ocl{background-position:-40px -120px}.jstree-default-responsive .jstree-last>.jstree-ocl{background-position:-40px -160px}.jstree-default-responsive .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-responsive .jstree-file{background:url(40px.png) 0 -160px no-repeat;background-size:120px 240px}.jstree-default-responsive .jstree-folder{background:url(40px.png) -40px -40px no-repeat;background-size:120px 240px}.jstree-default-responsive>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/throbber.gif b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/throbber.gif new file mode 100644 index 0000000..1b5b2fd Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/default/throbber.gif differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/30px.png b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/30px.png new file mode 100644 index 0000000..5582154 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/30px.png differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/32px.png b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/32px.png new file mode 100644 index 0000000..eb1db46 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/32px.png differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.eot b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.eot new file mode 100644 index 0000000..ec01fc3 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.eot differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.svg b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.svg new file mode 100644 index 0000000..82ba7a1 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.svg @@ -0,0 +1,2377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.ttf b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.ttf new file mode 100644 index 0000000..ea4ca80 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.ttf differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.woff b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.woff new file mode 100644 index 0000000..35ca59e Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-bold-webfont.woff differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.eot b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.eot new file mode 100644 index 0000000..e6b9784 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.eot differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.svg b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.svg new file mode 100644 index 0000000..d61247b --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.svg @@ -0,0 +1,2410 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.ttf b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.ttf new file mode 100644 index 0000000..e0b6ec3 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.ttf differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.woff b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.woff new file mode 100644 index 0000000..0f297db Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-extralight-webfont.woff differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.eot b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.eot new file mode 100644 index 0000000..5c9e81a Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.eot differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.svg b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.svg new file mode 100644 index 0000000..539b912 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.svg @@ -0,0 +1,2725 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.ttf b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.ttf new file mode 100644 index 0000000..f3adc9f Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.ttf differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.woff b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.woff new file mode 100644 index 0000000..4758678 Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/fonts/titillium/titilliumweb-regular-webfont.woff differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/style.css b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/style.css new file mode 100644 index 0000000..4879612 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/style.css @@ -0,0 +1,1122 @@ +/* jsTree default theme */ +.jstree-node, +.jstree-children, +.jstree-container-ul { + display: block; + margin: 0; + padding: 0; + list-style-type: none; + list-style-image: none; +} +.jstree-node { + white-space: nowrap; +} +.jstree-anchor { + display: inline-block; + color: #333; + white-space: nowrap; + padding: 0 4px 0 1px; + margin: 0; + vertical-align: top; +} +.jstree-anchor:focus { + outline: 0; +} +.jstree-anchor, +.jstree-anchor:link, +.jstree-anchor:visited, +.jstree-anchor:hover, +.jstree-anchor:active { + text-decoration: none; + color: inherit; +} +.jstree-icon { + display: inline-block; + text-decoration: none; + margin: 0; + padding: 0; + vertical-align: top; + text-align: center; +} +.jstree-icon:empty { + display: inline-block; + text-decoration: none; + margin: 0; + padding: 0; + vertical-align: top; + text-align: center; +} +.jstree-ocl { + cursor: pointer; +} +.jstree-leaf > .jstree-ocl { + cursor: default; +} +.jstree .jstree-open > .jstree-children { + display: block; +} +.jstree .jstree-closed > .jstree-children, +.jstree .jstree-leaf > .jstree-children { + display: none; +} +.jstree-anchor > .jstree-themeicon { + margin-right: 2px; +} +.jstree-no-icons .jstree-themeicon, +.jstree-anchor > .jstree-themeicon-hidden { + display: none; +} +.jstree-rtl .jstree-anchor { + padding: 0 1px 0 4px; +} +.jstree-rtl .jstree-anchor > .jstree-themeicon { + margin-left: 2px; + margin-right: 0; +} +.jstree-rtl .jstree-node { + margin-left: 0; +} +.jstree-rtl .jstree-container-ul > .jstree-node { + margin-right: 0; +} +.jstree-wholerow-ul { + position: relative; + display: inline-block; + min-width: 100%; +} +.jstree-wholerow-ul .jstree-leaf > .jstree-ocl { + cursor: pointer; +} +.jstree-wholerow-ul .jstree-anchor, +.jstree-wholerow-ul .jstree-icon { + position: relative; +} +.jstree-wholerow-ul .jstree-wholerow { + width: 100%; + cursor: pointer; + position: absolute; + left: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.vakata-context { + display: none; +} +.vakata-context, +.vakata-context ul { + margin: 0; + padding: 2px; + position: absolute; + background: #f5f5f5; + border: 1px solid #979797; + -moz-box-shadow: 5px 5px 4px -4px #666666; + -webkit-box-shadow: 2px 2px 2px #999999; + box-shadow: 2px 2px 2px #999999; +} +.vakata-context ul { + list-style: none; + left: 100%; + margin-top: -2.7em; + margin-left: -4px; +} +.vakata-context .vakata-context-right ul { + left: auto; + right: 100%; + margin-left: auto; + margin-right: -4px; +} +.vakata-context li { + list-style: none; + display: inline; +} +.vakata-context li > a { + display: block; + padding: 0 2em 0 2em; + text-decoration: none; + width: auto; + color: black; + white-space: nowrap; + line-height: 2.4em; + -moz-text-shadow: 1px 1px 0 white; + -webkit-text-shadow: 1px 1px 0 white; + text-shadow: 1px 1px 0 white; + -moz-border-radius: 1px; + -webkit-border-radius: 1px; + border-radius: 1px; +} +.vakata-context li > a:hover { + position: relative; + background-color: #e8eff7; + -moz-box-shadow: 0 0 2px #0a6aa1; + -webkit-box-shadow: 0 0 2px #0a6aa1; + box-shadow: 0 0 2px #0a6aa1; +} +.vakata-context li > a.vakata-context-parent { + background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); + background-position: right center; + background-repeat: no-repeat; +} +.vakata-context li > a:focus { + outline: 0; +} +.vakata-context .vakata-context-hover > a { + position: relative; + background-color: #e8eff7; + -moz-box-shadow: 0 0 2px #0a6aa1; + -webkit-box-shadow: 0 0 2px #0a6aa1; + box-shadow: 0 0 2px #0a6aa1; +} +.vakata-context .vakata-context-separator > a, +.vakata-context .vakata-context-separator > a:hover { + background: white; + border: 0; + border-top: 1px solid #e2e3e3; + height: 1px; + min-height: 1px; + max-height: 1px; + padding: 0; + margin: 0 0 0 2.4em; + border-left: 1px solid #e0e0e0; + -moz-text-shadow: 0 0 0 transparent; + -webkit-text-shadow: 0 0 0 transparent; + text-shadow: 0 0 0 transparent; + -moz-box-shadow: 0 0 0 transparent; + -webkit-box-shadow: 0 0 0 transparent; + box-shadow: 0 0 0 transparent; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +.vakata-context .vakata-contextmenu-disabled a, +.vakata-context .vakata-contextmenu-disabled a:hover { + color: silver; + background-color: transparent; + border: 0; + box-shadow: 0 0 0; +} +.vakata-context li > a > i { + text-decoration: none; + display: inline-block; + width: 2.4em; + height: 2.4em; + background: transparent; + margin: 0 0 0 -2em; + vertical-align: top; + text-align: center; + line-height: 2.4em; +} +.vakata-context li > a > i:empty { + width: 2.4em; + line-height: 2.4em; +} +.vakata-context li > a .vakata-contextmenu-sep { + display: inline-block; + width: 1px; + height: 2.4em; + background: white; + margin: 0 0.5em 0 0; + border-left: 1px solid #e2e3e3; +} +.vakata-context .vakata-contextmenu-shortcut { + font-size: 0.8em; + color: silver; + opacity: 0.5; + display: none; +} +.vakata-context-rtl ul { + left: auto; + right: 100%; + margin-left: auto; + margin-right: -4px; +} +.vakata-context-rtl li > a.vakata-context-parent { + background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); + background-position: left center; + background-repeat: no-repeat; +} +.vakata-context-rtl .vakata-context-separator > a { + margin: 0 2.4em 0 0; + border-left: 0; + border-right: 1px solid #e2e3e3; +} +.vakata-context-rtl .vakata-context-left ul { + right: auto; + left: 100%; + margin-left: -4px; + margin-right: auto; +} +.vakata-context-rtl li > a > i { + margin: 0 -2em 0 0; +} +.vakata-context-rtl li > a .vakata-contextmenu-sep { + margin: 0 0 0 0.5em; + border-left-color: white; + background: #e2e3e3; +} +#jstree-marker { + position: absolute; + top: 0; + left: 0; + margin: -5px 0 0 0; + padding: 0; + border-right: 0; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid; + width: 0; + height: 0; + font-size: 0; + line-height: 0; +} +#jstree-dnd { + line-height: 16px; + margin: 0; + padding: 4px; +} +#jstree-dnd .jstree-icon, +#jstree-dnd .jstree-copy { + display: inline-block; + text-decoration: none; + margin: 0 2px 0 0; + padding: 0; + width: 16px; + height: 16px; +} +#jstree-dnd .jstree-ok { + background: green; +} +#jstree-dnd .jstree-er { + background: red; +} +#jstree-dnd .jstree-copy { + margin: 0 2px 0 2px; +} +.jstree-proton .jstree-node, +.jstree-proton .jstree-icon { + background-repeat: no-repeat; + background-color: transparent; +} +.jstree-proton .jstree-anchor, +.jstree-proton .jstree-wholerow { + transition: background-color 0.15s, box-shadow 0.15s, color 0.15s; +} +.jstree-proton .jstree-hovered { + background: #76b6ec; + color: #ffffff; + border-radius: 3px; + box-shadow: inset 0 0 1px #76b6ec; +} +.jstree-proton .jstree-clicked { + background: #3392e3; + color: #ffffff; + border-radius: 3px; + box-shadow: inset 0 0 1px #3392e3; +} +.jstree-proton .jstree-no-icons .jstree-anchor > .jstree-themeicon { + display: none; +} +.jstree-proton .jstree-disabled { + background: transparent; + color: #666666; +} +.jstree-proton .jstree-disabled.jstree-hovered { + background: transparent; + box-shadow: none; +} +.jstree-proton .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-proton .jstree-disabled > .jstree-icon { + opacity: 0.8; + filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); + /* Firefox 10+ * +filter: gray; +/* IE6-9 */ + -webkit-filter: grayscale(100%); + /* Chrome 19+ & Safari 6+ */ +} +.jstree-proton .jstree-search { + font-style: italic; + color: #8b0000; + font-weight: bold; +} +.jstree-proton .jstree-no-checkboxes .jstree-checkbox { + display: none !important; +} +.jstree-proton.jstree-checkbox-no-clicked .jstree-clicked { + background: transparent; + color: inherit; + box-shadow: none; +} +.jstree-proton.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered { + background: #76b6ec; + color: #ffffff; +} +.jstree-proton.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked { + background: transparent; + color: inherit; +} +.jstree-proton.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered { + background: #76b6ec; + color: #ffffff; +} +.jstree-proton > .jstree-striped { + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==") left top repeat; +} +.jstree-proton > .jstree-wholerow-ul .jstree-hovered, +.jstree-proton > .jstree-wholerow-ul .jstree-clicked { + background: transparent; + box-shadow: none; + border-radius: 0; +} +.jstree-proton .jstree-wholerow { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.jstree-proton .jstree-wholerow-hovered { + background: #76b6ec; +} +.jstree-proton .jstree-wholerow-clicked { + background: #3392e3; + background: -moz-linear-gradient(top, #3392e3 0%, #3392e3 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #3392e3), color-stop(100%, #3392e3)); + background: -webkit-linear-gradient(top, #3392e3 0%, #3392e3 100%); + background: -o-linear-gradient(top, #3392e3 0%, #3392e3 100%); + background: -ms-linear-gradient(top, #3392e3 0%, #3392e3 100%); + background: linear-gradient(to bottom, #3392e3 0%, #3392e3 100%); + /*filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@color1', endColorstr='@color2',GradientType=0 );*/ +} +.jstree-proton .jstree-node { + min-height: 22px; + line-height: 22px; + margin-left: 22px; + min-width: 22px; +} +.jstree-proton .jstree-anchor { + line-height: 22px; + margin: 1px 0 2px; + height: 22px; +} +.jstree-proton .jstree-icon { + width: 22px; + height: 22px; + line-height: 22px; +} +.jstree-proton .jstree-icon:empty { + width: 22px; + height: 22px; + line-height: 22px; +} +.jstree-proton.jstree-rtl .jstree-node { + margin-right: 22px; +} +.jstree-proton .jstree-wholerow { + height: 22px; +} +.jstree-proton .jstree-node, +.jstree-proton .jstree-icon { + background-size: 320px 96px; + background-image: url("32px.png"); +} +.jstree-proton .jstree-node { + background-position: -293px -5px; + background-repeat: repeat-y; +} +.jstree-proton .jstree-last { + background: transparent; +} +.jstree-proton .jstree-open > .jstree-ocl { + background-position: -133px -5px; +} +.jstree-proton .jstree-closed > .jstree-ocl { + background-position: -101px -5px; +} +.jstree-proton .jstree-leaf > .jstree-ocl { + background-position: -69px -5px; +} +.jstree-proton .jstree-themeicon { + background-position: -261px -7px; +} +.jstree-proton > .jstree-no-dots .jstree-node, +.jstree-proton > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-proton > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -37px -5px; +} +.jstree-proton > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -5px -5px; +} +.jstree-proton .jstree-disabled { + background: transparent; +} +.jstree-proton .jstree-disabled.jstree-hovered { + background: transparent; +} +.jstree-proton .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-proton .jstree-checkbox { + background-position: -165px -5px; +} +.jstree-proton .jstree-checkbox:hover { + background-position: -165px -37px; +} +.jstree-proton.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, +.jstree-proton .jstree-checked > .jstree-checkbox { + background-position: -229px -5px; +} +.jstree-proton.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, +.jstree-proton .jstree-checked > .jstree-checkbox:hover { + background-position: -229px -37px; +} +.jstree-proton .jstree-anchor > .jstree-undetermined { + background-position: -197px -5px; +} +.jstree-proton .jstree-anchor > .jstree-undetermined:hover { + background-position: -197px -37px; +} +.jstree-proton > .jstree-striped { + background-size: auto 44px; +} +.jstree-proton.jstree-rtl .jstree-node { + background-size: 320px 96px; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); + background-position: 100% 1px; + background-repeat: repeat-y; +} +.jstree-proton.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-proton.jstree-rtl .jstree-open > .jstree-ocl { + background-position: -133px -37px; +} +.jstree-proton.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -101px -37px; +} +.jstree-proton.jstree-rtl .jstree-leaf > .jstree-ocl { + background-position: -69px -37px; +} +.jstree-proton.jstree-rtl > .jstree-no-dots .jstree-node, +.jstree-proton.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-proton.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -37px -37px; +} +.jstree-proton.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -5px -37px; +} +.jstree-proton .jstree-themeicon-custom { + background-color: transparent; + background-size: 320px 96px; + background-image: none; + background-position: 0 0; +} +.jstree-proton > .jstree-container-ul .jstree-loading > .jstree-ocl { + background: url("throbber.gif") center center no-repeat; +} +.jstree-proton .jstree-file { + background: url("32px.png") -101px -69px no-repeat; +} +.jstree-proton .jstree-folder { + background: url("32px.png") -261px -5px no-repeat; +} +.jstree-proton > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; +} +#jstree-dnd.jstree-proton { + line-height: 22px; + padding: 0 4px; +} +#jstree-dnd.jstree-proton .jstree-ok, +#jstree-dnd.jstree-proton .jstree-er { + background-size: 320px 96px; + background-image: url("32px.png"); + background-repeat: no-repeat; + background-color: transparent; +} +#jstree-dnd.jstree-proton i { + background: transparent; + width: 22px; + height: 22px; + line-height: 22px; +} +#jstree-dnd.jstree-proton .jstree-ok { + background-position: -5px -69px; +} +#jstree-dnd.jstree-proton .jstree-er { + background-position: -37px -69px; +} +.jstree-proton.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); +} +.jstree-proton.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-proton-small .jstree-node { + min-height: 18px; + line-height: 18px; + margin-left: 18px; + min-width: 18px; +} +.jstree-proton-small .jstree-anchor { + line-height: 18px; + margin: 1px 0 2px; + height: 18px; +} +.jstree-proton-small .jstree-icon { + width: 18px; + height: 18px; + line-height: 18px; +} +.jstree-proton-small .jstree-icon:empty { + width: 18px; + height: 18px; + line-height: 18px; +} +.jstree-proton-small.jstree-rtl .jstree-node { + margin-right: 18px; +} +.jstree-proton-small .jstree-wholerow { + height: 18px; +} +.jstree-proton-small .jstree-node, +.jstree-proton-small .jstree-icon { + background-size: 320px 96px; + background-image: url("32px.png"); +} +.jstree-proton-small .jstree-node { + background-position: -295px -7px; + background-repeat: repeat-y; +} +.jstree-proton-small .jstree-last { + background: transparent; +} +.jstree-proton-small .jstree-open > .jstree-ocl { + background-position: -135px -7px; +} +.jstree-proton-small .jstree-closed > .jstree-ocl { + background-position: -103px -7px; +} +.jstree-proton-small .jstree-leaf > .jstree-ocl { + background-position: -71px -7px; +} +.jstree-proton-small .jstree-themeicon { + background-position: -263px -9px; +} +.jstree-proton-small > .jstree-no-dots .jstree-node, +.jstree-proton-small > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-proton-small > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -39px -7px; +} +.jstree-proton-small > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -7px -7px; +} +.jstree-proton-small .jstree-disabled { + background: transparent; +} +.jstree-proton-small .jstree-disabled.jstree-hovered { + background: transparent; +} +.jstree-proton-small .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-proton-small .jstree-checkbox { + background-position: -167px -7px; +} +.jstree-proton-small .jstree-checkbox:hover { + background-position: -167px -39px; +} +.jstree-proton-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, +.jstree-proton-small .jstree-checked > .jstree-checkbox { + background-position: -231px -7px; +} +.jstree-proton-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, +.jstree-proton-small .jstree-checked > .jstree-checkbox:hover { + background-position: -231px -39px; +} +.jstree-proton-small .jstree-anchor > .jstree-undetermined { + background-position: -199px -7px; +} +.jstree-proton-small .jstree-anchor > .jstree-undetermined:hover { + background-position: -199px -39px; +} +.jstree-proton-small > .jstree-striped { + background-size: auto 36px; +} +.jstree-proton-small.jstree-rtl .jstree-node { + background-size: 320px 96px; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); + background-position: 100% 1px; + background-repeat: repeat-y; +} +.jstree-proton-small.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-proton-small.jstree-rtl .jstree-open > .jstree-ocl { + background-position: -135px -39px; +} +.jstree-proton-small.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -103px -39px; +} +.jstree-proton-small.jstree-rtl .jstree-leaf > .jstree-ocl { + background-position: -71px -39px; +} +.jstree-proton-small.jstree-rtl > .jstree-no-dots .jstree-node, +.jstree-proton-small.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-proton-small.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -39px -39px; +} +.jstree-proton-small.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: -7px -39px; +} +.jstree-proton-small .jstree-themeicon-custom { + background-color: transparent; + background-size: 320px 96px; + background-image: none; + background-position: 0 0; +} +.jstree-proton-small > .jstree-container-ul .jstree-loading > .jstree-ocl { + background: url("throbber.gif") center center no-repeat; +} +.jstree-proton-small .jstree-file { + background: url("32px.png") -103px -71px no-repeat; +} +.jstree-proton-small .jstree-folder { + background: url("32px.png") -263px -7px no-repeat; +} +.jstree-proton-small > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; +} +#jstree-dnd.jstree-proton-small { + line-height: 18px; + padding: 0 4px; +} +#jstree-dnd.jstree-proton-small .jstree-ok, +#jstree-dnd.jstree-proton-small .jstree-er { + background-size: 320px 96px; + background-image: url("32px.png"); + background-repeat: no-repeat; + background-color: transparent; +} +#jstree-dnd.jstree-proton-small i { + background: transparent; + width: 18px; + height: 18px; + line-height: 18px; +} +#jstree-dnd.jstree-proton-small .jstree-ok { + background-position: -7px -71px; +} +#jstree-dnd.jstree-proton-small .jstree-er { + background-position: -39px -71px; +} +.jstree-proton-small.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg=="); +} +.jstree-proton-small.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-proton-large .jstree-node { + min-height: 32px; + line-height: 32px; + margin-left: 32px; + min-width: 32px; +} +.jstree-proton-large .jstree-anchor { + line-height: 32px; + margin: 1px 0 2px; + height: 32px; +} +.jstree-proton-large .jstree-icon { + width: 32px; + height: 32px; + line-height: 32px; +} +.jstree-proton-large .jstree-icon:empty { + width: 32px; + height: 32px; + line-height: 32px; +} +.jstree-proton-large.jstree-rtl .jstree-node { + margin-right: 32px; +} +.jstree-proton-large .jstree-wholerow { + height: 32px; +} +.jstree-proton-large .jstree-node, +.jstree-proton-large .jstree-icon { + background-size: 320px 96px; + background-image: url("32px.png"); +} +.jstree-proton-large .jstree-node { + background-position: -288px 0px; + background-repeat: repeat-y; +} +.jstree-proton-large .jstree-last { + background: transparent; +} +.jstree-proton-large .jstree-open > .jstree-ocl { + background-position: -128px 0px; +} +.jstree-proton-large .jstree-closed > .jstree-ocl { + background-position: -96px 0px; +} +.jstree-proton-large .jstree-leaf > .jstree-ocl { + background-position: -64px 0px; +} +.jstree-proton-large .jstree-themeicon { + background-position: -256px -2px; +} +.jstree-proton-large > .jstree-no-dots .jstree-node, +.jstree-proton-large > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-proton-large > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -32px 0px; +} +.jstree-proton-large > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: 0px 0px; +} +.jstree-proton-large .jstree-disabled { + background: transparent; +} +.jstree-proton-large .jstree-disabled.jstree-hovered { + background: transparent; +} +.jstree-proton-large .jstree-disabled.jstree-clicked { + background: #efefef; +} +.jstree-proton-large .jstree-checkbox { + background-position: -160px 0px; +} +.jstree-proton-large .jstree-checkbox:hover { + background-position: -160px -32px; +} +.jstree-proton-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, +.jstree-proton-large .jstree-checked > .jstree-checkbox { + background-position: -224px 0px; +} +.jstree-proton-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, +.jstree-proton-large .jstree-checked > .jstree-checkbox:hover { + background-position: -224px -32px; +} +.jstree-proton-large .jstree-anchor > .jstree-undetermined { + background-position: -192px 0px; +} +.jstree-proton-large .jstree-anchor > .jstree-undetermined:hover { + background-position: -192px -32px; +} +.jstree-proton-large > .jstree-striped { + background-size: auto 64px; +} +.jstree-proton-large.jstree-rtl .jstree-node { + background-size: 320px 96px; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); + background-position: 100% 1px; + background-repeat: repeat-y; +} +.jstree-proton-large.jstree-rtl .jstree-last { + background: transparent; +} +.jstree-proton-large.jstree-rtl .jstree-open > .jstree-ocl { + background-position: -128px -32px; +} +.jstree-proton-large.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -96px -32px; +} +.jstree-proton-large.jstree-rtl .jstree-leaf > .jstree-ocl { + background-position: -64px -32px; +} +.jstree-proton-large.jstree-rtl > .jstree-no-dots .jstree-node, +.jstree-proton-large.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { + background: transparent; +} +.jstree-proton-large.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { + background-position: -32px -32px; +} +.jstree-proton-large.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { + background-position: 0px -32px; +} +.jstree-proton-large .jstree-themeicon-custom { + background-color: transparent; + background-size: 320px 96px; + background-image: none; + background-position: 0 0; +} +.jstree-proton-large > .jstree-container-ul .jstree-loading > .jstree-ocl { + background: url("throbber.gif") center center no-repeat; +} +.jstree-proton-large .jstree-file { + background: url("32px.png") -96px -64px no-repeat; +} +.jstree-proton-large .jstree-folder { + background: url("32px.png") -256px 0px no-repeat; +} +.jstree-proton-large > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; +} +#jstree-dnd.jstree-proton-large { + line-height: 32px; + padding: 0 4px; +} +#jstree-dnd.jstree-proton-large .jstree-ok, +#jstree-dnd.jstree-proton-large .jstree-er { + background-size: 320px 96px; + background-image: url("32px.png"); + background-repeat: no-repeat; + background-color: transparent; +} +#jstree-dnd.jstree-proton-large i { + background: transparent; + width: 32px; + height: 32px; + line-height: 32px; +} +#jstree-dnd.jstree-proton-large .jstree-ok { + background-position: 0px -64px; +} +#jstree-dnd.jstree-proton-large .jstree-er { + background-position: -32px -64px; +} +.jstree-proton-large.jstree-rtl .jstree-node { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg=="); +} +.jstree-proton-large.jstree-rtl .jstree-last { + background: transparent; +} +@media (max-width: 768px) { + #jstree-dnd.jstree-dnd-responsive { + line-height: 30px; + font-weight: bold; + font-size: 1.1em; + text-shadow: 1px 1px white; + } + #jstree-dnd.jstree-dnd-responsive > i { + background: transparent; + width: 30px; + height: 30px; + } + #jstree-dnd.jstree-dnd-responsive > .jstree-ok { + background-image: url("30px.png"); + background-position: 0 -150px; + background-size: 90px 180px; + } + #jstree-dnd.jstree-dnd-responsive > .jstree-er { + background-image: url("30px.png"); + background-position: -30px -150px; + background-size: 90px 180px; + } + #jstree-marker.jstree-dnd-responsive { + border-left-width: 10px; + border-top-width: 10px; + border-bottom-width: 10px; + margin-top: -10px; + } +} +@media (max-width: 768px) { + .jstree-proton-responsive { + /* + .jstree-open > .jstree-ocl, + .jstree-closed > .jstree-ocl { + border-radius:20px; + background-color:white; + } + */ + } + .jstree-proton-responsive .jstree-container-ul { + overflow: hidden; + } + .jstree-proton-responsive .jstree-icon { + background-image: url("30px.png"); + background-size: 90px 180px; + } + .jstree-proton-responsive .jstree-node, + .jstree-proton-responsive .jstree-leaf > .jstree-ocl { + background: transparent; + } + .jstree-proton-responsive .jstree-node { + min-height: 30px; + line-height: 30px; + margin-left: 30px; + min-width: 30px; + white-space: nowrap; + } + .jstree-proton-responsive .jstree-anchor { + line-height: 38px; + height: 38px; + margin: 0; + } + .jstree-proton-responsive .jstree-icon, + .jstree-proton-responsive .jstree-icon:empty { + margin-top: 4px; + width: 30px; + height: 30px; + line-height: 30px; + } + .jstree-proton-responsive > .jstree-container-ul > .jstree-node { + margin-left: 0; + } + .jstree-proton-responsive.jstree-rtl .jstree-node { + margin-left: 0; + margin-right: 30px; + } + .jstree-proton-responsive.jstree-rtl .jstree-container-ul > .jstree-node { + margin-right: 0; + } + .jstree-proton-responsive .jstree-ocl, + .jstree-proton-responsive .jstree-themeicon, + .jstree-proton-responsive .jstree-checkbox { + background-size: 90px 180px; + } + .jstree-proton-responsive .jstree-leaf > .jstree-ocl { + background: transparent; + } + .jstree-proton-responsive .jstree-open > .jstree-ocl { + background-position: 0 0px !important; + } + .jstree-proton-responsive .jstree-closed > .jstree-ocl { + background-position: 0 -30px !important; + } + .jstree-proton-responsive.jstree-rtl .jstree-closed > .jstree-ocl { + background-position: -30px 0px !important; + } + .jstree-proton-responsive .jstree-themeicon { + background-position: -30px -30px; + } + .jstree-proton-responsive .jstree-checkbox, + .jstree-proton-responsive .jstree-checkbox:hover { + background-position: -30px -60px; + } + .jstree-proton-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, + .jstree-proton-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, + .jstree-proton-responsive .jstree-checked > .jstree-checkbox, + .jstree-proton-responsive .jstree-checked > .jstree-checkbox:hover { + background-position: 0 -60px; + } + .jstree-proton-responsive .jstree-anchor > .jstree-undetermined, + .jstree-proton-responsive .jstree-anchor > .jstree-undetermined:hover { + background-position: 0 -90px; + } + .jstree-proton-responsive > .jstree-striped { + background: transparent; + } + .jstree-proton-responsive .jstree-wholerow-ul li { + position: relative; + } + .jstree-proton-responsive .jstree-wholerow-ul .jstree-wholerow { + position: absolute; + top: 0; + left: -1000px; + right: -1000px; + width: auto; + height: 100%; + } + .jstree-proton-responsive .jstree-wholerow { + border-top: 1px solid rgba(0, 0, 0, 0.05); + background: rgba(0, 0, 0, 0.02); + height: 30px; + } + .jstree-proton-responsive .jstree-wholerow-hovered { + background: #76b6ec; + } + .jstree-proton-responsive .jstree-wholerow-clicked { + background: #3392e3; + } + .jstree-proton-responsive .jstree-children .jstree-open + .jstree-open { + box-shadow: none; + } + .jstree-proton-responsive .jstree-node, + .jstree-proton-responsive .jstree-icon, + .jstree-proton-responsive .jstree-node > .jstree-ocl, + .jstree-proton-responsive .jstree-themeicon, + .jstree-proton-responsive .jstree-checkbox { + background-image: url("30px.png"); + background-size: 90px 180px; + } + .jstree-proton-responsive .jstree-node { + background-position: -60px 0; + background-repeat: repeat-y; + } + .jstree-proton-responsive .jstree-last { + background: transparent; + } + .jstree-proton-responsive .jstree-leaf > .jstree-ocl { + background-position: -30px -90px; + } + .jstree-proton-responsive .jstree-last > .jstree-ocl { + background-position: -30px -120px; + } + .jstree-proton-responsive .jstree-themeicon-custom { + background-color: transparent; + background-image: none; + background-position: 0 0; + } + .jstree-proton-responsive .jstree-file { + background: url("30px.png") 0 -120px no-repeat; + background-size: 90px 180px; + } + .jstree-proton-responsive .jstree-folder { + background: url("30px.png") -30px -30px no-repeat; + background-size: 90px 180px; + } + .jstree-proton-responsive > .jstree-container-ul > .jstree-node { + margin-left: 0; + margin-right: 0; + } +} +@font-face { + font-family: 'Titillium Web'; + src: url('fonts/titillium/titilliumweb-extralight-webfont.eot'); + src: url('fonts/titillium/titilliumweb-extralight-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/titillium/titilliumweb-extralight-webfont.woff') format('woff'), url('fonts/titillium/titilliumweb-extralight-webfont.ttf') format('truetype'), url('fonts/titillium/titilliumweb-extralight-webfont.svg#titillium_webthin') format('svg'); + font-weight: 300; + font-style: normal; +} +@font-face { + font-family: 'Titillium Web'; + src: url('fonts/titillium/titilliumweb-regular-webfont.eot'); + src: url('fonts/titillium/titilliumweb-regular-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/titillium/titilliumweb-regular-webfont.woff') format('woff'), url('fonts/titillium/titilliumweb-regular-webfont.ttf') format('truetype'), url('fonts/titillium/titilliumweb-regular-webfont.svg#titillium_webregular') format('svg'); + font-weight: 400; + font-style: normal; +} +@font-face { + font-family: 'Titillium Web'; + src: url('fonts/titillium/titilliumweb-bold-webfont.eot'); + src: url('fonts/titillium/titilliumweb-bold-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/titillium/titilliumweb-bold-webfont.woff') format('woff'), url('fonts/titillium/titilliumweb-bold-webfont.ttf') format('truetype'), url('fonts/titillium/titilliumweb-bold-webfont.svg#titillium_webbold') format('svg'); + font-weight: 700; + font-style: normal; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + @font-face { + font-family: 'Titillium Web'; + src: url('fonts/titillium/titilliumweb-extralight-webfont.svg#titillium_webthin') format('svg'); + font-weight: 300; + font-style: normal; + } + @font-face { + font-family: 'Titillium Web'; + src: url('fonts/titillium/titilliumweb-regular-webfont.svg#titillium_webregular') format('svg'); + font-weight: 400; + font-style: normal; + } + @font-face { + font-family: 'Titillium Web'; + src: url('fonts/titillium/titilliumweb-bold-webfont.svg#titillium_webbold') format('svg'); + font-weight: 700; + font-style: normal; + } +} +.jstree-proton { + font-family: 'Titillium Web', sans-serif, Arial, sans-serif; +} diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/style.min.css b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/style.min.css new file mode 100644 index 0000000..5024e5c --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/style.min.css @@ -0,0 +1 @@ +.jstree-node,.jstree-children,.jstree-container-ul{display:block;margin:0;padding:0;list-style-type:none;list-style-image:none}.jstree-node{white-space:nowrap}.jstree-anchor{display:inline-block;color:#333;white-space:nowrap;padding:0 4px 0 1px;margin:0;vertical-align:top}.jstree-anchor:focus{outline:0}.jstree-anchor,.jstree-anchor:link,.jstree-anchor:visited,.jstree-anchor:hover,.jstree-anchor:active{text-decoration:none;color:inherit}.jstree-icon{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-icon:empty{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-ocl{cursor:pointer}.jstree-leaf>.jstree-ocl{cursor:default}.jstree .jstree-open>.jstree-children{display:block}.jstree .jstree-closed>.jstree-children,.jstree .jstree-leaf>.jstree-children{display:none}.jstree-anchor>.jstree-themeicon{margin-right:2px}.jstree-no-icons .jstree-themeicon,.jstree-anchor>.jstree-themeicon-hidden{display:none}.jstree-rtl .jstree-anchor{padding:0 1px 0 4px}.jstree-rtl .jstree-anchor>.jstree-themeicon{margin-left:2px;margin-right:0}.jstree-rtl .jstree-node{margin-left:0}.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-wholerow-ul{position:relative;display:inline-block;min-width:100%}.jstree-wholerow-ul .jstree-leaf>.jstree-ocl{cursor:pointer}.jstree-wholerow-ul .jstree-anchor,.jstree-wholerow-ul .jstree-icon{position:relative}.jstree-wholerow-ul .jstree-wholerow{width:100%;cursor:pointer;position:absolute;left:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vakata-context{display:none}.vakata-context,.vakata-context ul{margin:0;padding:2px;position:absolute;background:#f5f5f5;border:1px solid #979797;-moz-box-shadow:5px 5px 4px -4px #666;-webkit-box-shadow:2px 2px 2px #999;box-shadow:2px 2px 2px #999}.vakata-context ul{list-style:none;left:100%;margin-top:-2.7em;margin-left:-4px}.vakata-context .vakata-context-right ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context li{list-style:none;display:inline}.vakata-context li>a{display:block;padding:0 2em;text-decoration:none;width:auto;color:#000;white-space:nowrap;line-height:2.4em;-moz-text-shadow:1px 1px 0 #fff;-webkit-text-shadow:1px 1px 0 #fff;text-shadow:1px 1px 0 #fff;-moz-border-radius:1px;-webkit-border-radius:1px;border-radius:1px}.vakata-context li>a:hover{position:relative;background-color:#e8eff7;-moz-box-shadow:0 0 2px #0a6aa1;-webkit-box-shadow:0 0 2px #0a6aa1;box-shadow:0 0 2px #0a6aa1}.vakata-context li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==);background-position:right center;background-repeat:no-repeat}.vakata-context li>a:focus{outline:0}.vakata-context .vakata-context-hover>a{position:relative;background-color:#e8eff7;-moz-box-shadow:0 0 2px #0a6aa1;-webkit-box-shadow:0 0 2px #0a6aa1;box-shadow:0 0 2px #0a6aa1}.vakata-context .vakata-context-separator>a,.vakata-context .vakata-context-separator>a:hover{background:#fff;border:0;border-top:1px solid #e2e3e3;height:1px;min-height:1px;max-height:1px;padding:0;margin:0 0 0 2.4em;border-left:1px solid #e0e0e0;-moz-text-shadow:0 0 0 transparent;-webkit-text-shadow:0 0 0 transparent;text-shadow:0 0 0 transparent;-moz-box-shadow:0 0 0 transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.vakata-context .vakata-contextmenu-disabled a,.vakata-context .vakata-contextmenu-disabled a:hover{color:silver;background-color:transparent;border:0;box-shadow:0 0 0}.vakata-context li>a>i{text-decoration:none;display:inline-block;width:2.4em;height:2.4em;background:0 0;margin:0 0 0 -2em;vertical-align:top;text-align:center;line-height:2.4em}.vakata-context li>a>i:empty{width:2.4em;line-height:2.4em}.vakata-context li>a .vakata-contextmenu-sep{display:inline-block;width:1px;height:2.4em;background:#fff;margin:0 .5em 0 0;border-left:1px solid #e2e3e3}.vakata-context .vakata-contextmenu-shortcut{font-size:.8em;color:silver;opacity:.5;display:none}.vakata-context-rtl ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context-rtl li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7);background-position:left center;background-repeat:no-repeat}.vakata-context-rtl .vakata-context-separator>a{margin:0 2.4em 0 0;border-left:0;border-right:1px solid #e2e3e3}.vakata-context-rtl .vakata-context-left ul{right:auto;left:100%;margin-left:-4px;margin-right:auto}.vakata-context-rtl li>a>i{margin:0 -2em 0 0}.vakata-context-rtl li>a .vakata-contextmenu-sep{margin:0 0 0 .5em;border-left-color:#fff;background:#e2e3e3}#jstree-marker{position:absolute;top:0;left:0;margin:-5px 0 0 0;padding:0;border-right:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid;width:0;height:0;font-size:0;line-height:0}#jstree-dnd{line-height:16px;margin:0;padding:4px}#jstree-dnd .jstree-icon,#jstree-dnd .jstree-copy{display:inline-block;text-decoration:none;margin:0 2px 0 0;padding:0;width:16px;height:16px}#jstree-dnd .jstree-ok{background:green}#jstree-dnd .jstree-er{background:red}#jstree-dnd .jstree-copy{margin:0 2px}.jstree-proton .jstree-node,.jstree-proton .jstree-icon{background-repeat:no-repeat;background-color:transparent}.jstree-proton .jstree-anchor,.jstree-proton .jstree-wholerow{transition:background-color .15s,box-shadow .15s,color .15s}.jstree-proton .jstree-hovered{background:#76b6ec;color:#fff;border-radius:3px;box-shadow:inset 0 0 1px #76b6ec}.jstree-proton .jstree-clicked{background:#3392e3;color:#fff;border-radius:3px;box-shadow:inset 0 0 1px #3392e3}.jstree-proton .jstree-no-icons .jstree-anchor>.jstree-themeicon{display:none}.jstree-proton .jstree-disabled{background:0 0;color:#666}.jstree-proton .jstree-disabled.jstree-hovered{background:0 0;box-shadow:none}.jstree-proton .jstree-disabled.jstree-clicked{background:#efefef}.jstree-proton .jstree-disabled>.jstree-icon{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");-webkit-filter:grayscale(100%)}.jstree-proton .jstree-search{font-style:italic;color:#8b0000;font-weight:700}.jstree-proton .jstree-no-checkboxes .jstree-checkbox{display:none!important}.jstree-proton.jstree-checkbox-no-clicked .jstree-clicked{background:0 0;color:inherit;box-shadow:none}.jstree-proton.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered{background:#76b6ec;color:#fff}.jstree-proton.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked{background:0 0;color:inherit}.jstree-proton.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered{background:#76b6ec;color:#fff}.jstree-proton>.jstree-striped{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==) left top repeat}.jstree-proton>.jstree-wholerow-ul .jstree-hovered,.jstree-proton>.jstree-wholerow-ul .jstree-clicked{background:0 0;box-shadow:none;border-radius:0}.jstree-proton .jstree-wholerow{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.jstree-proton .jstree-wholerow-hovered{background:#76b6ec}.jstree-proton .jstree-wholerow-clicked{background:#3392e3;background:-moz-linear-gradient(top,#3392e3 0,#3392e3 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3392e3),color-stop(100%,#3392e3));background:-webkit-linear-gradient(top,#3392e3 0,#3392e3 100%);background:-o-linear-gradient(top,#3392e3 0,#3392e3 100%);background:-ms-linear-gradient(top,#3392e3 0,#3392e3 100%);background:linear-gradient(to bottom,#3392e3 0,#3392e3 100%)}.jstree-proton .jstree-node{min-height:22px;line-height:22px;margin-left:22px;min-width:22px}.jstree-proton .jstree-anchor{line-height:22px;margin:1px 0 2px;height:22px}.jstree-proton .jstree-icon{width:22px;height:22px;line-height:22px}.jstree-proton .jstree-icon:empty{width:22px;height:22px;line-height:22px}.jstree-proton.jstree-rtl .jstree-node{margin-right:22px}.jstree-proton .jstree-wholerow{height:22px}.jstree-proton .jstree-node,.jstree-proton .jstree-icon{background-size:320px 96px;background-image:url(32px.png)}.jstree-proton .jstree-node{background-position:-293px -5px;background-repeat:repeat-y}.jstree-proton .jstree-last{background:0 0}.jstree-proton .jstree-open>.jstree-ocl{background-position:-133px -5px}.jstree-proton .jstree-closed>.jstree-ocl{background-position:-101px -5px}.jstree-proton .jstree-leaf>.jstree-ocl{background-position:-69px -5px}.jstree-proton .jstree-themeicon{background-position:-261px -7px}.jstree-proton>.jstree-no-dots .jstree-node,.jstree-proton>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-37px -5px}.jstree-proton>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-5px -5px}.jstree-proton .jstree-disabled{background:0 0}.jstree-proton .jstree-disabled.jstree-hovered{background:0 0}.jstree-proton .jstree-disabled.jstree-clicked{background:#efefef}.jstree-proton .jstree-checkbox{background-position:-165px -5px}.jstree-proton .jstree-checkbox:hover{background-position:-165px -37px}.jstree-proton.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-proton .jstree-checked>.jstree-checkbox{background-position:-229px -5px}.jstree-proton.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-proton .jstree-checked>.jstree-checkbox:hover{background-position:-229px -37px}.jstree-proton .jstree-anchor>.jstree-undetermined{background-position:-197px -5px}.jstree-proton .jstree-anchor>.jstree-undetermined:hover{background-position:-197px -37px}.jstree-proton>.jstree-striped{background-size:auto 44px}.jstree-proton.jstree-rtl .jstree-node{background-size:320px 96px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-proton.jstree-rtl .jstree-last{background:0 0}.jstree-proton.jstree-rtl .jstree-open>.jstree-ocl{background-position:-133px -37px}.jstree-proton.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-101px -37px}.jstree-proton.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-69px -37px}.jstree-proton.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-proton.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-37px -37px}.jstree-proton.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-5px -37px}.jstree-proton .jstree-themeicon-custom{background-color:transparent;background-size:320px 96px;background-image:none;background-position:0 0}.jstree-proton>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-proton .jstree-file{background:url(32px.png) -101px -69px no-repeat}.jstree-proton .jstree-folder{background:url(32px.png) -261px -5px no-repeat}.jstree-proton>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-proton{line-height:22px;padding:0 4px}#jstree-dnd.jstree-proton .jstree-ok,#jstree-dnd.jstree-proton .jstree-er{background-size:320px 96px;background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-proton i{background:0 0;width:22px;height:22px;line-height:22px}#jstree-dnd.jstree-proton .jstree-ok{background-position:-5px -69px}#jstree-dnd.jstree-proton .jstree-er{background-position:-37px -69px}.jstree-proton.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-proton.jstree-rtl .jstree-last{background:0 0}.jstree-proton-small .jstree-node{min-height:18px;line-height:18px;margin-left:18px;min-width:18px}.jstree-proton-small .jstree-anchor{line-height:18px;margin:1px 0 2px;height:18px}.jstree-proton-small .jstree-icon{width:18px;height:18px;line-height:18px}.jstree-proton-small .jstree-icon:empty{width:18px;height:18px;line-height:18px}.jstree-proton-small.jstree-rtl .jstree-node{margin-right:18px}.jstree-proton-small .jstree-wholerow{height:18px}.jstree-proton-small .jstree-node,.jstree-proton-small .jstree-icon{background-size:320px 96px;background-image:url(32px.png)}.jstree-proton-small .jstree-node{background-position:-295px -7px;background-repeat:repeat-y}.jstree-proton-small .jstree-last{background:0 0}.jstree-proton-small .jstree-open>.jstree-ocl{background-position:-135px -7px}.jstree-proton-small .jstree-closed>.jstree-ocl{background-position:-103px -7px}.jstree-proton-small .jstree-leaf>.jstree-ocl{background-position:-71px -7px}.jstree-proton-small .jstree-themeicon{background-position:-263px -9px}.jstree-proton-small>.jstree-no-dots .jstree-node,.jstree-proton-small>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-small>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -7px}.jstree-proton-small>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -7px}.jstree-proton-small .jstree-disabled{background:0 0}.jstree-proton-small .jstree-disabled.jstree-hovered{background:0 0}.jstree-proton-small .jstree-disabled.jstree-clicked{background:#efefef}.jstree-proton-small .jstree-checkbox{background-position:-167px -7px}.jstree-proton-small .jstree-checkbox:hover{background-position:-167px -39px}.jstree-proton-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-proton-small .jstree-checked>.jstree-checkbox{background-position:-231px -7px}.jstree-proton-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-proton-small .jstree-checked>.jstree-checkbox:hover{background-position:-231px -39px}.jstree-proton-small .jstree-anchor>.jstree-undetermined{background-position:-199px -7px}.jstree-proton-small .jstree-anchor>.jstree-undetermined:hover{background-position:-199px -39px}.jstree-proton-small>.jstree-striped{background-size:auto 36px}.jstree-proton-small.jstree-rtl .jstree-node{background-size:320px 96px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-proton-small.jstree-rtl .jstree-last{background:0 0}.jstree-proton-small.jstree-rtl .jstree-open>.jstree-ocl{background-position:-135px -39px}.jstree-proton-small.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-103px -39px}.jstree-proton-small.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-71px -39px}.jstree-proton-small.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-proton-small.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-small.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -39px}.jstree-proton-small.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -39px}.jstree-proton-small .jstree-themeicon-custom{background-color:transparent;background-size:320px 96px;background-image:none;background-position:0 0}.jstree-proton-small>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-proton-small .jstree-file{background:url(32px.png) -103px -71px no-repeat}.jstree-proton-small .jstree-folder{background:url(32px.png) -263px -7px no-repeat}.jstree-proton-small>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-proton-small{line-height:18px;padding:0 4px}#jstree-dnd.jstree-proton-small .jstree-ok,#jstree-dnd.jstree-proton-small .jstree-er{background-size:320px 96px;background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-proton-small i{background:0 0;width:18px;height:18px;line-height:18px}#jstree-dnd.jstree-proton-small .jstree-ok{background-position:-7px -71px}#jstree-dnd.jstree-proton-small .jstree-er{background-position:-39px -71px}.jstree-proton-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-proton-small.jstree-rtl .jstree-last{background:0 0}.jstree-proton-large .jstree-node{min-height:32px;line-height:32px;margin-left:32px;min-width:32px}.jstree-proton-large .jstree-anchor{line-height:32px;margin:1px 0 2px;height:32px}.jstree-proton-large .jstree-icon{width:32px;height:32px;line-height:32px}.jstree-proton-large .jstree-icon:empty{width:32px;height:32px;line-height:32px}.jstree-proton-large.jstree-rtl .jstree-node{margin-right:32px}.jstree-proton-large .jstree-wholerow{height:32px}.jstree-proton-large .jstree-node,.jstree-proton-large .jstree-icon{background-size:320px 96px;background-image:url(32px.png)}.jstree-proton-large .jstree-node{background-position:-288px 0;background-repeat:repeat-y}.jstree-proton-large .jstree-last{background:0 0}.jstree-proton-large .jstree-open>.jstree-ocl{background-position:-128px 0}.jstree-proton-large .jstree-closed>.jstree-ocl{background-position:-96px 0}.jstree-proton-large .jstree-leaf>.jstree-ocl{background-position:-64px 0}.jstree-proton-large .jstree-themeicon{background-position:-256px -2px}.jstree-proton-large>.jstree-no-dots .jstree-node,.jstree-proton-large>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-large>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px 0}.jstree-proton-large>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 0}.jstree-proton-large .jstree-disabled{background:0 0}.jstree-proton-large .jstree-disabled.jstree-hovered{background:0 0}.jstree-proton-large .jstree-disabled.jstree-clicked{background:#efefef}.jstree-proton-large .jstree-checkbox{background-position:-160px 0}.jstree-proton-large .jstree-checkbox:hover{background-position:-160px -32px}.jstree-proton-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-proton-large .jstree-checked>.jstree-checkbox{background-position:-224px 0}.jstree-proton-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-proton-large .jstree-checked>.jstree-checkbox:hover{background-position:-224px -32px}.jstree-proton-large .jstree-anchor>.jstree-undetermined{background-position:-192px 0}.jstree-proton-large .jstree-anchor>.jstree-undetermined:hover{background-position:-192px -32px}.jstree-proton-large>.jstree-striped{background-size:auto 64px}.jstree-proton-large.jstree-rtl .jstree-node{background-size:320px 96px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-proton-large.jstree-rtl .jstree-last{background:0 0}.jstree-proton-large.jstree-rtl .jstree-open>.jstree-ocl{background-position:-128px -32px}.jstree-proton-large.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-96px -32px}.jstree-proton-large.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-64px -32px}.jstree-proton-large.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-proton-large.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-large.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px -32px}.jstree-proton-large.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 -32px}.jstree-proton-large .jstree-themeicon-custom{background-color:transparent;background-size:320px 96px;background-image:none;background-position:0 0}.jstree-proton-large>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-proton-large .jstree-file{background:url(32px.png) -96px -64px no-repeat}.jstree-proton-large .jstree-folder{background:url(32px.png) -256px 0 no-repeat}.jstree-proton-large>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-proton-large{line-height:32px;padding:0 4px}#jstree-dnd.jstree-proton-large .jstree-ok,#jstree-dnd.jstree-proton-large .jstree-er{background-size:320px 96px;background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-proton-large i{background:0 0;width:32px;height:32px;line-height:32px}#jstree-dnd.jstree-proton-large .jstree-ok{background-position:0 -64px}#jstree-dnd.jstree-proton-large .jstree-er{background-position:-32px -64px}.jstree-proton-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-proton-large.jstree-rtl .jstree-last{background:0 0}@media (max-width:768px){#jstree-dnd.jstree-dnd-responsive{line-height:30px;font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}#jstree-dnd.jstree-dnd-responsive>i{background:0 0;width:30px;height:30px}#jstree-dnd.jstree-dnd-responsive>.jstree-ok{background-image:url(30px.png);background-position:0 -150px;background-size:90px 180px}#jstree-dnd.jstree-dnd-responsive>.jstree-er{background-image:url(30px.png);background-position:-30px -150px;background-size:90px 180px}#jstree-marker.jstree-dnd-responsive{border-left-width:10px;border-top-width:10px;border-bottom-width:10px;margin-top:-10px}}@media (max-width:768px){.jstree-proton-responsive .jstree-container-ul{overflow:hidden}.jstree-proton-responsive .jstree-icon{background-image:url(30px.png);background-size:90px 180px}.jstree-proton-responsive .jstree-node,.jstree-proton-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-responsive .jstree-node{min-height:30px;line-height:30px;margin-left:30px;min-width:30px;white-space:nowrap}.jstree-proton-responsive .jstree-anchor{line-height:38px;height:38px;margin:0}.jstree-proton-responsive .jstree-icon,.jstree-proton-responsive .jstree-icon:empty{margin-top:4px;width:30px;height:30px;line-height:30px}.jstree-proton-responsive>.jstree-container-ul>.jstree-node{margin-left:0}.jstree-proton-responsive.jstree-rtl .jstree-node{margin-left:0;margin-right:30px}.jstree-proton-responsive.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-proton-responsive .jstree-ocl,.jstree-proton-responsive .jstree-themeicon,.jstree-proton-responsive .jstree-checkbox{background-size:90px 180px}.jstree-proton-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-proton-responsive .jstree-open>.jstree-ocl{background-position:0 0!important}.jstree-proton-responsive .jstree-closed>.jstree-ocl{background-position:0 -30px!important}.jstree-proton-responsive.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-30px 0!important}.jstree-proton-responsive .jstree-themeicon{background-position:-30px -30px}.jstree-proton-responsive .jstree-checkbox,.jstree-proton-responsive .jstree-checkbox:hover{background-position:-30px -60px}.jstree-proton-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-proton-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-proton-responsive .jstree-checked>.jstree-checkbox,.jstree-proton-responsive .jstree-checked>.jstree-checkbox:hover{background-position:0 -60px}.jstree-proton-responsive .jstree-anchor>.jstree-undetermined,.jstree-proton-responsive .jstree-anchor>.jstree-undetermined:hover{background-position:0 -90px}.jstree-proton-responsive>.jstree-striped{background:0 0}.jstree-proton-responsive .jstree-wholerow-ul li{position:relative}.jstree-proton-responsive .jstree-wholerow-ul .jstree-wholerow{position:absolute;top:0;left:-1000px;right:-1000px;width:auto;height:100%}.jstree-proton-responsive .jstree-wholerow{border-top:1px solid rgba(0,0,0,.05);background:rgba(0,0,0,.02);height:30px}.jstree-proton-responsive .jstree-wholerow-hovered{background:#76b6ec}.jstree-proton-responsive .jstree-wholerow-clicked{background:#3392e3}.jstree-proton-responsive .jstree-children .jstree-open+.jstree-open{box-shadow:none}.jstree-proton-responsive .jstree-node,.jstree-proton-responsive .jstree-icon,.jstree-proton-responsive .jstree-node>.jstree-ocl,.jstree-proton-responsive .jstree-themeicon,.jstree-proton-responsive .jstree-checkbox{background-image:url(30px.png);background-size:90px 180px}.jstree-proton-responsive .jstree-node{background-position:-60px 0;background-repeat:repeat-y}.jstree-proton-responsive .jstree-last{background:0 0}.jstree-proton-responsive .jstree-leaf>.jstree-ocl{background-position:-30px -90px}.jstree-proton-responsive .jstree-last>.jstree-ocl{background-position:-30px -120px}.jstree-proton-responsive .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-proton-responsive .jstree-file{background:url(30px.png) 0 -120px no-repeat;background-size:90px 180px}.jstree-proton-responsive .jstree-folder{background:url(30px.png) -30px -30px no-repeat;background-size:90px 180px}.jstree-proton-responsive>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}}@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-extralight-webfont.eot);src:url(fonts/titillium/titilliumweb-extralight-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/titillium/titilliumweb-extralight-webfont.woff) format('woff'),url(fonts/titillium/titilliumweb-extralight-webfont.ttf) format('truetype'),url(fonts/titillium/titilliumweb-extralight-webfont.svg#titillium_webthin) format('svg');font-weight:300;font-style:normal}@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-regular-webfont.eot);src:url(fonts/titillium/titilliumweb-regular-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/titillium/titilliumweb-regular-webfont.woff) format('woff'),url(fonts/titillium/titilliumweb-regular-webfont.ttf) format('truetype'),url(fonts/titillium/titilliumweb-regular-webfont.svg#titillium_webregular) format('svg');font-weight:400;font-style:normal}@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-bold-webfont.eot);src:url(fonts/titillium/titilliumweb-bold-webfont.eot?#iefix) format('embedded-opentype'),url(fonts/titillium/titilliumweb-bold-webfont.woff) format('woff'),url(fonts/titillium/titilliumweb-bold-webfont.ttf) format('truetype'),url(fonts/titillium/titilliumweb-bold-webfont.svg#titillium_webbold) format('svg');font-weight:700;font-style:normal}@media screen and (-webkit-min-device-pixel-ratio:0){@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-extralight-webfont.svg#titillium_webthin) format('svg');font-weight:300;font-style:normal}@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-regular-webfont.svg#titillium_webregular) format('svg');font-weight:400;font-style:normal}@font-face{font-family:'Titillium Web';src:url(fonts/titillium/titilliumweb-bold-webfont.svg#titillium_webbold) format('svg');font-weight:700;font-style:normal}}.jstree-proton{font-family:'Titillium Web',sans-serif,Arial,sans-serif} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/throbber.gif b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/throbber.gif new file mode 100644 index 0000000..1b5b2fd Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/css/vendor/jstree/proton/throbber.gif differ diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/select2.min.css b/admin/survey/modules/mod_hierarhija/css/vendor/select2.min.css new file mode 100644 index 0000000..d2278f9 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/css/vendor/select2.min.css @@ -0,0 +1 @@ +.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} diff --git a/admin/survey/modules/mod_hierarhija/db_hirarhija_create.sql b/admin/survey/modules/mod_hierarhija/db_hirarhija_create.sql new file mode 100644 index 0000000..b7c3682 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/db_hirarhija_create.sql @@ -0,0 +1,190 @@ +# Vse tabele, ki so potrebne za modul mod_hierarhija + +#Hierarhija admin nivo - izgradnja nivojev in šifrantov +CREATE TABLE srv_hierarhija_ravni ( + id integer NOT NULL auto_increment, + anketa_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + level TINYINT NULL DEFAULT NULL, + ime VARCHAR(255) NULL DEFAULT NULL, + PRIMARY KEY (id), + FOREIGN KEY (anketa_id) REFERENCES srv_anketa (id) ON DELETE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE srv_hierarhija_sifranti ( + id integer NOT NULL auto_increment, + hierarhija_ravni_id INTEGER NOT NULL, + ime VARCHAR(255) NULL DEFAULT NULL, + PRIMARY KEY (id), + FOREIGN KEY (hierarhija_ravni_id) REFERENCES srv_hierarhija_ravni (id) ON DELETE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE srv_hierarhija_users ( + user_id INTEGER NOT NULL, + type TINYINT NULL DEFAULT 10 +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +# Hierarhija uporabniki, kjer se zgradi struktura +CREATE TABLE srv_hierarhija_struktura ( + id INTEGER NOT NULL auto_increment, + hierarhija_ravni_id INTEGER NOT NULL, + parent_id INTEGER DEFAULT NULL, + hierarhija_sifranti_id INTEGER NOT NULL, + level TINYINT NOT NULL, + PRIMARY KEY (id), + FOREIGN KEY (hierarhija_ravni_id) REFERENCES srv_hierarhija_ravni (id) ON DELETE CASCADE, + FOREIGN KEY (parent_id) REFERENCES srv_hierarhija_struktura (id) ON DELETE CASCADE, + FOREIGN KEY (hierarhija_sifranti_id) REFERENCES srv_hierarhija_sifranti (id) ON DELETE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE srv_hierarhija_struktura_users ( + hierarhija_struktura_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + FOREIGN KEY (hierarhija_struktura_id) REFERENCES srv_hierarhija_struktura (id) ON DELETE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +#Pivot table srv_hierarhija in srv_vrednost +CREATE TABLE srv_hierarhija_sifrant_vrednost ( + sifrant_id INTEGER NOT NULL, + vrednost_id INTEGER NOT NULL, + FOREIGN KEY (sifrant_id) REFERENCES srv_hierarhija_sifranti (id) ON DELETE CASCADE, + FOREIGN KEY (vrednost_id) REFERENCES srv_vrednost (id) ON DELETE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +#Pivot table srv_hierarhija in srv_vrednost +#ALTER TABLE srv_hierarhija_struktura CHANGE hidden hidden ENUM('0','1','2') NOT NULL DEFAULT '0'; + +ALTER TABLE srv_hierarhija_struktura + ADD COLUMN anketa_id INTEGER NOT NULL AFTER id, + ADD FOREIGN KEY (anketa_id) REFERENCES srv_anketa (id) ON DELETE CASCADE; + +# Dodamo moĹľnost unikaten, da upošteva samo unikatne šifrante na omenjeni ravni +ALTER TABLE srv_hierarhija_ravni + ADD COLUMN unikaten INTEGER DEFAULT 0; + + +# 23.12.2015 +# dDoloÄŤimo user type glede na anketo +ALTER TABLE srv_hierarhija_users + ADD COLUMN id INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, + ADD COLUMN anketa_id INTEGER NOT NULL AFTER user_id, + ADD PRIMARY KEY (id), + ADD FOREIGN KEY (anketa_id) REFERENCES srv_anketa (id) ON DELETE CASCADE; + +# kreiranje nakljuÄŤnega 5 znakov dolgega unikatnega niza +# CAST(MD5(RAND()) as CHAR(5)) +# 8.4.2016 +CREATE TABLE srv_hierarhija_koda ( + koda VARCHAR(10) NOT NULL UNIQUE, + anketa_id INTEGER NOT NULL, + url TEXT NOT NULL, + vloga ENUM('ucitelj', 'ucenec') NOT NULL, + user_id INT(15) NOT NULL, + hierarhija_struktura_id INT(15) NOT NULL, + datetime DATETIME, + PRIMARY KEY (koda), + FOREIGN KEY (anketa_id) REFERENCES srv_anketa (id) ON DELETE CASCADE, + FOREIGN KEY (hierarhija_struktura_id) REFERENCES srv_hierarhija_struktura (id) ON DELETE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +# MoĹľnost shranjevanja hierarhije +# 10.05.2016 +CREATE TABLE srv_hierarhija_shrani ( + id integer NOT NULL auto_increment, + anketa_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + ime VARCHAR(255) NULL DEFAULT NULL, + hierarhija LONGTEXT, + PRIMARY KEY (id), + FOREIGN KEY (anketa_id) REFERENCES srv_anketa (id) ON DELETE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +# Shranjevanje opcij za hierarhijo +# 26.5.2016 +CREATE TABLE srv_hierarhija_options ( + id integer NOT NULL auto_increment, + anketa_id INTEGER NOT NULL, + option_name VARCHAR(200) NOT NULL, + option_value LONGTEXT, + PRIMARY KEY (id), + FOREIGN KEY (anketa_id) REFERENCES srv_anketa (id) ON DELETE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +# Hierarhija help +INSERT INTO srv_help (what, help) VALUES ('srv_hierarchy_edit_elements', 'Za vsak izbran nivo se lahko dodaja nove elemente. Z izbiro možnosti brisanja se izbriše celoten nivo z vsemi šifranti. Lahko pa se omenejene elemente ureja in odstrani zgolj poljuben element nivoja.'); +INSERT INTO srv_help (what, help) VALUES ('srv_hierarhy_last_level_missing', 'Na zadnjem nivoju manjka izbran element in elektronski naslov osebe, ki bo preko elektronske pošte dobila kodo za reševanje ankete.'); + +# Shranjevanje strukture +# 3.11.2016 +ALTER TABLE srv_hierarhija_shrani ADD COLUMN struktura LONGTEXT DEFAULT NULL; + +# Dodana stolpec za seštevek vseh uÄŤitelje v in vseh uporabnikov +# 25.11.2016 +ALTER TABLE srv_hierarhija_shrani ADD COLUMN st_uciteljev INTEGER DEFAULT NULL; +ALTER TABLE srv_hierarhija_shrani ADD COLUMN st_vseh_uporabnikov INTEGER DEFAULT NULL; + +# OmogoÄŤimo komentarje za posamezno anketo +# 02.12.2016 +ALTER TABLE srv_hierarhija_shrani ADD COLUMN komentar TEXT DEFAULT NULL; + +# Piškot zapišemo za uÄŤitelja +# 26.05.2017 +ALTER TABLE srv_hierarhija_koda + ADD COLUMN srv_user_id INT(11) DEFAULT NULL AFTER vloga, + ADD FOREIGN KEY (srv_user_id) REFERENCES srv_user (id); + +# OmogoÄŤimo komentarje za posamezno anketo +# V mod_hierarhija/porocila je potreno ustvariti mapo logo (755) +# 09.06.2017 +ALTER TABLE srv_hierarhija_shrani ADD COLUMN logo VARCHAR(255) DEFAULT NULL; + +# 16.06.2017 +DROP INDEX koda ON srv_hierarhija_koda; +ALTER TABLE srv_hierarhija_koda ADD UNIQUE INDEX (koda); + +# 19.06.2017 +INSERT INTO srv_hierarhija_options (anketa_id, option_name, option_value) SELECT anketa_id, 'ne_poslji_kode_ucencem', '1' FROM srv_hierarhija_options WHERE option_name='poslji_kode' AND option_value='uciteljem'; +INSERT INTO srv_hierarhija_options (anketa_id, option_name, option_value) SELECT anketa_id, 'ne_poslji_kode_ucencem', '1' FROM srv_hierarhija_options WHERE option_name='poslji_kode' AND option_value='nikomur'; +INSERT INTO srv_hierarhija_options (anketa_id, option_name, option_value) SELECT anketa_id, 'ne_poslji_kodo_ucitelju', '1' FROM srv_hierarhija_options WHERE option_name='poslji_kode' AND option_value='nikomur'; +DELETE FROM srv_hierarhija_options WHERE option_name='poslji_kode'; + +#22.06.2017 +ALTER TABLE srv_hierarhija_shrani ADD COLUMN uporabniki_list TEXT DEFAULT NULL; + +# Ustvarjena tabela za superšifro +# 06.07.2017 +CREATE TABLE srv_hierarhija_supersifra ( + koda VARCHAR(10) NOT NULL UNIQUE, + anketa_id INTEGER NOT NULL, + kode TEXT NOT NULL, + datetime DATETIME, + PRIMARY KEY (koda), + FOREIGN KEY (anketa_id) REFERENCES srv_anketa (id) ON DELETE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +# tabela, ki beleĹľi uporabnike in katere ankete je rešil s superšiframi +# 10.7.2017 +CREATE TABLE srv_hierarhija_supersifra_resevanje ( + user_id INTEGER NOT NULL, + supersifra VARCHAR(10) NOT NULL, + koda VARCHAR(10) NOT NULL, + status TINYINT DEFAULT NULL, + datetime DATETIME DEFAULT NOW(), + PRIMARY KEY (user_id), + FOREIGN KEY (user_id) REFERENCES srv_user (id) ON DELETE CASCADE, + FOREIGN KEY (supersifra) REFERENCES srv_hierarhija_supersifra (koda) ON DELETE CASCADE, + FOREIGN KEY (koda) REFERENCES srv_hierarhija_koda (koda) ON DELETE CASCADE #na testu povzroÄŤal teĹľave +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +# Dostop do mdula SA +CREATE TABLE srv_hierarhija_dostop ( + user_id INTEGER NOT NULL, + dostop TINYINT DEFAULT 0, + ustanova VARCHAR(255) DEFAULT NULL, + aai_email VARCHAR(100) DEFAULT NULL, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (user_id), + FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE +)ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/admin/survey/modules/mod_hierarhija/img/sort_asc.png b/admin/survey/modules/mod_hierarhija/img/sort_asc.png new file mode 100644 index 0000000..e1ba61a Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/img/sort_asc.png differ diff --git a/admin/survey/modules/mod_hierarhija/img/sort_asc_disabled.png b/admin/survey/modules/mod_hierarhija/img/sort_asc_disabled.png new file mode 100644 index 0000000..fb11dfe Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/img/sort_asc_disabled.png differ diff --git a/admin/survey/modules/mod_hierarhija/img/sort_both.png b/admin/survey/modules/mod_hierarhija/img/sort_both.png new file mode 100644 index 0000000..af5bc7c Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/img/sort_both.png differ diff --git a/admin/survey/modules/mod_hierarhija/img/sort_desc.png b/admin/survey/modules/mod_hierarhija/img/sort_desc.png new file mode 100644 index 0000000..0e156de Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/img/sort_desc.png differ diff --git a/admin/survey/modules/mod_hierarhija/img/sort_desc_disabled.png b/admin/survey/modules/mod_hierarhija/img/sort_desc_disabled.png new file mode 100644 index 0000000..c9fdd8a Binary files /dev/null and b/admin/survey/modules/mod_hierarhija/img/sort_desc_disabled.png differ diff --git a/admin/survey/modules/mod_hierarhija/index.php b/admin/survey/modules/mod_hierarhija/index.php new file mode 100644 index 0000000..2881b8c --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/index.php @@ -0,0 +1,5 @@ + 0) { + $.each(data, function (index, value) { + that.inputNivo.push(value); + }); + } + }); + + // Pridobimo shranjene hierarhije v bazi + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=json_shranjene_hierarhije').success(function (data) { + if (data != 'undefined' && data.length > 0) { + $.each(data, function (index, value) { + that.shranjenaHierarhija.push(value); + }); + } + }); + + + // pridobimo vse nastavitve iz baze + this.vseNastavitveIzBaze(); + }, + + // Pridobimo trenutno število nivojev in dodamo novega + methods: { + // OmogoÄŤi moĹľnost preimenovanja ankete + editTitleToogle: function () { + return this.imeHierarhije.editTitle = !this.imeHierarhije.editTitle; + }, + + dodajNivoHierarhije: function (st) { + var that = this; + var ime = this.imeNivoja || 'nivo'; + var st = this.novaHierarhijaSt; + this.imeNivoja = ''; + + // POST request + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=post_nivoji', { + nivo: st, + ime: ime + }).success(function (data) { + // ko dobimo id od ravni potem napolnimo dom element inputNivo + that.inputNivo.push({ + st: st, + ime: ime, + id: data, + sifranti: [] + }); + + // posodobimo število nivojev + that.pridobiStNivojev(); + + }); + + }, + + odstraniNivoHierarhije: function (index, id) { + var st = this.inputNivo[index].st; + + this.inputNivo.forEach(function (obj) { + if (obj.st > st) + obj.st = obj.st - 1; + }); + + var that = this; + + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=brisi_nivo_hierarhija', { + id_nivoja: id + }).then(function (response) { + if (response.status == 200 && response.data == 0) { + swal({ + title: "Napaka!", + text: "Omenjen nivo ni mogoÄŤe izbrisati, ker je Ĺľe uporabljen pri izgradnji hierarhije.", + type: "warning", + confirmButtonText: "OK" + }); + } else { + that.inputNivo.splice(index, 1); + that.novaHierarhijaSt = (that.novaHierarhijaSt - 1); + } + }); + }, + + // izbrišemo vse ravni v hierarhiji, da lahko uporabnik na novo ustvarja + izbrisiCelotnoHierarhijo: function () { + + // Prejšno hierarhijo vedno shranimo + if (this.inputNivo.length > 0) + this.shraniTrenutnoHierarhijo(); + + // ÄŚe uporabnik ne vpiše imena potem obstojeÄŤo ne brišemo + if (this.pobrisiHierarhijoInZacniNovo()) { + // Vse spremenljivke postavimo na 0 + this.imeHierarhije = { + aktivna: '', + shrani: '', + index: '-1', + id: '-1' + }; + + this.previewHierarhije.vklop = false; + } + }, + + // PObrišemo trenutno aktivno hierarhijo in zaÄŤnemo novo, ki jo tudi shranimo za kasnejši preklic + pobrisiHierarhijoInZacniNovo: function () { + var that = this; + + //# V kolikor dela novo hierarhijo potem vedno prikaĹľemo moĹľnost za vpis imena + swal({ + title: "Nova hierarhija", + text: "Vpišite ime nove hierarhije:", + type: "input", + animation: "slide-from-top", + closeOnConfirm: false, + closeOnCancel: true, + showCancelButton: true, + cancelButtonText: 'PrekliÄŤi', + allowOutsideClick: true, + inputPlaceholder: "Primer: Hierarhija šola" + }, function (inputValue) { + if (inputValue === false) return false; + if (inputValue === "") { + swal.showInputError("Ime hierarhije je obvezno!"); + return false + } + + //# Pobrišemo vse ravni in vso trenutno hierarhij v kolikor vpiše novo + that.$http.post('ajax.php?anketa=' + that.anketaId + '&t=hierarhija-ajax&a=izbrisi_vse_ravni'); + + // Ime hierarhije shranimo v vue spremenljivko + that.getSaveOptions('aktivna_hierarhija_ime', inputValue); + that.imeHierarhije.shrani = inputValue; + + // Ime hierarhije shranimo tudi v srv_hierarhija_shrani, da dobimo ID vnosa, kamor potem shranjujemo json podatke z vsemi šifranti in nivoji + that.$http.post('ajax.php?anketa=' + that.anketaId + '&t=hierarhija-ajax&a=shrani_hierarhijo', { + ime: inputValue, + hierarhija: null + }).success(function (id) { + // shranimo tudi ID hierarhije + that.getSaveOptions('srv_hierarhija_shrani_id', id); + }); + + + location.reload(); + }); + + + }, + + // Dodamo šifrant k ustreznemu nivoju/ravni + dodajSifrant: function (index, idNivoja) { + var text = $('[data-nivo="' + idNivoja + '"]').val(); + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=post_sifranti', { + idNivoja: idNivoja, + imeSifranta: text + }).success(function (data) { + this.inputNivo[index].sifranti.push({ + ime: text + }); + + $('[data-nivo="' + idNivoja + '"]').val(''); + + var opcije = ''; + $.each(data, function (index, value) { + opcije += ''; + }); + + $('#nivo-' + idNivoja + ' td:eq( 1 )').html(''); + }); + + }, + + brisiSifrant: function (idNivoja) { + var that = this; + + // Toogle spremenljivka, ki prikaĹľe urejanje ali drop down meni + if (typeof this.brisanjeDropdownMenija[idNivoja] == 'undefined') + this.brisanjeDropdownMenija[idNivoja] = false; + + this.brisanjeDropdownMenija[idNivoja] = !this.brisanjeDropdownMenija[idNivoja]; + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=brisi_sifrante', { + idNivoja: idNivoja, + }).success(function (data) { + + if (that.brisanjeDropdownMenija[idNivoja]) { + var opcije = '
    '; + $.each(data, function (index, value) { + opcije += '
  • ' + value.ime + '
  • '; + }); + opcije += '
'; + + $('#nivo-' + idNivoja + ' td:eq( 1 )').html(opcije); + } else { + $('[data-nivo="' + idNivoja + '"]').val(''); + + var opcije = ''; + $.each(data, function (index, value) { + opcije += ''; + }); + + $('#nivo-' + idNivoja + ' td:eq( 1 )').html(''); + } + + }); + + }, + + posodobiUnikatnega: function (id, obj) { + if (obj.unikaten == 0) { + obj.unikaten = 1; + } else { + obj.unikaten = 0; + } + + $.post("ajax.php?anketa=" + this.anketaId + "&t=hierarhija-ajax&a=popravi_nivo_hierarhija", { + id_nivoja: id, + unikaten: obj.unikaten + }); + }, + + // posodobi ime labele nivoja + preimenujLabeloNivoja: function (id) { + this.$http.post("ajax.php?anketa=" + this.anketaId + "&t=hierarhija-ajax&a=popravi_nivo_hierarhija", { + id_nivoja: id, + besedilo: $('[data-labela="' + id + '"]').text() + }); + }, + + // Pridobimo število nivojev, ki je vpisano za izbrano anketo + pridobiStNivojev: function () { + var that = this; + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=st_nivojev').success(function (data) { + that.novaHierarhijaSt = (data + 1); + + if (data > 0) + that.previewHierarhije.vklop = false; + + }); + }, + + // Shranimo trenutno izdelano hierarhijo + shraniTrenutnoHierarhijo: function (shraniPodIstiId) { + // Če želimo izvesti update ali create new + var shraniPodIstiId = shraniPodIstiId || false; + + // V kolikor samo uporabimo checkbox in je še vedno isto potem naredimo update + if (this.imeHierarhije.shrani == this.imeHierarhije.aktivna) + shraniPodIstiId = true; + + // preverimo, če je shranjena struktura potem + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=pridobi-shranjeno-hierarhijo-bool', { + id: this.imeHierarhije.id, + polje: 'struktura', + }).then(function (response) { + + // UPDATE se vedno zgodi, kadar gremo naprej + if (shraniPodIstiId && this.imeHierarhije.index > 1 && this.imeHierarhije.index != 'default') { + return this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=update-aktivno-hierarhijo', { + id: this.imeHierarhije.id, + hierarhija: JSON.stringify(this.inputNivo) + }).success(function () { + // našo trenutno hierarhijo shranimo tudi v dom, da v kolikor uporabnik še enkrat izbere isto hierarhijo, da se mu naložijo isti elementi + this.shranjenaHierarhija[this.imeHierarhije.index].hierarhija = JSON.stringify(this.inputNivo); + }); + } + + // Hierarhijo shranimo na novo + + // če hierarhije ne poimenujemo potem dobi privzeto ime Hierarhija in čas kopiranja ali pa ostoječe ime in čas kopiranja (Šola, Hierarhija Šolski center) + if (!this.prikaziImeZaShranjevanje) { + // Če je že kopija kakšne od preh hierarhije potem dobi obstoječe ime in uro + var time = new Date(); + if (this.imeHierarhije.aktivna.length > 0) { + // ime_H:i:s" + var sekunde = ('0' + time.getSeconds()).slice(-2); + var minute = ('0' + time.getMinutes()).slice(-2); + var ure = ('0' + time.getHours()).slice(-2); + + this.imeHierarhije.shrani = this.imeHierarhije.aktivna + '_' + ure + ':' + minute + ':' + sekunde; + } else { + // Drugače pa "Hierarhija - H:i:s" + this.imeHierarhije.shrani = 'Hierarhija - ' + time.getHours() + ':' + time.getMinutes() + ':' + time.getSeconds(); + } + } + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=shrani_hierarhijo', { + ime: this.imeHierarhije.shrani, + hierarhija: JSON.stringify(this.inputNivo) + }).then(function (responseShrani) { + this.imeHierarhije.aktivna = this.imeHierarhije.shrani + + // SHRANJENO HIERARHIJO shranimo tudi v spremenljivko za kasnejši preklic + this.shranjenaHierarhija.push({ + id: responseShrani.data, + ime: this.imeHierarhije.shrani, + hierarhija: (typeof this.inputNivo == 'string' ? JSON.stringify(this.inputNivo) : this.inputNivo), + anketa: this.anketaId, + dom: true, + }); + + this.imeHierarhije.index = (this.shranjenaHierarhija.length - 1); + + // shranimo tudi ID hierarhije + this.getSaveOptions('srv_hierarhija_shrani_id', responseShrani.data); + this.imeHierarhije.id = responseShrani.data; + }); + + // Ime shranjene hierarhije shranimo tudi kot aktivno hierarhijo + this.getSaveOptions('aktivna_hierarhija_ime', this.imeHierarhije.shrani); + }); + + + }, + + /* + * Gumb za premikanje naprej + */ + premikNaprej: function (ime) { + + if (ime == 'uredi-uporabnike') { + this.shraniTrenutnoHierarhijo(false, true); + + // Preusmerimo na urejanje uporabnikov in naredimo cel reload ter pobrišemo cache + window.location.replace(location.origin + location.pathname + "?anketa=" + this.anketaId + "&a=hierarhija_superadmin&m=uredi-uporabnike"); + } + }, + + /* + * Uporabimo shranjeno hierarhijo iz seznama + */ + uporabiShranjenoHierarhijo: function (index, id, uporabniki) { + var that = this; + + // Tukaj moram imeti podatke še o starih stvareh + this.imeHierarhije.id = id; + this.uporabnikiZaKopijo = uporabniki || 0; + + if (this.vpisanaStruktura) + return swal({ + title: "Opozorilo!", + text: "Pri omenjeni strukturi hierarhije so že dodani uporabniki in nove hierarhije ni več mogoče izbrati, lahko samo dopolnjujete obstoječo.", + type: "warning", + confirmButtonText: "Zapri" + }); + + // Kadar še nimamo vpisane nobene ravni + if (this.novaHierarhijaSt == 1) + return that.posodobiHierarhijo(index, id); + + swal({ + title: "Kopiranje hierarhije", + text: "Z nadaljevanjem se bo hierarhija skopirala v novo ime, obstoječa pa se bo avtomatsko shranila pod dosedanje ime.", + type: "info", + showCancelButton: true, + cancelButtonText: "Ne", + confirmButtonText: "Da, nadaljuj." + }, function (shrani) { + + if (shrani) { + // V kolikor želi uporabnik shraniti trenutno hierarhijo in pustimo index kot je + that.shraniTrenutnoHierarhijo(true); + + setTimeout(function () { + Vue.nextTick(function () { + // Izberemo novo hierarhijo + that.posodobiHierarhijo(index, id); + }); + }, 100); + + } + + }); + }, + + // Preglej shranjeno hierarhijo in ne shrani v bazo + pregledShranjeneHierarhije: function (index, id, uporabniki) { + // Nastavitve trenutne strukture na katero je kliknil uporabnik shranimo v predogled, da se lahko uporabi v kolikor bi uporabnik želel uporabiti omenjeno hierarhijo + this.previewHierarhije = { + vklop: true, + ime: this.shranjenaHierarhija[index].ime, + index: index, + id: id, + uporabniki: uporabniki + }; + + + if (typeof this.shranjenaHierarhija[index].hierarhija == 'object') + this.previewHierarhije.input = this.shranjenaHierarhija[index].hierarhija; + else + this.previewHierarhije.input = JSON.parse(this.shranjenaHierarhija[index].hierarhija); + }, + + // Izklopimo predogled hierarhije + izklopiPredogled: function () { + this.previewHierarhije = { + vklop: false, + ime: '', + index: '', + id: '', + uporabniki: 0, + input: [] + }; + }, + + // Uporabnik je iz predogleda izbral željeno hierarhijo, ki se bo aktivirala + aktivirajIzbranoHierarhijo: function () { + this.uporabiShranjenoHierarhijo(this.previewHierarhije.index, this.previewHierarhije.id, this.previewHierarhije.uporabniki); + }, + + posodobiHierarhijo: function (index, id) { + var that = this; + + // dodamo active class + this.imeHierarhije.index = index; + + // Če urejamo hierarhijo potem nič ne urejamo sql baze in klik na ime hierarhije omogoči samo preimenovanje in brisanje + if (this.imeHierarhije.urejanje) + return ''; + + // preimenujemo Hierarhijo + this.imeHierarhije.aktivna = this.shranjenaHierarhija[index].ime; + + // // shranimo ime hierarhije in trenuten id izbrane hierarhije v opcije + // this.getSaveOptions('aktivna_hierarhija_ime', this.imeHierarhije.aktivna); + // this.getSaveOptions('srv_hierarhija_shrani_id', id); + + // Kadar prikličemo hierarhijo, ki je prazna, smo izbrali samo ime potem nič ne vrnemo, vse postavimo na nič + if (this.shranjenaHierarhija[index].hierarhija == '') { + this.inputNivo = []; + this.novaHierarhijaSt = 1; + // naloži šifrante, ker imamo šifrante v JSON.stringfy moramo anredite revers v object in če je object potem samo zapišemo v spremenljivko, drugače pa delamo reverse + } else if ((index < 2 || id === 'default') && typeof this.shranjenaHierarhija[index].hierarhija == 'object') { + this.inputNivo = this.shranjenaHierarhija[index].hierarhija; + } else { + this.inputNivo = JSON.parse(this.shranjenaHierarhija[index].hierarhija); + } + + + // prevzeto ne kopira uporabnikov, samo če pote če potrdi iz seznama + this.kopirajTudiUporabnike = 0; + + // pošljemo ravni in nivoje ter shranimo vse potrebno v + if (this.uporabnikiZaKopijo == 1) { + setTimeout(function () { + swal({ + title: "Opozorilo!", + text: "Ali želite kopirati tudi strukturo uporabnikov?", + type: "info", + showCancelButton: true, + cancelButtonText: "Ne", + confirmButtonText: "Da, tudi uporabnike." + }, function (shrani) { + + if (shrani) + that.kopirajTudiUporabnike = 1; + + Vue.nextTick(function () { + that.$http.post('ajax.php?anketa=' + that.anketaId + '&t=hierarhija-ajax&a=obnovi-hierarhijo', { + hierarhija: that.inputNivo, + uporabniki: that.kopirajTudiUporabnike, + id: id + }).success(function (data) { + that.inputNivo = []; + + if (data != 'undefined' && data != '' && data.length > 0) + $.each(data, function (index, value) { + that.inputNivo.push(value); + }); + + that.shraniTrenutnoHierarhijo(); + + // posodobimo število nivojev + that.pridobiStNivojev(); + + }); + }); + + }); + }, 100); + } else { + Vue.nextTick(function () { + that.$http.post('ajax.php?anketa=' + that.anketaId + '&t=hierarhija-ajax&a=obnovi-hierarhijo', { + hierarhija: that.inputNivo, + uporabniki: that.kopirajTudiUporabnike, + id: id + }).success(function (data) { + that.inputNivo = []; + + if (data != 'undefined' && data != '' && data.length > 0) + $.each(data, function (index, value) { + that.inputNivo.push(value); + }); + + that.shraniTrenutnoHierarhijo(); + + // posodobimo število nivojev + that.pridobiStNivojev(); + + }); + }); + + } + + }, + + // shrani ali pridobi opcije iz baze + getSaveOptions: function (option, value, response) { + if (typeof value != 'undefined' && typeof response == 'undefined') + response = 'save'; + + if (typeof value == 'undefined' && typeof response == 'undefined') + response = 'get'; + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=hierarhija-options&m=' + response, { + option_name: option || '', + option_value: value || '' + }, function (data) { + return data; + }); + }, + + // ko zapustimo urejanje/preimenovanje potem spremenimo tudi dom + preimenujHierarhijo: function (index, id) { + var ime = $.trim($('.h-ime-shranjeno.editable-hierarhija').html()); + + //odstranimo html tag + var div = document.createElement('div'); + div.innerHTML = ime; + ime = $.trim(div.innerText); + + var ime_dom = this.shranjenaHierarhija[index].ime; + + // V kolikor je bila preimenova aktivna anketa moramo tudi v bazi med opcijami preimenovati + if (this.imeHierarhije.aktivna == ime_dom) + this.getSaveOptions('aktivna_hierarhija_ime', ime); + + // v kolikor je zbrisano celotno ime ponovno damo na default + if (id == 'default' || ime.length == 0 || this.shranjenaHierarhija[index].ime.length == 0) + return $('.h-ime-shranjeno.active').html(ime_dom); + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=preimenuj-hierarhijo', { + id: id, + ime: ime + }, function () { + //v kolikor smo v bazi uspešno preimenovali potem tudi v naši spremenljivki preimenujemo + this.shranjenaHierarhija[index].ime = ime; + }); + }, + + izbrisiShranjenoHierarhijo: function (index, id) { + if (id == 'default' || id == this.imeHierarhije.id) + return ''; + + // post request, ki izbriše iz baze + var obvestilo = this.deleteHierarhijaShrani(id); + + if (obvestilo) + this.shranjenaHierarhija.splice(index, 1); + + }, + + // Uvoz in izviz hierarhije v CSV + uvozHierarhije: function () { + $('#fade').fadeTo('slow', 1); + $('#vrednost_edit').html('').fadeIn('slow').load('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=uvozi-hierarhijo', function () { + + //Vklopi nice input file + $("input[type=file]").nicefileinput({ + label: 'Poišči datoteko...' + }); + + }); + }, + + izvozHierarhije: function () { + this.$http.get('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=izvoz-hierarhije'); + }, + + // pridobimo vse nastavitve iz baze + vseNastavitveIzBaze: function () { + var that = this; + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=hierarhija-options&m=get').success(function (data) { + + $.each(data, function (index, value) { + if (index == 'aktivna_hierarhija_ime') { + // za prikaz naslova hierarhije + that.imeHierarhije.aktivna = value; + + // polje za shranjevanje, da shrani v enako hierarhijo + that.imeHierarhije.shrani = value; + + // Če imamo ime hierarhije potem nimamo predogleda + if (value.length > 0) + that.previewHierarhije.vklop = false; + + // that.imeHierarhije.index = (that.shranjenaHierarhija.length - 1); + } + + if (index == 'admin_skrij_urejanje_nivojev') + that.vklopiUrejanje = (value == 'true' ? true : false); + + if (index == 'srv_hierarhija_shrani_id') { + // na levi strani izbere ustrezno hierarhijo, moramo nastavit timeout, ker drugače ne pridobimo vseh hierarhij + setTimeout(function () { + Vue.nextTick(function () { + $.each(that.shranjenaHierarhija, function (i, val) { + if (val.id == value) { + that.imeHierarhije.index = i; + that.imeHierarhije.id = value; + } + }); + }); + }, 100); + } + + // V kolikor imamo vpisano struktur + if (index == 'vpisana_struktura') + that.vpisanaStruktura = value; + + }); + + }); + }, + + posodobiOpcijeHierarhije: function () { + if (this.imeHierarhije.urejanje) + this.vseNastavitveIzBaze(); + }, + + /** + * Če smo hierarhijo prvič aktivirali potem ponudi popup za vpis imena in shrani ime hierarhije v bazo + */ + hierarhijoSmoAktivirali: function () { + var that = this; + + if (this.inputNivo.length == 0 && this.imeHierarhije.aktivna == '' && this.imeHierarhije.shrani == '') + swal({ + title: "Nova hierarhija", + text: "Vpišite ime nove hierarhije:", + type: "input", + animation: "slide-from-top", + closeOnConfirm: false, + closeOnCancel: true, + inputPlaceholder: "Primer: Hierarhija šola" + }, function (inputValue) { + if (inputValue === false) return false; + + if (inputValue === "") { + swal.showInputError("Ime hierarhije je obvezno!"); + return false + } + + // Ime hierarhije shranimo v vue spremenljivko + that.getSaveOptions('aktivna_hierarhija_ime', inputValue); + that.imeHierarhije.shrani = inputValue; + that.imeHierarhije.aktivna = inputValue; + + swal.close(); + }); + }, + + + /** + * Pobriše shranjeno hierarhijo v tabeli srv_hierarhija_shrani + */ + deleteHierarhijaShrani: function (id) { + var id = id || 0; + var obvestilo = false; + + if (id == 0) + return console.log('brez Id-ja'); + + // post request, ki izbriše iz baze + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=izbrisi-hierarhijo', { + id: id + }).then(function (response) { + if (response.data == 'success') + obvestilo = true; + + return obvestilo; + }); + + return obvestilo; + }, + + /** + * Dodaj komentar k hierarhiji + */ + dodajKomentar: function () { + dodajKomentar(); + }, + + /** + * Odpre popup za nalaganje logotipa + */ + logoUpload: function () { + uploadLogo(); + } + + } + + }); + } + + + if (document.querySelector('#vue-gradnja-hierarhije')) { + gradnjaHierarhijeApp = new Vue({ + el: '#vue-gradnja-hierarhije', + data: { + anketaId: $('#srv_meta_anketa_id').val(), + pageLoadComplete: false, + vpisanaStruktura: false, // pove nam, če je uporabnik že vpisal kakšno strukturo, da s tem zaklenemo vpis novih ravni (obstoječa struktura ne bi bila ok) + izbran: { + skrij: 1, + sifrant: [], + strukturaId: [], + sifrantPodatki: [], + parent: [], + }, + // tukaj vpišemo št. nivoja, ki je key in nato sifrante + podatki: [], + + // V kolikor uporabnik ni superadmin/admin potem podtke, ki so nad njegovim ali enake njegovemu nivoju pridobimo kot fiksne in se jih ne da spreminjati + fiksniPodatki: [], + + // pri vpisu oseb na ustrezni nivo + osebe: { + prikazi: false, + nivo: 0, + vpisane: [], // key je številka nivoja, in potem notri imam object s podatki o osebah + nove: [], // key je številka nivoja in nato notri object s podatki o osebah + textarea: '', + show: [] // boolean, glede na nivo, da pokaže uporabnike pod šifranti + }, + + // podatki o uporabniku, ki ni admin + user: { + struktura: [], + uporabnik: [], + dropdown: [], + selected: '' + }, + + // vpis emaila preko textarea + email: { + napake: [], + opozorilo: false + }, + + elektronskiNaslovi: [{ + email: "prvi@email.si", + ime: "Prvo Ime" + }, { + email: "drugi@email.si", + ime: "Drugi email" + }], + + }, + watch: { + 'user.selected': function (val) { + + if (typeof val !== 'undefined' && val !== null && val.length > 0) + this.vpisemoUporabnikaIzDropDownMenija(); + + } + }, + computed: {}, + + ready: function () { + var that = this; + + // Pridobimo omejitve uporabnika + this.preveriNivoInPraviceUporabnika(); + + // Pridobimo vse nivoje in šifrante neglede na status uporabnika + this.naloziVseNivojeInSifrante(); + + // Ko je celoten JS in spletna stran naložena potem spremenimo select2 change event, da deluje + document.onreadystatechange = function () { + + // Ko je stran čisto naložena izvedemo kodo + if (document.readyState === 'complete') { + + // potrebno, ker drugače v FF in IE stvar ne deluje, da je zakasnitev 300ms in se počaka potem na naslednjo spremembo + setTimeout(function () { + Vue.nextTick(function () { + + // Prikažemo prvi nivo + that.pageLoadComplete = true; + + // Select 2 event + $(".select2").on('change', function () { + + // uogtotovimo, kje smo spremenili podatek + var st = that.izbran.sifrant.length; + var level = $(this).attr('data-level'); + + that.izbran.sifrant.forEach(function (value, key) { + if (key > level) { + for (var i = key; i < st; i++) { + that.izbran.sifrantPodatki.$set(i, null); + that.izbran.sifrant[i] = ""; + } + } + }); + + // Zanka po vseh nivojih, kateri so vpisani + that.izbran.sifrant.forEach(function (value, key) { + if (typeof value != 'undefined' && value.length > 0 && !isNaN(value) && that.izbran.sifrant[key].length > 0) { + that.preveriSifrantZaIzbranNivo(value, key) + } + }); + + }); + }); + }, 600); + + // Dodamo še možnost helpa v kolikor obstaja + load_help(); + } + } + + // Pridobi, če so že vpisani šifranti + this.pridobiNastavitveCeJeVpisanaStruktura(); + + // Pridobimo uporabnikeza dropdown meni user + this.pridobiUporabnikeZaDropdownList(); + + }, + + methods: { + // Preverimo, če je uporabnik admin ali je uporabnik s pravicami na določenem nivoju + preveriNivoInPraviceUporabnika: function () { + var that = this; + + // preverimo pravico in pridobimo že vpisano strukturo nad uporabikom + this.$http.get('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=gradnja-hierarhije&m=get-user-level', function (data) { + // pridobimo polji (uporabnik, struktura), v kolikor je admin ni podatka o strukturi + that.user = data; + + if (data.uporabnik != 1 && data.struktura) { + // ID strukture, ki je fiksna zapišemo v spremenljivko + data.struktura.forEach(function (val) { + that.izbran.strukturaId.$set(val.izbrani.level, val.izbrani.id); + + // Že izbrano strukturo vpišemo v sifrantiPodatki, kjer se dodajajo tudi še na novo dodani podatki + that.izbran.sifrantPodatki.$set(val.izbrani.level, val.izbrani); + }); + + } + }); + }, + + // Naložimo vse nivoje in pripadajoče šifrante + naloziVseNivojeInSifrante: function () { + var that = this; + + // pridobi šifrante za ustrezni nivo, če ni nič izbrano potem vedno pridobi šifrante za prvi nivo + this.$http.get('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=gradnja-hierarhije&m=get-sifranti', function (data) { + data.nivoji.forEach(function (val) { + val.sifranti = []; + + // vpišemo nivo in pdoatke nivoja + that.podatki.push(val); + + // pole $(this.el).on('change', )g nivoja vpišemo še podatke o šifrantih + data.sifranti.forEach(function (options) { + // tukaj zapišemo šifrante na ustrezen nivo, edino tukaj upoštevamo, da številka nivoja je za 1 manšja, ker če 0 pustimo potem pri prikazuso težave, nivo 1 je element 0 + if (val.level == options.level) + that.podatki[(val.level - 1)].sifranti.push(options); + }); + }); + + // Max število nivojev za validacije + that.podatki.maxLevel = data.maxLevel; + }); + }, + + // Preveri, če je šifrant za izbran nivo že vpisan v podatkovno bazo + preveriSifrantZaIzbranNivo: function (sifrant, nivo) { + var that = this; + // Parent vedno vzamemo id elementa, ki je vpisan en nivo prej + var parent_id = (this.izbran.sifrantPodatki[nivo - 1] ? this.izbran.sifrantPodatki[nivo - 1].id : null); + + Vue.nextTick(function () { + // var parent_id2 = (that.izbran.sifrantPodatki[nivo - 1] ? that.izbran.sifrantPodatki[nivo - 1].id : null); + + that.$http.post('ajax.php?anketa=' + that.anketaId + '&t=hierarhija-ajax&a=gradnja-hierarhije&m=preveri-sifrant-za-nivo', { + level: nivo, + hierarhija_sifranti_id: sifrant, + parent_id: parent_id + }).then(function (i) { + if (i.data == 0) { + // V kolikor omenjen id šifranta še ne obstaja v strukturi potem shranimo v polje novSifrant, da ga pri sumbitu upoštevamo + that.izbran.sifrantPodatki.$set(nivo, { + id: null, + level: nivo, + hierarhija_sifranti_id: sifrant, + hierarhija_ravni_id: that.podatki[nivo - 1].id, + parent_id: parent_id + }); + } else { + // shranimo na ključ, kjer je nivo celo polje + that.izbran.sifrantPodatki.$set(i.data.level, i.data); + } + + // Preverimo, za nivo, če lahko prikažemo uporabnike + that.prikaziUporabnike(nivo); + }); + // DOM updated + }); + + }, + + // Potrdimo vpis šifrantov, ki smo jih izbrali + submitSifrante: function () { + var that = this; + + // Preverimo, če je bil dodan kak nov elemepridobiIdSifrantovInUporabnikent + var prestejNove = 0; + this.izbran.sifrantPodatki.forEach(function (val) { + if (val != null && val.id == null && !isNaN(val.id)) + prestejNove++; + }); + + if (prestejNove == 0) + return swal({ + title: "Opozorilo!", + text: "
Vse vrstice so Ĺľe prenesene v hierarhijo:" + + "
  • Bodisi vnesite novega uÄŤitelja in njegov predmet.
  • " + + "
  • Bodisi zakljuÄŤite z vnosom in s klikom na gumb NAPREJ (spdaj desno) aktivirajte hierarhijo.
", + type: "error", + html: true + }); + + var st = this.podatki.maxLevel; + // Če je vnešen zadnji nivo, object ni null in ni vpisanih oseb, ker na zadnjem nivo morajo biti vpisane osebe + if (that.izbran.sifrantPodatki[st] != null && (typeof this.osebe.nove[st] == 'undefined' || this.osebe.nove[st].length == 0)) + return swal({ + title: "Opozorilo!", + text: "Na zadnjem nivoju morate obvezno vpisati elektronski naslov osebe.", + type: "error" + }); + + // Izpišemo opozorilo, če uporabnik ni vnesel zadnjega nivoja + if (that.izbran.sifrantPodatki[st] == null) + swal({ + title: "Opozorilo!", + text: "Niste vpisali zadnjega nivoja.", + type: "warning", + timer: 2000 + }); + + // Posredujemo podatke za shranjevanje + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=gradnja-hierarhije&m=post-struktura', { + vnos: that.izbran.sifrantPodatki, + osebe: that.osebe.nove + }).then(function () { + //Tukaj moramo osvežiti vse šifrante, v dataTables in JsTree, omenjeni funkciji sta v custom.js - splošni jquery + tabela.ajax.reload(null, false); + jstree_json_data(that.anketaId, 1); + + // Če je bil izdan zadnji nivo od vseh mogočih potem odstranimo element izbire iz zadnjega nivoja + if (typeof that.izbran.sifrant[that.podatki.maxLevel] != 'undefined' && that.izbran.sifrant[that.podatki.maxLevel].length > 0) { + // Zadnji nivo odstranimo iz select2 izbire + that.izbran.sifrant.splice(that.podatki.maxLevel, 1); + + // Izbrišemo tudi vse podatke o izbranem elementu iz DOM-a + that.izbran.sifrantPodatki.splice(that.podatki.maxLevel, 1); + + //postavimo spremenljivko na true, da prikaže drugačen tekst pri navodilih + $('.srv_hierarchy_user_help').hide(); + $('.srv_hierarchy_user_help_sifrant_vnesen').show(); + } + + // Osveži podatke o vseh šifrantih, ki so izbrani in so bili na novo dodani + that.preveriBazoZaSifrant(null, 1); + + // Polje z na novo dodanimi osebami se izprazni + that.osebe.nove = []; + + //Odstrani besedilo Uporabnik/i iz zadnjega polja, ker ga še tako odstranimo + that.osebe.show.$set(st, false); + + // Zapišemo spremembo, da je struktura vnešena + that.aliJeStrukturaVnesena(); + + // Shanimo celotno strukturo v string in srv_hierarhija_shrani + that.shraniUporabnikeNaHierarhijo(); + + }); + }, + + // Klik na ikono osebe, prikaže spodaj opcijo za vpis oseb + prikaziVnosOseb: function (level) { + // V kolikor kliknemo na isto ikono 2x potem uporabimo toggle opcijo + if (level == this.osebe.nivo) + return this.osebe.prikazi = !this.osebe.prikazi; + + this.osebe.prikazi = true; + return this.osebe.nivo = level; + }, + + vpisemoUporabnikaIzDropDownMenija: function () { + + this.osebe.nove[this.osebe.nivo] = [this.user.selected.split(',')]; + + // Prikažemo polje z uporabniki, ki so bili na novo dodani + this.prikaziUporabnike(this.osebe.nivo); + + // Tekstovno polje spraznimo in ga skrijemo + this.user.selected = null; + this.osebe.prikazi = false; + }, + + vpisOsebNaNivoTextarea: function () { + var that = this; + + // preverimo email in vrnemo napako, če obstaja + if (this.preveriPravilnostEmaila()) + return this.email.opozorilo; + + if (typeof this.user.selected !== 'undefined' && this.user.selected && this.user.selected.length > 0) { + var vpis = [this.user.selected]; + } else { + // uporabnike razdelimo glede na \n in jih shranimo v polje + var vpis = this.osebe.textarea.split('\n'); + } + + + this.osebe.nove.$set(that.osebe.nivo, []); + // ločimo še vejice + $.each(vpis, function (key, val) { + var loci = val.split(','); + + // če je email večji od 4 znakov, ga shranimo kot novega drugače ne + if (loci[0].length > 4) { + that.osebe.nove[that.osebe.nivo].push(loci); + } + }); + + // Prikažemo polje z uporabniki, ki so bili na novo dodani + this.prikaziUporabnike(this.osebe.nivo); + + // Tekstovno polje spraznimo in ga skrijemo + this.osebe.textarea = ''; + this.osebe.prikazi = false; + this.user.selected = ''; + }, + + // Preveri, če string ustreza pravilnemu zapis emaila + preveriEmail: function (email) { + var EMAIL_REGEX = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + + return EMAIL_REGEX.test(email); + }, + + // Preverimo pravilnost vpisanega emaila in vržemo napako + preveriPravilnostEmaila: function () { + var that = this; + + // uporabnike razdelimo glede na \n in jih shranimo v polje + var vpis = this.osebe.textarea.split('\n'); + + // vse napake postavimo na 0 + this.email.napake = []; + + // ločimo še vejice + $.each(vpis, function (key, val) { + var loci = val.split(','); + + if (!that.preveriEmail(loci[0]) && loci[0].length > 0) { + that.email.napake.push({ + naslov: loci[0], + vrstica: (key + 1) + }); + } + }); + + // v kolikor so v poju zapisani napačni email naslovi potem prikažemo opozorilo + if (this.email.napake.length > 0) + return this.email.opozorilo = true; + }, + + // Preverimo, če uporabniki so že vpisani v bazi in jih prikažemo ali če so bili uporabniki na novo dodani + prikaziUporabnike: function (level) { + // Uporabniki so bili na novo dodani na nivo + if (this.osebe.nove[level] && this.osebe.nove[level].length > 0) + return this.osebe.show.$set(level, true); + + // imamo uporabni v SQL bazi + if (this.izbran.sifrantPodatki[level] && this.izbran.sifrantPodatki[level].uporabniki) + return this.osebe.show.$set(level, true); + + return this.osebe.show.$set(level, false); + }, + + // Izbriši uporabnika iz this.osebe.nove + izbrisiUporabnika: function (level) { + return this.osebe.nove.splice(level, 1); + }, + + // Izbriši uporabnika iz Sql baze, ker je že shranjen + izbrisiUporabnikaIzBaze: function (userId, index, level) { + var that = this; + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=brisi&m=uporabnika', { + uporabnik_id: userId, + struktura_id: this.izbran.sifrantPodatki[level].id + }).then(function () { + that.izbran.sifrantPodatki[level].uporabniki.splice(index, 1); + }); + + }, + + // Preverimo v SQL-u, da dobimo za vpisane šifrante ID in parent_id + // Rekurzivna funkcija, ki ob sumbitu preveri v bazi in vsem še obstoječim šifrantom doda id in parent_id + preveriBazoZaSifrant: function (parent_id, key) { + var that = this; + + // Polje z omenjenim elementom mora obstajati, drugače smo prišli do konca + if (this.izbran.sifrantPodatki[key]) { + + // V kolikor element že ima parent id, potem tega elementa ne preverjamo in gremo preverit naslednji element + // Prvi element vedno preverimo (key == 1) + if (key > 1 && this.izbran.sifrantPodatki[key] && this.izbran.sifrantPodatki[key].parent_id != 'null') { + var st = key + 1; + this.preveriBazoZaSifrant(this.izbran.sifrantPodatki[key].id, st); + } + + // AJAX request, da preveri podatke o elementu in pridobi parent_id + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=gradnja-hierarhije&m=preveri-sifrant-za-nivo', { + level: this.izbran.sifrantPodatki[key].level, + hierarhija_sifranti_id: this.izbran.sifrantPodatki[key].hierarhija_sifranti_id, + parent_id: parent_id + }).then(function (i) { + + // shranimo na ključ, kjer je nivo celo polje + that.izbran.sifrantPodatki.$set(i.data.level, i.data); + + // V kolikor vsebuje podatke o uporabnikih potem te rudi prikaže + that.prikaziUporabnike(i.data.level); + + // Pridobimo številko naslednjega elementa + var st = 1 + Number(i.data.level); + + // Pokličemo rekurzivno funkcijo, da kjer je paren_id, id trenutnega elementa + that.preveriBazoZaSifrant(i.data.id, st); + }); + } + + return 0; + }, + + // pridobimo vse nastavitve iz baze + pridobiNastavitveCeJeVpisanaStruktura: function () { + var that = this; + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=hierarhija-options&m=get').success(function (data) { + + if (data.length == 0) + return that.vpisanaStruktura = false; + + $.each(data, function (index, value) { + if (index == 'vpisana_struktura') + that.vpisanaStruktura = value; + }); + }); + }, + + // Preveri, če obstaja med opcijami vpisana_struktura, drugače jo vnese + aliJeStrukturaVnesena: function () { + if (this.vpisanaStruktura) + return this.vpisanaStruktura; + + // V kolikor gre za vpis v bazo + hierarhijaApp.getSaveOptions('vpisana_struktura', 1); + this.vpisanaStruktura = 1; + }, + + // Preverimo, je izbran element za sledeči nivo, če je nivo večje kot zadnje nivo in če na zadnjem nivoju še ni vpisanega uporabnika potem dovoli prikaz ikone za vnos uporabnikov + aliPrikazemIkonoZaDodajanjeUporabnikov: function (level) { + var level = level || false; + + if (!level) + return false; + + if (this.izbran.sifrant[level] > 0 && + (level < this.podatki.maxLevel || + level == this.podatki.maxLevel && + this.izbran.sifrantPodatki[level] && + !this.izbran.sifrantPodatki[level].hasOwnProperty('uporabniki')) + ) + return true; + + return false; + }, + + /* + * Pridobimo vse ID-je že vpisanih šifrantov skupaj z uporabniki + * izhajamo pa iz zadnjega ID-ja + */ + pridobiIdSifrantovInUporabnike: function (idLast) { + var that = this; + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=gradnja-hierarhije&m=kopiranje-vrstice', { + id: idLast + }).then(function (response) { + // response ok in imamo objekt + if (response.status == 200 && response.data.length > 0) { + response.data.forEach(function (val) { + that.izbran.sifrantPodatki.$set(val.izbrani.level, val.izbrani); + $('option[value="' + val.izbrani.hierarhija_sifranti_id + '"]').parent().val(val.izbrani.hierarhija_sifranti_id).trigger('change'); + }); + + $(window).scrollTop(0); + } + }); + + }, + + /** + * Shranimo celotno strukturo z uporabniki v srv_hierarhija_shrani + */ + shraniUporabnikeNaHierarhijo: function () { + + this.$http.post('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=shrani-strukturo-hierarhije', { + id: this.anketaId, + shrani: 1 + }); + }, + + /** + * Pridobimo uporabnike, ki jih imamo shranjene v bazi za drop down list + */ + pridobiUporabnikeZaDropdownList: function () { + var that = this; + + this.$http.get('ajax.php?anketa=' + this.anketaId + '&t=hierarhija-ajax&a=gradnja-hierarhije&m=import-user&s=getAll').success(function (data) { + that.user.dropdown = data; + }); + }, + + + /**************** funkcije, ki preveri true/false **************/ + preveriCejeEmailZeVnesenVbazoZaUcitelja: function (maxLevel) { + var maxLevel = maxLevel || 0; + + if(maxLevel === 0 || this.izbran.sifrantPodatki[maxLevel] !== null) + return false; + + if(this.izbran.sifrantPodatki[maxLevel] !== null && this.izbran.sifrantPodatki[maxLevel].uporabniki.length > 0) + return true; + + return false; + }, + + prikaziJsKoSeJeCelaSpletnaStranZeNalozila: function(level){ + var level = level || 0; + + if((level == 1 && this.pageLoadComplete) || (this.izbran.sifrant[level-1] > 0 && this.izbran.sifrant[level-1].length > 0)) + return true; + + return false; + }, + + prikaziSelectZaZadnjiNivo: function(level) { + var level = level || 0; + this.osebe.nivo = level; + + var prikazi = this.aliPrikazemIkonoZaDodajanjeUporabnikov(level); + + if(level === this.podatki.maxLevel && this.user.dropdown && prikazi) + return true; + + return false; + }, + + }, + }); + } + + if (document.querySelector('#vue-custom')) { + new Vue({ + el: '#vue-custom', + data: { + anketaId: $('#srv_meta_anketa_id').val(), + managerOznaciVse: true, + statusTabela: '', + supersifra: [], + }, + methods: { + managerZamenjajOznaci: function () { + return this.managerOznaciVse = !this.managerOznaciVse; + }, + emailObvestiloZaManagerje: function () { + event.preventDefault(); + + var polje = []; + $('[name="manager"]:checked').each(function () { + polje.push($(this).val()); + }); + + //Poljšemo podatke + $.post("ajax.php?anketa=" + this.anketaId + "&t=hierarhija-ajax&a=ostalo&m=obvesti-managerje", { + managerji: polje + }).then(function (response) { + $('[name="manager"]:checked').each(function () { + $(this).hide(); + $(this).parent().prepend(' - '); + }); + + if (response.data == 'success') { + swal({ + title: "Obvestilo poslano!", + text: "Elektronsko sporočilo je bilo uspešno poslano.", + type: "success", + timer: 3000 + }); + } + + }); + + } + } + }); + } +}); + +function izbrisiSifrant(id) { + var anketa_id = $('#srv_meta_anketa_id').val(); + $.post("ajax.php?anketa=" + anketa_id + "&t=hierarhija-ajax&a=izbrisi_sifrant", { + idSifranta: id + }).then(function (response) { + if (response == 1) + return swal({ + title: "Opozorilo!", + text: "Šifrant je že uporabljen in ga ni mogoče izbrisati.", + type: "error", + timer: 3000 + }); + + $('[data-sifrant="' + id + '"]').remove(); + }); +} + +// Pobriše vrstico iz DataTables in odstrani šifrante iz vseh nivojev pri izbiri +function pobrisiVrsticoHierarhije(id) { + gradnjaHierarhijeApp.$set('izbran.sifrant', []); + gradnjaHierarhijeApp.$set('izbran.sifrantPodatki', []); + + // V kolikor gre za uporabnika na nižjem nivoju potem moramo ponovno pridobiti strukturo in vse podatke o fiksnih nivojih + gradnjaHierarhijeApp.preveriNivoInPraviceUporabnika(); + + brisiVrsticoHierarhije(id, 1); +} \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/js/vendor/custom.js b/admin/survey/modules/mod_hierarhija/js/vendor/custom.js new file mode 100644 index 0000000..dc64b58 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/js/vendor/custom.js @@ -0,0 +1,832 @@ +/************************************************ + DOCUMENT READY + ************************************************/ +var tabela = null; +var anketa_id = 0; + +$(document).ready(function () { + // pridobimo ID ankete, ko je dokument naložen + anketa_id = $('#srv_meta_anketa_id').val(); + + //vklopljeno iskanje za vse select box elemente + $('.h-selected select.hierarhija-select').chosen(); + $('.h-selected.hierarhija-select').chosen(); + + //Vklopi nice input file + $("input[type=file]").nicefileinput({ + label: 'Poišči datoteko...' + }); + + + //Data Tables konfiguracija za vpis šifrantov + if ($('#vpis-sifrantov-admin-tabela').length > 0) { + tabela = $('#vpis-sifrantov-admin-tabela').DataTable({ + "processing": true, + "lengthMenu": [[20, 40, 100, 200, -1], [20, 40, 100, 200, "vse"]], + "ajax": 'ajax.php?anketa=' + anketa_id + '&t=hierarhija-ajax&a=get-datatables-data', + "drawCallback": function (settings) { + if (tabela.page.info().recordsTotal == 0) { + $('#div-datatables').hide(); + $('#hierarhija-jstree-ime').hide(); + $('#admin_hierarhija_jstree').hide(); + } else { + $('#div-datatables').show(); + $('#hierarhija-jstree-ime').show(); + $('#admin_hierarhija_jstree').show(); + } + }, + "createdRow": function (row, data, rowIndex) { + // gremo po vseh td elementih + $.each($('td', row), function (colIndex) { + + // SQL query nam vrne objek, ki ga uporabimo za datatables vpis vrstice + if (data[colIndex] && data[colIndex].label) { + // Vsaka celica ima id strukture, ki je potreben za urejanje uporabbnikov za posamezno vrstico + $(this).attr('data-struktura', data[colIndex].id); + + // Vsaka celica ima številko nivoja - level + $(this).attr('data-level', data[colIndex].level); + + // Prikaz podatkov + $(this).html(data[colIndex].label); + } + + }); + }, + "language": { + "url": "modules/mod_hierarhija/js/vendor/datatables-slovenian.json" + } + }); + + + } + + + // datatables za prikaz že vpisanih šifrantov + if ($('#pregled-sifrantov-admin-tabela').length > 0) { + $('#pregled-sifrantov-admin-tabela').DataTable({ + ajax: 'ajax.php?anketa=' + anketa_id + '&t=hierarhija-ajax&a=get-datatables-data&m=1&p=1', + "language": { + "url": "modules/mod_hierarhija/js/vendor/datatables-slovenian.json" + } + }); + } + + + // Klik na ikono za komentar + $('.surveycomment').on('click', function () { + dodajKomentar(); + }); + + // Klik na ikono za upload logo - naloži logotip + $('.logo-upload').on('click', function () { + uploadLogo(); + }); + + // Skrivamo filtrov in vprašanj pri analizah + $('.znak').on('click', function (e) { + var razred = e.currentTarget.className; + + if (razred == 'znak minus') { + $('#div_means_dropdowns').animate('slow').hide(); + $('.minus').hide(); + $('.plus').show(); + } else { + $('#div_means_dropdowns').animate('slow').show(); + $('.plus').hide(); + $('.minus').show(); + } + }); + + // Skrijemo error, ki se je pojavil + $('.error-display').delay(10000).fadeOut('slow'); +}); +// uredi vrstico +// function urediVrsticoHierarhije(id) { +// var anketa_id = $('#anketa_id').val(); +// var el = $('.btn-urejanje-hierarhije[data-id="' + id + '"]').parent().siblings().last(); +// var text = el.html().split(" - "); +// +// // pridobi vse uporabnike, ki so dodani na trenutno hierarhijo +// var opcije = []; +// // $.post("ajax.php?anketa=" + anketa_id + "&t=hierarhija-ajax&a=gradnja-hierarhije&m=get-uporabniki", { +// // id: id +// // }).success(function (data) { +// // if (data == 0) +// // return opcije; +// // +// // // vse emaili dodamo med opcije in polje, ki ga kasneje združimo v string +// // $.each(JSON.parse(data), function (key, val) { +// // opcije.push(''); +// // }); +// // +// // el.html('Izbira: ' + text[0] + '
Uporabniki:').css({display:"block","float":"left",margin:0,padding:"0 5px"}).addClass("NFI-filename NFI"+i),s=a("
").css({overflow:"hidden",position:"relative",display:"block","float":"left","white-space":"nowrap","text-align":"center"}).addClass("NFI-button NFI"+i).attr("disabled",a(t).attr("disabled")).html(e.label);a(t).after(n),a(t).wrap(s),a(".NFI"+i).wrapAll('
'),a(".NFI-wrapper").css({overflow:"auto",display:"inline-block"}),a("#NFI-wrapper-"+i).addClass(a(t).attr("class")),a(t).css({opacity:0,position:"absolute",border:"none",margin:0,padding:0,top:0,right:0,cursor:"pointer",height:"60px"}).addClass("NFI-current"),a(t).on("change",function(){var l=a(t).val();if(e.fullPath)n.val(l);else{var r=l.split(/[/\\]/);n.val(r[r.length-1])}}),a(t).attr("data-styled",!0)}})}}(jQuery); \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/js/vendor/jstree.min.js b/admin/survey/modules/mod_hierarhija/js/vendor/jstree.min.js new file mode 100644 index 0000000..36dd02e --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/js/vendor/jstree.min.js @@ -0,0 +1,6 @@ +/*! jsTree - v3.1.1 - 2015-05-04 - (MIT) */ +!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a,b){"use strict";if(!a.jstree){var c=0,d=!1,e=!1,f=!1,g=[],h=a("script:last").attr("src"),i=window.document,j=i.createElement("LI"),k,l;j.setAttribute("role","treeitem"),k=i.createElement("I"),k.className="jstree-icon jstree-ocl",k.setAttribute("role","presentation"),j.appendChild(k),k=i.createElement("A"),k.className="jstree-anchor",k.setAttribute("href","#"),k.setAttribute("tabindex","-1"),l=i.createElement("I"),l.className="jstree-icon jstree-themeicon",l.setAttribute("role","presentation"),k.appendChild(l),j.appendChild(k),k=l=null,a.jstree={version:"3.1.1",defaults:{plugins:[]},plugins:{},path:h&&-1!==h.indexOf("/")?h.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g},a.jstree.create=function(b,d){var e=new a.jstree.core(++c),f=d;return d=a.extend(!0,{},a.jstree.defaults,d),f&&f.plugins&&(d.plugins=f.plugins),a.each(d.plugins,function(a,b){"core"!==a&&(e=e.plugin(b,d[b]))}),a(b).data("jstree",e),e.init(b,d),e},a.jstree.destroy=function(){a(".jstree:jstree").jstree("destroy"),a(i).off(".jstree")},a.jstree.core=function(a){this._id=a,this._cnt=0,this._wrk=null,this._data={core:{themes:{name:!1,dots:!1,icons:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},a.jstree.reference=function(b){var c=null,d=null;if(!b||!b.id||b.tagName&&b.nodeType||(b=b.id),!d||!d.length)try{d=a(b)}catch(e){}if(!d||!d.length)try{d=a("#"+b.replace(a.jstree.idregex,"\\$&"))}catch(e){}return d&&d.length&&(d=d.closest(".jstree")).length&&(d=d.data("jstree"))?c=d:a(".jstree").each(function(){var d=a(this).data("jstree");return d&&d._model.data[b]?(c=d,!1):void 0}),c},a.fn.jstree=function(c){var d="string"==typeof c,e=Array.prototype.slice.call(arguments,1),f=null;return c!==!0||this.length?(this.each(function(){var g=a.jstree.reference(this),h=d&&g?g[c]:null;return f=d&&h?h.apply(g,e):null,g||d||c!==b&&!a.isPlainObject(c)||a.jstree.create(this,c),(g&&!d||c===!0)&&(f=g||!1),null!==f&&f!==b?!1:void 0}),null!==f&&f!==b?f:this):!1},a.expr[":"].jstree=a.expr.createPseudo(function(c){return function(c){return a(c).hasClass("jstree")&&a(c).data("jstree")!==b}}),a.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:a.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0},a.jstree.core.prototype={plugin:function(b,c){var d=a.jstree.plugins[b];return d?(this._data[b]={},d.prototype=this,new d(c,this)):this},init:function(b,c){this._model={data:{"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this.element=a(b).addClass("jstree jstree-"+this._id),this.settings=c,this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0),this.element.attr("tabindex")||this.element.attr("tabindex","0"),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html(""),this.element.attr("aria-activedescendant","j"+this._id+"_loading"),this._data.core.li_height=this.get_container_ul().children("li").first().height()||24,this.trigger("loading"),this.load_node("#")},destroy:function(a){if(this._wrk)try{window.URL.revokeObjectURL(this._wrk),this._wrk=null}catch(b){}a||this.element.empty(),this.teardown()},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){var b="",c=null,d=0;this.element.on("dblclick.jstree",function(){if(i.selection&&i.selection.empty)i.selection.empty();else if(window.getSelection){var a=window.getSelection();try{a.removeAllRanges(),a.collapse()}catch(b){}}}).on("mousedown.jstree",a.proxy(function(a){a.target===this.element[0]&&(a.preventDefault(),d=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(a){a.preventDefault()}).on("click.jstree",".jstree-ocl",a.proxy(function(a){this.toggle_node(a.target)},this)).on("dblclick.jstree",".jstree-anchor",a.proxy(function(a){this.settings.core.dblclick_toggle&&this.toggle_node(a.target)},this)).on("click.jstree",".jstree-anchor",a.proxy(function(b){b.preventDefault(),b.currentTarget!==i.activeElement&&a(b.currentTarget).focus(),this.activate_node(b.currentTarget,b)},this)).on("keydown.jstree",".jstree-anchor",a.proxy(function(b){if("INPUT"===b.target.tagName)return!0;if(32!==b.which&&13!==b.which&&(b.shiftKey||b.ctrlKey||b.altKey||b.metaKey))return!0;var c=null;switch(this._data.core.rtl&&(37===b.which?b.which=39:39===b.which&&(b.which=37)),b.which){case 32:b.ctrlKey&&(b.type="click",a(b.currentTarget).trigger(b));break;case 13:b.type="click",a(b.currentTarget).trigger(b);break;case 37:b.preventDefault(),this.is_open(b.currentTarget)?this.close_node(b.currentTarget):(c=this.get_parent(b.currentTarget),c&&"#"!==c.id&&this.get_node(c,!0).children(".jstree-anchor").focus());break;case 38:b.preventDefault(),c=this.get_prev_dom(b.currentTarget),c&&c.length&&c.children(".jstree-anchor").focus();break;case 39:b.preventDefault(),this.is_closed(b.currentTarget)?this.open_node(b.currentTarget,function(a){this.get_node(a,!0).children(".jstree-anchor").focus()}):this.is_open(b.currentTarget)&&(c=this.get_node(b.currentTarget,!0).children(".jstree-children")[0],c&&a(this._firstChild(c)).children(".jstree-anchor").focus());break;case 40:b.preventDefault(),c=this.get_next_dom(b.currentTarget),c&&c.length&&c.children(".jstree-anchor").focus();break;case 106:this.open_all();break;case 36:b.preventDefault(),c=this._firstChild(this.get_container_ul()[0]),c&&a(c).children(".jstree-anchor").filter(":visible").focus();break;case 35:b.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().focus()}},this)).on("load_node.jstree",a.proxy(function(b,c){c.status&&("#"!==c.node.id||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(a.proxy(function(){if(this.element&&!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var b=[],c,d;for(c=0,d=this._data.core.selected.length;d>c;c++)b=b.concat(this._model.data[this._data.core.selected[c]].parents);for(b=a.vakata.array_unique(b),c=0,d=b.length;d>c;c++)this.open_node(b[c],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this),0))},this)).on("keypress.jstree",a.proxy(function(d){if("INPUT"===d.target.tagName)return!0;c&&clearTimeout(c),c=setTimeout(function(){b=""},500);var e=String.fromCharCode(d.which).toLowerCase(),f=this.element.find(".jstree-anchor").filter(":visible"),g=f.index(i.activeElement)||0,h=!1;if(b+=e,b.length>1){if(f.slice(g).each(a.proxy(function(c,d){return 0===a(d).text().toLowerCase().indexOf(b)?(a(d).focus(),h=!0,!1):void 0},this)),h)return;if(f.slice(0,g).each(a.proxy(function(c,d){return 0===a(d).text().toLowerCase().indexOf(b)?(a(d).focus(),h=!0,!1):void 0},this)),h)return}if(new RegExp("^"+e+"+$").test(b)){if(f.slice(g+1).each(a.proxy(function(b,c){return a(c).text().toLowerCase().charAt(0)===e?(a(c).focus(),h=!0,!1):void 0},this)),h)return;if(f.slice(0,g+1).each(a.proxy(function(b,c){return a(c).text().toLowerCase().charAt(0)===e?(a(c).focus(),h=!0,!1):void 0},this)),h)return}},this)).on("init.jstree",a.proxy(function(){var a=this.settings.core.themes;this._data.core.themes.dots=a.dots,this._data.core.themes.stripes=a.stripes,this._data.core.themes.icons=a.icons,this.set_theme(a.name||"default",a.url),this.set_theme_variant(a.variant)},this)).on("loading.jstree",a.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]()},this)).on("blur.jstree",".jstree-anchor",a.proxy(function(b){this._data.core.focused=null,a(b.currentTarget).filter(".jstree-hovered").mouseleave(),this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",a.proxy(function(b){var c=this.get_node(b.currentTarget);c&&c.id&&(this._data.core.focused=c.id),this.element.find(".jstree-hovered").not(b.currentTarget).mouseleave(),a(b.currentTarget).mouseenter(),this.element.attr("tabindex","-1")},this)).on("focus.jstree",a.proxy(function(){if(+new Date-d>500&&!this._data.core.focused){d=0;var a=this.get_node(this.element.attr("aria-activedescendant"),!0);a&&a.find("> .jstree-anchor").focus()}},this)).on("mouseenter.jstree",".jstree-anchor",a.proxy(function(a){this.hover_node(a.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",a.proxy(function(a){this.dehover_node(a.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),a(i).off(".jstree-"+this._id)},trigger:function(a,b){b||(b={}),b.instance=this,this.element.triggerHandler(a.replace(".jstree","")+".jstree",b)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(b){var c=this.settings.core.strings;return a.isFunction(c)?c.call(this,b):c&&c[b]?c[b]:b},_firstChild:function(a){a=a?a.firstChild:null;while(null!==a&&1!==a.nodeType)a=a.nextSibling;return a},_nextSibling:function(a){a=a?a.nextSibling:null;while(null!==a&&1!==a.nodeType)a=a.nextSibling;return a},_previousSibling:function(a){a=a?a.previousSibling:null;while(null!==a&&1!==a.nodeType)a=a.previousSibling;return a},get_node:function(b,c){b&&b.id&&(b=b.id);var d;try{if(this._model.data[b])b=this._model.data[b];else if("string"==typeof b&&this._model.data[b.replace(/^#/,"")])b=this._model.data[b.replace(/^#/,"")];else if("string"==typeof b&&(d=a("#"+b.replace(a.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[d.closest(".jstree-node").attr("id")])b=this._model.data[d.closest(".jstree-node").attr("id")];else if((d=a(b,this.element)).length&&this._model.data[d.closest(".jstree-node").attr("id")])b=this._model.data[d.closest(".jstree-node").attr("id")];else{if(!(d=a(b,this.element)).length||!d.hasClass("jstree"))return!1;b=this._model.data["#"]}return c&&(b="#"===b.id?this.element:a("#"+b.id.replace(a.jstree.idregex,"\\$&"),this.element)),b}catch(e){return!1}},get_path:function(a,b,c){if(a=a.parents?a:this.get_node(a),!a||"#"===a.id||!a.parents)return!1;var d,e,f=[];for(f.push(c?a.id:a.text),d=0,e=a.parents.length;e>d;d++)f.push(c?a.parents[d]:this.get_text(a.parents[d]));return f=f.reverse().slice(1),b?f.join(b):f},get_next_dom:function(b,c){var d;if(b=this.get_node(b,!0),b[0]===this.element[0]){d=this._firstChild(this.get_container_ul()[0]);while(d&&0===d.offsetHeight)d=this._nextSibling(d);return d?a(d):!1}if(!b||!b.length)return!1;if(c){d=b[0];do d=this._nextSibling(d);while(d&&0===d.offsetHeight);return d?a(d):!1}if(b.hasClass("jstree-open")){d=this._firstChild(b.children(".jstree-children")[0]);while(d&&0===d.offsetHeight)d=this._nextSibling(d);if(null!==d)return a(d)}d=b[0];do d=this._nextSibling(d);while(d&&0===d.offsetHeight);return null!==d?a(d):b.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first()},get_prev_dom:function(b,c){var d;if(b=this.get_node(b,!0),b[0]===this.element[0]){d=this.get_container_ul()[0].lastChild;while(d&&0===d.offsetHeight)d=this._previousSibling(d);return d?a(d):!1}if(!b||!b.length)return!1;if(c){d=b[0];do d=this._previousSibling(d);while(d&&0===d.offsetHeight);return d?a(d):!1}d=b[0];do d=this._previousSibling(d);while(d&&0===d.offsetHeight);if(null!==d){b=a(d);while(b.hasClass("jstree-open"))b=b.children(".jstree-children").first().children(".jstree-node:visible:last");return b}return d=b[0].parentNode.parentNode,d&&d.className&&-1!==d.className.indexOf("jstree-node")?a(d):!1},get_parent:function(a){return a=this.get_node(a),a&&"#"!==a.id?a.parent:!1},get_children_dom:function(a){return a=this.get_node(a,!0),a[0]===this.element[0]?this.get_container_ul().children(".jstree-node"):a&&a.length?a.children(".jstree-children").children(".jstree-node"):!1},is_parent:function(a){return a=this.get_node(a),a&&(a.state.loaded===!1||a.children.length>0)},is_loaded:function(a){return a=this.get_node(a),a&&a.state.loaded},is_loading:function(a){return a=this.get_node(a),a&&a.state&&a.state.loading},is_open:function(a){return a=this.get_node(a),a&&a.state.opened},is_closed:function(a){return a=this.get_node(a),a&&this.is_parent(a)&&!a.state.opened},is_leaf:function(a){return!this.is_parent(a)},load_node:function(b,c){var d,e,f,g,h;if(a.isArray(b))return this._load_nodes(b.slice(),c),!0;if(b=this.get_node(b),!b)return c&&c.call(this,b,!1),!1;if(b.state.loaded){for(b.state.loaded=!1,d=0,e=b.children_d.length;e>d;d++){for(f=0,g=b.parents.length;g>f;f++)this._model.data[b.parents[f]].children_d=a.vakata.array_remove_item(this._model.data[b.parents[f]].children_d,b.children_d[d]);this._model.data[b.children_d[d]].state.selected&&(h=!0,this._data.core.selected=a.vakata.array_remove_item(this._data.core.selected,b.children_d[d])),delete this._model.data[b.children_d[d]]}b.children=[],b.children_d=[],h&&this.trigger("changed",{action:"load_node",node:b,selected:this._data.core.selected})}return b.state.failed=!1,b.state.loading=!0,this.get_node(b,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(b,a.proxy(function(a){b=this._model.data[b.id],b.state.loading=!1,b.state.loaded=a,b.state.failed=!b.state.loaded;var d=this.get_node(b,!0);b.state.loaded&&!b.children.length&&d&&d.length&&!d.hasClass("jstree-leaf")&&d.removeClass("jstree-closed jstree-open").addClass("jstree-leaf"),d.removeClass("jstree-loading").attr("aria-busy",!1),this.trigger("load_node",{node:b,status:a}),c&&c.call(this,b,a)},this)),!0},_load_nodes:function(a,b,c){var d=!0,e=function(){this._load_nodes(a,b,!0)},f=this._model.data,g,h,i=[];for(g=0,h=a.length;h>g;g++)!f[a[g]]||(f[a[g]].state.loaded||f[a[g]].state.failed)&&c||(this.is_loading(a[g])||this.load_node(a[g],e),d=!1);if(d){for(g=0,h=a.length;h>g;g++)f[a[g]]&&f[a[g]].state.loaded&&i.push(a[g]);b&&!b.done&&(b.call(this,i),b.done=!0)}},load_all:function(a,b){if(a||(a="#"),a=this.get_node(a),!a)return!1;var c=[],d=this._model.data,e=d[a.id].children_d,f,g;for(a.state&&!a.state.loaded&&c.push(a.id),f=0,g=e.length;g>f;f++)d[e[f]]&&d[e[f]].state&&!d[e[f]].state.loaded&&c.push(e[f]);c.length?this._load_nodes(c,function(){this.load_all(a,b)}):(b&&b.call(this,a),this.trigger("load_all",{node:a}))},_load_node:function(b,c){var d=this.settings.core.data,e;return d?a.isFunction(d)?d.call(this,b,a.proxy(function(d){d===!1&&c.call(this,!1),this["string"==typeof d?"_append_html_data":"_append_json_data"](b,"string"==typeof d?a(a.parseHTML(d)).filter(function(){return 3!==this.nodeType}):d,function(a){c.call(this,a)})},this)):"object"==typeof d?d.url?(d=a.extend(!0,{},d),a.isFunction(d.url)&&(d.url=d.url.call(this,b)),a.isFunction(d.data)&&(d.data=d.data.call(this,b)),a.ajax(d).done(a.proxy(function(d,e,f){var g=f.getResponseHeader("Content-Type");return g&&-1!==g.indexOf("json")||"object"==typeof d?this._append_json_data(b,d,function(a){c.call(this,a)}):g&&-1!==g.indexOf("html")||"string"==typeof d?this._append_html_data(b,a(a.parseHTML(d)).filter(function(){return 3!==this.nodeType}),function(a){c.call(this,a)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:b.id,xhr:f})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1))},this)).fail(a.proxy(function(a){c.call(this,!1),this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:b.id,xhr:a})},this.settings.core.error.call(this,this._data.core.last_error)},this))):(e=a.isArray(d)||a.isPlainObject(d)?JSON.parse(JSON.stringify(d)):d,"#"===b.id?this._append_json_data(b,e,function(a){c.call(this,a)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:b.id})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1))):"string"==typeof d?"#"===b.id?this._append_html_data(b,a(a.parseHTML(d)).filter(function(){return 3!==this.nodeType}),function(a){c.call(this,a)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:b.id})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1)):c.call(this,!1):"#"===b.id?this._append_html_data(b,this._data.core.original_container_html.clone(!0),function(a){c.call(this,a)}):c.call(this,!1)},_node_changed:function(a){a=this.get_node(a),a&&this._model.changed.push(a.id)},_append_html_data:function(b,c,d){b=this.get_node(b),b.children=[],b.children_d=[];var e=c.is("ul")?c.children():c,f=b.id,g=[],h=[],i=this._model.data,j=i[f],k=this._data.core.selected.length,l,m,n;for(e.each(a.proxy(function(b,c){l=this._parse_model_from_html(a(c),f,j.parents.concat()),l&&(g.push(l),h.push(l),i[l].children_d.length&&(h=h.concat(i[l].children_d)))},this)),j.children=g,j.children_d=h,m=0,n=j.parents.length;n>m;m++)i[j.parents[m]].children_d=i[j.parents[m]].children_d.concat(h);this.trigger("model",{nodes:h,parent:f}),"#"!==f?(this._node_changed(f),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0)),this._data.core.selected.length!==k&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),d.call(this,!0)},_append_json_data:function(b,c,d,e){if(null!==this.element){b=this.get_node(b),b.children=[],b.children_d=[],c.d&&(c=c.d,"string"==typeof c&&(c=JSON.parse(c))),a.isArray(c)||(c=[c]);var f=null,g={df:this._model.default_state,dat:c,par:b.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},h=function(a,b){a.data&&(a=a.data);var c=a.dat,d=a.par,e=[],f=[],g=[],h=a.df,i=a.t_id,j=a.t_cnt,k=a.m,l=k[d],m=a.sel,n,o,p,q,r=function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=a.id.toString(),f,i,j,l,m={id:e,text:a.text||"",icon:a.icon!==b?a.icon:!0,parent:c,parents:d,children:a.children||[],children_d:a.children_d||[],data:a.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in h)h.hasOwnProperty(f)&&(m.state[f]=h[f]);if(a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(m.icon=a.data.jstree.icon),(m.icon===b||null===m.icon||""===m.icon)&&(m.icon=!0),a&&a.data&&(m.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(m.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(m.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(m.li_attr[f]=a.li_attr[f]);if(m.li_attr.id||(m.li_attr.id=e),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(m.a_attr[f]=a.a_attr[f]);for(a&&a.children&&a.children===!0&&(m.state.loaded=!1,m.children=[],m.children_d=[]),k[m.id]=m,f=0,i=m.children.length;i>f;f++)j=r(k[m.children[f]],m.id,d),l=k[j],m.children_d.push(j),l.children_d.length&&(m.children_d=m.children_d.concat(l.children_d));return delete a.data,delete a.children,k[m.id].original=a,m.state.selected&&g.push(m.id),m.id},s=function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=!1,f,l,m,n,o;do e="j"+i+"_"+ ++j;while(k[e]);o={id:!1,text:"string"==typeof a?a:"",icon:"object"==typeof a&&a.icon!==b?a.icon:!0,parent:c,parents:d,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in h)h.hasOwnProperty(f)&&(o.state[f]=h[f]);if(a&&a.id&&(o.id=a.id.toString()),a&&a.text&&(o.text=a.text),a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(o.icon=a.data.jstree.icon),(o.icon===b||null===o.icon||""===o.icon)&&(o.icon=!0),a&&a.data&&(o.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(o.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(o.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(o.li_attr[f]=a.li_attr[f]);if(o.li_attr.id&&!o.id&&(o.id=o.li_attr.id.toString()),o.id||(o.id=e),o.li_attr.id||(o.li_attr.id=o.id),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(o.a_attr[f]=a.a_attr[f]);if(a&&a.children&&a.children.length){for(f=0,l=a.children.length;l>f;f++)m=s(a.children[f],o.id,d),n=k[m],o.children.push(m),n.children_d.length&&(o.children_d=o.children_d.concat(n.children_d));o.children_d=o.children_d.concat(o.children)}return a&&a.children&&a.children===!0&&(o.state.loaded=!1,o.children=[],o.children_d=[]),delete a.data,delete a.children,o.original=a,k[o.id]=o,o.state.selected&&g.push(o.id),o.id};if(c.length&&c[0].id!==b&&c[0].parent!==b){for(o=0,p=c.length;p>o;o++)c[o].children||(c[o].children=[]),k[c[o].id.toString()]=c[o];for(o=0,p=c.length;p>o;o++)k[c[o].parent.toString()].children.push(c[o].id.toString()),l.children_d.push(c[o].id.toString());for(o=0,p=l.children.length;p>o;o++)n=r(k[l.children[o]],d,l.parents.concat()),f.push(n),k[n].children_d.length&&(f=f.concat(k[n].children_d));for(o=0,p=l.parents.length;p>o;o++)k[l.parents[o]].children_d=k[l.parents[o]].children_d.concat(f);q={cnt:j,mod:k,sel:m,par:d,dpc:f,add:g}}else{for(o=0,p=c.length;p>o;o++)n=s(c[o],d,l.parents.concat()),n&&(e.push(n),f.push(n),k[n].children_d.length&&(f=f.concat(k[n].children_d)));for(l.children=e,l.children_d=f,o=0,p=l.parents.length;p>o;o++)k[l.parents[o]].children_d=k[l.parents[o]].children_d.concat(f);q={cnt:j,mod:k,sel:m,par:d,dpc:f,add:g}}return"undefined"!=typeof window&&"undefined"!=typeof window.document?q:void postMessage(q)},i=function(b,c){if(null!==this.element){if(this._cnt=b.cnt,this._model.data=b.mod,c){var e,f,g=b.add,h=b.sel,i=this._data.core.selected.slice(),j=this._model.data;if(h.length!==i.length||a.vakata.array_unique(h.concat(i)).length!==h.length){for(e=0,f=h.length;f>e;e++)-1===a.inArray(h[e],g)&&-1===a.inArray(h[e],i)&&(j[h[e]].state.selected=!1);for(e=0,f=i.length;f>e;e++)-1===a.inArray(i[e],h)&&(j[i[e]].state.selected=!0)}}b.add.length&&(this._data.core.selected=this._data.core.selected.concat(b.add)),this.trigger("model",{nodes:b.dpc,parent:b.par}),"#"!==b.par?(this._node_changed(b.par),this.redraw()):this.redraw(!0),b.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),d.call(this,!0)}};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{null===this._wrk&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+h.toString()],{type:"text/javascript"}))),!this._data.core.working||e?(this._data.core.working=!0,f=new window.Worker(this._wrk),f.onmessage=a.proxy(function(a){i.call(this,a.data,!0);try{f.terminate(),f=null}catch(b){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1},this),g.par?f.postMessage(g):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([b,c,d,!0])}catch(j){i.call(this,h(g),!1),this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else i.call(this,h(g),!1)}},_parse_model_from_html:function(c,d,e){e=e?[].concat(e):[],d&&e.unshift(d);var f,g,h=this._model.data,i={id:!1,text:!1,icon:!0,parent:d,parents:e,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},j,k,l;for(j in this._model.default_state)this._model.default_state.hasOwnProperty(j)&&(i.state[j]=this._model.default_state[j]);if(k=a.vakata.attributes(c,!0),a.each(k,function(b,c){return c=a.trim(c),c.length?(i.li_attr[b]=c,void("id"===b&&(i.id=c.toString()))):!0}),k=c.children("a").first(),k.length&&(k=a.vakata.attributes(k,!0),a.each(k,function(b,c){c=a.trim(c),c.length&&(i.a_attr[b]=c)})),k=c.children("a").first().length?c.children("a").first().clone():c.clone(),k.children("ins, i, ul").remove(),k=k.html(),k=a("
").html(k),i.text=this.settings.core.force_text?k.text():k.html(),k=c.data(),i.data=k?a.extend(!0,{},k):null,i.state.opened=c.hasClass("jstree-open"),i.state.selected=c.children("a").hasClass("jstree-clicked"),i.state.disabled=c.children("a").hasClass("jstree-disabled"),i.data&&i.data.jstree)for(j in i.data.jstree)i.data.jstree.hasOwnProperty(j)&&(i.state[j]=i.data.jstree[j]);k=c.children("a").children(".jstree-themeicon"),k.length&&(i.icon=k.hasClass("jstree-themeicon-hidden")?!1:k.attr("rel")),i.state.icon!==b&&(i.icon=i.state.icon),(i.icon===b||null===i.icon||""===i.icon)&&(i.icon=!0),k=c.children("ul").children("li");do l="j"+this._id+"_"+ ++this._cnt;while(h[l]);return i.id=i.li_attr.id?i.li_attr.id.toString():l,k.length?(k.each(a.proxy(function(b,c){f=this._parse_model_from_html(a(c),i.id,e),g=this._model.data[f],i.children.push(f),g.children_d.length&&(i.children_d=i.children_d.concat(g.children_d))},this)),i.children_d=i.children_d.concat(i.children)):c.hasClass("jstree-closed")&&(i.state.loaded=!1),i.li_attr["class"]&&(i.li_attr["class"]=i.li_attr["class"].replace("jstree-closed","").replace("jstree-open","")),i.a_attr["class"]&&(i.a_attr["class"]=i.a_attr["class"].replace("jstree-clicked","").replace("jstree-disabled","")),h[i.id]=i,i.state.selected&&this._data.core.selected.push(i.id),i.id},_parse_model_from_flat_json:function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=a.id.toString(),f=this._model.data,g=this._model.default_state,h,i,j,k,l={id:e,text:a.text||"",icon:a.icon!==b?a.icon:!0,parent:c,parents:d,children:a.children||[],children_d:a.children_d||[],data:a.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(h in g)g.hasOwnProperty(h)&&(l.state[h]=g[h]);if(a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(l.icon=a.data.jstree.icon),(l.icon===b||null===l.icon||""===l.icon)&&(l.icon=!0),a&&a.data&&(l.data=a.data,a.data.jstree))for(h in a.data.jstree)a.data.jstree.hasOwnProperty(h)&&(l.state[h]=a.data.jstree[h]);if(a&&"object"==typeof a.state)for(h in a.state)a.state.hasOwnProperty(h)&&(l.state[h]=a.state[h]);if(a&&"object"==typeof a.li_attr)for(h in a.li_attr)a.li_attr.hasOwnProperty(h)&&(l.li_attr[h]=a.li_attr[h]);if(l.li_attr.id||(l.li_attr.id=e),a&&"object"==typeof a.a_attr)for(h in a.a_attr)a.a_attr.hasOwnProperty(h)&&(l.a_attr[h]=a.a_attr[h]);for(a&&a.children&&a.children===!0&&(l.state.loaded=!1,l.children=[],l.children_d=[]),f[l.id]=l,h=0,i=l.children.length;i>h;h++)j=this._parse_model_from_flat_json(f[l.children[h]],l.id,d),k=f[j],l.children_d.push(j),k.children_d.length&&(l.children_d=l.children_d.concat(k.children_d));return delete a.data,delete a.children,f[l.id].original=a,l.state.selected&&this._data.core.selected.push(l.id),l.id},_parse_model_from_json:function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=!1,f,g,h,i,j=this._model.data,k=this._model.default_state,l;do e="j"+this._id+"_"+ ++this._cnt;while(j[e]);l={id:!1,text:"string"==typeof a?a:"",icon:"object"==typeof a&&a.icon!==b?a.icon:!0,parent:c,parents:d,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in k)k.hasOwnProperty(f)&&(l.state[f]=k[f]);if(a&&a.id&&(l.id=a.id.toString()),a&&a.text&&(l.text=a.text),a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(l.icon=a.data.jstree.icon),(l.icon===b||null===l.icon||""===l.icon)&&(l.icon=!0),a&&a.data&&(l.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(l.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(l.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(l.li_attr[f]=a.li_attr[f]);if(l.li_attr.id&&!l.id&&(l.id=l.li_attr.id.toString()),l.id||(l.id=e),l.li_attr.id||(l.li_attr.id=l.id),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(l.a_attr[f]=a.a_attr[f]);if(a&&a.children&&a.children.length){for(f=0,g=a.children.length;g>f;f++)h=this._parse_model_from_json(a.children[f],l.id,d),i=j[h],l.children.push(h),i.children_d.length&&(l.children_d=l.children_d.concat(i.children_d));l.children_d=l.children_d.concat(l.children)}return a&&a.children&&a.children===!0&&(l.state.loaded=!1,l.children=[],l.children_d=[]),delete a.data,delete a.children,l.original=a,j[l.id]=l,l.state.selected&&this._data.core.selected.push(l.id),l.id},_redraw:function(){var a=this._model.force_full_redraw?this._model.data["#"].children.concat([]):this._model.changed.concat([]),b=i.createElement("UL"),c,d,e,f=this._data.core.focused;for(d=0,e=a.length;e>d;d++)c=this.redraw_node(a[d],!0,this._model.force_full_redraw),c&&this._model.force_full_redraw&&b.appendChild(c);this._model.force_full_redraw&&(b.className=this.get_container_ul()[0].className,b.setAttribute("role","group"),this.element.empty().append(b)),null!==f&&(c=this.get_node(f,!0),c&&c.length&&c.children(".jstree-anchor")[0]!==i.activeElement?c.children(".jstree-anchor").focus():this._data.core.focused=null),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:a})},redraw:function(a){a&&(this._model.force_full_redraw=!0),this._redraw()},draw_children:function(a){var b=this.get_node(a),c=!1,d=!1,e=!1,f=i;if(!b)return!1;if("#"===b.id)return this.redraw(!0);if(a=this.get_node(a,!0),!a||!a.length)return!1;if(a.children(".jstree-children").remove(),a=a[0],b.children.length&&b.state.loaded){for(e=f.createElement("UL"),e.setAttribute("role","group"),e.className="jstree-children",c=0,d=b.children.length;d>c;c++)e.appendChild(this.redraw_node(b.children[c],!0,!0));a.appendChild(e)}},redraw_node:function(b,c,d,e){var f=this.get_node(b),g=!1,h=!1,k=!1,l=!1,m=!1,n=!1,o="",p=i,q=this._model.data,r=!1,s=!1,t=null,u=0,v=0;if(!f)return!1;if("#"===f.id)return this.redraw(!0);if(c=c||0===f.children.length,b=i.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(f.id[0])?"\\3"+f.id[0]+" "+f.id.substr(1).replace(a.jstree.idregex,"\\$&"):f.id.replace(a.jstree.idregex,"\\$&"))):i.getElementById(f.id))b=a(b),d||(g=b.parent().parent()[0],g===this.element[0]&&(g=null),h=b.index()),c||!f.children.length||b.children(".jstree-children").length||(c=!0),c||(k=b.children(".jstree-children")[0]),r=b.children(".jstree-anchor")[0]===i.activeElement,b.remove();else if(c=!0,!d){if(g="#"!==f.parent?a("#"+f.parent.replace(a.jstree.idregex,"\\$&"),this.element)[0]:null,!(null===g||g&&q[f.parent].state.opened))return!1;h=a.inArray(f.id,null===g?q["#"].children:q[f.parent].children)}b=j.cloneNode(!0),o="jstree-node ";for(l in f.li_attr)if(f.li_attr.hasOwnProperty(l)){if("id"===l)continue;"class"!==l?b.setAttribute(l,f.li_attr[l]):o+=f.li_attr[l]}f.a_attr.id||(f.a_attr.id=f.id+"_anchor"),b.setAttribute("aria-selected",!!f.state.selected),b.setAttribute("aria-level",f.parents.length), +b.setAttribute("aria-labelledby",f.a_attr.id),f.state.disabled&&b.setAttribute("aria-disabled",!0),f.state.loaded&&!f.children.length?o+=" jstree-leaf":(o+=f.state.opened&&f.state.loaded?" jstree-open":" jstree-closed",b.setAttribute("aria-expanded",f.state.opened&&f.state.loaded)),null!==f.parent&&q[f.parent].children[q[f.parent].children.length-1]===f.id&&(o+=" jstree-last"),b.id=f.id,b.className=o,o=(f.state.selected?" jstree-clicked":"")+(f.state.disabled?" jstree-disabled":"");for(m in f.a_attr)if(f.a_attr.hasOwnProperty(m)){if("href"===m&&"#"===f.a_attr[m])continue;"class"!==m?b.childNodes[1].setAttribute(m,f.a_attr[m]):o+=" "+f.a_attr[m]}if(o.length&&(b.childNodes[1].className="jstree-anchor "+o),(f.icon&&f.icon!==!0||f.icon===!1)&&(f.icon===!1?b.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===f.icon.indexOf("/")&&-1===f.icon.indexOf(".")?b.childNodes[1].childNodes[0].className+=" "+f.icon+" jstree-themeicon-custom":(b.childNodes[1].childNodes[0].style.backgroundImage="url("+f.icon+")",b.childNodes[1].childNodes[0].style.backgroundPosition="center center",b.childNodes[1].childNodes[0].style.backgroundSize="auto",b.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?b.childNodes[1].appendChild(p.createTextNode(f.text)):b.childNodes[1].innerHTML+=f.text,c&&f.children.length&&(f.state.opened||e)&&f.state.loaded){for(n=p.createElement("UL"),n.setAttribute("role","group"),n.className="jstree-children",l=0,m=f.children.length;m>l;l++)n.appendChild(this.redraw_node(f.children[l],c,!0));b.appendChild(n)}if(k&&b.appendChild(k),!d){for(g||(g=this.element[0]),l=0,m=g.childNodes.length;m>l;l++)if(g.childNodes[l]&&g.childNodes[l].className&&-1!==g.childNodes[l].className.indexOf("jstree-children")){t=g.childNodes[l];break}t||(t=p.createElement("UL"),t.setAttribute("role","group"),t.className="jstree-children",g.appendChild(t)),g=t,hf;f++)this.open_node(c[f],d,e);return!0}if(c=this.get_node(c),!c||"#"===c.id)return!1;if(e=e===b?this.settings.core.animation:e,!this.is_closed(c))return d&&d.call(this,c,!1),!1;if(this.is_loaded(c))h=this.get_node(c,!0),i=this,h.length&&(e&&h.children(".jstree-children").length&&h.children(".jstree-children").stop(!0,!0),c.children.length&&!this._firstChild(h.children(".jstree-children")[0])&&this.draw_children(c),e?(this.trigger("before_open",{node:c}),h.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(e,function(){this.style.display="",i.trigger("after_open",{node:c})})):(this.trigger("before_open",{node:c}),h[0].className=h[0].className.replace("jstree-closed","jstree-open"),h[0].setAttribute("aria-expanded",!0))),c.state.opened=!0,d&&d.call(this,c,!0),h.length||this.trigger("before_open",{node:c}),this.trigger("open_node",{node:c}),e&&h.length||this.trigger("after_open",{node:c});else{if(this.is_loading(c))return setTimeout(a.proxy(function(){this.open_node(c,d,e)},this),500);this.load_node(c,function(a,b){return b?this.open_node(a,d,e):d?d.call(this,a,!1):!1})}},_open_to:function(b){if(b=this.get_node(b),!b||"#"===b.id)return!1;var c,d,e=b.parents;for(c=0,d=e.length;d>c;c+=1)"#"!==c&&this.open_node(e[c],!1,0);return a("#"+b.id.replace(a.jstree.idregex,"\\$&"),this.element)},close_node:function(c,d){var e,f,g,h;if(a.isArray(c)){for(c=c.slice(),e=0,f=c.length;f>e;e++)this.close_node(c[e],d);return!0}return c=this.get_node(c),c&&"#"!==c.id?this.is_closed(c)?!1:(d=d===b?this.settings.core.animation:d,g=this,h=this.get_node(c,!0),h.length&&(d?h.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(d,function(){this.style.display="",h.children(".jstree-children").remove(),g.trigger("after_close",{node:c})}):(h[0].className=h[0].className.replace("jstree-open","jstree-closed"),h.attr("aria-expanded",!1).children(".jstree-children").remove())),c.state.opened=!1,this.trigger("close_node",{node:c}),void(d&&h.length||this.trigger("after_close",{node:c}))):!1},toggle_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.toggle_node(b[c]);return!0}return this.is_closed(b)?this.open_node(b):this.is_open(b)?this.close_node(b):void 0},open_all:function(a,b,c){if(a||(a="#"),a=this.get_node(a),!a)return!1;var d="#"===a.id?this.get_container_ul():this.get_node(a,!0),e,f,g;if(!d.length){for(e=0,f=a.children_d.length;f>e;e++)this.is_closed(this._model.data[a.children_d[e]])&&(this._model.data[a.children_d[e]].state.opened=!0);return this.trigger("open_all",{node:a})}c=c||d,g=this,d=this.is_closed(a)?d.find(".jstree-closed").addBack():d.find(".jstree-closed"),d.each(function(){g.open_node(this,function(a,d){d&&this.is_parent(a)&&this.open_all(a,b,c)},b||0)}),0===c.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(c)})},close_all:function(b,c){if(b||(b="#"),b=this.get_node(b),!b)return!1;var d="#"===b.id?this.get_container_ul():this.get_node(b,!0),e=this,f,g;if(!d.length){for(f=0,g=b.children_d.length;g>f;f++)this._model.data[b.children_d[f]].state.opened=!1;return this.trigger("close_all",{node:b})}d=this.is_open(b)?d.find(".jstree-open").addBack():d.find(".jstree-open"),a(d.get().reverse()).each(function(){e.close_node(this,c||0)}),this.trigger("close_all",{node:b})},is_disabled:function(a){return a=this.get_node(a),a&&a.state&&a.state.disabled},enable_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.enable_node(b[c]);return!0}return b=this.get_node(b),b&&"#"!==b.id?(b.state.disabled=!1,this.get_node(b,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),void this.trigger("enable_node",{node:b})):!1},disable_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.disable_node(b[c]);return!0}return b=this.get_node(b),b&&"#"!==b.id?(b.state.disabled=!0,this.get_node(b,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),void this.trigger("disable_node",{node:b})):!1},activate_node:function(a,c){if(this.is_disabled(a))return!1;if(this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==b?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null),!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(c.metaKey||c.ctrlKey||c.shiftKey)&&(!c.shiftKey||this._data.core.last_clicked&&this.get_parent(a)&&this.get_parent(a)===this._data.core.last_clicked.parent))if(c.shiftKey){var d=this.get_node(a).id,e=this._data.core.last_clicked.id,f=this.get_node(this._data.core.last_clicked.parent).children,g=!1,h,i;for(h=0,i=f.length;i>h;h+=1)f[h]===d&&(g=!g),f[h]===e&&(g=!g),this.is_disabled(f[h])||!g&&f[h]!==d&&f[h]!==e?this.deselect_node(f[h],!0,c):this.select_node(f[h],!0,!1,c);this.trigger("changed",{action:"select_node",node:this.get_node(a),selected:this._data.core.selected,event:c})}else this.is_selected(a)?this.deselect_node(a,!1,c):this.select_node(a,!1,!1,c);else!this.settings.core.multiple&&(c.metaKey||c.ctrlKey||c.shiftKey)&&this.is_selected(a)?this.deselect_node(a,!1,c):(this.deselect_all(!0),this.select_node(a,!1,!1,c),this._data.core.last_clicked=this.get_node(a));this.trigger("activate_node",{node:this.get_node(a)})},hover_node:function(a){if(a=this.get_node(a,!0),!a||!a.length||a.children(".jstree-hovered").length)return!1;var b=this.element.find(".jstree-hovered"),c=this.element;b&&b.length&&this.dehover_node(b),a.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:this.get_node(a)}),setTimeout(function(){c.attr("aria-activedescendant",a[0].id)},0)},dehover_node:function(a){return a=this.get_node(a,!0),a&&a.length&&a.children(".jstree-hovered").length?(a.children(".jstree-anchor").removeClass("jstree-hovered"),void this.trigger("dehover_node",{node:this.get_node(a)})):!1},select_node:function(b,c,d,e){var f,g,h,i;if(a.isArray(b)){for(b=b.slice(),g=0,h=b.length;h>g;g++)this.select_node(b[g],c,d,e);return!0}return b=this.get_node(b),b&&"#"!==b.id?(f=this.get_node(b,!0),void(b.state.selected||(b.state.selected=!0,this._data.core.selected.push(b.id),d||(f=this._open_to(b)),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:b,selected:this._data.core.selected,event:e}),c||this.trigger("changed",{action:"select_node",node:b,selected:this._data.core.selected,event:e})))):!1},deselect_node:function(b,c,d){var e,f,g;if(a.isArray(b)){for(b=b.slice(),e=0,f=b.length;f>e;e++)this.deselect_node(b[e],c,d);return!0}return b=this.get_node(b),b&&"#"!==b.id?(g=this.get_node(b,!0),void(b.state.selected&&(b.state.selected=!1,this._data.core.selected=a.vakata.array_remove_item(this._data.core.selected,b.id),g.length&&g.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:b,selected:this._data.core.selected,event:d}),c||this.trigger("changed",{action:"deselect_node",node:b,selected:this._data.core.selected,event:d})))):!1},select_all:function(a){var b=this._data.core.selected.concat([]),c,d;for(this._data.core.selected=this._model.data["#"].children_d.concat(),c=0,d=this._data.core.selected.length;d>c;c++)this._model.data[this._data.core.selected[c]]&&(this._model.data[this._data.core.selected[c]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),a||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:b})},deselect_all:function(a){var b=this._data.core.selected.concat([]),c,d;for(c=0,d=this._data.core.selected.length;d>c;c++)this._model.data[this._data.core.selected[c]]&&(this._model.data[this._data.core.selected[c]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1),this.trigger("deselect_all",{selected:this._data.core.selected,node:b}),a||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:b})},is_selected:function(a){return a=this.get_node(a),a&&"#"!==a.id?a.state.selected:!1},get_selected:function(b){return b?a.map(this._data.core.selected,a.proxy(function(a){return this.get_node(a)},this)):this._data.core.selected.slice()},get_top_selected:function(b){var c=this.get_selected(!0),d={},e,f,g,h;for(e=0,f=c.length;f>e;e++)d[c[e].id]=c[e];for(e=0,f=c.length;f>e;e++)for(g=0,h=c[e].children_d.length;h>g;g++)d[c[e].children_d[g]]&&delete d[c[e].children_d[g]];c=[];for(e in d)d.hasOwnProperty(e)&&c.push(e);return b?a.map(c,a.proxy(function(a){return this.get_node(a)},this)):c},get_bottom_selected:function(b){var c=this.get_selected(!0),d=[],e,f;for(e=0,f=c.length;f>e;e++)c[e].children.length||d.push(c[e].id);return b?a.map(d,a.proxy(function(a){return this.get_node(a)},this)):d},get_state:function(){var a={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}},b;for(b in this._model.data)this._model.data.hasOwnProperty(b)&&"#"!==b&&(this._model.data[b].state.opened&&a.core.open.push(b),this._model.data[b].state.selected&&a.core.selected.push(b));return a},set_state:function(c,d){if(c){if(c.core){var e,f,g,h,i;if(c.core.open)return a.isArray(c.core.open)&&c.core.open.length?this._load_nodes(c.core.open,function(a){this.open_node(a,!1,0),delete c.core.open,this.set_state(c,d)},!0):(delete c.core.open,this.set_state(c,d)),!1;if(c.core.scroll)return c.core.scroll&&c.core.scroll.left!==b&&this.element.scrollLeft(c.core.scroll.left),c.core.scroll&&c.core.scroll.top!==b&&this.element.scrollTop(c.core.scroll.top),delete c.core.scroll,this.set_state(c,d),!1;if(c.core.selected)return h=this,this.deselect_all(),a.each(c.core.selected,function(a,b){h.select_node(b,!1,!0)}),delete c.core.selected,this.set_state(c,d),!1;for(i in c)c.hasOwnProperty(i)&&"core"!==i&&-1===a.inArray(i,this.settings.plugins)&&delete c[i];if(a.isEmptyObject(c.core))return delete c.core,this.set_state(c,d),!1}return a.isEmptyObject(c)?(c=null,d&&d.call(this),this.trigger("set_state"),!1):!0}return!1},refresh:function(b,c){this._data.core.state=c===!0?{}:this.get_state(),c&&a.isFunction(c)&&(this._data.core.state=c.call(this,this._data.core.state)),this._cnt=0,this._model.data={"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}};var d=this.get_container_ul()[0].className;b||(this.element.html(""),this.element.attr("aria-activedescendant","j"+this._id+"_loading")),this.load_node("#",function(b,c){c&&(this.get_container_ul()[0].className=d,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(a.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")})),this._data.core.state=null})},refresh_node:function(b){if(b=this.get_node(b),!b||"#"===b.id)return!1;var c=[],d=[],e=this._data.core.selected.concat([]);d.push(b.id),b.state.opened===!0&&c.push(b.id),this.get_node(b,!0).find(".jstree-open").each(function(){c.push(this.id)}),this._load_nodes(d,a.proxy(function(a){this.open_node(c,!1,0),this.select_node(this._data.core.selected),this.trigger("refresh_node",{node:b,nodes:a})},this))},set_id:function(b,c){if(b=this.get_node(b),!b||"#"===b.id)return!1;var d,e,f=this._model.data;for(c=c.toString(),f[b.parent].children[a.inArray(b.id,f[b.parent].children)]=c,d=0,e=b.parents.length;e>d;d++)f[b.parents[d]].children_d[a.inArray(b.id,f[b.parents[d]].children_d)]=c;for(d=0,e=b.children.length;e>d;d++)f[b.children[d]].parent=c;for(d=0,e=b.children_d.length;e>d;d++)f[b.children_d[d]].parents[a.inArray(b.id,f[b.children_d[d]].parents)]=c;return d=a.inArray(b.id,this._data.core.selected),-1!==d&&(this._data.core.selected[d]=c),d=this.get_node(b.id,!0),d&&(d.attr("id",c).children(".jstree-anchor").attr("id",c+"_anchor").end().attr("aria-labelledby",c+"_anchor"),this.element.attr("aria-activedescendant")===b.id&&this.element.attr("aria-activedescendant",c)),delete f[b.id],b.id=c,b.li_attr.id=c,f[c]=b,!0},get_text:function(a){return a=this.get_node(a),a&&"#"!==a.id?a.text:!1},set_text:function(b,c){var d,e;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.set_text(b[d],c);return!0}return b=this.get_node(b),b&&"#"!==b.id?(b.text=c,this.get_node(b,!0).length&&this.redraw_node(b.id),this.trigger("set_text",{obj:b,text:c}),!0):!1},get_json:function(b,c,d){if(b=this.get_node(b||"#"),!b)return!1;c&&c.flat&&!d&&(d=[]);var e={id:b.id,text:b.text,icon:this.get_icon(b),li_attr:a.extend(!0,{},b.li_attr),a_attr:a.extend(!0,{},b.a_attr),state:{},data:c&&c.no_data?!1:a.extend(!0,{},b.data)},f,g;if(c&&c.flat?e.parent=b.parent:e.children=[],!c||!c.no_state)for(f in b.state)b.state.hasOwnProperty(f)&&(e.state[f]=b.state[f]);if(c&&c.no_id&&(delete e.id,e.li_attr&&e.li_attr.id&&delete e.li_attr.id,e.a_attr&&e.a_attr.id&&delete e.a_attr.id),c&&c.flat&&"#"!==b.id&&d.push(e),!c||!c.no_children)for(f=0,g=b.children.length;g>f;f++)c&&c.flat?this.get_json(b.children[f],c,d):e.children.push(this.get_json(b.children[f],c));return c&&c.flat?d:"#"===b.id?e.children:e},create_node:function(c,d,e,f,g){if(null===c&&(c="#"),c=this.get_node(c),!c)return!1;if(e=e===b?"last":e,!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(c))return this.load_node(c,function(){this.create_node(c,d,e,f,!0)});d||(d={text:this.get_string("New node")}),"string"==typeof d&&(d={text:d}),d.text===b&&(d.text=this.get_string("New node"));var h,i,j,k;switch("#"===c.id&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":h=this.get_node(c.parent),e=a.inArray(c.id,h.children),c=h;break;case"after":h=this.get_node(c.parent),e=a.inArray(c.id,h.children)+1,c=h;break;case"inside":case"first":e=0;break;case"last":e=c.children.length;break;default:e||(e=0)}if(e>c.children.length&&(e=c.children.length),d.id||(d.id=!0),!this.check("create_node",d,c,e))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(d.id===!0&&delete d.id,d=this._parse_model_from_json(d,c.id,c.parents.concat()),!d)return!1;for(h=this.get_node(d),i=[],i.push(d),i=i.concat(h.children_d),this.trigger("model",{nodes:i,parent:c.id}),c.children_d=c.children_d.concat(i),j=0,k=c.parents.length;k>j;j++)this._model.data[c.parents[j]].children_d=this._model.data[c.parents[j]].children_d.concat(i);for(d=h,h=[],j=0,k=c.children.length;k>j;j++)h[j>=e?j+1:j]=c.children[j];return h[e]=d.id,c.children=h,this.redraw_node(c,!0),f&&f.call(this,this.get_node(d)),this.trigger("create_node",{node:this.get_node(d),parent:c.id,position:e}),d.id},rename_node:function(b,c){var d,e,f;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.rename_node(b[d],c);return!0}return b=this.get_node(b),b&&"#"!==b.id?(f=b.text,this.check("rename_node",b,this.get_parent(b),c)?(this.set_text(b,c),this.trigger("rename_node",{node:b,text:c,old:f}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1)):!1},delete_node:function(b){var c,d,e,f,g,h,i,j,k,l;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.delete_node(b[c]);return!0}if(b=this.get_node(b),!b||"#"===b.id)return!1;if(e=this.get_node(b.parent),f=a.inArray(b.id,e.children),l=!1,!this.check("delete_node",b,e,f))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==f&&(e.children=a.vakata.array_remove(e.children,f)),g=b.children_d.concat([]),g.push(b.id),j=0,k=g.length;k>j;j++){for(h=0,i=b.parents.length;i>h;h++)f=a.inArray(g[j],this._model.data[b.parents[h]].children_d),-1!==f&&(this._model.data[b.parents[h]].children_d=a.vakata.array_remove(this._model.data[b.parents[h]].children_d,f));this._model.data[g[j]].state.selected&&(l=!0,f=a.inArray(g[j],this._data.core.selected),-1!==f&&(this._data.core.selected=a.vakata.array_remove(this._data.core.selected,f)))}for(this.trigger("delete_node",{node:b,parent:e.id}),l&&this.trigger("changed",{action:"delete_node",node:b,selected:this._data.core.selected,parent:e.id}),j=0,k=g.length;k>j;j++)delete this._model.data[g[j]];return this.redraw_node(e,!0),!0},check:function(b,c,d,e,f){c=c&&c.id?c:this.get_node(c),d=d&&d.id?d:this.get_node(d);var g=b.match(/^move_node|copy_node|create_node$/i)?d:c,h=this.settings.core.check_callback;return"move_node"!==b&&"copy_node"!==b||f&&f.is_multi||c.id!==d.id&&a.inArray(c.id,d.children)!==e&&-1===a.inArray(d.id,c.children_d)?(g&&g.data&&(g=g.data),g&&g.functions&&(g.functions[b]===!1||g.functions[b]===!0)?(g.functions[b]===!1&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+b,data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})}),g.functions[b]):h===!1||a.isFunction(h)&&h.call(this,b,c,d,e,f)===!1||h&&h[b]===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+b,data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})},!1):!0):(this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})},!1)},last_error:function(){return this._data.core.last_error},move_node:function(c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r,s,t,u,v,w;if(d=this.get_node(d),e=e===b?0:e,!d)return!1;if(!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(d))return this.load_node(d,function(){this.move_node(c,d,e,f,!0,!1,i)});if(a.isArray(c)){if(1!==c.length){for(j=0,k=c.length;k>j;j++)(r=this.move_node(c[j],d,e,f,g,!1,i))&&(d=r,e="after");return this.redraw(),!0}c=c[0]}if(c=c&&c.id?c:this.get_node(c),!c||"#"===c.id)return!1;if(l=(c.parent||"#").toString(),n=e.toString().match(/^(before|after)$/)&&"#"!==d.id?this.get_node(d.parent):d,o=i?i:this._model.data[c.id]?this:a.jstree.reference(c.id),p=!o||!o._id||this._id!==o._id,m=o&&o._id&&l&&o._model.data[l]&&o._model.data[l].children?a.inArray(c.id,o._model.data[l].children):-1,o&&o._id&&(c=o._model.data[c.id]),p)return(r=this.copy_node(c,d,e,f,g,!1,i))?(o&&o.delete_node(c),r):!1;switch("#"===d.id&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":e=a.inArray(d.id,n.children);break;case"after":e=a.inArray(d.id,n.children)+1;break;case"inside":case"first":e=0;break;case"last":e=n.children.length;break;default:e||(e=0)}if(e>n.children.length&&(e=n.children.length),!this.check("move_node",c,n,e,{core:!0,origin:i,is_multi:o&&o._id&&o._id!==this._id,is_foreign:!o||!o._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(c.parent===n.id){for(q=n.children.concat(),r=a.inArray(c.id,q),-1!==r&&(q=a.vakata.array_remove(q,r),e>r&&e--),r=[],s=0,t=q.length;t>s;s++)r[s>=e?s+1:s]=q[s];r[e]=c.id,n.children=r,this._node_changed(n.id),this.redraw("#"===n.id)}else{for(r=c.children_d.concat(),r.push(c.id),s=0,t=c.parents.length;t>s;s++){for(q=[],w=o._model.data[c.parents[s]].children_d,u=0,v=w.length;v>u;u++)-1===a.inArray(w[u],r)&&q.push(w[u]);o._model.data[c.parents[s]].children_d=q}for(o._model.data[l].children=a.vakata.array_remove_item(o._model.data[l].children,c.id),s=0,t=n.parents.length;t>s;s++)this._model.data[n.parents[s]].children_d=this._model.data[n.parents[s]].children_d.concat(r);for(q=[],s=0,t=n.children.length;t>s;s++)q[s>=e?s+1:s]=n.children[s];for(q[e]=c.id,n.children=q,n.children_d.push(c.id),n.children_d=n.children_d.concat(c.children_d),c.parent=n.id,r=n.parents.concat(),r.unshift(n.id),w=c.parents.length,c.parents=r,r=r.concat(),s=0,t=c.children_d.length;t>s;s++)this._model.data[c.children_d[s]].parents=this._model.data[c.children_d[s]].parents.slice(0,-1*w),Array.prototype.push.apply(this._model.data[c.children_d[s]].parents,r);("#"===l||"#"===n.id)&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||(this._node_changed(l),this._node_changed(n.id)),h||this.redraw()}return f&&f.call(this,c,n,e),this.trigger("move_node",{node:c,parent:n.id,position:e,old_parent:l,old_position:m,is_multi:o&&o._id&&o._id!==this._id,is_foreign:!o||!o._id,old_instance:o,new_instance:this}),c.id},copy_node:function(c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r,s,t;if(d=this.get_node(d),e=e===b?0:e,!d)return!1;if(!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(d))return this.load_node(d,function(){this.copy_node(c,d,e,f,!0,!1,i)});if(a.isArray(c)){if(1!==c.length){for(j=0,k=c.length;k>j;j++)(m=this.copy_node(c[j],d,e,f,g,!0,i))&&(d=m,e="after");return this.redraw(),!0}c=c[0]}if(c=c&&c.id?c:this.get_node(c),!c||"#"===c.id)return!1;switch(q=(c.parent||"#").toString(),r=e.toString().match(/^(before|after)$/)&&"#"!==d.id?this.get_node(d.parent):d,s=i?i:this._model.data[c.id]?this:a.jstree.reference(c.id),t=!s||!s._id||this._id!==s._id,s&&s._id&&(c=s._model.data[c.id]),"#"===d.id&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":e=a.inArray(d.id,r.children);break;case"after":e=a.inArray(d.id,r.children)+1;break;case"inside":case"first":e=0;break;case"last":e=r.children.length;break;default:e||(e=0)}if(e>r.children.length&&(e=r.children.length),!this.check("copy_node",c,r,e,{core:!0,origin:i,is_multi:s&&s._id&&s._id!==this._id,is_foreign:!s||!s._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(p=s?s.get_json(c,{no_id:!0,no_data:!0,no_state:!0}):c,!p)return!1;if(p.id===!0&&delete p.id,p=this._parse_model_from_json(p,r.id,r.parents.concat()),!p)return!1;for(m=this.get_node(p),c&&c.state&&c.state.loaded===!1&&(m.state.loaded=!1),l=[],l.push(p),l=l.concat(m.children_d),this.trigger("model",{nodes:l,parent:r.id}),n=0,o=r.parents.length;o>n;n++)this._model.data[r.parents[n]].children_d=this._model.data[r.parents[n]].children_d.concat(l);for(l=[],n=0,o=r.children.length;o>n;n++)l[n>=e?n+1:n]=r.children[n];return l[e]=m.id,r.children=l,r.children_d.push(m.id),r.children_d=r.children_d.concat(m.children_d),"#"===r.id&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(r.id),h||this.redraw("#"===r.id),f&&f.call(this,m,r,e),this.trigger("copy_node",{node:m,original:c,parent:r.id,position:e,old_parent:q,old_position:s&&s._id&&q&&s._model.data[q]&&s._model.data[q].children?a.inArray(c.id,s._model.data[q].children):-1,is_multi:s&&s._id&&s._id!==this._id,is_foreign:!s||!s._id,old_instance:s,new_instance:this}),m.id},cut:function(b){if(b||(b=this._data.core.selected.concat()),a.isArray(b)||(b=[b]),!b.length)return!1;var c=[],g,h,i;for(h=0,i=b.length;i>h;h++)g=this.get_node(b[h]),g&&g.id&&"#"!==g.id&&c.push(g);return c.length?(d=c,f=this,e="move_node",void this.trigger("cut",{node:b})):!1},copy:function(b){if(b||(b=this._data.core.selected.concat()),a.isArray(b)||(b=[b]),!b.length)return!1;var c=[],g,h,i;for(h=0,i=b.length;i>h;h++)g=this.get_node(b[h]),g&&g.id&&"#"!==g.id&&c.push(g);return c.length?(d=c,f=this,e="copy_node",void this.trigger("copy",{node:b})):!1},get_buffer:function(){return{mode:e,node:d,inst:f}},can_paste:function(){return e!==!1&&d!==!1},paste:function(a,b){return a=this.get_node(a),a&&e&&e.match(/^(copy_node|move_node)$/)&&d?(this[e](d,a,b,!1,!1,!1,f)&&this.trigger("paste",{parent:a.id,node:d,mode:e}),d=!1,e=!1,void(f=!1)):!1},clear_buffer:function(){d=!1,e=!1,f=!1,this.trigger("clear_buffer")},edit:function(b,c,d){var e,f,g,h,i,j,k,l,m;return(b=this.get_node(b))?this.settings.core.check_callback===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_07",reason:"Could not edit node because of check_callback"},this.settings.core.error.call(this,this._data.core.last_error),!1):(m=b,c="string"==typeof c?c:b.text,this.set_text(b,""),b=this._open_to(b),m.text=c,e=this._data.core.rtl,f=this.element.width(),g=b.children(".jstree-anchor"),h=a(""),i=c,j=a("
",{css:{position:"absolute",top:"-200px",left:e?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),k=a("",{value:i,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:a.proxy(function(){var c=h.children(".jstree-rename-input"),e=c.val(),f=this.settings.core.force_text,k;""===e&&(e=i),j.remove(),h.replaceWith(g),h.remove(),i=f?i:a("
").append(a.parseHTML(i)).html(),this.set_text(b,i),k=!!this.rename_node(b,f?a("
").text(e).text():a("
").append(a.parseHTML(e)).html()),k||this.set_text(b,i),d&&d.call(this,m,k)},this),keydown:function(a){var b=a.which;27===b&&(this.value=i),(27===b||13===b||37===b||38===b||39===b||40===b||32===b)&&a.stopImmediatePropagation(),(27===b||13===b)&&(a.preventDefault(),this.blur())},click:function(a){a.stopImmediatePropagation()},mousedown:function(a){a.stopImmediatePropagation()},keyup:function(a){k.width(Math.min(j.text("pW"+this.value).width(),f))},keypress:function(a){return 13===a.which?!1:void 0}}),l={fontFamily:g.css("fontFamily")||"",fontSize:g.css("fontSize")||"",fontWeight:g.css("fontWeight")||"",fontStyle:g.css("fontStyle")||"",fontStretch:g.css("fontStretch")||"",fontVariant:g.css("fontVariant")||"",letterSpacing:g.css("letterSpacing")||"",wordSpacing:g.css("wordSpacing")||""},h.attr("class",g.attr("class")).append(g.contents().clone()).append(k),g.replaceWith(h),j.css(l),void k.css(l).width(Math.min(j.text("pW"+k[0].value).width(),f))[0].select()):!1},set_theme:function(b,c){if(!b)return!1;if(c===!0){var d=this.settings.core.themes.dir;d||(d=a.jstree.path+"/themes"),c=d+"/"+b+"/style.css"}c&&-1===a.inArray(c,g)&&(a("head").append(''),g.push(c)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=b,this.element.addClass("jstree-"+b),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+b+"-responsive"),this.trigger("set_theme",{theme:b})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(a){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),this._data.core.themes.variant=a,a&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(c,d){var e,f,g,h;if(a.isArray(c)){for(c=c.slice(),e=0,f=c.length;f>e;e++)this.set_icon(c[e],d);return!0}return c=this.get_node(c),c&&"#"!==c.id?(h=c.icon,c.icon=d===!0||null===d||d===b||""===d?!0:d,g=this.get_node(c,!0).children(".jstree-anchor").children(".jstree-themeicon"),d===!1?this.hide_icon(c):d===!0||null===d||d===b||""===d?(g.removeClass("jstree-themeicon-custom "+h).css("background","").removeAttr("rel"),h===!1&&this.show_icon(c)):-1===d.indexOf("/")&&-1===d.indexOf(".")?(g.removeClass(h).css("background",""),g.addClass(d+" jstree-themeicon-custom").attr("rel",d),h===!1&&this.show_icon(c)):(g.removeClass(h).css("background",""),g.addClass("jstree-themeicon-custom").css("background","url('"+d+"') center center no-repeat").attr("rel",d),h===!1&&this.show_icon(c)),!0):!1},get_icon:function(a){return a=this.get_node(a),a&&"#"!==a.id?a.icon:!1},hide_icon:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.hide_icon(b[c]);return!0}return b=this.get_node(b),b&&"#"!==b?(b.icon=!1,this.get_node(b,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0):!1},show_icon:function(b){var c,d,e;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.show_icon(b[c]);return!0}return b=this.get_node(b),b&&"#"!==b?(e=this.get_node(b,!0),b.icon=e.length?e.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"):!0,b.icon||(b.icon=!0),e.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0):!1}},a.vakata={},a.vakata.attributes=function(b,c){ +b=a(b)[0];var d=c?{}:[];return b&&b.attributes&&a.each(b.attributes,function(b,e){-1===a.inArray(e.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==e.value&&""!==a.trim(e.value)&&(c?d[e.name]=e.value:d.push(e.name))}),d},a.vakata.array_unique=function(a){var c=[],d,e,f,g={};for(d=0,f=a.length;f>d;d++)g[a[d]]===b&&(c.push(a[d]),g[a[d]]=!0);return c},a.vakata.array_remove=function(a,b,c){var d=a.slice((c||b)+1||a.length);return a.length=0>b?a.length+b:b,a.push.apply(a,d),a},a.vakata.array_remove_item=function(b,c){var d=a.inArray(c,b);return-1!==d?a.vakata.array_remove(b,d):b};var m=i.createElement("I");m.className="jstree-icon jstree-checkbox",m.setAttribute("role","presentation"),a.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0,cascade:"",tie_selection:!0},a.jstree.plugins.checkbox=function(c,d){this.bind=function(){d.bind.call(this),this._data.checkbox.uto=!1,this._data.checkbox.selected=[],this.settings.checkbox.three_state&&(this.settings.checkbox.cascade="up+down+undetermined"),this.element.on("init.jstree",a.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible,this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked"),this.settings.checkbox.tie_selection&&this.element.addClass("jstree-checkbox-selection")},this)).on("loading.jstree",a.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this)),-1!==this.settings.checkbox.cascade.indexOf("undetermined")&&this.element.on("changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",a.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(a.proxy(this._undetermined,this),50)},this)),this.settings.checkbox.tie_selection||this.element.on("model.jstree",a.proxy(function(a,b){var c=this._model.data,d=c[b.parent],e=b.nodes,f,g;for(f=0,g=e.length;g>f;f++)c[e[f]].state.checked=c[e[f]].original&&c[e[f]].original.state&&c[e[f]].original.state.checked,c[e[f]].state.checked&&this._data.checkbox.selected.push(e[f])},this)),(-1!==this.settings.checkbox.cascade.indexOf("up")||-1!==this.settings.checkbox.cascade.indexOf("down"))&&this.element.on("model.jstree",a.proxy(function(b,c){var d=this._model.data,e=d[c.parent],f=c.nodes,g=[],h,i,j,k,l,m,n=this.settings.checkbox.cascade,o=this.settings.checkbox.tie_selection;if(-1!==n.indexOf("down"))if(e.state[o?"selected":"checked"]){for(i=0,j=f.length;j>i;i++)d[f[i]].state[o?"selected":"checked"]=!0;this._data[o?"core":"checkbox"].selected=this._data[o?"core":"checkbox"].selected.concat(f)}else for(i=0,j=f.length;j>i;i++)if(d[f[i]].state[o?"selected":"checked"]){for(k=0,l=d[f[i]].children_d.length;l>k;k++)d[d[f[i]].children_d[k]].state[o?"selected":"checked"]=!0;this._data[o?"core":"checkbox"].selected=this._data[o?"core":"checkbox"].selected.concat(d[f[i]].children_d)}if(-1!==n.indexOf("up")){for(i=0,j=e.children_d.length;j>i;i++)d[e.children_d[i]].children.length||g.push(d[e.children_d[i]].parent);for(g=a.vakata.array_unique(g),k=0,l=g.length;l>k;k++){e=d[g[k]];while(e&&"#"!==e.id){for(h=0,i=0,j=e.children.length;j>i;i++)h+=d[e.children[i]].state[o?"selected":"checked"];if(h!==j)break;e.state[o?"selected":"checked"]=!0,this._data[o?"core":"checkbox"].selected.push(e.id),m=this.get_node(e,!0),m&&m.length&&m.attr("aria-selected",!0).children(".jstree-anchor").addClass(o?"jstree-clicked":"jstree-checked"),e=this.get_node(e.parent)}}}this._data[o?"core":"checkbox"].selected=a.vakata.array_unique(this._data[o?"core":"checkbox"].selected)},this)).on(this.settings.checkbox.tie_selection?"select_node.jstree":"check_node.jstree",a.proxy(function(b,c){var d=c.node,e=this._model.data,f=this.get_node(d.parent),g=this.get_node(d,!0),h,i,j,k,l=this.settings.checkbox.cascade,m=this.settings.checkbox.tie_selection;if(-1!==l.indexOf("down"))for(this._data[m?"core":"checkbox"].selected=a.vakata.array_unique(this._data[m?"core":"checkbox"].selected.concat(d.children_d)),h=0,i=d.children_d.length;i>h;h++)k=e[d.children_d[h]],k.state[m?"selected":"checked"]=!0,k&&k.original&&k.original.state&&k.original.state.undetermined&&(k.original.state.undetermined=!1);if(-1!==l.indexOf("up"))while(f&&"#"!==f.id){for(j=0,h=0,i=f.children.length;i>h;h++)j+=e[f.children[h]].state[m?"selected":"checked"];if(j!==i)break;f.state[m?"selected":"checked"]=!0,this._data[m?"core":"checkbox"].selected.push(f.id),k=this.get_node(f,!0),k&&k.length&&k.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"),f=this.get_node(f.parent)}-1!==l.indexOf("down")&&g.length&&g.find(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked").parent().attr("aria-selected",!0)},this)).on(this.settings.checkbox.tie_selection?"deselect_all.jstree":"uncheck_all.jstree",a.proxy(function(a,b){var c=this.get_node("#"),d=this._model.data,e,f,g;for(e=0,f=c.children_d.length;f>e;e++)g=d[c.children_d[e]],g&&g.original&&g.original.state&&g.original.state.undetermined&&(g.original.state.undetermined=!1)},this)).on(this.settings.checkbox.tie_selection?"deselect_node.jstree":"uncheck_node.jstree",a.proxy(function(b,c){var d=c.node,e=this.get_node(d,!0),f,g,h,i=this.settings.checkbox.cascade,j=this.settings.checkbox.tie_selection;if(d&&d.original&&d.original.state&&d.original.state.undetermined&&(d.original.state.undetermined=!1),-1!==i.indexOf("down"))for(f=0,g=d.children_d.length;g>f;f++)h=this._model.data[d.children_d[f]],h.state[j?"selected":"checked"]=!1,h&&h.original&&h.original.state&&h.original.state.undetermined&&(h.original.state.undetermined=!1);if(-1!==i.indexOf("up"))for(f=0,g=d.parents.length;g>f;f++)h=this._model.data[d.parents[f]],h.state[j?"selected":"checked"]=!1,h&&h.original&&h.original.state&&h.original.state.undetermined&&(h.original.state.undetermined=!1),h=this.get_node(d.parents[f],!0),h&&h.length&&h.attr("aria-selected",!1).children(".jstree-anchor").removeClass(j?"jstree-clicked":"jstree-checked");for(h=[],f=0,g=this._data[j?"core":"checkbox"].selected.length;g>f;f++)-1!==i.indexOf("down")&&-1!==a.inArray(this._data[j?"core":"checkbox"].selected[f],d.children_d)||-1!==i.indexOf("up")&&-1!==a.inArray(this._data[j?"core":"checkbox"].selected[f],d.parents)||h.push(this._data[j?"core":"checkbox"].selected[f]);this._data[j?"core":"checkbox"].selected=a.vakata.array_unique(h),-1!==i.indexOf("down")&&e.length&&e.find(".jstree-anchor").removeClass(j?"jstree-clicked":"jstree-checked").parent().attr("aria-selected",!1)},this)),-1!==this.settings.checkbox.cascade.indexOf("up")&&this.element.on("delete_node.jstree",a.proxy(function(a,b){var c=this.get_node(b.parent),d=this._model.data,e,f,g,h,i=this.settings.checkbox.tie_selection;while(c&&"#"!==c.id){for(g=0,e=0,f=c.children.length;f>e;e++)g+=d[c.children[e]].state[i?"selected":"checked"];if(g!==f)break;c.state[i?"selected":"checked"]=!0,this._data[i?"core":"checkbox"].selected.push(c.id),h=this.get_node(c,!0),h&&h.length&&h.attr("aria-selected",!0).children(".jstree-anchor").addClass(i?"jstree-clicked":"jstree-checked"),c=this.get_node(c.parent)}},this)).on("move_node.jstree",a.proxy(function(b,c){var d=c.is_multi,e=c.old_parent,f=this.get_node(c.parent),g=this._model.data,h,i,j,k,l,m=this.settings.checkbox.tie_selection;if(!d){h=this.get_node(e);while(h&&"#"!==h.id){for(i=0,j=0,k=h.children.length;k>j;j++)i+=g[h.children[j]].state[m?"selected":"checked"];if(i!==k)break;h.state[m?"selected":"checked"]=!0,this._data[m?"core":"checkbox"].selected.push(h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"),h=this.get_node(h.parent)}}h=f;while(h&&"#"!==h.id){for(i=0,j=0,k=h.children.length;k>j;j++)i+=g[h.children[j]].state[m?"selected":"checked"];if(i===k)h.state[m?"selected":"checked"]||(h.state[m?"selected":"checked"]=!0,this._data[m?"core":"checkbox"].selected.push(h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"));else{if(!h.state[m?"selected":"checked"])break;h.state[m?"selected":"checked"]=!1,this._data[m?"core":"checkbox"].selected=a.vakata.array_remove_item(this._data[m?"core":"checkbox"].selected,h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!1).children(".jstree-anchor").removeClass(m?"jstree-clicked":"jstree-checked")}h=this.get_node(h.parent)}},this))},this._undetermined=function(){if(null!==this.element){var a,c,d,e,f={},g=this._model.data,h=this.settings.checkbox.tie_selection,i=this._data[h?"core":"checkbox"].selected,j=[],k=this;for(a=0,c=i.length;c>a;a++)if(g[i[a]]&&g[i[a]].parents)for(d=0,e=g[i[a]].parents.length;e>d;d++)f[g[i[a]].parents[d]]===b&&"#"!==g[i[a]].parents[d]&&(f[g[i[a]].parents[d]]=!0,j.push(g[i[a]].parents[d]));for(this.element.find(".jstree-closed").not(":has(.jstree-children)").each(function(){var h=k.get_node(this),i;if(h.state.loaded){for(a=0,c=h.children_d.length;c>a;a++)if(i=g[h.children_d[a]],!i.state.loaded&&i.original&&i.original.state&&i.original.state.undetermined&&i.original.state.undetermined===!0)for(f[i.id]===b&&"#"!==i.id&&(f[i.id]=!0,j.push(i.id)),d=0,e=i.parents.length;e>d;d++)f[i.parents[d]]===b&&"#"!==i.parents[d]&&(f[i.parents[d]]=!0,j.push(i.parents[d]))}else if(h.original&&h.original.state&&h.original.state.undetermined&&h.original.state.undetermined===!0)for(f[h.id]===b&&"#"!==h.id&&(f[h.id]=!0,j.push(h.id)),d=0,e=h.parents.length;e>d;d++)f[h.parents[d]]===b&&"#"!==h.parents[d]&&(f[h.parents[d]]=!0,j.push(h.parents[d]))}),this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),a=0,c=j.length;c>a;a++)g[j[a]].state[h?"selected":"checked"]||(i=this.get_node(j[a],!0),i&&i.length&&i.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined"))}},this.redraw_node=function(b,c,e,f){if(b=d.redraw_node.apply(this,arguments)){var g,h,i=null;for(g=0,h=b.childNodes.length;h>g;g++)if(b.childNodes[g]&&b.childNodes[g].className&&-1!==b.childNodes[g].className.indexOf("jstree-anchor")){i=b.childNodes[g];break}i&&(!this.settings.checkbox.tie_selection&&this._model.data[b.id].state.checked&&(i.className+=" jstree-checked"),i.insertBefore(m.cloneNode(!1),i.childNodes[0]))}return e||-1===this.settings.checkbox.cascade.indexOf("undetermined")||(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(a.proxy(this._undetermined,this),50)),b},this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0,this.get_container_ul().removeClass("jstree-no-checkboxes")},this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1,this.get_container_ul().addClass("jstree-no-checkboxes")},this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()},this.is_undetermined=function(b){b=this.get_node(b);var c=this.settings.checkbox.cascade,d,e,f=this.settings.checkbox.tie_selection,g=this._data[f?"core":"checkbox"].selected,h=this._model.data;if(!b||b.state[f?"selected":"checked"]===!0||-1===c.indexOf("undetermined")||-1===c.indexOf("down")&&-1===c.indexOf("up"))return!1;if(!b.state.loaded&&b.original.state.undetermined===!0)return!0;for(d=0,e=b.children_d.length;e>d;d++)if(-1!==a.inArray(b.children_d[d],g)||!h[b.children_d[d]].state.loaded&&h[b.children_d[d]].original.state.undetermined)return!0;return!1},this.activate_node=function(b,c){return this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||a(c.target).hasClass("jstree-checkbox"))&&(c.ctrlKey=!0),this.settings.checkbox.tie_selection||!this.settings.checkbox.whole_node&&!a(c.target).hasClass("jstree-checkbox")?d.activate_node.call(this,b,c):this.is_disabled(b)?!1:(this.is_checked(b)?this.uncheck_node(b,c):this.check_node(b,c),void this.trigger("activate_node",{node:this.get_node(b)}))},this.check_node=function(b,c){if(this.settings.checkbox.tie_selection)return this.select_node(b,!1,!0,c);var d,e,f,g;if(a.isArray(b)){for(b=b.slice(),e=0,f=b.length;f>e;e++)this.check_node(b[e],c);return!0}return b=this.get_node(b),b&&"#"!==b.id?(d=this.get_node(b,!0),void(b.state.checked||(b.state.checked=!0,this._data.checkbox.selected.push(b.id),d&&d.length&&d.children(".jstree-anchor").addClass("jstree-checked"),this.trigger("check_node",{node:b,selected:this._data.checkbox.selected,event:c})))):!1},this.uncheck_node=function(b,c){if(this.settings.checkbox.tie_selection)return this.deselect_node(b,!1,c);var d,e,f;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.uncheck_node(b[d],c);return!0}return b=this.get_node(b),b&&"#"!==b.id?(f=this.get_node(b,!0),void(b.state.checked&&(b.state.checked=!1,this._data.checkbox.selected=a.vakata.array_remove_item(this._data.checkbox.selected,b.id),f.length&&f.children(".jstree-anchor").removeClass("jstree-checked"),this.trigger("uncheck_node",{node:b,selected:this._data.checkbox.selected,event:c})))):!1},this.check_all=function(){if(this.settings.checkbox.tie_selection)return this.select_all();var a=this._data.checkbox.selected.concat([]),b,c;for(this._data.checkbox.selected=this._model.data["#"].children_d.concat(),b=0,c=this._data.checkbox.selected.length;c>b;b++)this._model.data[this._data.checkbox.selected[b]]&&(this._model.data[this._data.checkbox.selected[b]].state.checked=!0);this.redraw(!0),this.trigger("check_all",{selected:this._data.checkbox.selected})},this.uncheck_all=function(){if(this.settings.checkbox.tie_selection)return this.deselect_all();var a=this._data.checkbox.selected.concat([]),b,c;for(b=0,c=this._data.checkbox.selected.length;c>b;b++)this._model.data[this._data.checkbox.selected[b]]&&(this._model.data[this._data.checkbox.selected[b]].state.checked=!1);this._data.checkbox.selected=[],this.element.find(".jstree-checked").removeClass("jstree-checked"),this.trigger("uncheck_all",{selected:this._data.checkbox.selected,node:a})},this.is_checked=function(a){return this.settings.checkbox.tie_selection?this.is_selected(a):(a=this.get_node(a),a&&"#"!==a.id?a.state.checked:!1)},this.get_checked=function(b){return this.settings.checkbox.tie_selection?this.get_selected(b):b?a.map(this._data.checkbox.selected,a.proxy(function(a){return this.get_node(a)},this)):this._data.checkbox.selected},this.get_top_checked=function(b){if(this.settings.checkbox.tie_selection)return this.get_top_selected(b);var c=this.get_checked(!0),d={},e,f,g,h;for(e=0,f=c.length;f>e;e++)d[c[e].id]=c[e];for(e=0,f=c.length;f>e;e++)for(g=0,h=c[e].children_d.length;h>g;g++)d[c[e].children_d[g]]&&delete d[c[e].children_d[g]];c=[];for(e in d)d.hasOwnProperty(e)&&c.push(e);return b?a.map(c,a.proxy(function(a){return this.get_node(a)},this)):c},this.get_bottom_checked=function(b){if(this.settings.checkbox.tie_selection)return this.get_bottom_selected(b);var c=this.get_checked(!0),d=[],e,f;for(e=0,f=c.length;f>e;e++)c[e].children.length||d.push(c[e].id);return b?a.map(d,a.proxy(function(a){return this.get_node(a)},this)):d},this.load_node=function(b,c){var e,f,g,h,i,j;if(!a.isArray(b)&&!this.settings.checkbox.tie_selection&&(j=this.get_node(b),j&&j.state.loaded))for(e=0,f=j.children_d.length;f>e;e++)this._model.data[j.children_d[e]].state.checked&&(i=!0,this._data.checkbox.selected=a.vakata.array_remove_item(this._data.checkbox.selected,j.children_d[e]));return d.load_node.apply(this,arguments)},this.get_state=function(){var a=d.get_state.apply(this,arguments);return this.settings.checkbox.tie_selection?a:(a.checkbox=this._data.checkbox.selected.slice(),a)},this.set_state=function(b,c){var e=d.set_state.apply(this,arguments);if(e&&b.checkbox){if(!this.settings.checkbox.tie_selection){this.uncheck_all();var f=this;a.each(b.checkbox,function(a,b){f.check_node(b)})}return delete b.checkbox,this.set_state(b,c),!1}return e}},a.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(b,c){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.create_node(d,{},"last",function(a){setTimeout(function(){c.edit(a)},0)})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.edit(d)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.delete_node(c.is_selected(d)?c.get_selected():d)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.cut(c.is_selected(d)?c.get_top_selected():d)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.copy(c.is_selected(d)?c.get_top_selected():d)}},paste:{separator_before:!1,icon:!1,_disabled:function(b){return!a.jstree.reference(b.reference).can_paste()},separator_after:!1,label:"Paste",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.paste(d)}}}}}}},a.jstree.plugins.contextmenu=function(c,d){this.bind=function(){d.bind.call(this);var b=0,c=null,e,f;this.element.on("contextmenu.jstree",".jstree-anchor",a.proxy(function(a,d){a.preventDefault(),b=a.ctrlKey?+new Date:0,(d||c)&&(b=+new Date+1e4),c&&clearTimeout(c),this.is_loading(a.currentTarget)||this.show_contextmenu(a.currentTarget,a.pageX,a.pageY,a)},this)).on("click.jstree",".jstree-anchor",a.proxy(function(c){this._data.contextmenu.visible&&(!b||+new Date-b>250)&&a.vakata.context.hide(),b=0},this)).on("touchstart.jstree",".jstree-anchor",function(b){b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(e=b.pageX,f=b.pageY,c=setTimeout(function(){a(b.currentTarget).trigger("contextmenu",!0)},750))}).on("touchmove.vakata.jstree",function(a){c&&a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches[0]&&(Math.abs(e-a.pageX)>50||Math.abs(f-a.pageY)>50)&&clearTimeout(c)}).on("touchend.vakata.jstree",function(a){c&&clearTimeout(c)}),a(i).on("context_hide.vakata.jstree",a.proxy(function(){this._data.contextmenu.visible=!1},this))},this.teardown=function(){this._data.contextmenu.visible&&a.vakata.context.hide(),d.teardown.call(this)},this.show_contextmenu=function(c,d,e,f){if(c=this.get_node(c),!c||"#"===c.id)return!1;var g=this.settings.contextmenu,h=this.get_node(c,!0),i=h.children(".jstree-anchor"),j=!1,k=!1;(g.show_at_node||d===b||e===b)&&(j=i.offset(),d=j.left,e=j.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(c)&&this.activate_node(c,f),k=g.items,a.isFunction(k)&&(k=k.call(this,c,a.proxy(function(a){this._show_contextmenu(c,d,e,a)},this))),a.isPlainObject(k)&&this._show_contextmenu(c,d,e,k)},this._show_contextmenu=function(b,c,d,e){var f=this.get_node(b,!0),g=f.children(".jstree-anchor");a(i).one("context_show.vakata.jstree",a.proxy(function(b,c){var d="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";a(c.element).addClass(d)},this)),this._data.contextmenu.visible=!0,a.vakata.context.show(g,{x:c,y:d},e),this.trigger("show_contextmenu",{node:b,x:c,y:d})}},function(a){var b=!1,c={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};a.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(b){a(i).triggerHandler("context_"+b+".vakata",{reference:c.reference,element:c.element,position:{x:c.position_x,y:c.position_y}})},_execute:function(b){return b=c.items[b],b&&(!b._disabled||a.isFunction(b._disabled)&&!b._disabled({item:b,reference:c.reference,element:c.element}))&&b.action?b.action.call(null,{item:b,reference:c.reference,element:c.element,position:{x:c.position_x,y:c.position_y}}):!1},_parse:function(b,d){if(!b)return!1;d||(c.html="",c.items=[]);var e="",f=!1,g;return d&&(e+=""),d||(c.html=e,a.vakata.context._trigger("parse")),e.length>10?e:!1},_show_submenu:function(c){if(c=a(c),c.length&&c.children("ul").length){var d=c.children("ul"),e=c.offset().left+c.outerWidth(),f=c.offset().top,g=d.width(),h=d.height(),i=a(window).width()+a(window).scrollLeft(),j=a(window).height()+a(window).scrollTop();b?c[e-(g+10+c.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):c[e+g+10>i?"addClass":"removeClass"]("vakata-context-right"),f+h+10>j&&d.css("bottom","-1px"),d.show()}},show:function(d,e,f){var g,h,i,j,k,l,m,n,o=!0;switch(c.element&&c.element.length&&c.element.width(""),o){case!e&&!d:return!1;case!!e&&!!d:c.reference=d,c.position_x=e.x,c.position_y=e.y;break;case!e&&!!d:c.reference=d,g=d.offset(),c.position_x=g.left+d.outerHeight(),c.position_y=g.top;break;case!!e&&!d:c.position_x=e.x,c.position_y=e.y}d&&!f&&a(d).data("vakata_contextmenu")&&(f=a(d).data("vakata_contextmenu")),a.vakata.context._parse(f)&&c.element.html(c.html),c.items.length&&(c.element.appendTo("body"),h=c.element,i=c.position_x,j=c.position_y,k=h.width(),l=h.height(),m=a(window).width()+a(window).scrollLeft(),n=a(window).height()+a(window).scrollTop(),b&&(i-=h.outerWidth()-a(d).outerWidth(),im&&(i=m-(k+20)),j+l+20>n&&(j=n-(l+20)),c.element.css({left:i,top:j}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),c.is_visible=!0,a.vakata.context._trigger("show"))},hide:function(){c.is_visible&&(c.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),c.is_visible=!1,a.vakata.context._trigger("hide"))}},a(function(){b="rtl"===a("body").css("direction");var d=!1;c.element=a("
    "),c.element.on("mouseenter","li",function(b){b.stopImmediatePropagation(),a.contains(this,b.relatedTarget)||(d&&clearTimeout(d),c.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),a(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),a.vakata.context._show_submenu(this))}).on("mouseleave","li",function(b){a.contains(this,b.relatedTarget)||a(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(b){a(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),a.vakata.context.settings.hide_onmouseleave&&(d=setTimeout(function(b){return function(){a.vakata.context.hide()}}(this),a.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(b){b.preventDefault(),a(this).blur().parent().hasClass("vakata-context-disabled")||a.vakata.context._execute(a(this).attr("rel"))===!1||a.vakata.context.hide()}).on("keydown","a",function(b){var d=null;switch(b.which){case 13:case 32:b.type="mouseup",b.preventDefault(),a(b.currentTarget).trigger(b);break;case 37:c.is_visible&&(c.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 38:c.is_visible&&(d=c.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),d.length||(d=c.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),d.addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 39:c.is_visible&&(c.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 40:c.is_visible&&(d=c.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),d.length||(d=c.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),d.addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 27:a.vakata.context.hide(),b.preventDefault()}}).on("keydown",function(a){a.preventDefault();var b=c.element.find(".vakata-contextmenu-shortcut-"+a.which).parent();b.parent().not(".vakata-context-disabled")&&b.click()}),a(i).on("mousedown.vakata.jstree",function(b){c.is_visible&&!a.contains(c.element[0],b.target)&&a.vakata.context.hide()}).on("context_show.vakata.jstree",function(a,d){c.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),b&&c.element.addClass("vakata-context-rtl").css("direction","rtl"),c.element.find("ul").hide().end()})})}(a),a.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0,large_drop_target:!1,large_drag_target:!1},a.jstree.plugins.dnd=function(b,c){this.bind=function(){c.bind.call(this),this.element.on("mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",a.proxy(function(b){if(this.settings.dnd.large_drag_target&&a(b.target).closest(".jstree-node")[0]!==b.currentTarget)return!0;if("touchstart"===b.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var c=this.get_node(b.target),d=this.is_selected(c)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,e=d>1?d+" "+this.get_string("nodes"):this.get_text(b.currentTarget);return this.settings.core.force_text&&(e=a.vakata.html.escape(e)),c&&c.id&&"#"!==c.id&&(1===b.which||"touchstart"===b.type)&&(this.settings.dnd.is_draggable===!0||a.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,d>1?this.get_top_selected(!0):[c]))?(this.element.trigger("mousedown.jstree"),a.vakata.dnd.start(b,{jstree:!0,origin:this,obj:this.get_node(c,!0),nodes:d>1?this.get_top_selected():[c.id]},'
    '+e+'
    ')):void 0},this))}},a(function(){var b=!1,c=!1,d=!1,e=a('
     
    ').hide();a(i).on("dnd_start.vakata.jstree",function(a,c){b=!1,c&&c.data&&c.data.jstree&&e.appendTo("body")}).on("dnd_move.vakata.jstree",function(f,g){if(d&&clearTimeout(d),g&&g.data&&g.data.jstree&&(!g.event.target.id||"jstree-marker"!==g.event.target.id)){var h=a.jstree.reference(g.event.target),i=!1,j=!1,k=!1,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;if(h&&h._data&&h._data.dnd)if(e.attr("class","jstree-"+h.get_theme()+(h.settings.core.themes.responsive?" jstree-dnd-responsive":"")),g.helper.children().attr("class","jstree-"+h.get_theme()+" jstree-"+h.get_theme()+"-"+h.get_theme_variant()+" "+(h.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[g.data.origin&&(g.data.origin.settings.dnd.always_copy||g.data.origin.settings.dnd.copy&&(g.event.metaKey||g.event.ctrlKey))?"show":"hide"](),g.event.target!==h.element[0]&&g.event.target!==h.get_container_ul()[0]||0!==h.get_container_ul().children().length){if(i=h.settings.dnd.large_drop_target?a(g.event.target).closest(".jstree-node").children(".jstree-anchor"):a(g.event.target).closest(".jstree-anchor"),i&&i.length&&i.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(j=i.offset(),k=g.event.pageY-j.top,o=i.outerHeight(),r=o/3>k?["b","i","a"]:k>o-o/3?["a","i","b"]:k>o/2?["i","a","b"]:["i","b","a"],a.each(r,function(f,k){switch(k){case"b":m=j.left-6,n=j.top,p=h.get_parent(i),q=i.parent().index();break;case"i":y=h.settings.dnd.inside_pos,z=h.get_node(i.parent()),m=j.left-2,n=j.top+o/2+1,p=z.id,q="first"===y?0:"last"===y?z.children.length:Math.min(y,z.children.length);break;case"a":m=j.left-6,n=j.top+o,p=h.get_parent(i),q=i.parent().index()+1}for(s=!0,t=0,u=g.data.nodes.length;u>t;t++)if(v=g.data.origin&&(g.data.origin.settings.dnd.always_copy||g.data.origin.settings.dnd.copy&&(g.event.metaKey||g.event.ctrlKey))?"copy_node":"move_node",w=q,"move_node"===v&&"a"===k&&g.data.origin&&g.data.origin===h&&p===h.get_parent(g.data.nodes[t])&&(x=h.get_node(p),w>a.inArray(g.data.nodes[t],x.children)&&(w-=1)),s=s&&(h&&h.settings&&h.settings.dnd&&h.settings.dnd.check_while_dragging===!1||h.check(v,g.data.origin&&g.data.origin!==h?g.data.origin.get_node(g.data.nodes[t]):g.data.nodes[t],p,w,{dnd:!0,ref:h.get_node(i.parent()),pos:k,origin:g.data.origin,is_multi:g.data.origin&&g.data.origin!==h,is_foreign:!g.data.origin})),!s){h&&h.last_error&&(c=h.last_error());break}return"i"===k&&i.parent().is(".jstree-closed")&&h.settings.dnd.open_timeout&&(d=setTimeout(function(a,b){return function(){a.open_node(b)}}(h,i),h.settings.dnd.open_timeout)),s?(b={ins:h,par:p,pos:"i"!==k||"last"!==y||0!==q||h.is_loaded(z)?q:"last"},e.css({left:m+"px",top:n+"px"}).show(),g.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),c={},r=!0,!1):void 0}),r===!0))return}else{for(s=!0,t=0,u=g.data.nodes.length;u>t;t++)if(s=s&&h.check(g.data.origin&&(g.data.origin.settings.dnd.always_copy||g.data.origin.settings.dnd.copy&&(g.event.metaKey||g.event.ctrlKey))?"copy_node":"move_node",g.data.origin&&g.data.origin!==h?g.data.origin.get_node(g.data.nodes[t]):g.data.nodes[t],"#","last",{dnd:!0,ref:h.get_node("#"),pos:"i",origin:g.data.origin,is_multi:g.data.origin&&g.data.origin!==h,is_foreign:!g.data.origin}),!s)break;if(s)return b={ins:h,par:"#",pos:"last"},e.hide(),void g.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok")}b=!1,g.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),e.hide()}}).on("dnd_scroll.vakata.jstree",function(a,c){c&&c.data&&c.data.jstree&&(e.hide(),b=!1,c.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er"))}).on("dnd_stop.vakata.jstree",function(f,g){if(d&&clearTimeout(d),g&&g.data&&g.data.jstree){e.hide().detach();var h,i,j=[];if(b){for(h=0,i=g.data.nodes.length;i>h;h++)j[h]=g.data.origin?g.data.origin.get_node(g.data.nodes[h]):g.data.nodes[h];b.ins[g.data.origin&&(g.data.origin.settings.dnd.always_copy||g.data.origin.settings.dnd.copy&&(g.event.metaKey||g.event.ctrlKey))?"copy_node":"move_node"](j,b.par,b.pos,!1,!1,!1,g.data.origin); + +}else h=a(g.event.target).closest(".jstree"),h.length&&c&&c.error&&"check"===c.error&&(h=h.jstree(!0),h&&h.settings.core.error.call(this,c))}}).on("keyup.jstree keydown.jstree",function(b,c){c=a.vakata.dnd._get(),c&&c.data&&c.data.jstree&&c.helper.find(".jstree-copy").first()[c.data.origin&&(c.data.origin.settings.dnd.always_copy||c.data.origin.settings.dnd.copy&&(b.metaKey||b.ctrlKey))?"show":"hide"]()})}),function(a){a.vakata.html={div:a("
    "),escape:function(b){return a.vakata.html.div.text(b).html()},strip:function(b){return a.vakata.html.div.empty().append(a.parseHTML(b)).text()}};var b={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};a.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:50},_trigger:function(b,c){var d=a.vakata.dnd._get();d.event=c,a(i).triggerHandler("dnd_"+b+".vakata",d)},_get:function(){return{data:b.data,element:b.element,helper:b.helper}},_clean:function(){b.helper&&b.helper.remove(),b.scroll_i&&(clearInterval(b.scroll_i),b.scroll_i=!1),b={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},a(i).off("mousemove.vakata.jstree touchmove.vakata.jstree",a.vakata.dnd.drag),a(i).off("mouseup.vakata.jstree touchend.vakata.jstree",a.vakata.dnd.stop)},_scroll:function(c){if(!b.scroll_e||!b.scroll_l&&!b.scroll_t)return b.scroll_i&&(clearInterval(b.scroll_i),b.scroll_i=!1),!1;if(!b.scroll_i)return b.scroll_i=setInterval(a.vakata.dnd._scroll,100),!1;if(c===!0)return!1;var d=b.scroll_e.scrollTop(),e=b.scroll_e.scrollLeft();b.scroll_e.scrollTop(d+b.scroll_t*a.vakata.dnd.settings.scroll_speed),b.scroll_e.scrollLeft(e+b.scroll_l*a.vakata.dnd.settings.scroll_speed),(d!==b.scroll_e.scrollTop()||e!==b.scroll_e.scrollLeft())&&a.vakata.dnd._trigger("scroll",b.scroll_e)},start:function(c,d,e){"touchstart"===c.type&&c.originalEvent&&c.originalEvent.changedTouches&&c.originalEvent.changedTouches[0]&&(c.pageX=c.originalEvent.changedTouches[0].pageX,c.pageY=c.originalEvent.changedTouches[0].pageY,c.target=i.elementFromPoint(c.originalEvent.changedTouches[0].pageX-window.pageXOffset,c.originalEvent.changedTouches[0].pageY-window.pageYOffset)),b.is_drag&&a.vakata.dnd.stop({});try{c.currentTarget.unselectable="on",c.currentTarget.onselectstart=function(){return!1},c.currentTarget.style&&(c.currentTarget.style.MozUserSelect="none")}catch(f){}return b.init_x=c.pageX,b.init_y=c.pageY,b.data=d,b.is_down=!0,b.element=c.currentTarget,b.target=c.target,b.is_touch="touchstart"===c.type,e!==!1&&(b.helper=a("
    ").html(e).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),a(i).on("mousemove.vakata.jstree touchmove.vakata.jstree",a.vakata.dnd.drag),a(i).on("mouseup.vakata.jstree touchend.vakata.jstree",a.vakata.dnd.stop),!1},drag:function(c){if("touchmove"===c.type&&c.originalEvent&&c.originalEvent.changedTouches&&c.originalEvent.changedTouches[0]&&(c.pageX=c.originalEvent.changedTouches[0].pageX,c.pageY=c.originalEvent.changedTouches[0].pageY,c.target=i.elementFromPoint(c.originalEvent.changedTouches[0].pageX-window.pageXOffset,c.originalEvent.changedTouches[0].pageY-window.pageYOffset)),b.is_down){if(!b.is_drag){if(!(Math.abs(c.pageX-b.init_x)>(b.is_touch?a.vakata.dnd.settings.threshold_touch:a.vakata.dnd.settings.threshold)||Math.abs(c.pageY-b.init_y)>(b.is_touch?a.vakata.dnd.settings.threshold_touch:a.vakata.dnd.settings.threshold)))return;b.helper&&(b.helper.appendTo("body"),b.helper_w=b.helper.outerWidth()),b.is_drag=!0,a.vakata.dnd._trigger("start",c)}var d=!1,e=!1,f=!1,g=!1,h=!1,j=!1,k=!1,l=!1,m=!1,n=!1;return b.scroll_t=0,b.scroll_l=0,b.scroll_e=!1,a(a(c.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(a(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var d=a(this),e=d.offset();return this.scrollHeight>this.offsetHeight&&(e.top+d.height()-c.pageYthis.offsetWidth&&(e.left+d.width()-c.pageXg&&c.pageY-kg&&g-(c.pageY-k)j&&c.pageX-lj&&j-(c.pageX-l)f&&(m=f-50),h&&n+b.helper_w>h&&(n=h-(b.helper_w+2)),b.helper.css({left:n+"px",top:m+"px"})),a.vakata.dnd._trigger("move",c),!1}},stop:function(c){if("touchend"===c.type&&c.originalEvent&&c.originalEvent.changedTouches&&c.originalEvent.changedTouches[0]&&(c.pageX=c.originalEvent.changedTouches[0].pageX,c.pageY=c.originalEvent.changedTouches[0].pageY,c.target=i.elementFromPoint(c.originalEvent.changedTouches[0].pageX-window.pageXOffset,c.originalEvent.changedTouches[0].pageY-window.pageYOffset)),b.is_drag)a.vakata.dnd._trigger("stop",c);else if("touchend"===c.type&&c.target===b.target){var d=setTimeout(function(){a(c.target).click()},100);a(c.target).one("click",function(){d&&clearTimeout(d)})}return a.vakata.dnd._clean(),!1}}}(a),a.jstree.defaults.massload=null,a.jstree.plugins.massload=function(b,c){this.init=function(a,b){c.init.call(this,a,b),this._data.massload={}},this._load_nodes=function(b,d,e){var f=this.settings.massload;return e&&!a.isEmptyObject(this._data.massload)?c._load_nodes.call(this,b,d,e):a.isFunction(f)?f.call(this,b,a.proxy(function(a){if(a)for(var f in a)a.hasOwnProperty(f)&&(this._data.massload[f]=a[f]);c._load_nodes.call(this,b,d,e)},this)):"object"==typeof f&&f&&f.url?(f=a.extend(!0,{},f),a.isFunction(f.url)&&(f.url=f.url.call(this,b)),a.isFunction(f.data)&&(f.data=f.data.call(this,b)),a.ajax(f).done(a.proxy(function(a,f,g){if(a)for(var h in a)a.hasOwnProperty(h)&&(this._data.massload[h]=a[h]);c._load_nodes.call(this,b,d,e)},this)).fail(a.proxy(function(a){c._load_nodes.call(this,b,d,e)},this))):c._load_nodes.call(this,b,d,e)},this._load_node=function(b,d){var e=this._data.massload[b.id];return e?this["string"==typeof e?"_append_html_data":"_append_json_data"](b,"string"==typeof e?a(a.parseHTML(e)).filter(function(){return 3!==this.nodeType}):e,function(a){d.call(this,a),delete this._data.massload[b.id]}):c._load_node.call(this,b,d)}},a.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,show_only_matches_children:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},a.jstree.plugins.search=function(c,d){this.bind=function(){d.bind.call(this),this._data.search.str="",this._data.search.dom=a(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=!1,this._data.search.smc=!1,this.element.on("before_open.jstree",a.proxy(function(b,c){var d,e,f,g=this._data.search.res,h=[],i=a();if(g&&g.length&&(this._data.search.dom=a(this.element[0].querySelectorAll("#"+a.map(g,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this._data.search.som&&this._data.search.res.length)){for(d=0,e=g.length;e>d;d++)h=h.concat(this.get_node(g[d]).parents);h=a.vakata.array_remove_item(a.vakata.array_unique(h),"#"),i=h.length?a(this.element[0].querySelectorAll("#"+a.map(h,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #"))):a(),this.element.find(".jstree-node").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last"),i=i.add(this._data.search.dom),this._data.search.smc&&this._data.search.dom.children(".jstree-children").find(".jstree-node").show(),i.parentsUntil(".jstree").addBack().show().filter(".jstree-children").each(function(){a(this).children(".jstree-node:visible").eq(-1).addClass("jstree-last")})}},this)).on("search.jstree",a.proxy(function(b,c){this._data.search.som&&c.nodes.length&&(this.element.find(".jstree-node").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last"),this._data.search.smc&&c.nodes.children(".jstree-children").find(".jstree-node").show(),c.nodes.parentsUntil(".jstree").addBack().show().filter(".jstree-children").each(function(){a(this).children(".jstree-node:visible").eq(-1).addClass("jstree-last")}))},this)).on("clear_search.jstree",a.proxy(function(a,b){this._data.search.som&&b.nodes.length&&this.element.find(".jstree-node").css("display","").filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last")},this))},this.search=function(c,d,e,f,g,h){if(c===!1||""===a.trim(c.toString()))return this.clear_search();f=this.get_node(f),f=f&&f.id?f.id:null,c=c.toString();var i=this.settings.search,j=i.ajax?i.ajax:!1,k=this._model.data,l=null,m=[],n=[],o,p;return this._data.search.res.length&&!g&&this.clear_search(),e===b&&(e=i.show_only_matches),h===b&&(h=i.show_only_matches_children),d||j===!1?(g||(this._data.search.str=c,this._data.search.dom=a(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=e,this._data.search.smc=h),l=new a.vakata.search(c,!0,{caseSensitive:i.case_sensitive,fuzzy:i.fuzzy}),a.each(k[f?f:"#"].children_d,function(a,b){var d=k[b];d.text&&(i.search_callback&&i.search_callback.call(this,c,d)||!i.search_callback&&l.search(d.text).isMatch)&&(!i.search_leaves_only||d.state.loaded&&0===d.children.length)&&(m.push(b),n=n.concat(d.parents))}),m.length&&(n=a.vakata.array_unique(n),this._search_open(n),g?(this._data.search.dom=this._data.search.dom.add(a(this.element[0].querySelectorAll("#"+a.map(m,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #")))),this._data.search.res=a.vakata.array_unique(this._data.search.res.concat(m))):(this._data.search.dom=a(this.element[0].querySelectorAll("#"+a.map(m,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.res=m),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")),void this.trigger("search",{nodes:this._data.search.dom,str:c,res:this._data.search.res,show_only_matches:e})):a.isFunction(j)?j.call(this,c,a.proxy(function(b){b&&b.d&&(b=b.d),this._load_nodes(a.isArray(b)?a.vakata.array_unique(b):[],function(){this.search(c,!0,e,f,g)},!0)},this),f):(j=a.extend({},j),j.data||(j.data={}),j.data.str=c,f&&(j.data.inside=f),a.ajax(j).fail(a.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(j)},this.settings.core.error.call(this,this._data.core.last_error)},this)).done(a.proxy(function(b){b&&b.d&&(b=b.d),this._load_nodes(a.isArray(b)?a.vakata.array_unique(b):[],function(){this.search(c,!0,e,f,g)},!0)},this)))},this.clear_search=function(){this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search"),this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0),this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res}),this._data.search.str="",this._data.search.res=[],this._data.search.opn=[],this._data.search.dom=a()},this._search_open=function(b){var c=this;a.each(b.concat([]),function(d,e){if("#"===e)return!0;try{e=a("#"+e.replace(a.jstree.idregex,"\\$&"),c.element)}catch(f){}e&&e.length&&c.is_closed(e)&&(c._data.search.opn.push(e[0].id),c.open_node(e,function(){c._search_open(b)},0))})}},function(a){a.vakata.search=function(b,c,d){d=d||{},d=a.extend({},a.vakata.search.defaults,d),d.fuzzy!==!1&&(d.fuzzy=!0),b=d.caseSensitive?b:b.toLowerCase();var e=d.location,f=d.distance,g=d.threshold,h=b.length,i,j,k,l;return h>32&&(d.fuzzy=!1),d.fuzzy&&(i=1<c;c++)a[b.charAt(c)]=0;for(c=0;h>c;c++)a[b.charAt(c)]|=1<c;c++){o=0,p=q;while(p>o)k(c,e+p)<=m?o=p:q=p,p=Math.floor((q-o)/2+o);for(q=p,s=Math.max(1,e-p+1),t=Math.min(e+p,l)+h,u=new Array(t+2),u[t+1]=(1<=s;f--)if(v=j[a.charAt(f-1)],u[f]=0===c?(u[f+1]<<1|1)&v:(u[f+1]<<1|1)&v|((r[f+1]|r[f])<<1|1)|r[f+1],u[f]&i&&(w=k(c,f-1),m>=w)){if(m=w,n=f-1,x.push(n),!(n>e))break;s=Math.max(1,2*e-n)}if(k(c+1,e)>m)break;r=u}return{isMatch:n>=0,score:w}},c===!0?{search:l}:l(c)},a.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1}}(a),a.jstree.defaults.sort=function(a,b){return this.get_text(a)>this.get_text(b)?1:-1},a.jstree.plugins.sort=function(b,c){this.bind=function(){c.bind.call(this),this.element.on("model.jstree",a.proxy(function(a,b){this.sort(b.parent,!0)},this)).on("rename_node.jstree create_node.jstree",a.proxy(function(a,b){this.sort(b.parent||b.node.parent,!1),this.redraw_node(b.parent||b.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",a.proxy(function(a,b){this.sort(b.parent,!1),this.redraw_node(b.parent,!0)},this))},this.sort=function(b,c){var d,e;if(b=this.get_node(b),b&&b.children&&b.children.length&&(b.children.sort(a.proxy(this.settings.sort,this)),c))for(d=0,e=b.children_d.length;e>d;d++)this.sort(b.children_d[d],!1)}};var n=!1;a.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree",ttl:!1,filter:!1},a.jstree.plugins.state=function(b,c){this.bind=function(){c.bind.call(this);var b=a.proxy(function(){this.element.on(this.settings.state.events,a.proxy(function(){n&&clearTimeout(n),n=setTimeout(a.proxy(function(){this.save_state()},this),100)},this)),this.trigger("state_ready")},this);this.element.on("ready.jstree",a.proxy(function(a,c){this.element.one("restore_state.jstree",b),this.restore_state()||b()},this))},this.save_state=function(){var b={state:this.get_state(),ttl:this.settings.state.ttl,sec:+new Date};a.vakata.storage.set(this.settings.state.key,JSON.stringify(b))},this.restore_state=function(){var b=a.vakata.storage.get(this.settings.state.key);if(b)try{b=JSON.parse(b)}catch(c){return!1}return b&&b.ttl&&b.sec&&+new Date-b.sec>b.ttl?!1:(b&&b.state&&(b=b.state),b&&a.isFunction(this.settings.state.filter)&&(b=this.settings.state.filter.call(this,b)),b?(this.element.one("set_state.jstree",function(c,d){d.instance.trigger("restore_state",{state:a.extend(!0,{},b)})}),this.set_state(b),!0):!1)},this.clear_state=function(){return a.vakata.storage.del(this.settings.state.key)}},function(a,b){a.vakata.storage={set:function(a,b){return window.localStorage.setItem(a,b)},get:function(a){return window.localStorage.getItem(a)},del:function(a){return window.localStorage.removeItem(a)}}}(a),a.jstree.defaults.types={"#":{},"default":{}},a.jstree.plugins.types=function(c,d){this.init=function(a,c){var e,f;if(c&&c.types&&c.types["default"])for(e in c.types)if("default"!==e&&"#"!==e&&c.types.hasOwnProperty(e))for(f in c.types["default"])c.types["default"].hasOwnProperty(f)&&c.types[e][f]===b&&(c.types[e][f]=c.types["default"][f]);d.init.call(this,a,c),this._model.data["#"].type="#"},this.refresh=function(a,b){d.refresh.call(this,a,b),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",a.proxy(function(a,c){var d=this._model.data,e=c.nodes,f=this.settings.types,g,h,i="default";for(g=0,h=e.length;h>g;g++)i="default",d[e[g]].original&&d[e[g]].original.type&&f[d[e[g]].original.type]&&(i=d[e[g]].original.type),d[e[g]].data&&d[e[g]].data.jstree&&d[e[g]].data.jstree.type&&f[d[e[g]].data.jstree.type]&&(i=d[e[g]].data.jstree.type),d[e[g]].type=i,d[e[g]].icon===!0&&f[i].icon!==b&&(d[e[g]].icon=f[i].icon);d["#"].type="#"},this)),d.bind.call(this)},this.get_json=function(b,c,e){var f,g,h=this._model.data,i=c?a.extend(!0,{},c,{no_id:!1}):{},j=d.get_json.call(this,b,i,e);if(j===!1)return!1;if(a.isArray(j))for(f=0,g=j.length;g>f;f++)j[f].type=j[f].id&&h[j[f].id]&&h[j[f].id].type?h[j[f].id].type:"default",c&&c.no_id&&(delete j[f].id,j[f].li_attr&&j[f].li_attr.id&&delete j[f].li_attr.id,j[f].a_attr&&j[f].a_attr.id&&delete j[f].a_attr.id);else j.type=j.id&&h[j.id]&&h[j.id].type?h[j.id].type:"default",c&&c.no_id&&(j=this._delete_ids(j));return j},this._delete_ids=function(b){if(a.isArray(b)){for(var c=0,d=b.length;d>c;c++)b[c]=this._delete_ids(b[c]);return b}return delete b.id,b.li_attr&&b.li_attr.id&&delete b.li_attr.id,b.a_attr&&b.a_attr.id&&delete b.a_attr.id,b.children&&a.isArray(b.children)&&(b.children=this._delete_ids(b.children)),b},this.check=function(c,e,f,g,h){if(d.check.call(this,c,e,f,g,h)===!1)return!1;e=e&&e.id?e:this.get_node(e),f=f&&f.id?f:this.get_node(f);var i=e&&e.id?h&&h.origin?h.origin:a.jstree.reference(e.id):null,j,k,l,m;switch(i=i&&i._model&&i._model.data?i._model.data:null,c){case"create_node":case"move_node":case"copy_node":if("move_node"!==c||-1===a.inArray(e.id,f.children)){if(j=this.get_rules(f),j.max_children!==b&&-1!==j.max_children&&j.max_children===f.children.length)return this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+c,data:JSON.stringify({chk:c,pos:g,obj:e&&e.id?e.id:!1,par:f&&f.id?f.id:!1})},!1;if(j.valid_children!==b&&-1!==j.valid_children&&-1===a.inArray(e.type||"default",j.valid_children))return this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+c,data:JSON.stringify({chk:c,pos:g,obj:e&&e.id?e.id:!1,par:f&&f.id?f.id:!1})},!1;if(i&&e.children_d&&e.parents){for(k=0,l=0,m=e.children_d.length;m>l;l++)k=Math.max(k,i[e.children_d[l]].parents.length);k=k-e.parents.length+1}(0>=k||k===b)&&(k=1);do{if(j.max_depth!==b&&-1!==j.max_depth&&j.max_depthf;f++)this.set_type(c[f],d);return!0}return e=this.settings.types,c=this.get_node(c),e[d]&&c?(h=c.type,i=this.get_icon(c),c.type=d,(i===!0||e[h]&&e[h].icon!==b&&i===e[h].icon)&&this.set_icon(c,e[d].icon!==b?e[d].icon:!0),!0):!1}},a.jstree.defaults.unique={case_sensitive:!1,duplicate:function(a,b){return a+" ("+b+")"}},a.jstree.plugins.unique=function(c,d){this.check=function(b,c,e,f,g){if(d.check.call(this,b,c,e,f,g)===!1)return!1;if(c=c&&c.id?c:this.get_node(c),e=e&&e.id?e:this.get_node(e),!e||!e.children)return!0;var h="rename_node"===b?f:c.text,i=[],j=this.settings.unique.case_sensitive,k=this._model.data,l,m;for(l=0,m=e.children.length;m>l;l++)i.push(j?k[e.children[l]].text:k[e.children[l]].text.toLowerCase());switch(j||(h=h.toLowerCase()),b){case"delete_node":return!0;case"rename_node":return l=-1===a.inArray(h,i)||c.text&&c.text[j?"toString":"toLowerCase"]()===h,l||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),l;case"create_node":return l=-1===a.inArray(h,i),l||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_04",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),l;case"copy_node":return l=-1===a.inArray(h,i),l||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_02",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),l;case"move_node":return l=c.parent===e.id&&(!g||!g.is_multi)||-1===a.inArray(h,i),l||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_03",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),l}return!0},this.create_node=function(c,e,f,g,h){if(!e||e.text===b){if(null===c&&(c="#"),c=this.get_node(c),!c)return d.create_node.call(this,c,e,f,g,h);if(f=f===b?"last":f,!f.toString().match(/^(before|after)$/)&&!h&&!this.is_loaded(c))return d.create_node.call(this,c,e,f,g,h);e||(e={});var i,j,k,l,m,n=this._model.data,o=this.settings.unique.case_sensitive,p=this.settings.unique.duplicate;for(j=i=this.get_string("New node"),k=[],l=0,m=c.children.length;m>l;l++)k.push(o?n[c.children[l]].text:n[c.children[l]].text.toLowerCase());l=1;while(-1!==a.inArray(o?j:j.toLowerCase(),k))j=p.call(this,i,++l).toString();e.text=j}return d.create_node.call(this,c,e,f,g,h)}};var o=i.createElement("DIV");if(o.setAttribute("unselectable","on"),o.setAttribute("role","presentation"),o.className="jstree-wholerow",o.innerHTML=" ",a.jstree.plugins.wholerow=function(b,c){this.bind=function(){c.bind.call(this),this.element.on("ready.jstree set_state.jstree",a.proxy(function(){this.hide_dots()},this)).on("init.jstree loading.jstree ready.jstree",a.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",a.proxy(function(a,b){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",a.proxy(function(a,b){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");var c=!1,d,e;for(d=0,e=b.selected.length;e>d;d++)c=this.get_node(b.selected[d],!0),c&&c.length&&c.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",a.proxy(function(a,b){this.get_node(b.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",a.proxy(function(a,b){"hover_node"===a.type&&this.is_disabled(b.node)||this.get_node(b.node,!0).children(".jstree-wholerow")["hover_node"===a.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",a.proxy(function(b){b.preventDefault();var c=a.Event("contextmenu",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey,pageX:b.pageX,pageY:b.pageY});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c)},this)).on("click.jstree",".jstree-wholerow",function(b){b.stopImmediatePropagation();var c=a.Event("click",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",a.proxy(function(b){b.stopImmediatePropagation();var c=a.Event("click",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",a.proxy(function(a){return a.stopImmediatePropagation(),this.is_disabled(a.currentTarget)||this.hover_node(a.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",a.proxy(function(a){this.dehover_node(a.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),c.teardown.call(this)},this.redraw_node=function(b,d,e,f){if(b=c.redraw_node.apply(this,arguments)){var g=o.cloneNode(!0);-1!==a.inArray(b.id,this._data.core.selected)&&(g.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===b.id&&(g.className+=" jstree-wholerow-hovered"),b.insertBefore(g,b.childNodes[0])}return b}},i.registerElement&&Object&&Object.create){var p=Object.create(HTMLElement.prototype);p.createdCallback=function(){var b={core:{},plugins:[]},c;for(c in a.jstree.plugins)a.jstree.plugins.hasOwnProperty(c)&&this.attributes[c]&&(b.plugins.push(c),this.getAttribute(c)&&JSON.parse(this.getAttribute(c))&&(b[c]=JSON.parse(this.getAttribute(c))));for(c in a.jstree.defaults.core)a.jstree.defaults.core.hasOwnProperty(c)&&this.attributes[c]&&(b.core[c]=JSON.parse(this.getAttribute(c))||this.getAttribute(c));a(this).jstree(b)};try{i.registerElement("vakata-jstree",{prototype:p})}catch(q){}}}}); \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/js/vendor/onload.js b/admin/survey/modules/mod_hierarhija/js/vendor/onload.js new file mode 100644 index 0000000..99eda6b --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/js/vendor/onload.js @@ -0,0 +1,16 @@ +/** + * Created by Robert Smalc on 24.7.2015. + */ +$(function() { + load_meta_variables(); // script.js + ajax_start_stop(); // script.js + onload_init(); // script.js + inline_jezik_hover(); // script.js + + + means_init(); // nastavitve v meansih + + load_help(); // poskrbi, da naloĹľi HELP/qtip js + //charts_init(); // nastavitve v charts + //creport_init(); +}); \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/js/vendor/select2.min.js b/admin/survey/modules/mod_hierarhija/js/vendor/select2.min.js new file mode 100644 index 0000000..c668840 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/js/vendor/select2.min.js @@ -0,0 +1,3 @@ +/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;hc;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
      ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
    • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
        '),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('
      • ×
      • ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"â’¶":"A","A":"A","Ă€":"A","Ă":"A","Ă‚":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ă":"A","Ä€":"A","Ä‚":"A","áş°":"A","áş®":"A","áş´":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ă„":"A","Çž":"A","Ả":"A","Ă…":"A","Çş":"A","ÇŤ":"A","Č€":"A","Č‚":"A","áş ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ä„":"A","Čş":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","ÇĽ":"AE","Ǣ":"AE","ęś´":"AO","Ꜷ":"AU","Ꜹ":"AV","ęśş":"AV","Ꜽ":"AY","â’·":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","É":"B","Ć‚":"B","Ć":"B","â’¸":"C","C":"C","Ć":"C","Ä":"C","ÄŠ":"C","ÄŚ":"C","Ç":"C","á¸":"C","Ƈ":"C","Č»":"C","ęśľ":"C","â’ą":"D","D":"D","Ḋ":"D","ÄŽ":"D","Ḍ":"D","á¸":"D","Ḓ":"D","Ḏ":"D","Ä":"D","Ć‹":"D","ĆŠ":"D","Ɖ":"D","ęťą":"D","DZ":"DZ","Ç„":"DZ","Dz":"Dz","Ç…":"Dz","â’ş":"E","E":"E","Ă":"E","É":"E","ĂŠ":"E","Ề":"E","áşľ":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ä’":"E","Ḕ":"E","Ḗ":"E","Ä”":"E","Ä–":"E","Ă‹":"E","áşş":"E","Äš":"E","Č„":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ä":"E","á¸":"E","Ḛ":"E","Ć":"E","ĆŽ":"E","â’»":"F","F":"F","Ḟ":"F","Ć‘":"F","ęť»":"F","â’Ľ":"G","G":"G","Ç´":"G","Äś":"G","Ḡ":"G","Äž":"G","Ä ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ć“":"G","ęž ":"G","ęť˝":"G","ęťľ":"G","â’˝":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Čž":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","â±µ":"H","Ɥ":"H","â’ľ":"I","I":"I","ĂŚ":"I","ĂŤ":"I","ĂŽ":"I","Ĩ":"I","ÄŞ":"I","Ĭ":"I","Ä°":"I","ĂŹ":"I","Ḯ":"I","á»":"I","ÇŹ":"I","Č":"I","ČŠ":"I","Ị":"I","Ä®":"I","Ḭ":"I","Ć—":"I","â’ż":"J","J":"J","Ä´":"J","É":"J","â“€":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ć":"K","Ⱪ":"K","Ꝁ":"K","ęť‚":"K","ęť„":"K","Ꞣ":"K","â“":"L","L":"L","Äż":"L","Äą":"L","Ä˝":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Ĺ":"L","Č˝":"L","Ɫ":"L","â± ":"L","ęť":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Ç":"Lj","â“‚":"M","M":"M","Ḿ":"M","Ṁ":"M","áą‚":"M","â±®":"M","Ćś":"M","â“":"N","N":"N","Ǹ":"N","Ĺ":"N","Ă‘":"N","áą„":"N","Ň":"N","Ṇ":"N","Ĺ…":"N","Ṋ":"N","áą":"N","Č ":"N","Ćť":"N","ęž":"N","Ꞥ":"N","ÇŠ":"NJ","Ç‹":"Nj","â“„":"O","O":"O","Ă’":"O","Ă“":"O","Ă”":"O","á»’":"O","á»":"O","á»–":"O","á»”":"O","Ă•":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","ĹŚ":"O","áą":"O","áą’":"O","ĹŽ":"O","Č®":"O","Č°":"O","Ă–":"O","ČŞ":"O","Ỏ":"O","Ĺ":"O","Ç‘":"O","ČŚ":"O","ČŽ":"O","Ć ":"O","Ờ":"O","Ớ":"O","á» ":"O","Ở":"O","Ợ":"O","Ọ":"O","á»":"O","ÇŞ":"O","Ǭ":"O","Ă":"O","Çľ":"O","Ɔ":"O","Ćź":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","â“…":"P","P":"P","áą”":"P","áą–":"P","Ƥ":"P","Ᵽ":"P","ęť":"P","ęť’":"P","ęť”":"P","Ⓠ":"Q","Q":"Q","ęť–":"Q","ęť":"Q","ÉŠ":"Q","Ⓡ":"R","R":"R","Ĺ”":"R","áą":"R","Ĺ":"R","Č":"R","Č’":"R","áąš":"R","áąś":"R","Ĺ–":"R","áąž":"R","ÉŚ":"R","Ɽ":"R","ęťš":"R","Ꞧ":"R","ęž‚":"R","â“":"S","S":"S","áşž":"S","Ĺš":"S","Ṥ":"S","Ĺś":"S","áą ":"S","Ĺ ":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Č":"S","Ĺž":"S","Ȿ":"S","Ꞩ":"S","ęž„":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Čš":"T","Ţ":"T","áą°":"T","áą®":"T","Ŧ":"T","Ƭ":"T","Ć®":"T","Čľ":"T","Ꞇ":"T","Ꜩ":"TZ","â“Š":"U","U":"U","Ă™":"U","Ăš":"U","Ă›":"U","Ũ":"U","Ṹ":"U","ĹŞ":"U","áąş":"U","Ŭ":"U","Ăś":"U","Ç›":"U","Ç—":"U","Ç•":"U","Ç™":"U","Ủ":"U","Ĺ®":"U","Ĺ°":"U","Ç“":"U","Č”":"U","Č–":"U","ĆŻ":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","áą´":"U","É„":"U","â“‹":"V","V":"V","Ṽ":"V","áąľ":"V","Ʋ":"V","ęťž":"V","É…":"V","ęť ":"VY","â“Ś":"W","W":"W","Ẁ":"W","áş‚":"W","Ĺ´":"W","Ẇ":"W","áş„":"W","áş":"W","Ⱳ":"W","â“Ť":"X","X":"X","Ẋ":"X","Ẍ":"X","â“Ž":"Y","Y":"Y","Ỳ":"Y","Ăť":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","á»´":"Y","Ćł":"Y","ÉŽ":"Y","Ỿ":"Y","â“Ź":"Z","Z":"Z","Ĺą":"Z","áş":"Z","Ĺ»":"Z","Ĺ˝":"Z","áş’":"Z","áş”":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","â“":"a","ď˝":"a","áşš":"a","Ă ":"a","á":"a","â":"a","ầ":"a","ấ":"a","áş«":"a","áş©":"a","ĂŁ":"a","Ä":"a","Ä":"a","áş±":"a","ắ":"a","áşµ":"a","áşł":"a","ȧ":"a","ǡ":"a","ä":"a","Çź":"a","ả":"a","ĂĄ":"a","Ç»":"a","ÇŽ":"a","Č":"a","Č":"a","ạ":"a","áş­":"a","áş·":"a","á¸":"a","Ä…":"a","ⱥ":"a","É":"a","ęśł":"aa","æ":"ae","Ç˝":"ae","ÇŁ":"ae","ęśµ":"ao","ęś·":"au","ęśą":"av","ęś»":"av","ęś˝":"ay","â“‘":"b","b":"b","á¸":"b","ḅ":"b","ḇ":"b","Ć€":"b","Ć":"b","É“":"b","â“’":"c","ď˝":"c","ć":"c","ĉ":"c","Ä‹":"c","ÄŤ":"c","ç":"c","ḉ":"c","Ć":"c","ČĽ":"c","ęśż":"c","ↄ":"c","â““":"d","d":"d","ḋ":"d","ÄŹ":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","Ä‘":"d","ĆŚ":"d","É–":"d","É—":"d","ęťş":"d","Çł":"dz","dž":"dz","â“”":"e","ď˝…":"e","è":"e","Ă©":"e","ĂŞ":"e","á»":"e","áşż":"e","á»…":"e","á»":"e","áş˝":"e","Ä“":"e","ḕ":"e","ḗ":"e","Ä•":"e","Ä—":"e","Ă«":"e","áş»":"e","Ä›":"e","Č…":"e","ȇ":"e","áşą":"e","ệ":"e","Č©":"e","ḝ":"e","Ä™":"e","ḙ":"e","ḛ":"e","ɇ":"e","É›":"e","Çť":"e","â“•":"f","f":"f","ḟ":"f","Ć’":"f","ꝼ":"f","â“–":"g","g":"g","ǵ":"g","Äť":"g","ḡ":"g","Äź":"g","ġ":"g","ǧ":"g","ÄŁ":"g","ÇĄ":"g","É ":"g","ꞡ":"g","ᵹ":"g","ęťż":"g","â“—":"h","ď˝":"h","ÄĄ":"h","ḣ":"h","ḧ":"h","Čź":"h","ḥ":"h","ḩ":"h","ḫ":"h","áş–":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ÉĄ":"h","Ć•":"hv","â“":"i","i":"i","ì":"i","Ă­":"i","Ă®":"i","Ä©":"i","Ä«":"i","Ä­":"i","ĂŻ":"i","ḯ":"i","ỉ":"i","Ç":"i","ȉ":"i","Č‹":"i","ị":"i","ÄŻ":"i","ḭ":"i","ɨ":"i","ı":"i","â“™":"j","j":"j","ĵ":"j","Ç°":"j","ɉ":"j","â“š":"k","k":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Ć™":"k","ⱪ":"k","ęť":"k","ęť":"k","ęť…":"k","ꞣ":"k","â“›":"l","l":"l","Ĺ€":"l","Äş":"l","Äľ":"l","ḷ":"l","ḹ":"l","ÄĽ":"l","ḽ":"l","ḻ":"l","Ĺż":"l","Ĺ‚":"l","Ćš":"l","É«":"l","ⱡ":"l","ꝉ":"l","ęž":"l","ꝇ":"l","lj":"lj","â“ś":"m","m":"m","ḿ":"m","áą":"m","áą":"m","ɱ":"m","ÉŻ":"m","â“ť":"n","n":"n","Çą":"n","Ĺ„":"n","ñ":"n","áą…":"n","Ĺ":"n","ṇ":"n","ņ":"n","áą‹":"n","ṉ":"n","Ćž":"n","ɲ":"n","ʼn":"n","ęž‘":"n","ꞥ":"n","ÇŚ":"nj","â“ž":"o","o":"o","ò":"o","Ăł":"o","Ă´":"o","ồ":"o","ố":"o","á»—":"o","ổ":"o","õ":"o","ṍ":"o","Č­":"o","ṏ":"o","ĹŤ":"o","áą‘":"o","áą“":"o","ĹŹ":"o","ČŻ":"o","ȱ":"o","ö":"o","Č«":"o","ỏ":"o","Ĺ‘":"o","Ç’":"o","ČŤ":"o","ČŹ":"o","ơ":"o","ờ":"o","á»›":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","á»™":"o","Ç«":"o","Ç­":"o","ø":"o","Çż":"o","É”":"o","ęť‹":"o","ꝍ":"o","ɵ":"o","ĆŁ":"oi","ČŁ":"ou","ꝏ":"oo","â“ź":"p","ď˝":"p","áą•":"p","áą—":"p","ĆĄ":"p","áµ˝":"p","ęť‘":"p","ęť“":"p","ęť•":"p","â“ ":"q","q":"q","É‹":"q","ęť—":"q","ęť™":"q","ⓡ":"r","ď˝’":"r","Ĺ•":"r","áą™":"r","Ĺ™":"r","Č‘":"r","Č“":"r","áą›":"r","áąť":"r","Ĺ—":"r","áąź":"r","ÉŤ":"r","É˝":"r","ęť›":"r","ꞧ":"r","ęž":"r","ⓢ":"s","s":"s","Ăź":"s","Ĺ›":"s","ṥ":"s","Ĺť":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","áą©":"s","Č™":"s","Ĺź":"s","Čż":"s","ęž©":"s","ęž…":"s","áş›":"s","â“Ł":"t","ď˝”":"t","áą«":"t","áş—":"t","ĹĄ":"t","áą­":"t","Č›":"t","ĹŁ":"t","áą±":"t","ṯ":"t","ŧ":"t","Ć­":"t","Ę":"t","ⱦ":"t","ꞇ":"t","ęś©":"tz","ⓤ":"u","u":"u","Ăą":"u","Ăş":"u","Ă»":"u","Ĺ©":"u","áąą":"u","Ĺ«":"u","áą»":"u","Ĺ­":"u","ĂĽ":"u","Çś":"u","Ç":"u","Ç–":"u","Çš":"u","ủ":"u","ĹŻ":"u","ű":"u","Ç”":"u","Č•":"u","Č—":"u","Ć°":"u","ừ":"u","ứ":"u","ữ":"u","á»­":"u","á»±":"u","ụ":"u","áął":"u","Ĺł":"u","áą·":"u","áąµ":"u","ʉ":"u","â“Ą":"v","ď˝–":"v","áą˝":"v","áąż":"v","Ę‹":"v","ęťź":"v","ĘŚ":"v","ꝡ":"vy","ⓦ":"w","ď˝—":"w","áş":"w","áş":"w","ŵ":"w","ẇ":"w","áş…":"w","áş":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ď˝":"x","áş‹":"x","ẍ":"x","ⓨ":"y","ď˝™":"y","ỳ":"y","Ă˝":"y","Ĺ·":"y","ỹ":"y","Čł":"y","ẏ":"y","Ăż":"y","á»·":"y","áş™":"y","ỵ":"y","Ć´":"y","ÉŹ":"y","ỿ":"y","â“©":"z","z":"z","Ĺş":"z","áş‘":"z","ĹĽ":"z","Ĺľ":"z","áş“":"z","áş•":"z","ƶ":"z","ČĄ":"z","É€":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Î":"Ε","Ή":"Η","Ί":"Ι","ÎŞ":"Ι","ÎŚ":"Îź","ÎŽ":"ÎĄ","Ϋ":"ÎĄ","ÎŹ":"Ω","ά":"α","έ":"ε","ή":"η","ÎŻ":"Îą","ĎŠ":"Îą","Î":"Îą","ĎŚ":"Îż","ĎŤ":"Ď…","Ď‹":"Ď…","ΰ":"Ď…","ω":"ω","Ď‚":"Ď"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change"); +if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
      • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null; +},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}); \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/js/vendor/status.js b/admin/survey/modules/mod_hierarhija/js/vendor/status.js new file mode 100644 index 0000000..be7cdce --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/js/vendor/status.js @@ -0,0 +1,137 @@ +var tableStatus; +var kodeKosarica = []; +var anketa_id = 0; + +$(document).ready(function () { + // pridobimo ID ankete, ko je dokument naloĹľen + anketa_id = $('#srv_meta_anketa_id').val() + + if (document.querySelector('#hierarhija-status')) { + tableStatus = $('#hierarhija-status-admin').DataTable({ + "language": { + "url": "modules/mod_hierarhija/js/vendor/datatables-slovenian.json" + }, + "lengthMenu": [[50, 100, 200, 400, -1], [50, 100, 200, 400, "vse"]], + // Prevzeto imamo prvo vrstico skrito, ker gre za urejanje + "columnDefs": [ + {"visible": false, "targets": 0} + ] + }); + + $.get('ajax.php?anketa=' + anketa_id + '&t=hierarhija-ajax&a=super-sifra&m=getAll').then(function (response) { + var tabela = JSON.parse(response); + sestaviTabeloSuperKodami(tabela); + }); + + } +}); + +/** + * Sestavimo tabelo s superkodo in pripadajoÄŤimi hierarhijami + * @param {object} objekt + */ +function sestaviTabeloSuperKodami(objekt) { + if (objekt.length == 0) + return null; + + $('.prikaz-superkod').show(); + + var vrstice = ''; + + $.each(objekt, function (superKoda, hierarhije) { + vrstice += '' + superKoda + ''; + vrstice += '
          '; + + $.each(hierarhije, function (koda, hierarhija) { + vrstice += '
        • ' + hierarhija.hierarhija + ' | ' + hierarhija.ucitelj + '
        • '; + }); + + + vrstice += '
        '; + }); + + $('.prikaz-superkod tbody').html(vrstice); +} + +/** + * PrikaĹľe moĹľnost urejanja superkode + */ +function prikaziUrejanjeSuperkode() { + var column = tableStatus.column(0); + + column.visible(!column.visible()); + + $('.kosarica').toggle(); +} + +/** + * Izberemo ustrezno kodo + * + * @param {string} koda + */ +function dodajKodoVKosarico(koda) { + + if (!poisciKodo(kodeKosarica, koda)) + kodeKosarica.push({ + koda: koda, + hierarhija: $('[data-hierarhija="' + koda + '"]').text(), + email: $('[data-email="' + koda + '"]').text(), + }); + + generirajSeznamKod(); +} + +function generirajSeznamKod() { + $("#seznamKod").html(''); + kodeKosarica.forEach(function (val, index) { + $("#seznamKod").append('
      • ' + (index + 1) + '. hierarhija: ' + val.hierarhija + ' - ' + val.email + '
      • '); + }); +} + +function poisciKodo(kosarica, koda) { + for (i = 0; i < kosarica.length; i++) { + + if (kosarica[i].koda == koda) + return kosarica.splice(i, 1); + + } + + return false; +} + +function izbrisiSifro(koda) { + poisciKodo(kodeKosarica, koda); + generirajSeznamKod(); + + $('input[value="' + koda + '"]').attr('checked', false); +} + + +$(function () { + $("#seznamKod").sortable({ + placeholder: "ui-state-highlight", + update: function (event, ui) { + $("#seznamKod li").each(function () { + $(this).children('span').html($(this).index() + 1) + }); + }, + }).disableSelection(); + + $('#ustvari-superkodo').on('click', function () { + var kode = $("#seznamKod").sortable("toArray"); + + $.post('ajax.php?anketa=' + anketa_id + '&t=hierarhija-ajax&a=super-sifra&m=shrani', { + kode: kode + }).then(function (response) { + if(response.length == 0) + return false; + + var tabela = JSON.parse(response); + sestaviTabeloSuperKodami(tabela); + + kodeKosarica = []; + $('.tabela-status input').attr('checked', false); + generirajSeznamKod(); + }) + }); +}); \ No newline at end of file diff --git a/admin/survey/modules/mod_hierarhija/js/vendor/vue-resource.min.js b/admin/survey/modules/mod_hierarhija/js/vendor/vue-resource.min.js new file mode 100644 index 0000000..29cdee9 --- /dev/null +++ b/admin/survey/modules/mod_hierarhija/js/vendor/vue-resource.min.js @@ -0,0 +1,7 @@ +/** + * vue-resource v0.7.0 + * https://github.com/vuejs/vue-resource + * Released under the MIT License. + */ + +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueResource=e():t.VueResource=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){function r(t){var e=n(1);e.config=t.config,e.warning=t.util.warn,e.nextTick=t.util.nextTick,t.url=n(2),t.http=n(8),t.resource=n(23),t.Promise=n(10),Object.defineProperties(t.prototype,{$url:{get:function(){return e.options(t.url,this,this.$options.url)}},$http:{get:function(){return e.options(t.http,this,this.$options.http)}},$resource:{get:function(){return t.resource.bind(this)}},$promise:{get:function(){return function(e){return new t.Promise(e,this)}.bind(this)}}})}window.Vue&&Vue.use(r),t.exports=r},function(t,e){function n(t,e,o){for(var i in e)o&&(r.isPlainObject(e[i])||r.isArray(e[i]))?(r.isPlainObject(e[i])&&!r.isPlainObject(t[i])&&(t[i]={}),r.isArray(e[i])&&!r.isArray(t[i])&&(t[i]=[]),n(t[i],e[i],o)):void 0!==e[i]&&(t[i]=e[i])}var r=e,o=[],i=window.console;r.warn=function(t){i&&r.warning&&(!r.config.silent||r.config.debug)&&i.warn("[VueResource warn]: "+t)},r.error=function(t){i&&i.error(t)},r.trim=function(t){return t.replace(/^\s*|\s*$/g,"")},r.toLower=function(t){return t?t.toLowerCase():""},r.isArray=Array.isArray,r.isString=function(t){return"string"==typeof t},r.isFunction=function(t){return"function"==typeof t},r.isObject=function(t){return null!==t&&"object"==typeof t},r.isPlainObject=function(t){return r.isObject(t)&&Object.getPrototypeOf(t)==Object.prototype},r.options=function(t,e,n){return n=n||{},r.isFunction(n)&&(n=n.call(e)),r.merge(t.bind({$vm:e,$options:n}),t,{$options:n})},r.each=function(t,e){var n,o;if("number"==typeof t.length)for(n=0;n=200&&t.status<300,t})}},function(t,e,n){function r(t,e){t instanceof i?this.promise=t:this.promise=new i(t.bind(e)),this.context=e}var o=n(1),i=window.Promise||n(11);r.all=function(t,e){return new r(i.all(t),e)},r.resolve=function(t,e){return new r(i.resolve(t),e)},r.reject=function(t,e){return new r(i.reject(t),e)},r.race=function(t,e){return new r(i.race(t),e)};var s=r.prototype;s.bind=function(t){return this.context=t,this},s.then=function(t,e){return t&&t.bind&&this.context&&(t=t.bind(this.context)),e&&e.bind&&this.context&&(e=e.bind(this.context)),this.promise=this.promise.then(t,e),this},s["catch"]=function(t){return t&&t.bind&&this.context&&(t=t.bind(this.context)),this.promise=this.promise["catch"](t),this},s["finally"]=function(t){return this.then(function(e){return t.call(this),e},function(e){return t.call(this),i.reject(e)})},s.success=function(t){return o.warn("The `success` method has been deprecated. Use the `then` method instead."),this.then(function(e){return t.call(this,e.data,e.status,e)||e})},s.error=function(t){return o.warn("The `error` method has been deprecated. Use the `catch` method instead."),this["catch"](function(e){return t.call(this,e.data,e.status,e)||e})},s.always=function(t){o.warn("The `always` method has been deprecated. Use the `finally` method instead.");var e=function(e){return t.call(this,e.data,e.status,e)||e};return this.then(e,e)},t.exports=r},function(t,e,n){function r(t){this.state=a,this.value=void 0,this.deferred=[];var e=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(n){e.reject(n)}}var o=n(1),i=0,s=1,a=2;r.reject=function(t){return new r(function(e,n){n(t)})},r.resolve=function(t){return new r(function(e,n){e(t)})},r.all=function(t){return new r(function(e,n){function o(n){return function(r){s[n]=r,i+=1,i===t.length&&e(s)}}var i=0,s=[];0===t.length&&e(s);for(var a=0;a1?t.apply(e,arguments):t.call(e,i):t.call(e)}}function d(t,e){e=e||0;for(var i=t.length-e,n=new Array(i);i--;)n[i]=t[i+e];return n}function v(t,e){for(var i=Object.keys(e),n=i.length;n--;)t[i[n]]=e[i[n]];return t}function m(t){return null!==t&&"object"==typeof t}function g(t){return zi.call(t)===Ui}function _(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}function y(t,e){var i,n,r,s,o,a=function a(){var h=Date.now()-s;h=0?i=setTimeout(a,e-h):(i=null,o=t.apply(r,n),i||(r=n=null))};return function(){return r=this,n=arguments,s=Date.now(),i||(i=setTimeout(a,e)),o}}function b(t,e){for(var i=t.length;i--;)if(t[i]===e)return i;return-1}function w(t){var e=function e(){if(!e.cancelled)return t.apply(this,arguments)};return e.cancel=function(){e.cancelled=!0},e}function C(t,e){return t==e||!(!m(t)||!m(e))&&JSON.stringify(t)===JSON.stringify(e)}function $(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap=Object.create(null)}function k(){return cn.charCodeAt(pn+1)}function x(){return cn.charCodeAt(++pn)}function A(){return pn>=fn}function O(){for(;k()===An;)x()}function T(t){return t===Cn||t===$n}function N(t){return On[t]}function j(t,e){return Tn[t]===e}function E(){for(var t,e=x();!A();)if(t=x(),t===xn)x();else if(t===e)break}function F(t){for(var e=0,i=t;!A();)if(t=k(),T(t))E();else if(i===t&&e++,j(i,t)&&e--,x(),0===e)break}function S(){for(var t=pn;!A();)if(dn=k(),T(dn))E();else if(N(dn))F(dn);else if(dn===kn){if(x(),dn=k(),dn!==kn){vn!==_n&&vn!==wn||(vn=yn);break}x()}else{if(dn===An&&(vn===bn||vn===wn)){O();break}vn===yn&&(vn=bn),x()}return cn.slice(t+1,pn)||null}function D(){for(var t=[];!A();)t.push(P());return t}function P(){var t,e={};return vn=yn,e.name=S().trim(),vn=wn,t=R(),t.length&&(e.args=t),e}function R(){for(var t=[];!A()&&vn!==yn;){var e=S();if(!e)break;t.push(L(e))}return t}function L(t){if(gn.test(t))return{value:o(t),dynamic:!1};var e=h(t),i=e===t;return{value:i?t:e,dynamic:i}}function H(t){var e=mn.get(t);if(e)return e;cn=t,un={},fn=cn.length,pn=-1,dn="",vn=_n;var i;return cn.indexOf("|")<0?un.expression=cn.trim():(un.expression=S().trim(),i=D(),i.length&&(un.filters=i)),mn.put(t,un),un}function I(t){return t.replace(jn,"\\$&")}function M(){var t=I(Hn.delimiters[0]),e=I(Hn.delimiters[1]),i=I(Hn.unsafeDelimiters[0]),n=I(Hn.unsafeDelimiters[1]);Fn=new RegExp(i+"((?:.|\\n)+?)"+n+"|"+t+"((?:.|\\n)+?)"+e,"g"),Sn=new RegExp("^"+i+"((?:.|\\n)+?)"+n+"$"),En=new $(1e3)}function V(t){En||M();var e=En.get(t);if(e)return e;if(!Fn.test(t))return null;for(var i,n,r,s,o,a,h=[],l=Fn.lastIndex=0;i=Fn.exec(t);)n=i.index,n>l&&h.push({value:t.slice(l,n)}),r=Sn.test(i[0]),s=r?i[1]:i[2],o=s.charCodeAt(0),a=42===o,s=a?s.slice(1):s,h.push({tag:!0,value:s.trim(),html:r,oneTime:a}),l=n+i[0].length;return l1?t.map(function(t){return B(t,e)}).join("+"):B(t[0],e,!0)}function B(t,e,i){return t.tag?t.oneTime&&e?'"'+e.$eval(t.value)+'"':z(t.value,i):'"'+t.value+'"'}function z(t,e){if(Dn.test(t)){var i=H(t);return i.filters?"this._applyFilters("+i.expression+",null,"+JSON.stringify(i.filters)+",false)":"("+t+")"}return e?t:"("+t+")"}function U(t,e,i,n){Q(t,1,function(){e.appendChild(t)},i,n)}function q(t,e,i,n){Q(t,1,function(){tt(t,e)},i,n)}function J(t,e,i){Q(t,-1,function(){it(t)},e,i)}function Q(t,e,i,n,r){var s=t.__v_trans;if(!s||!s.hooks&&!en||!n._isCompiled||n.$parent&&!n.$parent._isCompiled)return i(),void(r&&r());var o=e>0?"enter":"leave";s[o](i,r)}function G(t){if("string"==typeof t){t=document.querySelector(t)}return t}function Z(t){if(!t)return!1;var e=t.ownerDocument.documentElement,i=t.parentNode;return e===t||e===i||!(!i||1!==i.nodeType||!e.contains(i))}function X(t,e){var i=t.getAttribute(e);return null!==i&&t.removeAttribute(e),i}function Y(t,e){var i=X(t,":"+e);return null===i&&(i=X(t,"v-bind:"+e)),i}function K(t,e){return t.hasAttribute(e)||t.hasAttribute(":"+e)||t.hasAttribute("v-bind:"+e)}function tt(t,e){e.parentNode.insertBefore(t,e)}function et(t,e){e.nextSibling?tt(t,e.nextSibling):e.parentNode.appendChild(t)}function it(t){t.parentNode.removeChild(t)}function nt(t,e){e.firstChild?tt(t,e.firstChild):e.appendChild(t)}function rt(t,e){var i=t.parentNode;i&&i.replaceChild(e,t)}function st(t,e,i,n){t.addEventListener(e,i,n)}function ot(t,e,i){t.removeEventListener(e,i)}function at(t){var e=t.className;return"object"==typeof e&&(e=e.baseVal||""),e}function ht(t,e){Yi&&!/svg$/.test(t.namespaceURI)?t.className=e:t.setAttribute("class",e)}function lt(t,e){if(t.classList)t.classList.add(e);else{var i=" "+at(t)+" ";i.indexOf(" "+e+" ")<0&&ht(t,(i+e).trim())}}function ct(t,e){if(t.classList)t.classList.remove(e);else{for(var i=" "+at(t)+" ",n=" "+e+" ";i.indexOf(n)>=0;)i=i.replace(n," ");ht(t,i.trim())}t.className||t.removeAttribute("class")}function ut(t,e){var i,n;if(dt(t)&&yt(t.content)&&(t=t.content),t.hasChildNodes())for(ft(t),n=e?document.createDocumentFragment():document.createElement("div");i=t.firstChild;)n.appendChild(i);return n}function ft(t){for(var e;e=t.firstChild,pt(e);)t.removeChild(e);for(;e=t.lastChild,pt(e);)t.removeChild(e)}function pt(t){return t&&(3===t.nodeType&&!t.data.trim()||8===t.nodeType)}function dt(t){return t.tagName&&"template"===t.tagName.toLowerCase()}function vt(t,e){var i=Hn.debug?document.createComment(t):document.createTextNode(e?" ":"");return i.__v_anchor=!0,i}function mt(t){if(t.hasAttributes())for(var e=t.attributes,i=0,n=e.length;i=h.length){for(var t=0;t=97&&e<=122||e>=65&&e<=90?"ident":e>=49&&e<=57?"number":"else"}function Mt(t){var e=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(n(e)?h(e):"*"+e)}function Vt(t){function e(){var e=t[c+1];if(u===lr&&"'"===e||u===cr&&'"'===e)return c++,n="\\"+e,p[tr](),!0}var i,n,r,s,o,a,h,l=[],c=-1,u=rr,f=0,p=[];for(p[er]=function(){void 0!==r&&(l.push(r),r=void 0)},p[tr]=function(){void 0===r?r=n:r+=n},p[ir]=function(){p[tr](),f++},p[nr]=function(){if(f>0)f--,u=hr,p[tr]();else{if(f=0,r=Mt(r),r===!1)return!1;p[er]()}};null!=u;)if(c++,i=t[c],"\\"!==i||!e()){if(s=It(i),h=pr[u],o=h[s]||h.else||fr,o===fr)return;if(u=o[0],a=p[o[1]],a&&(n=o[2],n=void 0===n?i:n,a()===!1))return;if(u===ur)return l.raw=t,l}}function Wt(t){var e=Kn.get(t);return e||(e=Vt(t),e&&Kn.put(t,e)),e}function Bt(t,e){return Yt(e).get(t)}function zt(e,i,n){var r=e;if("string"==typeof i&&(i=Vt(i)),!i||!m(e))return!1;for(var s,o,a=0,h=i.length;a-1?i.replace($r,Qt):i,e+"scope."+i)}function Qt(t,e){return Or[e]}function Gt(t){yr.test(t),Or.length=0;var e=t.replace(Cr,qt).replace(br,"");return e=(" "+e).replace(xr,Jt).replace($r,Qt),Zt(e)}function Zt(t){try{return new Function("scope","return "+t+";")}catch(t){return Ut}}function Xt(t){var e=Wt(t);if(e)return function(t,i){zt(t,e,i)}}function Yt(t,e){t=t.trim();var i=vr.get(t);if(i)return e&&!i.set&&(i.set=Xt(i.exp)),i;var n={exp:t};return n.get=Kt(t)&&t.indexOf("[")<0?Zt("scope."+t):Gt(t),e&&(n.set=Xt(t)),vr.put(t,n),n}function Kt(t){return kr.test(t)&&!Ar.test(t)&&"Math."!==t.slice(0,5)}function te(){Nr.length=0,jr.length=0,Er={},Fr={},Sr=!1}function ee(){for(var t=!0;t;)t=!1,ie(Nr),ie(jr),Nr.length?t=!0:(Gi&&Hn.devtools&&Gi.emit("flush"),te())}function ie(t){for(var e=0;e0){var o=s+(n?e:bt(e));r=Jr.get(o),r||(r=qe(i,t.$options,!0),Jr.put(o,r))}else r=qe(i,t.$options,!0);this.linker=r}function ye(t,e,i){var n=t.node.previousSibling;if(n){for(t=n.__v_frag;!(t&&t.forId===i&&t.inserted||n===e);){if(n=n.previousSibling,!n)return;t=n.__v_frag}return t}}function be(t){for(var e=-1,i=new Array(Math.floor(t));++e47&&e<58?parseInt(t,10):1===t.length&&(e=t.toUpperCase().charCodeAt(0),e>64&&e<91)?e:ds[t]});return i=[].concat.apply([],i),function(e){if(i.indexOf(e.keyCode)>-1)return t.call(this,e)}}function xe(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function Ae(t){return function(e){return e.preventDefault(),t.call(this,e)}}function Oe(t){return function(e){if(e.target===e.currentTarget)return t.call(this,e)}}function Te(t){if(ys[t])return ys[t];var e=Ne(t);return ys[t]=ys[e]=e,e}function Ne(t){t=u(t);var e=l(t),i=e.charAt(0).toUpperCase()+e.slice(1);bs||(bs=document.createElement("div"));var n,r=ms.length;if("filter"!==e&&e in bs.style)return{kebab:t,camel:e};for(;r--;)if(n=gs[r]+i,n in bs.style)return{kebab:ms[r]+t,camel:n}}function je(t){var e=[];if(qi(t))for(var i=0,n=t.length;i=r?i():t[s].call(e,n)}var r=t.length,s=0;t[0].call(e,n)}function Se(t,e,i){for(var r,s,o,a,h,c,f,p=[],d=i.$options.propsData,v=Object.keys(e),m=v.length;m--;)s=v[m],r=e[s]||Rs,h=l(s),Ls.test(h)&&(f={name:s,path:h,options:r,mode:Ps.ONE_WAY,raw:null},o=u(s),null===(a=Y(t,o))&&(null!==(a=Y(t,o+".sync"))?f.mode=Ps.TWO_WAY:null!==(a=Y(t,o+".once"))&&(f.mode=Ps.ONE_TIME)),null!==a?(f.raw=a,c=H(a),a=c.expression,f.filters=c.filters,n(a)&&!c.filters?f.optimizedLiteral=!0:f.dynamic=!0,f.parentPath=a):null!==(a=X(t,o))?f.raw=a:d&&null!==(a=d[s]||d[h])&&(f.raw=a),p.push(f));return De(p)}function De(t){return function(e,n){e._props={};for(var r,s,l,c,f,p=e.$options.propsData,d=t.length;d--;)if(r=t[d],f=r.raw,s=r.path,l=r.options,e._props[s]=r,p&&i(p,s)&&Re(e,r,p[s]),null===f)Re(e,r,void 0);else if(r.dynamic)r.mode===Ps.ONE_TIME?(c=(n||e._context||e).$get(r.parentPath),Re(e,r,c)):e._context?e._bindDir({name:"prop",def:Is,prop:r},null,null,n):Re(e,r,e.$get(r.parentPath));else if(r.optimizedLiteral){var v=h(f);c=v===f?a(o(f)):v,Re(e,r,c)}else c=l.type===Boolean&&(""===f||f===u(r.name))||f,Re(e,r,c)}}function Pe(t,e,i,n){var r=e.dynamic&&Kt(e.parentPath),s=i;void 0===s&&(s=He(t,e)),s=Me(e,s,t);var o=s!==i;Ie(e,s,t)||(s=void 0),r&&!o?Ft(function(){n(s)}):n(s)}function Re(t,e,i){Pe(t,e,i,function(i){Lt(t,e.path,i)})}function Le(t,e,i){Pe(t,e,i,function(i){t[e.path]=i})}function He(t,e){var n=e.options;if(!i(n,"default"))return n.type!==Boolean&&void 0;var r=n.default;return m(r),"function"==typeof r&&n.type!==Function?r.call(t):r}function Ie(t,e,i){if(!t.options.required&&(null===t.raw||null==e))return!0;var n=t.options,r=n.type,s=!r,o=[];if(r){qi(r)||(r=[r]);for(var a=0;ae?-1:t===e?0:1});for(e=0,i=c.length;ep.priority)&&(p=f,c=r.name,a=pi(r.name),o=r.value,l=h[1],u=h[2]));return p?ui(t,l,o,i,p,c,u,a):void 0}function ci(){}function ui(t,e,i,n,r,s,o,a){var h=H(i),l={name:e,arg:o,expression:h.expression,filters:h.filters,raw:i,attr:s,modifiers:a,def:r};"for"!==e&&"if"!==e&&"router-view"!==e||(l.ref=mt(t));var c=function(t,e,i,n,r){l.ref&&Lt((n||t).$refs,l.ref,null),t._bindDir(l,e,i,n,r)};return c.terminal=!0,c}function fi(t,e){function i(t,e,i){var n=i&&vi(i),r=!n&&H(s);v.push({name:t,attr:o,raw:a,def:e,arg:l,modifiers:c,expression:r&&r.expression,filters:r&&r.filters,interp:i,hasOneTime:n})}for(var n,r,s,o,a,h,l,c,u,f,p,d=t.length,v=[];d--;)if(n=t[d],r=o=n.name,s=a=n.value,f=V(s),l=null,c=pi(r),r=r.replace(to,""),f)s=W(f),l=r,i("bind",Fs.bind,f);else if(eo.test(r))c.literal=!Xs.test(r),i("transition",Zs.transition);else if(Ys.test(r))l=r.replace(Ys,""),i("on",Fs.on);else if(Xs.test(r))h=r.replace(Xs,""),"style"===h||"class"===h?i(h,Zs[h]):(l=h,i("bind",Fs.bind));else if(p=r.match(Ks)){if(h=p[1],l=p[2],"else"===h)continue;u=jt(e,"directives",h,!0),u&&i(h,u)}if(v.length)return di(v)}function pi(t){var e=Object.create(null),i=t.match(to);if(i)for(var n=i.length;n--;)e[i[n].slice(1)]=!0;return e}function di(t){return function(e,i,n,r,s){for(var o=t.length;o--;)e._bindDir(t[o],i,n,r,s)}}function vi(t){for(var e=t.length;e--;)if(t[e].oneTime)return!0}function mi(t){return"SCRIPT"===t.tagName&&(!t.hasAttribute("type")||"text/javascript"===t.getAttribute("type"))}function gi(t,e){return e&&(e._containerAttrs=yi(t)),dt(t)&&(t=ce(t)),e&&(e._asComponent&&!e.template&&(e.template=""),e.template&&(e._content=ut(t),t=_i(t,e))),yt(t)&&(nt(vt("v-start",!0),t),t.appendChild(vt("v-end",!0))),t}function _i(t,e){var i=e.template,n=ce(i,!0);if(n){var r=n.firstChild;if(!r)return n;var s=r.tagName&&r.tagName.toLowerCase();return e.replace?(t===document.body,n.childNodes.length>1||1!==r.nodeType||"component"===s||jt(e,"components",s)||K(r,"is")||jt(e,"elementDirectives",s)||r.hasAttribute("v-for")||r.hasAttribute("v-if")?n:(e._replacerAttrs=yi(r),bi(t,r),r)):(t.appendChild(n),t)}}function yi(t){if(1===t.nodeType&&t.hasAttributes())return d(t.attributes)}function bi(t,e){for(var i,n,r=t.attributes,s=r.length;s--;)i=r[s].name,n=r[s].value,e.hasAttribute(i)||ro.test(i)?"class"===i&&!V(n)&&(n=n.trim())&&n.split(/\s+/).forEach(function(t){lt(e,t)}):e.setAttribute(i,n)}function wi(t,e){if(e){for(var i,n,r=t._slotContents=Object.create(null),s=0,o=e.children.length;s1?d(i):i;var r=e&&i.some(function(t){return t._fromParent});r&&(n=!1);for(var s=d(arguments,1),o=0,a=i.length;oe?s:-s}var i=null,n=void 0;t=uo(t);var r=d(arguments,1),s=r[r.length-1];"number"==typeof s?(s=s<0?-1:1,r=r.length>1?r.slice(0,-1):r):s=1;var o=r[0];return o?("function"==typeof o?i=function(t,e){return o(t,e)*s}:(n=Array.prototype.concat.apply([],r),i=function(t,r,s){return s=s||0,s>=n.length-1?e(t,r,s):e(t,r,s)||i(t,r,s+1)}),t.slice().sort(i)):t}function Li(t,e){var i;if(g(t)){var n=Object.keys(t);for(i=n.length;i--;)if(Li(t[n[i]],e))return!0}else if(qi(t)){for(i=t.length;i--;)if(Li(t[i],e))return!0}else if(null!=t)return t.toString().toLowerCase().indexOf(e)>-1}function Hi(i){function n(t){return new Function("return function "+f(t)+" (options) { this._init(options) }")()}i.options={directives:Fs,elementDirectives:co,filters:po,transitions:{},components:{},partials:{},replace:!0},i.util=Xn,i.config=Hn,i.set=t,i.delete=e,i.nextTick=an,i.compiler=so,i.FragmentFactory=_e,i.internalDirectives=Zs,i.parsers={path:dr,text:Pn,template:Ur,directive:Nn,expression:Tr},i.cid=0;var r=1;i.extend=function(t){t=t||{};var e=this,i=0===e.cid;if(i&&t._Ctor)return t._Ctor;var s=t.name||e.options.name,o=n(s||"VueComponent");return o.prototype=Object.create(e.prototype),o.prototype.constructor=o,o.cid=r++,o.options=Nt(e.options,t),o.super=e,o.extend=e.extend,Hn._assetTypes.forEach(function(t){o[t]=e[t]}),s&&(o.options.components[s]=o),i&&(t._Ctor=o),o},i.use=function(t){if(!t.installed){var e=d(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):t.apply(null,e),t.installed=!0,this}},i.mixin=function(t){i.options=Nt(i.options,t)},Hn._assetTypes.forEach(function(t){i[t]=function(e,n){return n?("component"===t&&g(n)&&(n.name||(n.name=e),n=i.extend(n)),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}),v(i.transition,Mn)}var Ii=Object.prototype.hasOwnProperty,Mi=/^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/,Vi=/-(\w)/g,Wi=/([^-])([A-Z])/g,Bi=/(?:^|[-_\/])(\w)/g,zi=Object.prototype.toString,Ui="[object Object]",qi=Array.isArray,Ji="__proto__"in{},Qi="undefined"!=typeof window&&"[object Object]"!==Object.prototype.toString.call(window),Gi=Qi&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Zi=Qi&&window.navigator.userAgent.toLowerCase(),Xi=Zi&&Zi.indexOf("trident")>0,Yi=Zi&&Zi.indexOf("msie 9.0")>0,Ki=Zi&&Zi.indexOf("android")>0,tn=void 0,en=void 0,nn=void 0,rn=void 0;if(Qi&&!Yi){var sn=void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend,on=void 0===window.onanimationend&&void 0!==window.onwebkitanimationend;tn=sn?"WebkitTransition":"transition",en=sn?"webkitTransitionEnd":"transitionend",nn=on?"WebkitAnimation":"animation",rn=on?"webkitAnimationEnd":"animationend"}var an=function(){function t(){n=!1;var t=i.slice(0);i=[];for(var e=0;e=this.length&&(this.length=Number(t)+1),this.splice(t,1,e)[0]}),_(Jn,"$remove",function(t){if(this.length){var e=b(this,t);return e>-1?this.splice(e,1):void 0}});var Gn=Object.getOwnPropertyNames(Qn),Zn=!0;St.prototype.walk=function(t){for(var e=Object.keys(t),i=0,n=e.length;i",""],tr:[2,"","
        "],col:[2,"","
        "]};Ir.td=Ir.th=[3,"","
        "],Ir.option=Ir.optgroup=[1,'"],Ir.thead=Ir.tbody=Ir.colgroup=Ir.caption=Ir.tfoot=[1,"","
        "],Ir.g=Ir.defs=Ir.symbol=Ir.use=Ir.image=Ir.text=Ir.circle=Ir.ellipse=Ir.line=Ir.path=Ir.polygon=Ir.polyline=Ir.rect=[1,'',""];var Mr=/<([\w:-]+)/,Vr=/&#?\w+?;/,Wr=/