diff options
Diffstat (limited to 'admin/survey/classes/class.SurveyZankaProfiles.php')
-rw-r--r-- | admin/survey/classes/class.SurveyZankaProfiles.php | 190 |
1 files changed, 130 insertions, 60 deletions
diff --git a/admin/survey/classes/class.SurveyZankaProfiles.php b/admin/survey/classes/class.SurveyZankaProfiles.php index 7b341a6..af2ed21 100644 --- a/admin/survey/classes/class.SurveyZankaProfiles.php +++ b/admin/survey/classes/class.SurveyZankaProfiles.php @@ -126,13 +126,13 @@ class SurveyZankaProfiles { static function DisplayLink($hideAdvanced = true) {
global $lang;
+
// profili statusov
$allProfiles = self :: $profiles;
$css = (self::$currentProfileId == SZP_DEFAULT_PROFILE ? ' gray' : '');
if ($hideAdvanced == false || self::$currentProfileId != SZP_DEFAULT_PROFILE) {
- echo '<li class="space"> </li>';
echo '<li>';
- echo '<span class="as_link'.$css.'" id="link_zanka_profile" title="' . $lang['srv_zanke'] . '" onClick="zankaProfileAction(\'showProfiles\');">' . $lang['srv_zanke'] . '</span>'."\n";
+ echo ' <span class="'.$css.'" id="link_zanka_profile" title="' . $lang['srv_zanke'] . '" onClick="zankaProfileAction(\'showProfiles\');">' . $lang['srv_zanke'] . '</span>'."\n";
echo '</li>';
}
@@ -174,6 +174,7 @@ class SurveyZankaProfiles { break;
}
}
+
static function showProfiles ($pid = null) {
global $lang;
@@ -206,69 +207,79 @@ class SurveyZankaProfiles { }
}
}
- #echo '<div id="currentZankaProfile">'.$lang['srv_analiza_selected_profile'].': <b>' . self::$profiles[$pid]['name'] . '</b></div >'.NEW_LINE;
if ( self::$currentProfileId != SZP_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+ echo '<div id="not_default_setting" class="popup_note">';
echo $lang['srv_not_default_setting'];
- echo '</div><br class="clr displayNone">';
+ echo '</div>';
}
- echo '<div class="zanka_profile_holder">'.NEW_LINE;
- echo ' <div id="zanka_profile" class="select">'.NEW_LINE;
+ echo '<div class="popup_main with_menu">';
+
+
+ echo '<div class="popup_left zanka_profile_holder">'.NEW_LINE;
+
+ echo ' <div id="zanka_profile" class="list select">'.NEW_LINE;
if (count(self::$profiles) > 0 ){
foreach (self::$profiles as $key => $value) {
if ($value['id'] != null) {
- echo '<div class="option' . ($pid == $value['id'] ? ' active' : '') . '" id="zanka_profile_' . $value['id'] . '" value="'.$value['id'].'">';
+ echo '<div class="list-item option' . ($pid == $value['id'] ? ' active' : '') . '" id="zanka_profile_' . $value['id'] . '" value="'.$value['id'].'">';
echo $value['name'];
if($value['id'] == $pid){
+
+ echo '<div class="profile_icons">';
+
if ( $pid != 0) {
- # sistemskega ne pustimo izbrisat
+ # sistemskega ne pustimo izbrisat
echo ' <a href="#" title="'.$lang['srv_delete_profile'].'" onclick="zankaProfileAction(\'deleteAsk\'); return false;"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'.NEW_LINE;
}
if ( $pid > 0) {
- # seje in sistemskega ne pustimo preimenovat
+ # seje in sistemskega ne pustimo preimenovat
echo ' <a href="#" title="'.$lang['srv_rename_profile'].'" onclick="zankaProfileAction(\'renameAsk\'); return false;"><span class="faicon edit icon-as_link floatRight spaceRight"></span></a>'.NEW_LINE;
- }
+ }
+
+ echo '</div>';
}
echo '</div>'.NEW_LINE;
}
}
}
- echo ' </div>'.NEW_LINE;
- echo '<div class="clr"></div>'.NEW_LINE;
+ echo ' <button class="small white-black" onclick="zankaProfileAction(\'newName\'); return false;">'.$lang['srv_save_new_profile'].'</button>'.NEW_LINE;
+
+ echo ' </div>'.NEW_LINE;
echo '</div>'.NEW_LINE;
+
+
// izrišemo dva stolpca z možnostjo premikanja enih in drugih variabelS
- echo '<div id="fs_list">'.NEW_LINE;
- echo '<div class="left link_no_decoration">'.NEW_LINE;
+ echo '<div id="fs_list" class="popup_right">'.NEW_LINE;
+
+ echo '<div id="skupine_left">';
+
+ echo '<div class="top">'.NEW_LINE;
+
+ echo '<div class="select">'.NEW_LINE;
echo $lang['srv_select'].NEW_LINE;
- echo '<a href="#" onclick="return $.dds.selectAll(\'fs_list_3\');">'.$lang['srv_all'].'</a>'.NEW_LINE;
- echo '<a href="#" onclick="return $.dds.selectNone(\'fs_list_3\');">'.$lang['srv_none'].'</a> '.NEW_LINE;
+ echo '<a href="#" onclick="return $.dds.selectAll(\'fs_list_3\');">'.$lang['srv_all'].'</a> - '.NEW_LINE;
+ echo '<a href="#" onclick="return $.dds.selectNone(\'fs_list_3\');">'.$lang['srv_none'].'</a> - '.NEW_LINE;
echo '<a href="#" onclick="return $.dds.selectInvert(\'fs_list_3\');">'.$lang['srv_invert'].'</a>'.NEW_LINE;
echo '</div>'.NEW_LINE;
- echo '<div class="left link_no_decoration" style="width:200px; text-align:center">'.NEW_LINE;
- echo '<a href="#" onclick="zankaProfileAction(\'clearDdsZanka\'); return false;">'.$lang['srv_clear'].'</a>'.NEW_LINE;
+
+ echo '<div class="clear_multiply">'.NEW_LINE;
echo '<input type="checkbox" name="mnozenje" id="mnozenje" value="1"'.($mnozenje==1?' checked="checked"':'').' autocomplete="off"/><label for="mnozenje">'.$lang['srv_analiza_krat'].'</label>'.NEW_LINE;
echo '</div>'.NEW_LINE;
+
+ echo '</div>'.NEW_LINE; #top
- echo '<div class="right link_no_decoration">'.NEW_LINE;
- echo $lang['srv_select'].NEW_LINE;
- echo '<a href="#" onclick="return $.dds.selectAll(\'fs_list_4\');">'.$lang['srv_all'].'</a>'.NEW_LINE;
- echo '<a href="#" onclick="return $.dds.selectNone(\'fs_list_4\');">'.$lang['srv_none'].'</a> '.NEW_LINE;
- echo '<a href="#" onclick="return $.dds.selectInvert(\'fs_list_4\');">'.$lang['srv_invert'].'</a>'.NEW_LINE;
- echo '</div>'.NEW_LINE;
- echo '<br class="clr" />'.NEW_LINE;
- echo '<br />'.NEW_LINE;
- echo '<div class="left fs_container">'.NEW_LINE;
+ echo '<div class="fs_container">'.NEW_LINE;
echo '<ul id="fs_list_3" class="left">'.NEW_LINE;
$sdf = SurveyDataFile::get_instance();
$sdf->init($sid);
@@ -280,7 +291,31 @@ class SurveyZankaProfiles { }
echo '</ul>'.NEW_LINE;
echo '</div>'.NEW_LINE;
- echo '<div class="right fs_container">'.NEW_LINE;
+
+
+ echo '</div>'; #left
+
+
+
+ echo '<div id="skupine_right">';
+
+ echo '<div class="top">'.NEW_LINE;
+ echo '<div class="select">'.NEW_LINE;
+ echo $lang['srv_select'].NEW_LINE;
+ echo '<a href="#" onclick="return $.dds.selectAll(\'fs_list_4\');">'.$lang['srv_all'].'</a> - '.NEW_LINE;
+ echo '<a href="#" onclick="return $.dds.selectNone(\'fs_list_4\');">'.$lang['srv_none'].'</a> - '.NEW_LINE;
+ echo '<a href="#" onclick="return $.dds.selectInvert(\'fs_list_4\');">'.$lang['srv_invert'].'</a>'.NEW_LINE;
+ echo '</div>'.NEW_LINE;
+
+
+ echo '<div class="clear_multiply">'.NEW_LINE;
+ echo '</div>'.NEW_LINE;
+
+ echo '</div>'.NEW_LINE; #top
+
+
+
+ echo '<div class="fs_container">'.NEW_LINE;
echo '<ul id="fs_list_4" class="left">'.NEW_LINE;
if (count($selected_variables) > 0 ) {
foreach($selected_variables as $key => $variabla) {
@@ -290,6 +325,9 @@ class SurveyZankaProfiles { }
echo '</ul>'.NEW_LINE;
echo '</div>'.NEW_LINE;
+
+ echo '</div>'; #right
+
echo '<script type="text/javascript">'.NEW_LINE;
echo '$(document).ready(function() {';
echo '$(function(){'.NEW_LINE;
@@ -303,45 +341,77 @@ class SurveyZankaProfiles { echo '});'.NEW_LINE;
echo '</script>'.NEW_LINE;
- echo '<br class="clr" />'.NEW_LINE;
-
echo '</div>'.NEW_LINE;
- echo '<div id="missingProfilebuttons">'.NEW_LINE;
- if ((int)$pid < 0 ) {// pri seji in sistemskem ne pustimo shranjevanja
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zankaProfileAction(\'runSession\'); return false;"><span>'.$lang['srv_run_as_session_profile'].'</span></a></span></span>'.NEW_LINE;
- } else {
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zankaProfileAction(\'run\'); return false;"><span>'.$lang['srv_save_and_run_profile'].'</span></a></span></span>'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'runSession\'); return false;"><span>'.$lang['srv_run_as_session_profile'].'</span></a></span></span>'.NEW_LINE;
+ echo '</div>';
+
+
+ echo '<div id="missingProfilebuttons" class="button_holder">'.NEW_LINE;
+
+ echo '<button class="medium white-blue" onclick="zankaProfileAction(\'cancle\'); return false;">'.$lang['srv_close_profile'].'</button>'.NEW_LINE;
+
+ // pri seji in sistemskem ne pustimo shranjevanja
+ if ((int)$pid < 0 ) {
+ echo '<button class="medium blue" onclick="zankaProfileAction(\'runSession\'); return false;">'.$lang['srv_run_as_session_profile'].'</button>'.NEW_LINE;
+ }
+ else {
+ echo '<button class="medium white-blue" onclick="zankaProfileAction(\'runSession\'); return false;">'.$lang['srv_run_as_session_profile'].'</button>'.NEW_LINE;
+ echo '<button class="medium blue" onclick="zankaProfileAction(\'run\'); return false;">'.$lang['srv_save_and_run_profile'].'</button>'.NEW_LINE;
}
-
- echo '<span class="floatRight spaceLeft"><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'newName\'); return false;"><span>'.$lang['srv_save_new_profile'].'</span></a></span></span>'.NEW_LINE;
- echo '<span class="floatRight spaceLeft"><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'cancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'.NEW_LINE;
-
+
echo '</div>'.NEW_LINE;
+
+
echo '<div id="zankaProfileCoverDiv"></div>'.NEW_LINE;
// div za shranjevanje novega profila
- echo '<div id="newProfileDiv">'.$lang['srv_missing_profile_name'].': '.NEW_LINE;
- echo '<input id="newProfileName" name="newProfileName" type="text" size="45" />'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'newCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zankaProfileAction(\'newCreate\'); return false;"><span>'.$lang['srv_save_profile'].'</span></a></span></span>'.NEW_LINE;
+ echo '<div id="newProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newProfileName" name="newProfileName" type="text" class="text large" value=""/>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zankaProfileAction(\'newCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zankaProfileAction(\'newCreate\'); return false;">'.$lang['srv_save_profile'].'</button>';
+ echo '</div>';
+
echo '</div>'.NEW_LINE;
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': '.NEW_LINE;
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . self::$profiles[$pid]['name'] . '" size="45" />'.NEW_LINE;
- echo '<input id="renameProfileId" type="hidden" value="' . $czp . '" />'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zankaProfileAction(\'renameConfirm\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'renameCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'.NEW_LINE;
+ echo '<div id="renameProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . self::$profiles[$pid]['name'] . '" class="text large"/>';
+ echo '<input id="renameProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zankaProfileAction(\'renameCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zankaProfileAction(\'renameConfirm\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
echo '</div>'.NEW_LINE;
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . self::$profiles[$pid]['name'] . '</b>?'.NEW_LINE;
- echo '<input id="deleteProfileId" type="hidden" value="' . $czp . '" />'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zankaProfileAction(\'deleteConfirm\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'deleteCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'.NEW_LINE;
+ echo '<div id="deleteProfileDiv">';
+
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . self::$profiles[$pid]['name'] . '</span>?';
+ echo '<input id="deleteProfileId" type="hidden" value="' . $czp . '" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zankaProfileAction(\'deleteCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zankaProfileAction(\'deleteConfirm\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
echo '</div>'.NEW_LINE;
}
@@ -460,15 +530,16 @@ class SurveyZankaProfiles { */
static function getFiltersForLoops() {
$result = array();
- $_spr_for_loops = explode(',',self::$profiles[self::$currentProfileId]['variables']);
+ $_spr_for_loops = isset(self::$profiles[self::$currentProfileId]['variables']) ? explode(',',self::$profiles[self::$currentProfileId]['variables']) : array();
+ $_results = array();
$i = 0;
if (count($_spr_for_loops) > 0) {
foreach ($_spr_for_loops AS $_spr) {
$sdf = SurveyDataFile::get_instance();
$sdf->init(self::$sid);
$_spr_data = $sdf->getHeaderVariable($_spr);
- if ($_spr_data['tip'] == 1 || $_spr_data['tip'] == 3) {
+ if (isset($_spr_data['tip']) && $_spr_data['tip'] == 1 || $_spr_data['tip'] == 3) {
# radio oz, dropdown
# zloopamo skozi opcije
@@ -479,7 +550,7 @@ class SurveyZankaProfiles { }
}
- } else if ($_spr_data['tip'] === '2') {
+ } else if (isset($_spr_data['tip']) && $_spr_data['tip'] === '2') {
# checkbox
#zloopamo po vrednostih in dodamo filtre za 1-checked 2-not checked
foreach ($_spr_data['grids'] as $g_key => $grid) {
@@ -498,7 +569,7 @@ class SurveyZankaProfiles { }
# če mamo množenje, lahko izvedemo samo nad dvema spremenljivkama
- if (self::$profiles[self::$currentProfileId]['mnozenje'] == 1) {
+ if (isset(self::$profiles[self::$currentProfileId]['mnozenje']) && self::$profiles[self::$currentProfileId]['mnozenje'] == 1) {
if (count($_results[0]) > 0) {
foreach ($_results[0] AS $_result0) {
if (count($_results[1]) > 0) {
@@ -517,8 +588,7 @@ class SurveyZankaProfiles { }
}
} else {
-
- $result = $_results[0];
+ $result = isset($_results[0]) ? $_results[0] : array();
}
return $result;
}
|