2013-02-11 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_servers.php, extensions/plugin_registration.php:
	cleaned source code.
	
	* godmode/reporting/reporting_builder.item_editor.php: fixed the
	usability for the SQL items in the reports.
	
	Fixes: #3573455




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7618 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-11 11:43:32 +00:00
parent ebfd1535fe
commit 182e5a32a2
4 changed files with 40 additions and 15 deletions

View File

@ -1,3 +1,13 @@
2013-02-11 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_servers.php, extensions/plugin_registration.php:
cleaned source code.
* godmode/reporting/reporting_builder.item_editor.php: fixed the
usability for the SQL items in the reports.
Fixes: #3573455
2013-02-11 Miguel de Dios <miguel.dedios@artica.es>
* godmode/menu.php, godmode/alerts/configure_alert_template.php,

View File

@ -135,12 +135,12 @@ function pluginreg_extension_main () {
else {
$macros = json_encode($macros);
}
$values = array(
'name' => io_safe_input ($ini_array["plugin_definition"]["name"]),
'description' => io_safe_input ($ini_array["plugin_definition"]["description"]),
'max_timeout' => $ini_array["plugin_definition"]["timeout"],
'max_retries' => isset($ini_array["plugin_definition"]["retries"]) ? $ini_array["plugin_definition"]["retries"] : 0,
'max_retries' => $ini_array["plugin_definition"]["retries"],
'execute' => io_safe_input ($exec_path),
'parameters' => io_safe_input ($ini_array["plugin_definition"]["execution_postcommand"]),
'macros' => $macros,

View File

@ -819,9 +819,18 @@ html_print_input_hidden('id_item', $idItem);
<td style="vertical-align: top;"><?php echo __('Text'); ?></td>
<td style=""><?php html_print_textarea('text', 5, 25, $text); ?></td>
</tr>
<tr id="row_custom" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Custom SQL template'); ?></td>
<td style=""><?php html_print_select_from_sql('SELECT id, name FROM treport_custom_sql', 'id_custom', $idCustom, 'chooseSQLquery()', '--', '0'); ?></td>
</tr>
<tr id="row_query" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Query SQL'); ?></td>
<td style=""><?php html_print_textarea('sql', 5, 25, $sql); ?></td>
<td style="vertical-align: top;"><?php echo __('SQL query'); ?></td>
<td style="" id="sql_entry">
<?php
html_print_textarea('sql', 5, 25, $sql);
?>
</td>
<td style="" id="sql_example"></td>
</tr>
<tr id="row_servers" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Server'); ?></td>
@ -838,14 +847,6 @@ html_print_input_hidden('id_item', $idItem);
<td style="vertical-align: top;"><?php echo __('Serialized header') . ui_print_help_tip(__("The separator character is |"), true);?></td>
<td style=""><?php html_print_input_text('header', $header, '', 40, 90); ?></td>
</tr>
<tr id="row_custom" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Custom SQL template'); ?></td>
<td style=""><?php html_print_select_from_sql('SELECT id, name FROM treport_custom_sql', 'id_custom', $idCustom, 'chooseSQLquery()', '--', '0'); ?></td>
</tr>
<tr id="row_custom_example">
<td style="vertical-align: top;"><?php echo __('SQL preview'); ?></td>
<td style="" id="sql_example"></td>
</tr>
<tr id="row_url" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('URL'); ?></td>
<td style=""><?php html_print_input_text('url', $url, '', 40, 90); ?></td>
@ -1394,9 +1395,14 @@ function chooseSQLquery() {
var idCustom = $("#id_custom").val();
if (idCustom == 0) {
$("#sql_example").css('display', 'none');
$("#sql_entry").css('display', '');
$("#sql_example").html('');
}
else {
$("#sql_example").css('display', '');
$("#sql_entry").css('display', 'none');
var params1 = [];
params1.push("get_image_path=1");
params1.push("img_src=" + "images/spinner.gif");

View File

@ -517,13 +517,22 @@ function servers_check_status () {
switch ($config["dbtype"]) {
case "mysql":
$sql = "SELECT COUNT(id_server) FROM tserver WHERE status = 1 AND keepalive > NOW() - INTERVAL 15 MINUTE";
$sql = "SELECT COUNT(id_server)
FROM tserver
WHERE status = 1
AND keepalive > NOW() - INTERVAL 15 MINUTE";
break;
case "postgresql":
$sql = "SELECT COUNT(id_server) FROM tserver WHERE status = 1 AND keepalive > NOW() - INTERVAL '15 MINUTE'";
$sql = "SELECT COUNT(id_server)
FROM tserver
WHERE status = 1
AND keepalive > NOW() - INTERVAL '15 MINUTE'";
break;
case "oracle":
$sql = "SELECT COUNT(id_server) FROM tserver WHERE status = 1 AND keepalive > systimestamp - INTERVAL '15' MINUTE";
$sql = "SELECT COUNT(id_server)
FROM tserver
WHERE status = 1
AND keepalive > systimestamp - INTERVAL '15' MINUTE";
break;
}
$status = (int) db_get_sql ($sql); //Cast as int will assure a number value