diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index 523930a58b9..23c34f57fcf 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -125,38 +125,27 @@ if ($action == 'updateMask') {
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
-} elseif ($action == 'set_PROPALE_DRAFT_WATERMARK') {
- $draft = GETPOST('PROPALE_DRAFT_WATERMARK', 'alpha');
-
- $res = dolibarr_set_const($db, "PROPALE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
- if (!($res > 0)) {
- $error++;
+} elseif ($action == 'update') {
+ if (GETPOSTISSET('PROPALE_VALIDITY_DURATION')) {
+ $value = GETPOST('PROPALE_VALIDITY_DURATION');
+ $res = dolibarr_set_const($db, "PROPALE_VALIDITY_DURATION", $value, 'chaine', 0, '', $conf->entity);
+ if (!($res > 0)) {
+ $error++;
+ }
}
-
- if (!$error) {
- setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- } else {
- setEventMessages($langs->trans("Error"), null, 'errors');
+ if (GETPOSTISSET('PROPALE_DRAFT_WATERMARK')) {
+ $draft = GETPOST('PROPALE_DRAFT_WATERMARK', 'alpha');
+ $res = dolibarr_set_const($db, "PROPALE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
+ if (!($res > 0)) {
+ $error++;
+ }
}
-} elseif ($action == 'set_PROPOSAL_FREE_TEXT') {
- $freetext = GETPOST('PROPOSAL_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
-
- $res = dolibarr_set_const($db, "PROPOSAL_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
-
- if (!($res > 0)) {
- $error++;
- }
-
- if (!$error) {
- setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- } else {
- setEventMessages($langs->trans("Error"), null, 'errors');
- }
-} elseif ($action == 'setdefaultduration') {
- $res = dolibarr_set_const($db, "PROPALE_VALIDITY_DURATION", $value, 'chaine', 0, '', $conf->entity);
-
- if (!($res > 0)) {
- $error++;
+ if (GETPOSTISSET('PROPOSAL_FREE_TEXT')) {
+ $freetext = GETPOST('PROPOSAL_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
+ $res = dolibarr_set_const($db, "PROPOSAL_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
+ if (!($res > 0)) {
+ $error++;
+ }
}
if (!$error) {
@@ -609,73 +598,22 @@ print '
';
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
-print "