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 ""; +print ''; +print ''; +print ''; +print ''; + +print '
'; print ""; print "\n"; print '\n"; -print "\n"; print ""; - -print ""; -print ''; -print ""; print ''; print ''; -print '"; -print ''; +print '"; print ''; -print ''; - -// Allow external download -print ''; -print ''; -print ''; - -// Allow OnLine Sign -print ''; -print ''; -print ''; - -// default update prices on cloning a proposal -/* -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -*/ - -/* -print ''; -print ''; -print ''; -print '\n"; -print ''; -*/ $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2); $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation"); @@ -685,9 +623,6 @@ foreach ($substitutionarray as $key => $val) { } $htmltext .= ''; -print ''; -print ''; -print ''; print '\n"; -print ''; +print ''; +print "\n"; -print ""; -print ''; -print ""; print '\n"; -print ''; +print ''; +print "\n"; + + +// Allow external download +print ''; +print ''; +print ''; + +// Allow OnLine Sign +print ''; +print ''; +print ''; + /* Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. if (isModEnabled('facture')) @@ -749,6 +693,9 @@ else print '
".$langs->trans("Parameter")."'.$langs->trans("Value")." 
'.$langs->trans("DefaultProposalDurationValidity").''."'; +print "
'.$langs->trans("AllowExternalDownload").''; -print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); -print '
'.$langs->trans("AllowOnLineSign").''; -print ajax_constantonoff('PROPOSAL_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1); -print '
' . $langs->trans('DefaultPuttingPricesUpToDate').''; -if (!empty($conf->use_javascript_ajax)) { - print ajax_constantonoff('PROPOSAL_CLONE_UPDATE_PRICES', array(), $conf->entity, 0, 0, 1, 0); -} else { - if (empty($conf->global->PROPOSAL_CLONE_UPDATE_PRICES)) { - print '' . img_picto($langs->trans('Disabled'), 'switch_off') . ''; - } else { - print '' . img_picto($langs->trans('Enabled'), 'switch_on') . ''; - } -} -print '
'; -print $langs->trans("UseCustomerContactAsPropalRecipientIfExist"); -print ''; -print $form->selectyesno("value",$conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1); -print ''; -print ''; -print "
'; print $form->textwithpicto($langs->trans("FreeLegalTextOnProposal"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; $variablename = 'PROPOSAL_FREE_TEXT'; @@ -698,23 +633,32 @@ if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes'); print $doleditor->Create(); } -print '
'; -print ''; -print "
'; print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print '
'; print ''; -print ''; -print ''; -print "
'.$langs->trans("AllowExternalDownload").''; +print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); +print '
'.$langs->trans("AllowOnLineSign").''; +print ajax_constantonoff('PROPOSAL_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1); +print '
'; +print '
'; + +print ''; /*