Merge branch 'ent-6145-Mostrar-AVG-MAX-MIN-en-graficas-con-selector-individual' into 'develop'

add new options char

See merge request artica/pandorafms!3471
This commit is contained in:
Daniel Rodriguez 2020-10-05 12:04:46 +02:00
commit 099a0e4d67
3 changed files with 107 additions and 54 deletions

View File

@ -2122,7 +2122,7 @@ $class = 'databox filters';
<td style="font-weight:bold;"> <td style="font-weight:bold;">
<?php <?php
echo __('Full resolution graph (TIP)').ui_print_help_tip( echo __('Full resolution graph (TIP)').ui_print_help_tip(
__('This option may cause performance issues.'), __('TIP mode charts do not support average - maximum - minimum series, you can only enable TIP or average, maximum or minimum series'),
true true
); );
?> ?>

View File

@ -233,8 +233,9 @@ $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
$data = []; $data = [];
$data[0] = __('Show full scale graph (TIP)').ui_print_help_tip( $data[0] = __('Show full scale graph (TIP)');
__('This option may cause performance issues'), $data[0] .= ui_print_help_tip(
__('TIP mode charts do not support average - maximum - minimum series, you can only enable TIP or average, maximum or minimum series'),
true, true,
'images/tip.png', 'images/tip.png',
true true

View File

@ -80,6 +80,18 @@ $label = db_get_value(
'id_agente_modulo', 'id_agente_modulo',
$id $id
); );
ui_require_css_file('register', 'include/styles/', true);
// Connection lost alert.
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
ui_print_message_dialog(
$conn_title,
$conn_text,
'connection',
'/images/error_1.png'
);
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
@ -171,6 +183,11 @@ $label = db_get_value(
$fullscale = get_parameter('fullscale', 0); $fullscale = get_parameter('fullscale', 0);
} }
$type_mode_graph = get_parameter_checkbox(
'type_mode_graph',
($fullscale === 1) ? 0 : $config['type_mode_graph']
);
$time_compare = false; $time_compare = false;
if ($time_compare_separated) { if ($time_compare_separated) {
@ -294,14 +311,8 @@ $label = db_get_value(
true true
); );
$table->data[3][2] = __('Show full scale graph (TIP)'); $table->data[3][2] = '';
$table->data[3][3] = html_print_checkbox_switch( $table->data[3][3] = '';
'fullscale',
1,
(bool) $fullscale,
true,
false
);
if (!modules_is_boolean($id)) { if (!modules_is_boolean($id)) {
$table->data[4][0] = __('Zoom'); $table->data[4][0] = __('Zoom');
@ -349,6 +360,29 @@ $label = db_get_value(
true true
); );
$table->data[6][0] = __('Show AVG/MAX/MIN data series in graph');
$table->data[6][1] = html_print_checkbox_switch(
'type_mode_graph',
1,
(bool) $type_mode_graph,
true,
false
);
$table->data[6][2] = __('Show full scale graph (TIP)');
$table->data[6][2] .= ui_print_help_tip(
__('TIP mode charts do not support average - maximum - minimum series, you can only enable TIP or average, maximum or minimum series'),
true
);
$table->data[6][3] = html_print_checkbox_switch(
'fullscale',
1,
(bool) $fullscale,
true,
false
);
$form_table = html_print_table($table, true); $form_table = html_print_table($table, true);
$form_table .= '<div style="width:100%; text-align:right; margin-top: 15px;">'; $form_table .= '<div style="width:100%; text-align:right; margin-top: 15px;">';
$form_table .= html_print_submit_button( $form_table .= html_print_submit_button(
@ -433,6 +467,7 @@ $label = db_get_value(
'fullscale' => $fullscale, 'fullscale' => $fullscale,
'zoom' => $zoom, 'zoom' => $zoom,
'height' => 300, 'height' => 300,
'type_mode_graph' => $type_mode_graph,
]; ];
$output .= grafico_modulo_sparse($params); $output .= grafico_modulo_sparse($params);
$output .= '<br>'; $output .= '<br>';
@ -479,51 +514,68 @@ ui_include_time_picker(true);
?> ?>
<script> <script>
$('#checkbox-time_compare_separated').click(function() { $(document).ready (function () {
$('#checkbox-time_compare_overlapped').removeAttr('checked'); $('#checkbox-time_compare_separated').click(function(e) {
}); if(e.target.checked === true) {
$('#checkbox-time_compare_overlapped').click(function() { $('#checkbox-time_compare_overlapped').prop('checked', false);
$('#checkbox-time_compare_separated').removeAttr('checked'); }
}); });
$('#checkbox-time_compare_overlapped').click(function(e) {
if(e.target.checked === true) {
$('#checkbox-time_compare_separated').prop('checked', false);
}
});
// Add datepicker and timepicker $('#checkbox-fullscale').click(function(e) {
$("#text-start_date").datepicker({ if(e.target.checked === true) {
dateFormat: "<?php echo DATE_FORMAT_JS; ?>" $('#checkbox-type_mode_graph').prop('checked', false);
}); }
$("#text-start_time").timepicker({ });
showSecond: true,
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
timeText: '<?php echo __('Time'); ?>',
hourText: '<?php echo __('Hour'); ?>',
minuteText: '<?php echo __('Minute'); ?>',
secondText: '<?php echo __('Second'); ?>',
currentText: '<?php echo __('Now'); ?>',
closeText: '<?php echo __('Close'); ?>'
});
$.datepicker.setDefaults( $('#checkbox-type_mode_graph').click(function(e) {
$.datepicker.regional["<?php echo $custom_user_language; ?>"] if(e.target.checked === true) {
); $('#checkbox-fullscale').prop('checked', false);
}
});
// Menu. // Add datepicker and timepicker
$('#module_graph_menu_header').on('click', function(){ $("#text-start_date").datepicker({
var arrow = $('#module_graph_menu_header .module_graph_menu_arrow'); dateFormat: "<?php echo DATE_FORMAT_JS; ?>"
var arrow_up = 'arrow_up_green'; });
var arrow_down = 'arrow_down_green'; $("#text-start_time").timepicker({
if( $('.module_graph_menu_content').hasClass( showSecond: true,
'module_graph_menu_content_closed')){ timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
$('.module_graph_menu_content').show(); timeOnlyTitle: '<?php echo __('Choose time'); ?>',
$('.module_graph_menu_content').removeClass( timeText: '<?php echo __('Time'); ?>',
'module_graph_menu_content_closed'); hourText: '<?php echo __('Hour'); ?>',
arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up)); minuteText: '<?php echo __('Minute'); ?>',
} secondText: '<?php echo __('Second'); ?>',
else{ currentText: '<?php echo __('Now'); ?>',
$('.module_graph_menu_content').hide(); closeText: '<?php echo __('Close'); ?>'
$('.module_graph_menu_content').addClass( });
'module_graph_menu_content_closed');
arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down)); $.datepicker.setDefaults(
} $.datepicker.regional["<?php echo $custom_user_language; ?>"]
);
// Menu.
$('#module_graph_menu_header').on('click', function(){
var arrow = $('#module_graph_menu_header .module_graph_menu_arrow');
var arrow_up = 'arrow_up_green';
var arrow_down = 'arrow_down_green';
if( $('.module_graph_menu_content').hasClass(
'module_graph_menu_content_closed')){
$('.module_graph_menu_content').show();
$('.module_graph_menu_content').removeClass(
'module_graph_menu_content_closed');
arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up));
}
else{
$('.module_graph_menu_content').hide();
$('.module_graph_menu_content').addClass(
'module_graph_menu_content_closed');
arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down));
}
});
}); });
</script> </script>