Ent 7363 bug al copiar consola visual
This commit is contained in:
parent
c99e810b54
commit
a2a3e67d49
|
@ -194,22 +194,22 @@ if ($delete_layout || $copy_layout) {
|
|||
}
|
||||
|
||||
if ($copy_layout) {
|
||||
// Number of inserts
|
||||
// Number of inserts.
|
||||
$ninsert = (int) 0;
|
||||
|
||||
// Return from DB the source layout
|
||||
// Return from DB the source layout.
|
||||
$layout_src = db_get_all_rows_filter(
|
||||
'tlayout',
|
||||
['id' => $id_layout]
|
||||
);
|
||||
|
||||
// Name of dst
|
||||
// Name of dst.
|
||||
$name_dst = get_parameter(
|
||||
'name_dst',
|
||||
$layout_src[0]['name'].' copy'
|
||||
);
|
||||
|
||||
// Create the new Console
|
||||
// Create the new Console.
|
||||
$idGroup = $layout_src[0]['id_group'];
|
||||
$background = $layout_src[0]['background'];
|
||||
$height = $layout_src[0]['height'];
|
||||
|
@ -217,12 +217,15 @@ if ($delete_layout || $copy_layout) {
|
|||
$visualConsoleName = $name_dst;
|
||||
|
||||
$values = [
|
||||
'name' => $visualConsoleName,
|
||||
'id_group' => $idGroup,
|
||||
'background' => $background,
|
||||
'height' => $height,
|
||||
'width' => $width,
|
||||
'name' => $visualConsoleName,
|
||||
'id_group' => $idGroup,
|
||||
'background' => $background,
|
||||
'height' => $height,
|
||||
'width' => $width,
|
||||
'background_color' => $layout_src[0]['background_color'],
|
||||
'is_favourite' => $layout_src[0]['is_favourite'],
|
||||
];
|
||||
|
||||
$result = db_process_sql_insert('tlayout', $values);
|
||||
|
||||
$idNewVisualConsole = $result;
|
||||
|
|
|
@ -152,7 +152,6 @@ function menu_print_menu(&$menu)
|
|||
$first_sub_sec2 = '';
|
||||
|
||||
foreach ($main['sub'] as $subsec2 => $sub) {
|
||||
// hd($sub, true);
|
||||
$count_sub++;
|
||||
|
||||
// Init some variables.
|
||||
|
|
|
@ -352,7 +352,25 @@ final class BarsGraph extends Item
|
|||
false,
|
||||
false
|
||||
);
|
||||
$graph = base64_encode(file_get_contents($image));
|
||||
$rc = file_get_contents($image);
|
||||
if ($rc !== false) {
|
||||
$graph = base64_encode($rc);
|
||||
} else {
|
||||
$graph = graph_nodata_image(
|
||||
// Width.
|
||||
$width,
|
||||
// Height.
|
||||
$height,
|
||||
// Type.
|
||||
'hbar',
|
||||
// Text.
|
||||
'',
|
||||
// Percent.
|
||||
false,
|
||||
// Base64.
|
||||
true
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if ($typeGraph === 'horizontal') {
|
||||
$graph = \hbar_graph(
|
||||
|
|
Loading…
Reference in New Issue