From 7057b771bbd200bc8d0532b6bfebb9c81ec88aca Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Fri, 24 Mar 2017 10:59:32 +0100 Subject: [PATCH] NEW allow to modify validated doc --- admin/quickcustomerprice_setup.php | 6 +++--- class/actions_quickcustomerprice.class.php | 6 +++--- core/modules/modquickcustomerprice.class.php | 2 +- langs/fr_FR/quickcustomerprice.lang | 4 +++- script/interface.php | 4 ++++ 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/admin/quickcustomerprice_setup.php b/admin/quickcustomerprice_setup.php index f48fe5f..9059269 100644 --- a/admin/quickcustomerprice_setup.php +++ b/admin/quickcustomerprice_setup.php @@ -108,13 +108,13 @@ // Example with a yes / no select $var=!$var; print ''; -print ''.$langs->trans("ParamLabel").''; +print ''.$langs->trans("QCP_ALLOW_CHANGE_ON_VALIDATE").''; print ' '; print ''; print '
'; print ''; -print ''; -print $form->selectyesno("CONSTNAME",$conf->global->CONSTNAME,1); +print ''; +print $form->selectyesno("QCP_ALLOW_CHANGE_ON_VALIDATE",$conf->global->QCP_ALLOW_CHANGE_ON_VALIDATE,1); print ''; print '
'; print ''; diff --git a/class/actions_quickcustomerprice.class.php b/class/actions_quickcustomerprice.class.php index 641a623..7e51e71 100644 --- a/class/actions_quickcustomerprice.class.php +++ b/class/actions_quickcustomerprice.class.php @@ -65,10 +65,10 @@ function formObjectOptions($parameters, &$object, &$action, $hookmanager) //var_dump($parameters['currentcontext']); if ($parameters['currentcontext'] == 'propalcard' || $parameters['currentcontext'] == 'ordercard' || $parameters['currentcontext'] == 'invoicecard') { + global $langs, $conf; + + if($object->statut > 0 && empty($conf->global->QCP_ALLOW_CHANGE_ON_VALIDATE)) return 0; - if($object->statut > 0) return 0; - - global $langs; ?>