Merge branch 'ent-7363-Bug-al-copiar-consola-visual' into 'develop'

Ent 7363 bug al copiar consola visual

See merge request artica/pandorafms!4053
This commit is contained in:
vgilc 2021-04-22 07:07:22 +00:00
commit 2b973162b9
3 changed files with 31 additions and 11 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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(