2010-09-20 Raul Mateos <raulofpandora@gmail.com>

* operation/agentes/customfields.php: Add code to show text when no
	fields defined.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3263 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
raulmateos 2010-09-20 17:35:59 +00:00
parent 72d209dee9
commit 2a6538106a
2 changed files with 36 additions and 27 deletions

View File

@ -1,3 +1,8 @@
2010-09-20 Raúl Mateos <raulofpandora@gmail.com>
* operation/agentes/customfields.php: Add code to show text when no
fields defined.
2010-09-20 Sancho Lerena <slerena@artica.es>
* include/config.inc.php: config_process.php is obtained from defined

View File

@ -2,7 +2,7 @@
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
@ -40,40 +40,44 @@ if (! give_acl ($config["id_user"], $agent["id_grupo"], "AR")) {
return;
}
$table->width = '65%';
$table->head = array ();
$table->head[0] = __('Field');
$table->head[1] = __('Display on front').print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true);
$table->head[2] = __('Description');
$table->align = array ();
$table->align[1] = 'center';
$table->align[2] = 'center';
$table->data = array ();
$fields = get_db_all_fields_in_table('tagent_custom_fields');
if($fields === false) $fields = array();
if($fields === false) {
$fields = array();
echo "<div class='nf'>". __("No fields defined"). "</div>";
} else {
$table->width = '65%';
$table->head = array ();
$table->head[0] = __('Field');
$table->head[1] = __('Display on front').print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true);
$table->head[2] = __('Description');
$table->align = array ();
$table->align[1] = 'center';
$table->align[2] = 'center';
$table->data = array ();
foreach ($fields as $field) {
foreach ($fields as $field) {
$data[0] = '<b>'.$field['name'].'</b>';
$data[0] = '<b>'.$field['name'].'</b>';
if($field['display_on_front']) {
$data[1] = print_image('images/tick.png', true);
}else {
$data[1] = print_image('images/delete.png', true);
}
if($field['display_on_front']) {
$data[1] = print_image('images/tick.png', true);
}else {
$data[1] = print_image('images/delete.png', true);
}
$custom_value = get_db_value_filter('description', 'tagent_custom_data', array('id_field' => $field['id_field'], 'id_agent' => $id_agente));
$custom_value = get_db_value_filter('description', 'tagent_custom_data', array('id_field' => $field['id_field'], 'id_agent' => $id_agente));
if($custom_value === false || $custom_value == '') {
$custom_value = '<i>-'.__('empty').'-</i>';
if($custom_value === false || $custom_value == '') {
$custom_value = '<i>-'.__('empty').'-</i>';
}
$data[2] = $custom_value;
array_push ($table->data, $data);
}
$data[2] = $custom_value;
array_push ($table->data, $data);
}
print_table ($table);
print_table ($table);
}
?>