'event_fields', 'value' => $event_fields, ]; // update 'event_fields' in tconfig table to keep the value at update. $result = db_process_sql_update( 'tconfig', $values, ['token' => 'event_fields'] ); $config['event_fields'] = $event_fields; } $fields_selected = []; $event_fields = ''; $fields_selected = explode(',', $config['event_fields']); $result_selected = []; // Show list of fields selected. if ($fields_selected[0] != '') { foreach ($fields_selected as $field_selected) { $result_selected[$field_selected] = events_get_column_name( $field_selected ); } } $event = []; echo '

'.__('Show event fields'); echo ' '; html_print_image('images/clean.png', false, ['title' => __('Load the fields from previous events'), 'onclick' => "if (! confirm ('".__('Event fields will be loaded. Do you want to continue?')."')) return false"]); echo '

'; $table = new stdClass(); $table->width = '100%'; $table->class = 'databox filters'; $table->size = []; // ~ $table->size[0] = '20%'; $table->size[1] = '10px'; // ~ $table->size[2] = '20%'; $table->style[0] = 'text-align:center;'; $table->style[2] = 'text-align:center;'; $table->data = []; $fields_available = []; $fields_available['id_evento'] = __('Event Id'); $fields_available['evento'] = __('Event Name'); $fields_available['id_agente'] = __('Agent ID'); $fields_available['agent_name'] = __('Agent Name'); $fields_available['id_usuario'] = __('User'); $fields_available['id_grupo'] = __('Group'); $fields_available['estado'] = __('Status'); $fields_available['timestamp'] = __('Timestamp'); $fields_available['event_type'] = __('Event Type'); $fields_available['id_agentmodule'] = __('Module Name'); $fields_available['id_alert_am'] = __('Alert'); $fields_available['criticity'] = __('Severity'); $fields_available['user_comment'] = __('Comment'); $fields_available['tags'] = __('Tags'); $fields_available['source'] = __('Source'); $fields_available['id_extra'] = __('Extra Id'); $fields_available['owner_user'] = __('Owner'); $fields_available['ack_utimestamp'] = __('ACK Timestamp'); $fields_available['instructions'] = __('Instructions'); $fields_available['server_name'] = __('Server Name'); $fields_available['data'] = __('Data'); $fields_available['module_status'] = __('Module Status'); // remove fields already selected foreach ($fields_available as $key => $available) { foreach ($result_selected as $selected) { if ($selected == $available) { unset($fields_available[$key]); } } } $table->data[0][0] = ''.__('Fields available').''; $table->data[1][0] = html_print_select($fields_available, 'fields_available[]', true, '', '', 0, true, true, false, '', false, 'width: 300px'); $table->data[1][1] = ''.html_print_image( 'images/darrowright.png', true, [ 'id' => 'right', 'title' => __('Add fields to select'), ] ).''; $table->data[1][1] .= '



'.html_print_image( 'images/darrowleft.png', true, [ 'id' => 'left', 'title' => __('Delete fields to select'), ] ).''; $table->data[0][1] = ''; $table->data[0][2] = ''.__('Fields selected').''; $table->data[1][2] = html_print_select( $result_selected, 'fields_selected[]', true, '', '', 0, true, true, false, '', false, 'width: 300px' ); echo '
'; html_print_table($table); echo '
'; html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"'); echo ''; echo '
'; ?>