mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'develop' into feature/alias_freandly_name
Conflicts: pandora_console/include/functions_ui.php
This commit is contained in:
commit
3051ce4e23
@ -14,7 +14,7 @@
|
|||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
function dbmanager_query ($sql, &$error) {
|
function dbmanager_query ($sql, &$error, $dbconnection) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
@ -25,22 +25,49 @@ function dbmanager_query ($sql, &$error) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
$sql = html_entity_decode($sql, ENT_QUOTES);
|
$sql = html_entity_decode($sql, ENT_QUOTES);
|
||||||
|
if ($config["mysqli"]) {
|
||||||
$result = mysql_query ($sql);
|
$result = mysqli_query ($dbconnection, $sql);
|
||||||
|
if ($result === false) {
|
||||||
|
$backtrace = debug_backtrace ();
|
||||||
|
$error = mysqli_error ($dbconnection);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$result = mysql_query ($sql, $dbconnection);
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
$backtrace = debug_backtrace ();
|
$backtrace = debug_backtrace ();
|
||||||
$error = mysql_error ();
|
$error = mysql_error ();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result === true) {
|
|
||||||
return mysql_affected_rows ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($result === true) {
|
||||||
|
if($config["mysqli"]){
|
||||||
|
return mysqli_affected_rows ($dbconnection);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return mysql_affected_rows ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($config["mysqli"]){
|
||||||
|
while ($row = mysqli_fetch_array ($result, MYSQL_ASSOC)) {
|
||||||
|
array_push ($retval, $row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
|
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
|
||||||
array_push ($retval, $row);
|
array_push ($retval, $row);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($config["mysqli"]){
|
||||||
|
mysqli_free_result ($result);
|
||||||
|
}
|
||||||
|
else{
|
||||||
mysql_free_result ($result);
|
mysql_free_result ($result);
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty ($retval))
|
if (! empty ($retval))
|
||||||
return $retval;
|
return $retval;
|
||||||
@ -131,8 +158,10 @@ function dbmgr_extension_main () {
|
|||||||
echo "<hr />";
|
echo "<hr />";
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
|
|
||||||
|
$dbconnection = $config['dbconnection'];
|
||||||
$error = '';
|
$error = '';
|
||||||
$result = dbmanager_query ($sql, $error);
|
|
||||||
|
$result = dbmanager_query ($sql, $error, $dbconnection);
|
||||||
|
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
echo '<strong>An error has occured when querying the database.</strong><br />';
|
echo '<strong>An error has occured when querying the database.</strong><br />';
|
||||||
@ -152,6 +181,7 @@ function dbmgr_extension_main () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "<div style='overflow: auto;'>";
|
echo "<div style='overflow: auto;'>";
|
||||||
|
$table = new stdClass();
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->class = 'databox data';
|
$table->class = 'databox data';
|
||||||
$table->head = array_keys ($result[0]);
|
$table->head = array_keys ($result[0]);
|
||||||
|
@ -365,7 +365,7 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
// Page header for normal console
|
// Page header for normal console
|
||||||
else
|
else
|
||||||
ui_print_page_header (__('Reporting').' » '.__('Custom reporting'), "images/op_reporting.png", false, "", false, $buttons);
|
ui_print_page_header (__('Reporting').' » '.__('Custom reporting'), "images/op_reporting.png", false, "", false, $buttons,false,'',80);
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'delete_report') {
|
if ($action == 'delete_report') {
|
||||||
@ -1908,7 +1908,7 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
// Page header for normal console
|
// Page header for normal console
|
||||||
else
|
else
|
||||||
ui_print_page_header (__('Reporting') . $subsection, "images/op_reporting.png", false, "", false, $buttons);
|
ui_print_page_header (__('Reporting') . $subsection, "images/op_reporting.png", false, "", false, $buttons,false,'',80);
|
||||||
|
|
||||||
|
|
||||||
reporting_enterprise_select_main_tab($action);
|
reporting_enterprise_select_main_tab($action);
|
||||||
@ -1980,7 +1980,7 @@ if ($enterpriseEnable and defined('METACONSOLE')) {
|
|||||||
else {
|
else {
|
||||||
ui_print_page_header(__('Reporting') . $textReportName,
|
ui_print_page_header(__('Reporting') . $textReportName,
|
||||||
"images/op_reporting.png", false,
|
"images/op_reporting.png", false,
|
||||||
"reporting_" . $activeTab . "_tab", false, $buttons);
|
"reporting_" . $activeTab . "_tab", false, $buttons,false,'',80);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($resultOperationDB !== null) {
|
if ($resultOperationDB !== null) {
|
||||||
|
@ -77,7 +77,7 @@ if (!defined('METACONSOLE')) {
|
|||||||
else {
|
else {
|
||||||
echo '<div id="frame_view" style="overflow: auto; margin: 0px auto; padding: 5px; ">';
|
echo '<div id="frame_view" style="overflow: auto; margin: 0px auto; padding: 5px; ">';
|
||||||
}
|
}
|
||||||
echo '<div id="background" class="" style="top:50px;
|
echo '<div id="background" class="" style="top:0px;
|
||||||
margin: 0px auto;border: 1px lightgray solid; width: ' . $widthBackground . 'px; height: ' . $heightBackground . 'px;">';
|
margin: 0px auto;border: 1px lightgray solid; width: ' . $widthBackground . 'px; height: ' . $heightBackground . 'px;">';
|
||||||
echo "<div id='background_grid'
|
echo "<div id='background_grid'
|
||||||
style='position: absolute; display: none; overflow: hidden;
|
style='position: absolute; display: none; overflow: hidden;
|
||||||
|
@ -2391,7 +2391,8 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal
|
|||||||
* @return string Header HTML
|
* @return string Header HTML
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function ui_print_page_header ($title, $icon = "", $return = false, $help = "", $godmode = false, $options = "", $alias = "") {
|
|
||||||
|
function ui_print_page_header ($title, $icon = "", $return = false, $help = "", $godmode = false, $options = "", $modal = false, $message = "", $numChars = GENERIC_SIZE_TEXT, $alias = "") {
|
||||||
$title = io_safe_input_html($title);
|
$title = io_safe_input_html($title);
|
||||||
if (($icon == "") && ($godmode == true)) {
|
if (($icon == "") && ($godmode == true)) {
|
||||||
$icon = "images/gm_setup.png";
|
$icon = "images/gm_setup.png";
|
||||||
@ -2422,10 +2423,9 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "",
|
|||||||
$title = str_replace("Monitoring » Services » Service Map » ",'',$title);
|
$title = str_replace("Monitoring » Services » Service Map » ",'',$title);
|
||||||
}
|
}
|
||||||
|
|
||||||
$buffer .= '<ul class="mn"><li class="' . $type . '"> ' . ' ';
|
|
||||||
if(empty($alias)){
|
if(empty($alias)){
|
||||||
$buffer .= '<span style="">' .
|
$buffer .= '<span style="margin-right:10px;">' .
|
||||||
ui_print_truncate_text($title, 38);
|
ui_print_truncate_text($title, $numChars);
|
||||||
}else{
|
}else{
|
||||||
$buffer .= '<span style="">' .
|
$buffer .= '<span style="">' .
|
||||||
'<span title='.$title.'>'.$alias.'</span>';
|
'<span title='.$title.'>'.$alias.'</span>';
|
||||||
|
@ -1214,7 +1214,7 @@ function set_positions_graph() {
|
|||||||
return d.y - ((node_radius / 0.8) / 2);
|
return d.y - ((node_radius / 0.8) / 2);
|
||||||
});
|
});
|
||||||
|
|
||||||
var position_text = node_radius * 0.6;
|
var position_text = node_radius * 0.8;
|
||||||
|
|
||||||
node.selectAll(".node_text")
|
node.selectAll(".node_text")
|
||||||
.attr("x", function(d) {
|
.attr("x", function(d) {
|
||||||
@ -2893,7 +2893,7 @@ function draw_elements_graph() {
|
|||||||
return "#link_id_" + d.id_db;
|
return "#link_id_" + d.id_db;
|
||||||
})
|
})
|
||||||
.append("tspan")
|
.append("tspan")
|
||||||
.attr("style", "font-size: 8px; " +
|
.attr("style", "font-size: 12px; " +
|
||||||
"font-style:normal; " +
|
"font-style:normal; " +
|
||||||
"font-weight:normal; " +
|
"font-weight:normal; " +
|
||||||
"line-height: 100%; " +
|
"line-height: 100%; " +
|
||||||
@ -2919,7 +2919,7 @@ function draw_elements_graph() {
|
|||||||
return "#link_reverse_id_" + d.id_db;
|
return "#link_reverse_id_" + d.id_db;
|
||||||
})
|
})
|
||||||
.append("tspan")
|
.append("tspan")
|
||||||
.attr("style", "font-size: 8px; " +
|
.attr("style", "font-size: 12px; " +
|
||||||
"font-style:normal; " +
|
"font-style:normal; " +
|
||||||
"font-weight:normal; " +
|
"font-weight:normal; " +
|
||||||
"line-height: 100%; " +
|
"line-height: 100%; " +
|
||||||
@ -3152,7 +3152,7 @@ function draw_elements_graph() {
|
|||||||
node_temp.append("title")
|
node_temp.append("title")
|
||||||
.text(function(d) {return d.text; });
|
.text(function(d) {return d.text; });
|
||||||
|
|
||||||
var font_size = (node_radius / 2.8);
|
var font_size = (node_radius / 1.5);
|
||||||
|
|
||||||
node_temp.append("text")
|
node_temp.append("text")
|
||||||
.attr("class", "node_text")
|
.attr("class", "node_text")
|
||||||
|
@ -127,10 +127,8 @@ else {
|
|||||||
ui_print_page_header (
|
ui_print_page_header (
|
||||||
__('Reporting') .
|
__('Reporting') .
|
||||||
" » " .
|
" » " .
|
||||||
__('Custom reporting') .
|
|
||||||
" - " .
|
|
||||||
reporting_get_name($id_report),
|
reporting_get_name($id_report),
|
||||||
"images/op_reporting.png", false, "", false, $options);
|
"images/op_reporting.png", false, "", false, $options,false,'',80);
|
||||||
}
|
}
|
||||||
//------------------- END HEADER ---------------------------------------
|
//------------------- END HEADER ---------------------------------------
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user