'event_fields',
'value' => $event_fields
);
//update 'event_fields' in tconfig table to keep the value at update.
$result = db_process_sql_update('tconfig', $values, array ('token' => 'event_fields'));
}
$result_selected = array();
//show list of fields selected.
if ($fields_selected[0]!='') {
foreach ($fields_selected as $field_selected) {
switch ($field_selected) {
case 'id_evento':
$result = __('Event id');
break;
case 'evento':
$result = __('Event name');
break;
case 'id_agente':
$result = __('Agent name');
break;
case 'id_usuario':
$result = __('User');
break;
case 'id_grupo':
$result = __('Group');
break;
case 'estado':
$result = __('Status');
break;
case 'timestamp':
$result = __('Timestamp');
break;
case 'event_type':
$result = __('Event type');
break;
case 'id_agentmodule':
$result = __('Agent module');
break;
case 'id_alert_am':
$result = __('Alert');
break;
case 'criticity':
$result = __('Criticity');
break;
case 'user_comment':
$result = __('Comment');
break;
case 'tags':
$result = __('Tags');
break;
case 'source':
$result = __('Source');
break;
case 'id_extra':
$result = __('Extra id');
break;
case 'owner_user':
$result = __('Owner');
break;
case 'ack_utimestamp':
$result = __('ACK Timestamp');
break;
case 'server_name':
$result = __('Server name');
break;
}
$result_selected[$field_selected] = $result;
}
}
$event = array();
echo '
';
$table->width = '90%';
$table->size = array();
//~ $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 = array();
$fields_available = array();
$fields_available['id_evento'] = __('Event id');
$fields_available['evento'] = __('Event name');
$fields_available['id_agente'] = __('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'] = __('Agent module');
$fields_available['id_alert_am'] = __('Alert');
$fields_available['criticity'] = __('Criticity');
$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['server_name'] = __('Server name');
//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, '', '', '', true, true, false, '', false, 'width: 200px');
$table->data[1][1] = ''.html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add fields to select'))).'';
$table->data[1][1] .= '
'. html_print_image('images/darrowleft.png', true, array('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, '', '', '', true, true, false, '', false, 'width: 200px');
echo '