Merge branch 'ent-11835-list-of-elements-se-carga-items-visual-console' into 'develop'

Ent 11835 list of elements se carga items visual console

See merge request artica/pandorafms!6317
This commit is contained in:
Rafael Ameijeiras 2023-08-08 12:19:24 +00:00
commit bc5357c4fe
2 changed files with 75 additions and 57 deletions

View File

@ -182,7 +182,7 @@ if ($layoutDatas === false) {
$alternativeStyle = true;
$parents = visual_map_get_items_parents($idVisualConsole);
$x = 0;
foreach ($layoutDatas as $layoutData) {
$idLayoutData = $layoutData['id'];
@ -537,7 +537,8 @@ foreach ($layoutDatas as $layoutData) {
$table->data[($i + 1)][5] = '';
$table->data[($i + 1)][5] .= html_print_checkbox('multiple_delete_items', $idLayoutData, false, true);
$table->data[($i + 1)][5] .= '<a href="'.$url_delete.'" '.'onclick="javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
$table->data[($i + 1)][5] .= '<a href="'.$url_delete.'"onclick="javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
$table->data[($i + 1)][5] .= html_print_input_hidden('updated_'.$idLayoutData, '0', true);
// Second row
$table->data[($i + 2)]['icon'] = '';
@ -778,6 +779,12 @@ foreach ($layoutDatas as $layoutData) {
$alternativeStyle = !$alternativeStyle;
$i = ($i + 3);
$x++;
}
$x = (($x * 13) + 14);
if ($x > ini_get('max_input_vars')) {
ui_print_warning_message(__('You have to change the <b>"max_input_vars"</b> and set bigger value on <b>php.ini</b> for update, there is too much elements to update'));
}
$pure = get_parameter('pure', 0);
@ -888,6 +895,16 @@ ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
return false;
});
$('select[id^="image_"], input[name^="width_"], input[name^="height"], input[name^="left_"], input[name^="top_"], select[id^="parent_"], input[id^="agent_"], select[id^="module_"]').change(function(){
var id = $(this).attr('id').split('_')[1];
$('#hidden-updated_'+id).val('1');
});
$('select[id^="map_linked"]').change(function(){
var id = $(this).attr('id').split('_')[2];
$('#hidden-updated_'+id).val('1');
});
defineTinyMCE('#tinyMCE_editor');
$("#dialog_label_editor").hide ()

View File

@ -418,7 +418,6 @@ switch ($activeTab) {
case 'update':
// Update background
$background = get_parameter('background');
$background_color = get_parameter('background_color');
$width = get_parameter('width');
$height = get_parameter('height');
@ -434,7 +433,6 @@ switch ($activeTab) {
'tlayout',
[
'background' => $background,
'background_color' => $background_color,
'width' => $width,
'height' => $height,
],
@ -463,6 +461,8 @@ switch ($activeTab) {
foreach ($idsElements as $idElement) {
$id = $idElement['id'];
$update = get_parameter('updated_'.$id, 0);
if ($update === '1') {
$values = [];
$values['label'] = get_parameter('label_'.$id, '');
$values['image'] = get_parameter('image_'.$id, '');
@ -520,6 +520,7 @@ switch ($activeTab) {
db_process_sql_update('tlayout_data', $values, ['id' => $id]);
}
}
break;
case 'delete':