diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3fb7b1ea2d..72681bc7e7 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2014-02-20 Miguel de Dios + + * godmode/agentes/fields_manager.php: added the id column in the + list of fields because it is needed in some api calls. + 2014-02-19 Miguel de Dios * godmode/agentes/module_manager_editor_common.php: added lost id diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index 1bb44664de..081629cc4e 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -55,7 +55,7 @@ if ($create_field) { /* Update field */ if ($update_field) { /*Check if name field is empty*/ - if( $name != "") { + if ( $name != "") { $values = array('name' => $name, 'display_on_front' => $display_on_front); $result = db_process_sql_update('tagent_custom_fields', $values, array('id_field' => $id_field)); @@ -87,12 +87,14 @@ $fields = db_get_all_fields_in_table('tagent_custom_fields'); $table->width = '98%'; if ($fields) { $table->head = array (); - $table->head[0] = __('Field'); - $table->head[1] = __('Display on front').ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true); - $table->head[2] = __('Actions'); + $table->head[0] = __('ID'); + $table->head[1] = __('Field'); + $table->head[2] = __('Display on front').ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true); + $table->head[3] = __('Actions'); $table->align = array (); - $table->align[1] = 'center'; + $table->align[0] = 'right'; $table->align[2] = 'center'; + $table->align[3] = 'center'; $table->data = array (); } else { @@ -101,25 +103,29 @@ else { if ($fields === false) $fields = array(); + foreach ($fields as $field) { - $data[0] = ''.$field['name'].''; + $data[0] = $field['id_field']; - if($field['display_on_front']) { - $data[1] = html_print_image('images/tick.png', true); + $data[1] = ''.$field['name'].''; + + if ($field['display_on_front']) { + $data[2] = html_print_image('images/tick.png', true); } else { - $data[1] = html_print_image('images/delete.png', true); + $data[2] = html_print_image('images/delete.png', true); } - $data[2] = '' . html_print_image("images/config.png", true, array("alt" => __('Edit'), "title" => __('Edit'), "border" => '0')) . ''; - $data[2] .= '  ' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "title" => __('Delete'), "border" => '0')) . ''; + $data[3] = '' . html_print_image("images/config.png", true, array("alt" => __('Edit'), "title" => __('Edit'), "border" => '0')) . ''; + $data[3] .= '  ' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "title" => __('Delete'), "border" => '0')) . ''; array_push ($table->data, $data); } -if($fields) +if ($fields) { html_print_table ($table); +} echo '
'; echo '
';