Merge branch 'develop' into feature/alias_freandly_name

Conflicts:
	pandora_console/include/functions_ui.php
This commit is contained in:
Daniel Maya 2017-02-17 10:11:59 +01:00
commit 3051ce4e23
6 changed files with 56 additions and 28 deletions

@ -14,7 +14,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
function dbmanager_query ($sql, &$error) {
function dbmanager_query ($sql, &$error, $dbconnection) {
global $config;
switch ($config["dbtype"]) {
@ -25,22 +25,49 @@ function dbmanager_query ($sql, &$error) {
return false;
$sql = html_entity_decode($sql, ENT_QUOTES);
$result = mysql_query ($sql);
if ($result === false) {
$backtrace = debug_backtrace ();
$error = mysql_error ();
return false;
if ($config["mysqli"]) {
$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) {
$backtrace = debug_backtrace ();
$error = mysql_error ();
return false;
}
}
if ($result === true) {
return mysql_affected_rows ();
if($config["mysqli"]){
return mysqli_affected_rows ($dbconnection);
}
else{
return mysql_affected_rows ();
}
}
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
array_push ($retval, $row);
if($config["mysqli"]){
while ($row = mysqli_fetch_array ($result, MYSQL_ASSOC)) {
array_push ($retval, $row);
}
}
else{
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
array_push ($retval, $row);
}
}
if($config["mysqli"]){
mysqli_free_result ($result);
}
else{
mysql_free_result ($result);
}
mysql_free_result ($result);
if (! empty ($retval))
return $retval;
@ -131,8 +158,10 @@ function dbmgr_extension_main () {
echo "<hr />";
echo "<br />";
$dbconnection = $config['dbconnection'];
$error = '';
$result = dbmanager_query ($sql, $error);
$result = dbmanager_query ($sql, $error, $dbconnection);
if ($result === false) {
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;'>";
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox data';
$table->head = array_keys ($result[0]);

@ -365,7 +365,7 @@ switch ($action) {
}
// Page header for normal console
else
ui_print_page_header (__('Reporting').' &raquo; '.__('Custom reporting'), "images/op_reporting.png", false, "", false, $buttons);
ui_print_page_header (__('Reporting').' &raquo; '.__('Custom reporting'), "images/op_reporting.png", false, "", false, $buttons,false,'',80);
if ($action == 'delete_report') {
@ -1908,7 +1908,7 @@ switch ($action) {
}
// Page header for normal console
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);
@ -1980,7 +1980,7 @@ if ($enterpriseEnable and defined('METACONSOLE')) {
else {
ui_print_page_header(__('Reporting') . $textReportName,
"images/op_reporting.png", false,
"reporting_" . $activeTab . "_tab", false, $buttons);
"reporting_" . $activeTab . "_tab", false, $buttons,false,'',80);
}
if ($resultOperationDB !== null) {

@ -77,7 +77,7 @@ if (!defined('METACONSOLE')) {
else {
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;">';
echo "<div id='background_grid'
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
*/
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);
if (($icon == "") && ($godmode == true)) {
$icon = "images/gm_setup.png";
@ -2421,11 +2422,10 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "",
if(strpos($title, "Monitoring » Services »") != -1){
$title = str_replace("Monitoring » Services » Service Map » ",'',$title);
}
$buffer .= '<ul class="mn"><li class="' . $type . '">&nbsp;' . '&nbsp; ';
if(empty($alias)){
$buffer .= '<span style="">' .
ui_print_truncate_text($title, 38);
$buffer .= '<span style="margin-right:10px;">' .
ui_print_truncate_text($title, $numChars);
}else{
$buffer .= '<span style="">' .
'<span title='.$title.'>'.$alias.'</span>';

@ -1214,7 +1214,7 @@ function set_positions_graph() {
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")
.attr("x", function(d) {
@ -2893,7 +2893,7 @@ function draw_elements_graph() {
return "#link_id_" + d.id_db;
})
.append("tspan")
.attr("style", "font-size: 8px; " +
.attr("style", "font-size: 12px; " +
"font-style:normal; " +
"font-weight:normal; " +
"line-height: 100%; " +
@ -2919,7 +2919,7 @@ function draw_elements_graph() {
return "#link_reverse_id_" + d.id_db;
})
.append("tspan")
.attr("style", "font-size: 8px; " +
.attr("style", "font-size: 12px; " +
"font-style:normal; " +
"font-weight:normal; " +
"line-height: 100%; " +
@ -3152,7 +3152,7 @@ function draw_elements_graph() {
node_temp.append("title")
.text(function(d) {return d.text; });
var font_size = (node_radius / 2.8);
var font_size = (node_radius / 1.5);
node_temp.append("text")
.attr("class", "node_text")

@ -127,10 +127,8 @@ else {
ui_print_page_header (
__('Reporting') .
" &raquo; " .
__('Custom reporting') .
" - " .
reporting_get_name($id_report),
"images/op_reporting.png", false, "", false, $options);
"images/op_reporting.png", false, "", false, $options,false,'',80);
}
//------------------- END HEADER ---------------------------------------