From 31693eed21ffa7fd8784e42527cb76ec7a0910d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Dec 2020 11:10:35 +0100 Subject: [PATCH] Fix setup was not clear --- htdocs/langs/am_ET/products.lang | 2 +- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/products.lang | 3 +- htdocs/product/admin/product.php | 53 ++++++++++++++++++-------------- 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/htdocs/langs/am_ET/products.lang b/htdocs/langs/am_ET/products.lang index 97db059594f..18af7f2f252 100644 --- a/htdocs/langs/am_ET/products.lang +++ b/htdocs/langs/am_ET/products.lang @@ -108,7 +108,7 @@ FillWithLastServiceDates=Fill with last service line dates MultiPricesAbility=Multiple price segments per product/service (each customer is in one price segment) MultiPricesNumPrices=Number of prices DefaultPriceType=Base of prices per default (with versus without tax) when adding new sale prices -AssociatedProductsAbility=Activate kits (virtual products) +AssociatedProductsAbility=Enable Kits (set of other products) AssociatedProducts=Kits AssociatedProductsNumber=Number of products composing this kit ParentProductsNumber=Number of parent packaging product diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b6784b75835..d314c44aa0e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -56,6 +56,7 @@ GUISetup=Display SetupArea=Setup UploadNewTemplate=Upload new template(s) FormToTestFileUploadForm=Form to test file upload (according to setup) +ModuleMustBeEnabled=Module %s must be enabled IfModuleEnabled=Note: yes is effective only if module %s is enabled RemoveLock=Remove/rename file %s if it exists, to allow usage of the Update/Install tool. RestoreLock=Restore file %s, with read permission only, to disable any further use of the Update/Install tool. diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 8c30b2e02c1..f0c4a5362b8 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -108,7 +108,8 @@ FillWithLastServiceDates=Fill with last service line dates MultiPricesAbility=Multiple price segments per product/service (each customer is in one price segment) MultiPricesNumPrices=Number of prices DefaultPriceType=Base of prices per default (with versus without tax) when adding new sale prices -AssociatedProductsAbility=Activate kits (virtual products) +AssociatedProductsAbility=Enable Kits (set of other products) +VariantsAbility=Enable Variants (variations of products, for example color, size) AssociatedProducts=Kits AssociatedProductsNumber=Number of products composing this kit ParentProductsNumber=Number of parent packaging product diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 16c3c849ce6..af158278079 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -127,8 +127,8 @@ if ($action == 'other') $value = GETPOST('price_base_type', 'alpha'); $res = dolibarr_set_const($db, "PRODUCT_PRICE_BASE_TYPE", $value, 'chaine', 0, '', $conf->entity); - $value = GETPOST('PRODUIT_SOUSPRODUITS', 'alpha'); - $res = dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $value, 'chaine', 0, '', $conf->entity); + /*$value = GETPOST('PRODUIT_SOUSPRODUITS', 'alpha'); + $res = dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $value, 'chaine', 0, '', $conf->entity);*/ $value = GETPOST('activate_viewProdDescInForm', 'alpha'); $res = dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $value, 'chaine', 0, '', $conf->entity); @@ -312,7 +312,6 @@ print ' '.$langs->trans("Status").''; print ' '.$langs->trans("ShortInfo").''; print "\n"; -$var = true; foreach ($dirproduct as $dirroot) { $dir = dol_buildpath($dirroot, 0); @@ -340,7 +339,6 @@ foreach ($dirproduct as $dirroot) if ($modCodeProduct->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($modCodeProduct->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var = !$var; print ''."\n"; print ''.$modCodeProduct->name.''."\n"; print ''.$modCodeProduct->info($langs).''."\n"; @@ -537,17 +535,35 @@ print ''.$langs->trans("Value").''."\n"; print ''."\n"; -/* - * Other parameters - */ +// Enable kits (subproducts) -$rowspan = 4; -if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $rowspan++; -if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) $rowspan++; -if (!empty($conf->global->MAIN_MULTILANGS)) $rowspan++; -if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) $rowspan++; +print ''; +print ''.$langs->trans("AssociatedProductsAbility").''; +print ''; +print ajax_constantonoff("PRODUIT_SOUSPRODUITS", array(), $conf->entity, 0, 0, 1, 0); +//print $form->selectyesno("PRODUIT_SOUSPRODUITS", $conf->global->PRODUIT_SOUSPRODUITS, 1); +print ''; +print ''; +// Enable variants + +print ''; +print ''.$langs->trans("VariantsAbility").''; +print ''; +//print ajax_constantonoff("PRODUIT_SOUSPRODUITS", array(), $conf->entity, 0, 0, 1, 0); +//print $form->selectyesno("PRODUIT_SOUSPRODUITS", $conf->global->PRODUIT_SOUSPRODUITS, 1); +if (empty($conf->variants->enabled)) { + print ''.$langs->trans("ModuleMustBeEnabled", $langs->transnoentitiesnoconv("Module610Name")).''; +} else { + print yn(1).' ('.$langs->trans("ModuleIsEnabled", $langs->transnoentitiesnoconv("Module610Name")).')'; +} +print ''; +print ''; + + +// Rule for price + print ''; if (empty($conf->multicompany->enabled)) { @@ -575,7 +591,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print ''; } -//Default product price base type +// Default product price base type print ''; print ''.$langs->trans("DefaultPriceType").''; print ''; @@ -583,16 +599,7 @@ print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_ print ''; print ''; -// sousproduits activation/desactivation - -print ''; -print ''.$langs->trans("AssociatedProductsAbility").''; -print ''; -print $form->selectyesno("PRODUIT_SOUSPRODUITS", $conf->global->PRODUIT_SOUSPRODUITS, 1); -print ''; -print ''; - -// Utilisation formulaire Ajax sur choix produit +// Use Ajax form to select a product print ''; print ''.$form->textwithpicto($langs->trans("UseSearchToSelectProduct"), $langs->trans('UseSearchToSelectProductTooltip'), 1).'';