#11206 Fix custom field view

This commit is contained in:
miguel angel rasteu 2023-08-22 11:16:17 +02:00
parent 817c3223be
commit 0194fbaa59
3 changed files with 77 additions and 27 deletions

View File

@ -374,6 +374,11 @@ if (check_login()) {
$agent = $agent_alias;
}
if (is_metaconsole() === false) {
$values['id_tagente'] = $values['id_agente'];
$values['id_tmetaconsole_setup'] = 1;
}
$data[] = [
'ref' => $referencia,
'data_custom_field' => ui_bbcode_to_html($values['name_custom_fields']),
@ -479,7 +484,7 @@ if (check_login()) {
$table_modules = new stdClass();
$table_modules->width = '100%';
$table_modules->class = 'databox data';
$table_modules->class = 'databox data custom_field_data';
$table_modules->head = [];
$table_modules->head[0] = __('Module name');
@ -663,7 +668,11 @@ if (check_login()) {
__('Load filter'),
'load_filter',
false,
'class="sub upd"',
[
'icon' => 'search',
'class' => 'sub upd',
'onclick' => 'load_filter()',
],
true
);
@ -687,6 +696,9 @@ if (check_login()) {
$table->width = '100%';
$table->class = 'databox';
$table->rowspan = [];
$table->style = [];
$table->cellstyle[0][0] = 'display: grid';
$table->cellstyle[0][1] = 'display: grid';
if ($filters['id'] == 'extended_create_filter') {
echo "<div id='msg_error_create'></div>";
@ -697,7 +709,7 @@ if (check_login()) {
'',
15,
255,
true
true,
);
$table->data[1][0] = __('Group');
@ -728,7 +740,11 @@ if (check_login()) {
__('Create filter'),
'create_filter',
false,
'class="sub upd"',
[
'icon' => 'search',
'class' => 'sub upd',
'onclick' => 'create_filter()',
],
true
);
} else {
@ -776,21 +792,28 @@ if (check_login()) {
__('Delete filter'),
'delete_filter',
false,
'class="sub upd"',
[
'icon' => 'delete',
'class' => 'sub upd',
'onclick' => 'delete_filter()',
],
true
);
$table->data[1][2] = html_print_submit_button(
__('Update filter'),
'update_filter',
false,
'class="sub upd"',
[
'icon' => 'update',
'class' => 'sub upd',
'onclick' => 'update_filter()',
],
true
);
}
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&amp;pure='.$config['pure'].'">';
html_print_table($table);
echo '</form>';
return;
}

View File

@ -12601,7 +12601,7 @@ div.agents_custom_fields #datatables_wrapper div.bottom {
.dt-buttons {
width: auto;
position: fixed;
position: absolute;
margin-left: 55px;
}
@ -12618,3 +12618,15 @@ div.agents_custom_fields #datatables_wrapper div.bottom {
-webkit-font-smoothing: antialiased;
font-weight: bold;
}
td.details-control {
background: url("../../images/darrowdown.png") no-repeat center center;
cursor: pointer;
}
tr.shown td.details-control {
background: url("../../images/darrowup.png") no-repeat center center;
}
.custom_field_data > tbody > tr > td:not(:first-child) {
text-align: center;
}

View File

@ -58,8 +58,7 @@ ui_print_standard_header(
// =====================================================================
// Includes
// =====================================================================
enterprise_include_once('include/functions_metaconsole.php');
require_once $config['homedir'].'/include/functions_custom_fields.php';
require_once 'include/functions_custom_fields.php';
// =====================================================================
// parameters
@ -829,19 +828,35 @@ $(document).ready (function () {
* Create dialog
*/
function dialog_filter_cf(title, type_form){
$("#filter_cf").dialog ({
title: title,
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 688,
height: 280
})
.show ();
if (type_form == 'load') {
$("#filter_cf").dialog ({
title: title,
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 688,
height: 200
})
.show ();
} else {
$("#filter_cf").dialog ({
title: title,
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 688,
height: 350
})
.show ();
}
$("#filter_cf").empty();
@ -1067,7 +1082,7 @@ function table_datatables(filters, indexed_descriptions, processing){
function build_table_child (d, filters, processing) {
array_data = JSON.parse(filters);
var filters_modules = $('#form-module-counters').serializeArray();
var status_modules = filters_modules.map(
name => name.name.replace(/lists_modules\[/g,'').replace(/\]/g,'')
@ -1146,7 +1161,7 @@ function append_tab_filter(filters){
});
//action update
$('#submit-update_filter').on('click', function(){
$('#button-update_filter').on('click', function(){
id = $('#id_name').val();
group_search = $('#group_search_up').val();
$.ajax({
@ -1170,7 +1185,7 @@ function append_tab_filter(filters){
});
//delete update
$('#submit-delete_filter').on('click', function(){
$('#button-delete_filter').on('click', function(){
//dialog confirm
display_confirm_dialog(