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

View File

@ -12601,7 +12601,7 @@ div.agents_custom_fields #datatables_wrapper div.bottom {
.dt-buttons { .dt-buttons {
width: auto; width: auto;
position: fixed; position: absolute;
margin-left: 55px; margin-left: 55px;
} }
@ -12618,3 +12618,15 @@ div.agents_custom_fields #datatables_wrapper div.bottom {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
font-weight: bold; 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 // Includes
// ===================================================================== // =====================================================================
enterprise_include_once('include/functions_metaconsole.php'); require_once 'include/functions_custom_fields.php';
require_once $config['homedir'].'/include/functions_custom_fields.php';
// ===================================================================== // =====================================================================
// parameters // parameters
@ -829,6 +828,7 @@ $(document).ready (function () {
* Create dialog * Create dialog
*/ */
function dialog_filter_cf(title, type_form){ function dialog_filter_cf(title, type_form){
if (type_form == 'load') {
$("#filter_cf").dialog ({ $("#filter_cf").dialog ({
title: title, title: title,
resizable: true, resizable: true,
@ -839,9 +839,24 @@ function dialog_filter_cf(title, type_form){
background: "black" background: "black"
}, },
width: 688, width: 688,
height: 280 height: 200
}) })
.show (); .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(); $("#filter_cf").empty();
@ -1146,7 +1161,7 @@ function append_tab_filter(filters){
}); });
//action update //action update
$('#submit-update_filter').on('click', function(){ $('#button-update_filter').on('click', function(){
id = $('#id_name').val(); id = $('#id_name').val();
group_search = $('#group_search_up').val(); group_search = $('#group_search_up').val();
$.ajax({ $.ajax({
@ -1170,7 +1185,7 @@ function append_tab_filter(filters){
}); });
//delete update //delete update
$('#submit-delete_filter').on('click', function(){ $('#button-delete_filter').on('click', function(){
//dialog confirm //dialog confirm
display_confirm_dialog( display_confirm_dialog(