2011-08-29 Vanessa Gil <vanessa.gil@artica.es>

*godmode/agentes/fields_manager.php: Fixed: is possible to create custom fields with the same name.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4837 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2011-08-29 12:30:16 +00:00
parent c777a00149
commit 2e95c5a042
2 changed files with 10 additions and 11 deletions

View File

@ -1,3 +1,7 @@
2011-08-29 Vanessa Gil <vanessa.gil@artica.es>
*godmode/agentes/fields_manager.php: Fixed: is possible to create custom fields with the same name.
2011-08-29 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/map_builder.php: wrote the source code for copy the

View File

@ -40,18 +40,13 @@ $display_on_front = (int) get_parameter ('display_on_front', 0);
/* Create field */
if ($create_field) {
/*Check if name field is empty*/
if ($name != "") {
if ($name == ""){
echo "<h3 class='error'>".__('The name must not be empty')."</h3>";
} else if ($name == db_get_value ('name', 'tagent_custom_fields', 'name', $name)) {
echo "<h3 class='error'>".__('The name must be unique')."</h3>";
} else {
$result = db_process_sql_insert('tagent_custom_fields', array('name' => $name, 'display_on_front' => $display_on_front));
}
else {
$result = false;
}
if ($result) {
echo "<h3 class='suc'>".__('Field successfully created')."</h3>";
}
else {
echo "<h3 class='error'>".__('There was a problem creating field')."</h3>";
echo "<h3 class='suc'>".__('Field successfully created')."</h3>";
}
}