diff options
Diffstat (limited to 'admin/survey/modules/mod_hierarhija/class')
7 files changed, 42 insertions, 33 deletions
diff --git a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php index 652cfa9..0770ee9 100644 --- a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php +++ b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php @@ -40,13 +40,14 @@ class AjaxHierarhijaDostopUporabnikovClass { }else {
echo '<h2> Vpiši uporabnika za dostop do SA modula</h2>';
}
+ echo '<div class="popup_close"><a href="#" onClick="edit_user_close();">✕</a></div>';
echo '<div>';
// EMAIL
echo '<div style="width: 100%;">';
echo '<label>Elektronski naslov</label><br/>';
if(!empty($user)){
- echo '<input type="email" value="'.$user->email .'" disabled="disabled" style="width: 80%; padding: 4px; margin: 2px 0;"/>';
+ echo '<input type="email" value="'.$user->email .'" disabled="disabled" />';
}else{
echo '<input type="email"
value=""
@@ -54,7 +55,7 @@ class AjaxHierarhijaDostopUporabnikovClass { id="sa-email"
onblur="preveriVpisanEmailZaSAdostop()"
required="required"
- style="width: 80%; padding: 4px; margin: 2px 0;"/>';
+ />';
echo '<input type="hidden" value="" id="sa-id" "/>';
echo '<span id="sa-email-sporocilo"></span>';
}
@@ -63,13 +64,13 @@ class AjaxHierarhijaDostopUporabnikovClass { // Organizzacija
echo '<div style="padding:15px 0;width: 100%;">';
echo '<label>Šola oz. javni zavod</label><br/>';
- echo '<input type="text" value="'.(!empty($user) ? $user->ustanova : NULL).'" placeholder="Srednja šola" id="sa-ustanova" required="required" style="width: 80%; padding: 4px; margin: 2px 0;"/>';
+ echo '<input type="text" value="'.(!empty($user) ? $user->ustanova : NULL).'" placeholder="Srednja šola" id="sa-ustanova" required="required" />';
echo '</div>';
// Email za AAI dostop
echo '<div style="padding-bottom:15px; width: 100%;">';
echo '<label>Elektronski naaslov za AAI dostop (v kolikor je primarni email drugačen od AAI dostopa)</label><br/>';
- echo '<input type="email" value="'.(!empty($user) ? $user->aai_email : NULL).'" placeholder="janez.novak@guest.arnes.si" id="sa-aai" style="width: 80%; padding: 4px; margin: 2px 0;"/>';
+ echo '<input type="email" value="'.(!empty($user) ? $user->aai_email : NULL).'" placeholder="janez.novak@guest.arnes.si" id="sa-aai" />';
echo '</div>';
echo '</div>';
@@ -77,17 +78,29 @@ class AjaxHierarhijaDostopUporabnikovClass { // Gumb za zapret popup in potrdit
echo '<div class="sa-modul">';
- echo '<div class="buttonwrapper spaceRight floatLeft">';
+ /* echo '<div class="buttonwrapper spaceRight floatLeft">';
if(!empty($user)) {
echo '<a class="ovalbutton ovalbutton_orange sa-potrdi" href="#" onclick="posodobiSAuporabnika(\'' . $user->id . '\')"; return false;"><span>' . $lang['srv_potrdi'] . '</span></a>' . "\n\r";
}else {
echo '<a class="ovalbutton ovalbutton_orange sa-potrdi" href="#" onclick="shraniSAuporabnika()"; return false;"><span>' . $lang['srv_potrdi'] . '</span></a>' . "\n\r";
}
- echo '</div>';
+ echo '</div>'; */
- echo '<div class="buttonwrapper spaceRight floatLeft">';
+ /* echo '<div class="buttonwrapper spaceRight floatLeft">';
echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="vrednost_cancel(); return false;"><span>' . $lang['srv_close_profile'] . '</span></a>' . "\n\r";
+ echo '</div>'; */
+ echo '<div class="button_holder">';
+
+ echo '<button class="medium white-blue" href="#" onclick="edit_user_close();return false;"><span>' . $lang['srv_close_profile'] . '</span></button>' . "\n\r";
+
+ if(!empty($user)) {
+ echo '<button class="medium blue" href="#" onclick="posodobiSAuporabnika(\'' . $user->id . '\')"; return false;"><span>' . $lang['srv_potrdi'] . '</span></button>' . "\n\r";
+ }else {
+ echo '<button class="medium blue" href="#" onclick="shraniSAuporabnika()"; return false;"><span>' . $lang['srv_potrdi'] . '</span></button>' . "\n\r";
+ }
+
echo '</div>';
+
echo '</div>';
echo '</div>';
@@ -182,6 +195,7 @@ class AjaxHierarhijaDostopUporabnikovClass { echo '<div class="sa-modul">';
echo '<h3><strong>'.$lang['user2'].'</strong></h3>';
+ echo '<div class="popup_close"><a href="#" onClick="edit_user_close();">✕</a></div>';
echo '<p><label for="type">'.$lang['admin_type'].':</label>';
switch ($user->type){
case 0:
@@ -217,8 +231,11 @@ class AjaxHierarhijaDostopUporabnikovClass { // Gumb za zapret popup in potrdit
echo '<div style=" display: block;">';
- echo '<div class="buttonwrapper spaceRight floatLeft">';
+ /* echo '<div class="buttonwrapper spaceRight floatLeft">';
echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="vrednost_cancel(); return false;"><span>' . $lang['srv_close_profile'] . '</span></a>' . "\n\r";
+ echo '</div>'; */
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" href="#" onclick="edit_user_close(); return false;"><span>' . $lang['srv_close_profile'] . '</span></button>' . "\n\r";
echo '</div>';
echo '</div>';
echo '</div>';
diff --git a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php index 628977f..56db0f3 100644 --- a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php +++ b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php @@ -319,7 +319,7 @@ class AjaxUporabniki $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')");
+ 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);
diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php index 0ed3956..cc0d5c4 100644 --- a/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php @@ -922,10 +922,9 @@ class HierarhijaAjax 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");
+ $ime_mape = sisplet_query("SELECT * FROM srv_library_folder where id='" . AppSettings::getInstance()->getSetting('hierarhija-folder_id') . "'", "obj")->naslov;
+ $ankete_v_knjiznici = sisplet_query("SELECT * FROM srv_library_anketa WHERE folder='" . AppSettings::getInstance()->getSetting('hierarhija-folder_id') . "'", "obj");
if (empty($ime_mape) && sizeof($ankete_v_knjiznici) == 0) {
echo 'Knjižnica je prazna.';
@@ -937,14 +936,14 @@ class HierarhijaAjax 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");
+ $srv_anketa = sisplet_query("SELECT id, naslov, hash FROM srv_anketa WHERE id='" . $anketa->ank_id . "'", "obj");
if(!empty($srv_anketa->naslov)) {
echo '<li>';
echo '<input type="radio" name="knjiznica_izbira" id="ank_'.$anketa->ank_id.'" value="'.$anketa->ank_id.'" /> ';
echo '<span class="enka-checkbox-radio"></span>';
echo '<span>
- <a href="'.$this->site_url.'/main/survey/index.php?anketa='.$anketa->ank_id.'&preview=on" target="_blank" title="Predogled ankete">
+ <a href="'.$this->site_url.'/main/survey/index.php?anketa='.$srv_anketa->hash.'&preview=on" target="_blank" title="Predogled ankete">
<span class="faicon preview"></span>
</a>
</span>';
@@ -953,13 +952,13 @@ class HierarhijaAjax }
}
} elseif (is_object($ankete_v_knjiznici)) {
- $srv_anketa = sisplet_query("SELECT id, naslov FROM srv_anketa WHERE id='" . $ankete_v_knjiznici->ank_id . "'", "obj");
+ $srv_anketa = sisplet_query("SELECT id, naslov, hash FROM srv_anketa WHERE id='" . $ankete_v_knjiznici->ank_id . "'", "obj");
if(!empty($srv_anketa->naslov)) {
echo '<li>';
echo '<input type="radio" name="knjiznica_izbira" id="ank_'.$ankete_v_knjiznici->ank_id.'" value="'.$ankete_v_knjiznici->ank_id.'" /> ';
echo '<span>
- <a href="'.$this->site_url.'main/survey/index.php?anketa='.$ankete_v_knjiznici->ank_id.'&preview=on" target="_blank" title="Predogled ankete">
+ <a href="'.$this->site_url.'main/survey/index.php?anketa='.$srv_anketa->hash.'&preview=on" target="_blank" title="Predogled ankete">
<span class="faicon preview"></span>
</a>
</span>';
diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php index a322a5d..dcf18f7 100644 --- a/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php @@ -54,9 +54,7 @@ class HierarhijaAnalysis # polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo::getInstance()->SurveyInit($this->anketa);
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
- $this->db_table = '_active';
- }
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# Inicializiramo in polovimo nastavitve missing profila
SurveyStatusProfiles::Init($this->anketa);
@@ -1183,10 +1181,7 @@ class HierarhijaAnalysis $options = array('inline_legenda' => $inline_legenda, 'isTextAnswer' => false, 'isOtherAnswer' => false, 'num_show_records' => $num_show_records);
-// if (self :: $show_spid_div == true) {
-// echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
-// self::displaySpremenljivkaIcons($spid);
-// }
+
# tekst vprašanja
echo '<table class="anl_tbl anl_bt anl_br tbl_clps">';
diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php index 37bf787..14275df 100644 --- a/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php @@ -2087,8 +2087,7 @@ class Hierarhija { }
}
- $db_table = (SurveyInfo::getInstance()
- ->getSurveyColumn('db_table') == 1) ? '_active' : '';
+ $db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// tukaj pridobimo podatke o anketi za določeno strukturo
// preverimov prvi in zadnji nivo
diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php index 3f283f6..fbc615a 100644 --- a/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php @@ -41,10 +41,7 @@ class HierarhijaHelper // V kolikor smo na katerikoli strani, potem gledamo po piškotkih
if (isset($get->{'survey-'.$ank_id})) {
- $active = '';
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
- $active = '_active';
- }
+ $active = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// ID uporabnika, glede na njegov piškot
$srv_user = sisplet_query("SELECT id FROM srv_user WHERE cookie='".$get->{'survey-'.$ank_id}."'", "obj")->id;
@@ -195,8 +192,7 @@ class HierarhijaHelper $strani = [
'https://www.1ka.si/',
- 'http://test.1ka.si/',
- 'http://1ka.test/',
+ 'https://test.1ka.si/',
'https://1ka.arnes.si/'
];
@@ -211,6 +207,10 @@ class HierarhijaHelper if ($admin_type == 0) {
return true;
}
+ // ZAENKRAT JE HIERARHHIJA VIDNA SAMO ADMINOM, KER ITAK NE DELUJE OK
+ else{
+ return false;
+ }
//AAI uporabnik
if (! empty($_COOKIE['aai']) && $_COOKIE['aai'] == 1) {
diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php index 18bda68..d361812 100644 --- a/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php +++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php @@ -313,8 +313,7 @@ class HierarhijaIzvoz { }
}
- $db_table = (SurveyInfo::getInstance()
- ->getSurveyColumn('db_table') == 1) ? '_active' : '';
+ $db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// tukaj pridobimo podatke o anketi za določeno strukturo
// preverimov prvi in zadnji nivo
|