2013-02-20 Sergio Martin <sergio.martin@artica.es>

* include/functions_html.php
	include/styles/pandora_minimal.css
	include/styles/menu.css
	include/styles/pandora.css
	operation/agentes/stat_win.php
	operation/events/events.build_table.php
	operation/events/events_list.php
	general/main_menu.php
	godmode/events/event_edit_filter.php: Remodelate the 
	events form view. Pushing the graph in a hidden lateral
	tab and reordering all the form



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7684 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-02-20 13:48:46 +00:00
parent 067b5a1d8b
commit 6b15ef5df7
10 changed files with 315 additions and 282 deletions

View File

@ -1,3 +1,17 @@
2013-02-20 Sergio Martin <sergio.martin@artica.es>
* include/functions_html.php
include/styles/pandora_minimal.css
include/styles/menu.css
include/styles/pandora.css
operation/agentes/stat_win.php
operation/events/events.build_table.php
operation/events/events_list.php
general/main_menu.php
godmode/events/event_edit_filter.php: Remodelate the
events form view. Pushing the graph in a hidden lateral
tab and reordering all the form
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,

View File

@ -20,6 +20,9 @@ if (! isset ($config["id_user"])) {
exit ();
}
// Menu container prepared to autohide menu
echo '<div id="menu_container">';
echo '<div class="tit bg">:: '.__('Operation').' ::</div>';
require ("operation/menu.php");
@ -40,6 +43,8 @@ require ("godmode/menu.php");
require ("links_menu.php");
echo '</div>'; //menu_container
ui_require_jquery_file ('cookie');
?>
<script type="text/javascript" language="javascript">
@ -50,6 +55,36 @@ $(document).ready( function() {
//In case the links gets activated, we don't want to follow link
return false;
});
$('#menu_container').hover (handlerIn, handlerOut);
var openTime = 0;
var handsIn = 0;
function handlerIn() {
handsIn = 1;
if(openTime == 0) {
$('#menu_container').animate({"left": "+=130px"}, 200);
openTime = new Date().getTime();
// Close in 1 second if is not closed manually
setTimeout(function(){
if(openTime > 0 && handsIn == 0) {
$('#menu_container').animate({"left": "-=130px"}, 100);
openTime = 0;
}
}, 1000);
}
}
function handlerOut() {
handsIn = 0;
var openedTime = new Date().getTime() - openTime;
if(openedTime > 1000) {
$('#menu_container').animate({"left": "-=130px"}, 100);
openTime = 0;
}
}
});
/* ]]> */
</script>

View File

@ -77,9 +77,9 @@ else {
$event_view_hr = '';
$id_user_ack = '';
$group_rep = '';
$tag_with_json = json_encode(array());
$tag_with_json = $tag_with_json_clean = json_encode(array());
$tag_with_base64 = base64_encode($tag_with_json);
$tag_without_json = json_encode(array());
$tag_without_json = $tag_without_json_clean = json_encode(array());
$tag_without_base64 = base64_encode($tag_without_json);
$filter_only_alert = '';
}

View File

