diff options
Diffstat (limited to 'admin/survey/classes/class.SurveyTimeProfiles.php')
-rw-r--r-- | admin/survey/classes/class.SurveyTimeProfiles.php | 209 |
1 files changed, 126 insertions, 83 deletions
diff --git a/admin/survey/classes/class.SurveyTimeProfiles.php b/admin/survey/classes/class.SurveyTimeProfiles.php index 0c88b11..37628c7 100644 --- a/admin/survey/classes/class.SurveyTimeProfiles.php +++ b/admin/survey/classes/class.SurveyTimeProfiles.php @@ -74,9 +74,9 @@ class SurveyTimeProfiles { self::$profiles['-1'] = array('id'=>'-1',
'name'=>$lang['srv_temp_profile'],
'type'=>$_SESSION['time_profile'][self::$surveyId]['type'],
- 'starts'=>$_SESSION['time_profile'][self::$surveyId]['starts'],
- 'ends'=>$_SESSION['time_profile'][self::$surveyId]['ends'],
- 'interval_txt'=>$_SESSION['time_profile'][self::$surveyId]['interval_txt']);
+ 'starts'=>(isset($_SESSION['time_profile'][self::$surveyId]['starts']) ? $_SESSION['time_profile'][self::$surveyId]['starts'] : null),
+ 'ends'=>(isset($_SESSION['time_profile'][self::$surveyId]['ends']) ? $_SESSION['time_profile'][self::$surveyId]['ends'] : null),
+ 'interval_txt'=>(isset($_SESSION['time_profile'][self::$surveyId]['interval_txt']) ? $_SESSION['time_profile'][self::$surveyId]['interval_txt'] : null));
$dsp = -1;
} else {
@@ -361,13 +361,9 @@ class SurveyTimeProfiles { $css = ($izbranProfil == STP_DEFAULT_PROFILE ? ' gray' : '');
if ($hideAdvanced == false || $izbranProfil != STP_DEFAULT_PROFILE) {
- if ($showseperator == true) {
- echo '<li class="space"> </li>';
- }
echo '<li>';
- echo '<span class="as_link'.$css.'" id="link_time_profile" title="' . $lang['srv_time_profile_link_title'] . '" onClick="timeProfileAction(\'showProfiles\');">' . $lang['srv_time_profile_link'] . '</span>';
+ echo ' <span class="'.$css.'" id="link_time_profile" title="' . $lang['srv_time_profile_link_title'] . '" onClick="timeProfileAction(\'showProfiles\');">' . $lang['srv_time_profile_link'] . '</span>';
echo '</li>';
-
}
}
@@ -390,25 +386,30 @@ class SurveyTimeProfiles { $currentFilterProfile = $_all_profiles[$current_pid];
if ( $current_pid != STP_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="time_profile_left_right floatLeft">';
- echo '<div class="time_profile_holder">';
- # zlistamo vse profile
- echo '<div id="time_profile" class="select">';
+ echo '<div class="popup_main with_menu">';
+
+
+ echo '<div class="time_profile_holder popup_left">';
+
+ # zlistamo vse profile
+ echo '<div id="time_profile" class="list select">';
if (count($_all_profiles)) {
foreach ($_all_profiles as $id=>$profile) {
- echo '<div class="option' . ($current_pid == $id ? ' active' : '') . '" id="time_profile_' . $id . '" value="'.$id.'">';
+ echo '<div class="list-item option' . ($current_pid == $id ? ' active' : '') . '" id="time_profile_' . $id . '" value="'.$id.'">';
echo $profile['name'];
if($current_pid == $id){
+ echo '<div class="profile_icons">';
+
# privzetega profila ne moremo ne zbrisat ne preimenovat
if ($current_pid != 0) {
echo '<a href="#" title="'.$lang['srv_delete_profile'].'" onclick="timeProfileAction(\'show_delete\'); return false;"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>';
@@ -416,68 +417,96 @@ class SurveyTimeProfiles { if ($current_pid > 0) {
echo '<a href="#" title="'.$lang['srv_rename_profile'].'" onclick="timeProfileAction(\'show_rename\'); return false;"><span class="faicon edit floatRight spaceRight"></span></a>';
}
+ echo '</div>';
}
echo '</div>';
}
}
- echo ' </div>'; // time_profile
- echo '</div>'; //time_profile_holder
- echo '</div>'; //time_profile_left
+ echo '</div>';
+
+ echo '<button class="small white-black" title="'.$lang['srv_create_new_profile'].'" onclick="timeProfileAction(\'show_create\'); return false;"><span class="faicon plus_32"></span>'.$lang['srv_create_new_profile'] . '</button>';
+
+ echo '</div>';
- echo '<div class="time_profile_left_right floatRight">';
- echo '<div id="time_profile_content">';
+ echo '<div id="time_profile_content" class="profile_right">';
self::DisplayProfileData($current_pid);
echo '</div>'; // time_profile_content
- echo '</div>'; // time_profile_right
+
+
+ echo '</div>';
- echo '<div class="time_profile_button_right_holder floatRight">';
+ echo '<div class="button_holder">';
if ($current_pid == 0) {
- echo '<span class="floatRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
-# echo '<span class="floatRight spaceRight" title="'.$lang['srv_save_run_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'run_profile\'); return false;"><span>'.$lang['srv_run_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'show_create\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
- } else if ($current_pid == -1) {
- echo '<span class="floatRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'show_create\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
- } else {
- echo '<span class="floatRight" title="'.$lang['srv_save_run_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'run_profile\'); return false;"><span>'.$lang['srv_run_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'show_create\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
+ echo '<button class="medium white-black" title="'.$lang['srv_close_profile'].'" onclick="timeProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_run_as_session_profile'].'" onclick="timeProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ }
+ else if ($current_pid == -1) {
+ echo '<button class="medium white-black" title="'.$lang['srv_close_profile'].'" onclick="timeProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_run_as_session_profile'].'" onclick="timeProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ }
+ else {
+ echo '<button class="medium white-black" title="'.$lang['srv_close_profile'].'" onclick="timeProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium white-blue" title="'.$lang['srv_run_as_session_profile'].'" onclick="timeProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_save_run_profile'].'" onclick="timeProfileAction(\'run_profile\'); return false;">'.$lang['srv_run_profile'] . '</button>';
}
- echo '</div>'; // time_profile_button_right_holder
+ echo '</div>';
// cover Div
echo '<div id="timeProfileCoverDiv"></div>';
// div za kreacijo novega
- echo '<div id="newProfileDiv">'.$lang['srv_missing_profile_name'].': ';
- echo '<input id="newProfileName" name="newProfileName" type="text" value="" size="50" />';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'do_create\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_save'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel_create\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
+ 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-black" onClick="timeProfileAction(\'cancel_create\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="timeProfileAction(\'do_create\'); return false;">'.$lang['srv_analiza_arhiviraj_save'].'</button>';
+ echo '</div>';
+
echo '</div>';
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': ';
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . $currentFilterProfile['name'] . '" size="50" />';
+ 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" class="text large" name="renameProfileName" type="text" value="' . $currentFilterProfile['name'] . '" size="50" />';
echo '<input id="renameProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'do_rename\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel_rename\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onClick="timeProfileAction(\'cancel_rename\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="timeProfileAction(\'do_rename\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
+
echo '</div>';
-
+
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . $currentFilterProfile['name'] . '</b>?';
+ echo '<div id="deleteProfileDiv">';
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . $currentFilterProfile['name'] . '</span>?';
echo '<input id="deleteProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'do_delete\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel_delete\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
- echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onClick="timeProfileAction(\'cancel_delete\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="timeProfileAction(\'do_delete\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
}
/** Funkcija prikaze osnovnih informacije profila
@@ -499,22 +528,30 @@ class SurveyTimeProfiles { $time = $p_data['interval_txt'];
}
- echo '<input type="radio" name="type" id="time_date_type" value="0" '.($type == '0' ? ' checked="checked"' : '').' autocomplete="off"><label> ' . $lang['srv_time_profile_from'] . ': </label>';
- echo '<input id="startDate" type="text" name="startDate" value="' . $p_data['starts'] . '" onclick="changeTimeProfileType();" readonly="true" '.' autocomplete="off"/> ';
- echo '<span class="faicon calendar_icon icon-as_link" id="starts_img"></span>';
- echo '<label> ' . $lang['srv_time_profile_to'] . ': </label>';
- echo '<input id="endDate" type="text" name="endDate" value="' . $p_data['ends'] . '" onclick="changeTimeProfileType();" readonly="true" '.'cautocomplete="off"/> ';
- echo '<span class="faicon calendar_icon icon-as_link" id="expire_img"></span>' . "\n" ;
- echo '<br />';
- echo '<p><input type="radio" name="type" id="time_date_interval" value="1" '.($type == '0' ? '' : ' checked="checked"').' autocomplete="off">'.$lang['srv_statistic_period_label'].':';
- echo '<select name="stat_interval" id="stat_interval" onclick="changeTimeProfileType(\'interval\');" '.'autocomplete="off">';
- echo '<option value="" selected="true">'.$lang['srv_time_profile_choose_interval'].'</option>';
+ echo '<div class="setting_holder">';
+ echo '<p class="setting_title">' . $lang['srv_time_profile_time'] . '</p>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="type" id="time_date_type" value="0" '.($type == '0' ? ' checked="checked"' : '').' autocomplete="off"><label for="time_date_type">' . $lang['srv_time_profile_from'] . ':</label>';
+ echo ' <input id="startDate" type="text" class="text medium" name="startDate" value="' . $p_data['starts'] . '" onclick="changeTimeProfileType();" readonly="true" '.' autocomplete="off"/> ';
+ echo ' <span class="faicon calendar_icon pointer blue" id="starts_img"></span>';
+ echo ' <label>' . $lang['srv_time_profile_to'] . ':</label>';
+ echo ' <input id="endDate" type="text" class="text medium" name="endDate" value="' . $p_data['ends'] . '" onclick="changeTimeProfileType();" readonly="true" '.'cautocomplete="off"/> ';
+ echo ' <span class="faicon calendar_icon pointer blue" id="expire_img"></span>' . "\n" ;
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="type" id="time_date_interval" value="1" '.($type == '0' ? '' : ' checked="checked"').' autocomplete="off"><label for="time_date_interval">'.$lang['srv_statistic_period_label'].':</label>';
+ echo ' <select class="dropdown medium" name="stat_interval" id="stat_interval" onclick="changeTimeProfileType(\'interval\');" '.'autocomplete="off">';
+ echo ' <option value="" selected="true">'.$lang['srv_time_profile_choose_interval'].'</option>';
foreach (self::$STP_ARRAYS as $INTERVAL) {
- echo '<option value="'.$INTERVAL.'"' . ($time == $INTERVAL ? ' selected' : '') . '>'.$lang['srv_diagnostics_'.$INTERVAL].'</option>';
+ echo ' <option value="'.$INTERVAL.'"' . ($time == $INTERVAL ? ' selected' : '') . '>'.$lang['srv_diagnostics_'.$INTERVAL].'</option>';
}
- echo '</select>';
- echo '</p>';
-
+ echo ' </select>';
+ echo '</div>';
+
+ echo '</div>';
+
echo '<script type="text/javascript">';
# za profil id=0 (privzet profil ne pustimo spreminjat
echo
@@ -538,24 +575,25 @@ class SurveyTimeProfiles { }
public static function ajax() {
+ $pid = isset($_POST['pid']) ? $_POST['pid'] : null;
switch ($_GET['a']) {
case 'showProfile':
- self::displayProfiles($_POST['pid']);
+ self::displayProfiles($pid);
break;
case 'createProfile':
self::createNewProfile();
break;
case 'changeProfile':
- self::ChooseProfile($_POST['pid']);
+ self::ChooseProfile($pid);
break;
case 'renameProfile':
- self::RenameProfile($_POST['pid'], $_POST['name']);
+ self::RenameProfile($pid, $_POST['name']);
break;
case 'deleteProfile':
- self::DeleteProfile($_POST['pid']);
+ self::DeleteProfile($pid);
break;
case 'saveProfile':
- self::SaveProfile($_POST['pid'],$_POST['type'],$_POST['startDate'],$_POST['endDate'],$_POST['stat_interval']);
+ self::SaveProfile($pid,$_POST['type'],$_POST['startDate'],$_POST['endDate'],$_POST['stat_interval']);
break;
default:
print_r("<pre>");
@@ -659,33 +697,38 @@ class SurveyTimeProfiles { */
static function printIsDefaultProfile() {
global $lang;
+
if (self::$currentProfileId != 0) {
+
$cp_data = self::GetCurentProfileData();
- echo '<div id="timeProfileDafaultNote">';
+
+ echo '<div id="timeProfileDafaultNote" class="filter_box">';
+ echo ' <div class="header">';
+
# odvisno od tipa profila izpišemo ali obdobje ali interval
if ($cp_data['type'] == 0) {
# obdobje: od - do
- echo $lang['srv_time_profile_filter_dates'];
- echo date(STP_DATE_FORMAT, strtotime($cp_data['starts']));
- echo $lang['srv_time_profile_filter_dates_2'];
- echo date(STP_DATE_FORMAT, strtotime($cp_data['ends']));
- } else {
+ echo '<span class="semi-bold">'.$lang['obdobje_od'].':</span> '.date(STP_DATE_FORMAT, strtotime($cp_data['starts']));
+ echo ' <span class="semi-bold">'.$lang['obdobje_do'].':</span> '.date(STP_DATE_FORMAT, strtotime($cp_data['ends']));
+ }
+ else {
# interval: zadnjih x dni
- echo $lang['srv_time_profile_filter_period'];
- echo ($lang['srv_diagnostics_'.$cp_data['interval_txt']]);
+ echo '<span class="semi-bold">'.$lang['srv_time_profile_filter_period'].':</span> '.($lang['srv_diagnostics_'.$cp_data['interval_txt']]);
}
- echo ' ';
- echo '<span class="as_link" id="link_time_profile_edit">'.$lang['srv_profile_edit'].'</span>';
- echo ' ';
- echo '<span class="as_link" id="link_time_profile_remove">'.$lang['srv_profile_remove'].'</span>';
+ echo ' <div class="icons">';
+ echo ' <span class="faicon edit" id="link_time_profile_edit" title="'.$lang['srv_profile_edit'].'"></span>';
+ echo ' <span class="faicon delete" id="link_time_profile_remove" title="'.$lang['srv_profile_remove'].'"></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
echo '</div>';
- echo '<br class="clr"/>';
return true;
-
- } else {
+ }
+ else {
return false;
}
}
|