mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
2012-09-04 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/graph_builder.php, include/functions_modules.php, operation/agentes/ver_agente.php: cleaned source code style. * include/functions_html.php: fixed the function "html_print_select" when pass the selected as array (for example in multiple select box). * godmode/reporting/reporting_builder.item_editor.php, include/functions_reports.php: into the function "get_report_name" added parameter $template to get type for content template. And the function "get_report_types" renamed for "reports_get_report_types" and added the same parameter $template. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6931 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
8d220286b9
commit
9bea1609e1
@ -1,3 +1,19 @@
|
||||
2012-09-04 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/reporting/graph_builder.php,
|
||||
include/functions_modules.php, operation/agentes/ver_agente.php:
|
||||
cleaned source code style.
|
||||
|
||||
* include/functions_html.php: fixed the function "html_print_select"
|
||||
when pass the selected as array
|
||||
(for example in multiple select box).
|
||||
|
||||
* godmode/reporting/reporting_builder.item_editor.php,
|
||||
include/functions_reports.php: into the function "get_report_name"
|
||||
added parameter $template to get type for content template. And the
|
||||
function "get_report_types" renamed for "reports_get_report_types"
|
||||
and added the same parameter $template.
|
||||
|
||||
2012-08-31 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_graph.php
|
||||
|
@ -74,9 +74,16 @@ if ($add_graph) {
|
||||
$period = get_parameter_post ("period");
|
||||
|
||||
// Create graph
|
||||
$values = array( 'id_user' => $config['id_user'], 'name' => $name, 'description' => $description,
|
||||
'period' => $period, 'width' => $width, 'height' => $height,
|
||||
'private' => 0, 'id_group' => $idGroup, 'events' => $events,
|
||||
$values = array(
|
||||
'id_user' => $config['id_user'],
|
||||
'name' => $name,
|
||||
'description' => $description,
|
||||
'period' => $period,
|
||||
'width' => $width,
|
||||
'height' => $height,
|
||||
'private' => 0,
|
||||
'id_group' => $idGroup,
|
||||
'events' => $events,
|
||||
'stacked' => $stacked);
|
||||
|
||||
if (trim($name) != "") {
|
||||
|
@ -361,10 +361,10 @@ html_print_input_hidden('id_item', $idItem);
|
||||
<td style="">
|
||||
<?php
|
||||
if ($action == 'new') {
|
||||
html_print_select(get_report_types(), 'type', $type, 'chooseType();', '', '');
|
||||
html_print_select(reports_get_report_types(), 'type', $type, 'chooseType();', '', '');
|
||||
}
|
||||
else {
|
||||
echo get_report_name($type);
|
||||
echo reports_get_report_types($type);
|
||||
echo '<input type="hidden" id="type" name="type" value="' . $type . '" />';
|
||||
}
|
||||
?>
|
||||
|
@ -293,9 +293,15 @@ function html_print_select ($fields, $name, $selected = '', $script = '',
|
||||
$nothing = __('None');
|
||||
}
|
||||
$output .= '<option value="'.$nothing_value.'"';
|
||||
|
||||
if ($nothing_value == $selected) {
|
||||
$output .= ' selected="selected"';
|
||||
}
|
||||
else if (is_array ($selected)) {
|
||||
if (in_array ($nothing_value, $selected)) {
|
||||
$output .= ' selected="selected"';
|
||||
}
|
||||
}
|
||||
$output .= '>'.$nothing.'</option>';
|
||||
}
|
||||
|
||||
|
@ -538,7 +538,17 @@ function modules_get_agentmodule ($id_agentmodule) {
|
||||
$fields_[] = $field['column_name'];
|
||||
}
|
||||
$fields = implode(',', $fields_);
|
||||
$result = db_process_sql("SELECT TO_NUMBER(MAX_CRITICAL) as max_critical, TO_NUMBER(MIN_CRITICAL) as min_critical, TO_NUMBER(MAX_WARNING) as max_warning, TO_NUMBER(MIN_WARNING) as min_warning, TO_NUMBER(POST_PROCESS) as post_process, " . $fields . " FROM tagente_modulo WHERE id_agente_modulo = " . $id_agentmodule);
|
||||
|
||||
$result = db_process_sql("
|
||||
SELECT TO_NUMBER(MAX_CRITICAL) as max_critical,
|
||||
TO_NUMBER(MIN_CRITICAL) as min_critical,
|
||||
TO_NUMBER(MAX_WARNING) as max_warning,
|
||||
TO_NUMBER(MIN_WARNING) as min_warning,
|
||||
TO_NUMBER(POST_PROCESS) as post_process,
|
||||
" . $fields . "
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = " . $id_agentmodule);
|
||||
|
||||
return $result[0];
|
||||
break;
|
||||
}
|
||||
@ -565,7 +575,10 @@ function modules_get_agentmodule_id ($agentmodule_name, $agent_id) {
|
||||
* @return bool true if is init and false if is not init
|
||||
*/
|
||||
function modules_get_agentmodule_is_init ($id_agentmodule) {
|
||||
$result = db_get_row_filter ('tagente_estado', array('id_agente_modulo' => $id_agentmodule), 'utimestamp');
|
||||
$result = db_get_row_filter ('tagente_estado',
|
||||
array('id_agente_modulo' => $id_agentmodule),
|
||||
'utimestamp');
|
||||
|
||||
return (bool)$result['utimestamp'];
|
||||
}
|
||||
|
||||
@ -589,7 +602,8 @@ function modules_get_agent_modules_count ($id_agent = 0) {
|
||||
$filter = sprintf (" WHERE id_agente IN (%s)", implode (",", (array) $id_agent));
|
||||
}
|
||||
|
||||
return (int) db_get_sql ("SELECT COUNT(*) FROM tagente_modulo" . $filter);
|
||||
return (int) db_get_sql ("SELECT COUNT(*)
|
||||
FROM tagente_modulo" . $filter);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -411,11 +411,12 @@ function reports_delete_content ($id_report_content) {
|
||||
* Get report type name from type id.
|
||||
*
|
||||
* @param int $type Type id of the report.
|
||||
* @param boolean $template Set true for to get types for templates. By default false.
|
||||
*
|
||||
* @return string Report type name.
|
||||
*/
|
||||
function get_report_name ($type) {
|
||||
$types = get_report_types ();
|
||||
function get_report_name ($type, $template = false) {
|
||||
$types = reports_get_report_types ($template);
|
||||
if (! isset ($types[$type]))
|
||||
return __('Unknown');
|
||||
|
||||
@ -475,9 +476,11 @@ function get_report_type_data_source ($type) {
|
||||
/**
|
||||
* Get report types in an array.
|
||||
*
|
||||
* @param boolean $template Set true for to get types for templates. By default false.
|
||||
*
|
||||
* @return array An array with all the possible reports in Pandora where the array index is the report id.
|
||||
*/
|
||||
function get_report_types () {
|
||||
function reports_get_report_types ($template = false) {
|
||||
global $config;
|
||||
|
||||
$types = array ();
|
||||
@ -497,6 +500,10 @@ function get_report_types () {
|
||||
$types['sql_graph_hbar'] = array('optgroup' => __('Graphs'),
|
||||
'name' => __('SQL horizonal bar graph'));
|
||||
}
|
||||
if ($template) {
|
||||
$types['automatic_graph'] = array('optgroup' => __('Graphs'),
|
||||
'name' => __('Automatic combined Graph'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -306,6 +306,7 @@ if (is_ajax ()) {
|
||||
//$agent_modules['any_text'] = __('Any');
|
||||
|
||||
echo json_encode ($agent_modules);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user