@ -125,6 +125,10 @@ function html_print_side_layer ($params) {
'height' => '97%',
'top_text' => '',
'bottom_text' => '',
'top' => '0',
'autotop' => '',
'icon_width' => 50,
'icon_height' => 50,
'icon_open' => $params['icon_closed']
);
@ -138,18 +142,18 @@ function html_print_side_layer ($params) {
switch($params['position']) {
case 'left':
$round_class = 'menu_radius_right';
$round_class = 'menu_sidebar_radius_right';
$body_float = 'left';
$button_float = 'right';
break;
case 'right':
$round_class = 'menu_radius_left';
$round_class = 'menu_sidebar_radius_left';
$body_float = 'right';
$button_float = 'left';
break;
}
$out_html = '<div id="side_layer" class="menu ' . $round_class . '" style="z-index:1; overflow: hidden; height: ' . $params['height'] . ';">';
$out_html = '<div id="side_layer" class="menu_sidebar ' . $round_class . '" style="display:none; z-index:1; overflow: hidden; height: ' . $params['height'] . ';">';
$table->id = 'side_layer_layout';
$table->width = $params['width'] . 'px';
@ -159,7 +163,7 @@ function html_print_side_layer ($params) {
$top = '<div id="side_top_text" style="width: 100%";">' . $params['top_text'] . '</div>';
$button = '<div id="show_menu" style="vertical-align: middle; position: relative; border:1px solid #FFF; height: 50px; width: 50px;">';
$button = '<div id="show_menu" style="vertical-align: middle; position: relative; border:1px solid #FFF; width: ' . $params['icon_width'] . 'px; height: ' . $params['icon_height'] . 'px;">';
$button .= html_print_image($params['position'] == 'left' ? $params['icon_open'] : $params['icon_closed'], true, array('id' => 'graph_menu_arrow'));
$button .= '</div>';
@ -209,22 +213,31 @@ function html_print_side_layer ($params) {
$out_js = "<script type='text/javascript'>
<!--
var defSlideTime = 220;
var visibleMargin = 55;
var visibleMargin = " . $params['icon_width'] . " + 10;
var menuW = " . $params['width'] . ";
var hiddenMargin = menuW - visibleMargin;
var windowWidth = $(window).width();
var position = '" . $params['position'] . "';
var sideClosed = 1;
var top_dist = '" . $params['top'] ."';
var autotop = '" . $params['autotop'] ."';
window.onload = function() {
if(top_dist == 'auto_over') {
top_dist = $('#' + autotop).offset().top;
}
else if(top_dist == 'auto_below') {
top_dist = $('#' + autotop).offset().top + $('#' + autotop).height();
}
$(document).ready( function() {
// SET INITIAL POSITION AND SHOW LAYER
$('#side_layer').css('top', 0);
$('#side_layer').css('top', top_dist);
switch (position) {
case 'left':
$('#side_layer').css('left', -hiddenMargin);
break;
case 'right':
$('#side_layer').css('left', windowWidth - visibleMargin - 12);
$('#side_layer').css('left', windowWidth - visibleMargin - 1);
$('#side_layer').css('width', visibleMargin + 'px');
break;
@ -269,7 +282,7 @@ function html_print_side_layer ($params) {
sideClosed = 0;
}
});
};
});
if(position == 'right') {
// Move the right menu if window is resized
@ -1154,6 +1167,7 @@ function html_print_textarea ($name, $rows, $columns, $value = '', $attributes =
* $table->size - An array of column sizes
* $table->wrap - An array of "nowrap"s or nothing
* $table->style - An array of personalized style for each column.
* $table->rowid - An array of personalized ids of each row.
* $table->rowstyle - An array of personalized style of each row.
* $table->rowclass - An array of personalized classes of each row (odd-evens classes will be ignored).
* $table->colspan - An array of colspans of each column.
@ -1225,6 +1239,11 @@ function html_print_table (&$table, $return = false) {
if (isset ($table->styleTable)) {
$styleTable = $table->styleTable;
}
if (isset ($table->rowid)) {
foreach ($table->rowid as $key => $id) {
$rowid[$key] = $id;
}
}
if (isset ($table->rowstyle)) {
foreach ($table->rowstyle as $key => $st) {
$rowstyle[$key] = ' '. $st .';';
@ -1336,16 +1355,18 @@ function html_print_table (&$table, $return = false) {
if (!empty ($table->data)) {
$oddeven = 1;
foreach ($table->data as $keyrow => $row) {
if (!isset ($rowstyle[$keyrow])) {
$rowstyle[$keyrow] = '';
}
if (!isset ($rowid[$keyrow])) {
$rowid[$keyrow] = $tableid."-".$keyrow;
}
$oddeven = $oddeven ? 0 : 1;
$class = 'datos'.($oddeven ? "" : "2");
if (isset ($rowclass[$keyrow])) {
$class = $rowclass[$keyrow];
}
$output .= '<tr id="'.$tableid."-".$keyrow.'" style="'.$rowstyle[$keyrow].'" class="'.$class.'">'."\n";
$output .= '<tr id="'.$rowid[$keyrow].'" style="'.$rowstyle[$keyrow].'" class="'.$class.'">'."\n";
/* Special separator rows */
if ($row == 'hr' and $countcols) {
$output .= '<td colspan="'. $countcols .'"><div class="tabledivider"></div></td>';

View File

@ -110,6 +110,11 @@ background-color: #fff;
background-image: url(../../images/link.png);
background-position: 4px 8px;
}
.menu {
width: 164px;
}
/* Icons specified here */
#icon_oper-networkconsole {
background-image: url(../../images/plotchart.png);
@ -221,3 +226,11 @@ background-color: #fff;
#icon_god-events {
background-image: url(../../images/lightning_go.png);
}
#menu_container {
z-index: 3;
position: absolute;
left: -130px;
background-color: #AAA;
height: 100%;
}

View File

@ -1394,7 +1394,10 @@ div#main {
padding-left: 0px;
padding-top: 0px;
padding-bottom: 20px;
/*CLASSIC STYLE*/
margin-left: 175px;
/*AUTOHIDDEN MENU*/
/*margin-left: 40px;*/
margin-right: 20px;
}
div#head {
@ -1739,3 +1742,48 @@ span#plugin_description {
.visual_font_size_36pt, .visual_font_size_36pt > em, .visual_font_size_36pt > strong {
font-size: 36pt;
}
/*SIDEBAR*/
.menu_sidebar {
color:#000;
background:#cccacb url('../../images/login_background.png') right center no-repeat;
margin-left: 10px;
padding-left: 0px;
padding-right: 0px;
padding-top: 10px;
text-align: left;
font-family:arial,sans-serif,verdana;
font-size:10px;
border:1px solid #000;
position:absolute;
margin:0;
width:400px;
height:260px;
-moz-box-shadow: 0px 4px 4px #010E1B !important;
-webkit-box-shadow: 0px 4px 4px #010E1B !important;
box-shadow: 0px 4px 4px #010E1B !important;
filter:alpha(opacity=97);
-moz-opacity: 0.97;
opacity: 0.97;
}
.menu_sidebar_radius_left {
-moz-border-top-left-radius: 10px;
-webkit-border-top-left-radius: 10px;
border-top-left-radius: 10px;
-moz-border-bottom-left-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
border-bottom-left-radius: 10px;
border-right:0px solid #000;
}
.menu_sidebar_radius_right {
-moz-border-top-right-radius: 10px;
-webkit-border-top-right-radius: 10px;
border-top-right-radius: 10px;
}

View File

@ -74,43 +74,6 @@ table, img {
.databox {
background-color: #fafafa;
}
.menu {
color:#000;
background:#cccacb url('../../images/login_background.png') right center no-repeat;
margin-left: 10px;
padding-left: 5px;
padding-right: 5px;
padding-top: 10px;
text-align: left;
font-family:arial,sans-serif,verdana;
font-size:10px;
border:1px solid #000;
position:absolute;
margin:0;
width:400px;
height:260px;
-moz-box-shadow: 0px 6px 6px #010E1B !important;
-webkit-box-shadow: 0px 6px 6px #010E1B !important;
box-shadow: 0px 6px 6px #010E1B !important;
filter:alpha(opacity=97);
-moz-opacity: 0.97;
opacity: 0.97;
}
.menu_radius_left {
-moz-border-top-left-radius: 10px;
-webkit-border-top-left-radius: 10px;
border-top-left-radius: 10px;
}
.menu_radius_right {
-moz-border-top-right-radius: 10px;
-webkit-border-top-right-radius: 10px;
border-top-right-radius: 10px;
}
#show_menu {
background:#cccacb;

View File

@ -339,35 +339,7 @@ $label = base64_decode(get_parameter('label', ''));
html_print_side_layer($params);
?>
<!-- z-index is 1 because 2 made the calendar show under the divmenu. -->
<div id="divmenu2" class="menu menu_radius_left" style="display:none; z-index:1; height: 97%;">
<b> <?php echo __('Pandora FMS Graph configuration menu');?></b>
<br />
<br />
<?php
echo __('Please, make your changes and apply with the <i>Reload</i> button');
?>
<div style="float: left; width: 85%;">
<form method="get" action="stat_win.php">
<table class="databox_frame" cellspacing="2" width="100%">
<tr>
<td></td>
<td style="text-align: right">
<?php
html_print_submit_button (__('Reload'), "submit", false, 'class="sub next"');
?>
</td>
</tr>
</table>
</form>
</div>
<div id="show_menu2" style="position: relative; border:1px solid #FFF; float: right; height: 50px; width: 50px;">
<?php
html_print_image("images/graphmenu_arrow.png", false, array('id' => 'graph_menu_arrow'));
?>
<div>
</div>
</body>
</html>
<script>

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details.
$table->width = '100%';
$table->width = '98%';
$table->id = "eventtable";
$table->cellpadding = 4;
$table->cellspacing = 4;

View File

@ -160,122 +160,44 @@ echo '<div id="event_control" style="display:none">';
// Table for filter controls
echo '<form id="form_filter" method="post" action="index.php?sec=eventos&amp;sec2=operation/events/events&amp;refr='.$config["refr"].'&amp;pure='.$config["pure"].'&amp;section=' . $section . '&amp;history='.(int)$history.'">';
echo '<table style="float:left;" width="550" cellpadding="4" cellspacing="4" class="databox"><tr id="row_name" style="visibility: hidden">';
// Filter name
echo "<td id='filter_name_color'>".__('Filter name')."</td><td>";
html_print_input_text ('id_name', $id_name, '', 15);
echo "</td>";
$table->id = 'stat_win_form';
$table->width = '98%';
$table->cellspacing = 4;
$table->cellpadding = 4;
$table->class = 'databox';
$table->styleTable = 'font-weight: bold; color: #555;';
// Filter group
echo "<td id='filter_group_color'>".__('Filter group')."</td><td>";
html_print_select_groups($config["id_user"], "ER", true, 'id_group', $id_group, '', '', 0, false, false, false, 'w130');
echo "</td></tr>";
$table->rowstyle[] = 'visibility: hidden;';
$table->rowid[] = 'row_name';
$data = array();
$data[0] = __('Filter name') . '<br>';
$data[0] .= html_print_input_text ('id_name', $id_name, '', 15, 255, true);
$data[1] = __('Filter group') . '<br>';
$data[1] .= html_print_select_groups($config["id_user"], "ER", true, 'id_group', $id_group, '', '', 0, true, false, false, 'w130');
$data[3] = $data[4] = '';
$table->data[] = $data;
$table->rowclass[] = '';
// Group combo
echo "<td>".__('Group')."</td><td>";
html_print_select_groups($config["id_user"], "ER", true, 'ev_group', $ev_group, '', '', 0, false, false, false, 'w130');
echo "</td>";
// Event type
echo "<td>".__('Event type')."</td><td>";
$data = array();
$data[0] = __('Group') . '<br>';
$data[0] .= html_print_select_groups($config["id_user"], "ER", true, 'id_group', $id_group, '', '', 0, true, false, false, 'w130');
$data[1] = __('Event type') . '<br>';
$types = get_event_types ();
// Expand standard array to add not_normal (not exist in the array, used only for searches)
$types["not_normal"] = __("Not normal");
html_print_select ($types, 'event_type', $event_type, '', __('All'), '');
echo "</td></tr><tr>";
// Severity
echo "<td>".__('Severity')."</td><td>";
html_print_select (get_priorities (), "severity", $severity, '', __('All'), '-1', false, false, false);
echo '</td>';
// Status
echo "<td>".__('Event status')."</td><td>";
$data[1] .= html_print_select ($types, 'event_type', $event_type, '', __('All'), '', true);
$data[2] = __('Severity') . '<br>';
$data[2] .= html_print_select (get_priorities (), "severity", $severity, '', __('All'), '-1', true, false, false);
$data[3] = __('Event status') . '<br>';
$fields = events_get_all_status();
$data[3] .= html_print_select ($fields, 'status', $status, '', '', '', true);
$data[4] = __('Max. hours old') . '<br>';
$data[4] .= html_print_input_text ('event_view_hr', $event_view_hr, '', 5, 255, true);
$table->data[] = $data;
$table->rowclass[] = '';
html_print_select ($fields, 'status', $status, '', '', '');
//NEW LINE
echo "</td></tr><tr>";
// Free search
echo "<td>" . __('Free search') . "</td>";
echo "<td>";
html_print_input_text ('search', io_safe_output($search), '', 15);
echo '</td>';
//Agent search
echo "<td>" . __('Agent search') . "</td>";
echo '<td class="datos">';
$params = array();
$params['show_helptip'] = true;
$params['input_name'] = 'text_agent';
$params['value'] = $text_agent;
if($meta) {
$params['javascript_page'] = 'enterprise/meta/include/ajax/events.ajax';
}
else {
$params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_name'] = 'id_agent';
$params['hidden_input_idagent_value'] = $id_agent;
}
ui_print_agent_autocomplete_input($params);
echo '</td>';
echo "</tr>";
// User selectable block size
echo '<tr><td>';
echo __('Block size for pagination');
echo '</td>';
$lpagination[25] = 25;
$lpagination[50] = 50;
$lpagination[100] = 100;
$lpagination[200] = 200;
$lpagination[500] = 500;
echo "<td>";
html_print_select ($lpagination, "pagination", $pagination, '', __('Default'), $config["block_size"]);
echo "</td>";
echo "<td>" . __('Max. hours old') . "</td>";
echo "<td>";
html_print_input_text ('event_view_hr', $event_view_hr, '', 5);
echo "</td>";
echo "</tr><tr>";
echo "<td>" . __('User ack.') . "</td>";
echo "<td>";
$users = users_get_info ();
html_print_select ($users, "id_user_ack", $id_user_ack, '', __('Any'), 0);
echo "</td>";
echo "<td>";
echo __("Repeated");
echo "</td><td>";
$repeated_sel[0] = __("All events");
$repeated_sel[1] = __("Group events");
html_print_select ($repeated_sel, "group_rep", $group_rep, '');
echo "</td></tr>";
echo "<tr>";
echo "<td colspan='2'>" . __('Events with following tags') . "</td>";
echo "<td colspan='2'>" . __('Events without following tags') . "</td>";
echo "</tr>";
echo "<tr>";
// TAGS
$tags_select_with = array();
$tags_select_without = array();
$tag_with_temp = array();
@ -300,68 +222,100 @@ $add_with_tag_disabled = empty($tags_select_with);
$remove_with_tag_disabled = empty($tag_with_temp);
$add_without_tag_disabled = empty($tags_select_without);
$remove_without_tag_disabled = empty($tag_without_temp);
echo "<td>";
html_print_select ($tags_select_with, 'select_with', '', '', '', 0,
false, false, true, '', false, 'width: 120px;');
echo "</td>";
echo "<td>";
html_print_button(__('Add'), 'add_whith', $add_with_tag_disabled,
'', 'class="add sub"');
echo "</td>";
echo "<td>";
html_print_select ($tags_select_without, 'select_without', '', '', '', 0,
false, false, true, '', false, 'width: 120px;');
echo "</td>";
echo "<td>";
html_print_button(__('Add'), 'add_whithout', $add_without_tag_disabled,
'', 'class="add sub"');
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td valign='top'>";
html_print_select ($tag_with_temp, 'tag_with_temp', array(), '', '',
0, false, true,
true, '', false, "width: 120px; height: 50px;");
html_print_input_hidden('tag_with', $tag_with_base64);
echo "</td>";
echo "<td valign='top'>";
html_print_button(__('Remove'), 'remove_whith', $remove_with_tag_disabled,
'', 'class="delete sub"');
echo "</td>";
echo "<td valign='top'>";
html_print_select ($tag_without_temp, 'tag_without_temp', array(), '',
'', 0, false, true,
true, '', false, "width: 120px; height: 50px;");
html_print_input_hidden('tag_without', $tag_without_base64);
echo "</td>";
echo "<td valign='top'>";
html_print_button(__('Remove'), 'remove_whithout', $remove_without_tag_disabled,
'', 'class="delete sub"');
echo "</td>";
echo "</tr>";
echo "<tr>";
$tabletags->id = 'filter_events_tags';
$tabletags->width = '100%';
$tabletags->cellspacing = 4;
$tabletags->cellpadding = 4;
$tabletags->class = '';
$tabletags->styleTable = 'border: 0px;';
echo "<td>";
echo __("Alert events") . "</td><td>";
$data = array();
$data[0] = __('Events with following tags') . '<br>';
$data[0] .= html_print_select ($tags_select_with, 'select_with', '', '', '', 0,
true, false, true, '', false, 'width: 120px;') . '<br>';
$data[1] = __('Events without following tags') . '<br>';
$data[1] .= html_print_select ($tags_select_without, 'select_without', '', '', '', 0,
true, false, true, '', false, 'width: 120px;') . '<br>';
$tabletags->data[] = $data;
$tabletags->rowclass[] = '';
html_print_select (array('-1' => __('All'), '0' => __('Filter alert events'), '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '');
$data = array();
$data[0] = html_print_button(__('Add'), 'add_with', $add_with_tag_disabled,
'', 'class="add sub"', true);
$data[0] .= html_print_input_hidden('tag_with', $tag_with_base64, true);
$data[0] .= html_print_button(__('Remove'), 'remove_with', $remove_with_tag_disabled,
'', 'class="delete sub"', true);
echo "</td></tr>";
$data[1] = html_print_button(__('Add'), 'add_without', $add_without_tag_disabled,
'', 'class="add sub"', true);
$data[1] .= html_print_input_hidden('tag_without', $tag_without_base64, true);
$data[1] .= html_print_button(__('Remove'), 'remove_without', $remove_without_tag_disabled,
'', 'class="delete sub"', true);
$tabletags->data[] = $data;
$tabletags->rowclass[] = '';
echo '<tr><td>';
$data = array();
$data[0] = html_print_select ($tag_with_temp, 'tag_with_temp', array(), '', '',
0, true, true, true, '', false, "width: 120px; height: 50px;") . '<br>';
$data[1] = html_print_select ($tag_without_temp, 'tag_without_temp', array(), '', '',
0, true, true, true, '', false, "width: 120px; height: 50px;") . '<br>';
$tabletags->data[] = $data;
$tabletags->rowclass[] = '';
// END OF TAGS
echo __("Load filter");
$data = array();
$data[0] = '<fieldset class="databox" style="width:90%;"><legend>' . __('Tags') . '</legend>' . html_print_table($tabletags, true) . '</fieldset>';
$table->colspan[count($table->data)][0] = 2;
$table->rowspan[count($table->data)][0] = 3;
$data[2] = __('Free search') . '<br>';
$data[2] .= html_print_input_text ('search', io_safe_output($search), '', 25, 255, true);
$data[3] = __('Agent search') . '<br>';
$params = array();
$params['show_helptip'] = true;
$params['input_name'] = 'text_agent';
$params['value'] = $text_agent;
$params['return'] = true;
echo '</td><td>';
// Custom filters from user
if($meta) {
$params['javascript_page'] = 'enterprise/meta/include/ajax/events.ajax';
}
else {
$params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_name'] = 'id_agent';
$params['hidden_input_idagent_value'] = $id_agent;
}
$data[3] .= ui_print_agent_autocomplete_input($params);
$data[4] = __("Repeated") . '<br>';
$repeated_sel[0] = __("All events");
$repeated_sel[1] = __("Group events");
$data[4] .= html_print_select ($repeated_sel, "group_rep", $group_rep, '', '', 0, true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[2] = __("Alert events") . '<br>';
$data[2] .= html_print_select (array('-1' => __('All'), '0' => __('Filter alert events'), '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '', true);
$data[3] = __('Block size for pagination') . '<br>';
$lpagination[25] = 25;
$lpagination[50] = 50;
$lpagination[100] = 100;
$lpagination[200] = 200;
$lpagination[500] = 500;
$data[3] .= html_print_select ($lpagination, "pagination", $pagination, '', __('Default'), $config["block_size"], true);
$data[4] = __('User ack.') . '<br>';
$users = users_get_info ();
$data[4] .= html_print_select ($users, "id_user_ack", $id_user_ack, '', __('Any'), 0, true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[1] = __("Load filter") . '<br>';
$filters = events_get_event_filter_select();
html_print_select ($filters, "filter_id", $filter_id, '', __('none'), 0, false);
echo '</td></tr>';
echo '<tr><td colspan="4" style="text-align:right">';
$data[1] .= html_print_select ($filters, "filter_id", $filter_id, '', __('none'), 0, true);
$table->data[] = $data;
$table->rowclass[] = '';
// Trick to catch if the update button has been pushed (don't collapse filter)
// or autorefresh is in use (collapse filter)
@ -389,16 +343,38 @@ else{
}
//The buttons
html_print_submit_button (__('Update filter'), 'update_filter', false, 'class="sub upd" style="visibility:hidden"');
html_print_submit_button (__('Save filter'), 'save_filter', false, 'class="sub upd"');
html_print_submit_button (__('Update'), 'update', false, 'class="sub upd"');
echo "</td></tr></table></form>"; //This is the filter div
echo '<div style="width:220px; float:left;">';
echo grafico_eventos_grupo(350, 248, rawurlencode ($sql_post), $meta, $history);
echo '</div>';
echo '<div id="steps_clean">&nbsp;</div>';
echo '</div>';
$data = array();
$data[0] = html_print_submit_button (__('Update filter'), 'update_filter', false, 'class="sub upd" style="visibility:hidden"', true);
$data[0] .= html_print_submit_button (__('Save filter'), 'save_filter', false, 'class="sub upd"', true);
$data[0] .= html_print_submit_button (__('Update'), 'update', false, 'class="sub upd"', true);
$table->colspan[count($table->data)][0] = 5;
$table->rowstyle[count($table->data)] = 'text-align:right;';
$table->data[] = $data;
$table->rowclass[] = '';
html_print_table($table);
unset($table);
echo "</form>"; //This is the filter div
echo "</div>";
$params = array();
$params['position'] = 'right';
$params['icon_closed'] = 'images/setup.png';
$params['body_text'] = '<b>' . __('Events graph by agent') . '</b>';
$params['body_text'] .= grafico_eventos_grupo(350, 248, rawurlencode ($sql_post), $meta, $history);
$params['icon_closed'] = '/images/chart_curve';
$params['icon_open'] = '/images/chart_curve';
$params['height'] = '250px';
$params['top'] = 'auto_below';
$params['autotop'] = 'menu_tab_frame_view';
$params['icon_width'] = 16;
$params['icon_height'] = 16;
html_print_side_layer($params);
$event_table = events_get_events_table($meta, $history);
@ -577,13 +553,11 @@ $(document).ready( function() {
$('#row_name').css('visibility', '');
$('#show_filter_error')
.html('<h3 class="error"> <?php echo __('Define name and group for the filter and click on Save filter again'); ?> </h3>');
$('#filter_name_color').css('color', '#CC0000');
$('#filter_group_color').css('color', '#CC0000');
$('#row_name').css('color', '#CC0000');
// If the filter has name insert in database
}
else {
$('#filter_name_color').css('color', '#000000');
$('#filter_group_color').css('color', '#000000');
$('#row_name').css('color', '#555');
// If the filter name is blank show error
if ($('#text-id_name').val() == '') {
$('#show_filter_error').html('<h3 class="error"> <?php echo __('Filter name cannot be left blank'); ?> </h3>');
@ -756,19 +730,19 @@ $(document).ready( function() {
}
});
$("#button-add_whith").click(function() {
$("#button-add_with").click(function() {
click_button_add_tag("with");
});
$("#button-add_whithout").click(function() {
$("#button-add_without").click(function() {
click_button_add_tag("without");
});
$("#button-remove_whith").click(function() {
$("#button-remove_with").click(function() {
click_button_remove_tag("with");
});
$("#button-remove_whithout").click(function() {
$("#button-remove_without").click(function() {
click_button_remove_tag("without");
});
@ -778,16 +752,16 @@ function click_button_remove_tag(what_button) {
if (what_button == "with") {
id_select_origin = "#select_with";
id_select_destiny = "#tag_with_temp";
id_button_remove = "#button-remove_whith";
id_button_add = "#button-add_whith";
id_button_remove = "#button-remove_with";
id_button_add = "#button-add_with";
select_origin_empty = origin_select_with_tag_empty;
}
else { //without
id_select_origin = "#select_without";
id_select_destiny = "#tag_without_temp";
id_button_remove = "#button-remove_whithout";
id_button_add = "#button-add_whithout";
id_button_remove = "#button-remove_without";
id_button_add = "#button-add_without";
select_origin_empty = origin_select_without_tag_empty;
}
@ -839,16 +813,16 @@ function click_button_add_tag(what_button) {
if (what_button == 'with') {
id_select_origin = "#select_with";
id_select_destiny = "#tag_with_temp";
id_button_remove = "#button-remove_whith";
id_button_add = "#button-add_whith";
id_button_remove = "#button-remove_with";
id_button_add = "#button-add_with";
select_destiny_empty = select_with_tag_empty;
}
else { //without
id_select_origin = "#select_without";
id_select_destiny = "#tag_without_temp";
id_button_remove = "#button-remove_whithout";
id_button_add = "#button-add_whithout";
id_button_remove = "#button-remove_without";
id_button_add = "#button-add_without";
select_destiny_empty = select_without_tag_empty;
}
@ -927,8 +901,6 @@ function reorder_tags_inputs() {
$("#tag_with_temp option").remove();
$('#select_without option[value="' + val_none + '"]').remove();
jQuery.each($("#tag_without_temp option"), function(key, element) {
val = $(element).val();
@ -942,8 +914,6 @@ function reorder_tags_inputs() {
$("#tag_without_temp option").remove();
tags_base64 = $("#hidden-tag_with").val();
tags = jQuery.parseJSON(Base64.decode(tags_base64));
jQuery.each(tags, function(key, element) {
@ -956,26 +926,23 @@ function reorder_tags_inputs() {
});
if ($("#select_with option").length == 0) {
origin_select_with_tag_empty = true;
$("#button-add_whith").attr('disabled', 'true');
$("#button-add_with").attr('disabled', 'true');
$("#select_with").append($("<option value='" + val_none + "'>" + text_none + "</option>"));
}
else {
origin_select_with_tag_empty = false;
$("#button-add_whith").removeAttr('disabled');
$("#button-add_with").removeAttr('disabled');
}
if ($("#tag_with_temp option").length == 0) {
select_with_tag_empty = true;
$("#button-remove_whith").attr('disabled', 'true');
$("#button-remove_with").attr('disabled', 'true');
$("#tag_with_temp").append($("<option value='" + val_none + "'>" + text_none + "</option>"));
}
else {
select_with_tag_empty = false;
$("#button-remove_whith").removeAttr('disabled');
$("#button-remove_with").removeAttr('disabled');
}
tags_base64 = $("#hidden-tag_without").val();
tags = jQuery.parseJSON(Base64.decode(tags_base64));
jQuery.each(tags, function(key, element) {
@ -988,21 +955,21 @@ function reorder_tags_inputs() {
});
if ($("#select_without option").length == 0) {
origin_select_without_tag_empty = true;
$("#button-add_whithout").attr('disabled', 'true');
$("#button-add_without").attr('disabled', 'true');
$("#select_without").append($("<option value='" + val_none + "'>" + text_none + "</option>"));
}
else {
origin_select_without_tag_empty = false;
$("#button-add_whithout").removeAttr('disabled');
$("#button-add_without").removeAttr('disabled');
}
if ($("#tag_without_temp option").length == 0) {
select_without_tag_empty = true;
$("#button-remove_whithout").attr('disabled', 'true');
$("#button-remove_without").attr('disabled', 'true');
$("#tag_without_temp").append($("<option value='" + val_none + "'>" + text_none + "</option>"));
}
else {
select_without_tag_empty = false;
$("#button-remove_whithout").removeAttr('disabled');
$("#button-remove_without").removeAttr('disabled');
}
}
/* ]]> */