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:
commit
2b973162b9
|
@ -194,22 +194,22 @@ if ($delete_layout || $copy_layout) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($copy_layout) {
|
if ($copy_layout) {
|
||||||
// Number of inserts
|
// Number of inserts.
|
||||||
$ninsert = (int) 0;
|
$ninsert = (int) 0;
|
||||||
|
|
||||||
// Return from DB the source layout
|
// Return from DB the source layout.
|
||||||
$layout_src = db_get_all_rows_filter(
|
$layout_src = db_get_all_rows_filter(
|
||||||
'tlayout',
|
'tlayout',
|
||||||
['id' => $id_layout]
|
['id' => $id_layout]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Name of dst
|
// Name of dst.
|
||||||
$name_dst = get_parameter(
|
$name_dst = get_parameter(
|
||||||
'name_dst',
|
'name_dst',
|
||||||
$layout_src[0]['name'].' copy'
|
$layout_src[0]['name'].' copy'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create the new Console
|
// Create the new Console.
|
||||||
$idGroup = $layout_src[0]['id_group'];
|
$idGroup = $layout_src[0]['id_group'];
|
||||||
$background = $layout_src[0]['background'];
|
$background = $layout_src[0]['background'];
|
||||||
$height = $layout_src[0]['height'];
|
$height = $layout_src[0]['height'];
|
||||||
|
@ -217,12 +217,15 @@ if ($delete_layout || $copy_layout) {
|
||||||
$visualConsoleName = $name_dst;
|
$visualConsoleName = $name_dst;
|
||||||
|
|
||||||
$values = [
|
$values = [
|
||||||
'name' => $visualConsoleName,
|
'name' => $visualConsoleName,
|
||||||
'id_group' => $idGroup,
|
'id_group' => $idGroup,
|
||||||
'background' => $background,
|
'background' => $background,
|
||||||
'height' => $height,
|
'height' => $height,
|
||||||
'width' => $width,
|
'width' => $width,
|
||||||
|
'background_color' => $layout_src[0]['background_color'],
|
||||||
|
'is_favourite' => $layout_src[0]['is_favourite'],
|
||||||
];
|
];
|
||||||
|
|
||||||
$result = db_process_sql_insert('tlayout', $values);
|
$result = db_process_sql_insert('tlayout', $values);
|
||||||
|
|
||||||
$idNewVisualConsole = $result;
|
$idNewVisualConsole = $result;
|
||||||
|
|
|
@ -152,7 +152,6 @@ function menu_print_menu(&$menu)
|
||||||
$first_sub_sec2 = '';
|
$first_sub_sec2 = '';
|
||||||
|
|
||||||
foreach ($main['sub'] as $subsec2 => $sub) {
|
foreach ($main['sub'] as $subsec2 => $sub) {
|
||||||
// hd($sub, true);
|
|
||||||
$count_sub++;
|
$count_sub++;
|
||||||
|
|
||||||
// Init some variables.
|
// Init some variables.
|
||||||
|
|
|
@ -352,7 +352,25 @@ final class BarsGraph extends Item
|
||||||
false,
|
false,
|
||||||
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 {
|
} else {
|
||||||
if ($typeGraph === 'horizontal') {
|
if ($typeGraph === 'horizontal') {
|
||||||
$graph = \hbar_graph(
|
$graph = \hbar_graph(
|
||||||
|
|
Loading…
Reference in New Issue