diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 0dd8265012782..5b81bccd6ada1 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -195,6 +195,9 @@ //$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'
'; } + + $db->begin(); + if (! $error) { $object->oldcopy = dol_clone($object); @@ -242,11 +245,15 @@ if ($error) { + $db->rollback(); $action='edit'; } else { - $object->societe->fetch(GETPOST('socid','int')); + $db->commit(); + + if (GETPOST('socid','int') > 0) $object->societe->fetch(GETPOST('socid','int')); + else unset($object->societe); } } @@ -529,7 +536,7 @@ print ''; // Customer - print ''.$langs->trans("Company").''; + print ''.$langs->trans("Thirdparty").''; $text=$form->select_company($object->societe->id,'socid','',1,1); $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(),$texthelp,1); @@ -600,7 +607,7 @@ print ''.$langs->trans("Label").''.$object->title.''; // Third party - print ''.$langs->trans("Company").''; + print ''.$langs->trans("Thirdparty").''; if ($object->societe->id > 0) print $object->societe->getNomUrl(1); else print' '; print '';