diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index 2abb2b5acad..6905156990b 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -182,30 +182,15 @@ else if ($action == 'setmod')
dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity);
}
-else if ($action == 'set_CONTRACT_FREE_TEXT')
+else if ($action == 'set_other')
{
$freetext= GETPOST('CONTRACT_FREE_TEXT','alpha');
- $res = dolibarr_set_const($db, "CONTRACT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
+ $res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
- if (! $res > 0) $error++;
-
- if (! $error)
- {
- setEventMessage($langs->trans("SetupSaved"));
- }
- else
- {
- setEventMessage($langs->trans("Error"),'errors');
- }
-}
-
-else if ($action == 'set_CONTRACT_DRAFT_WATERMARK')
-{
$draft= GETPOST('CONTRACT_DRAFT_WATERMARK','alpha');
+ $res2 = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
- $res = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
-
- if (! $res > 0) $error++;
+ if (! $res1 > 0 || ! $res2 > 0) $error++;
if (! $error)
{
@@ -217,6 +202,7 @@ else if ($action == 'set_CONTRACT_DRAFT_WATERMARK')
}
}
+
/*
* View
*/
@@ -506,44 +492,43 @@ print "
";
*
*/
+print '