Merge pull request #3370 from atm-gauthier/new_add_next_ref_on_product_service_clone

NEW : conf to use next product/service ref when we clone a product/se…
This commit is contained in:
Laurent Destailleur 2015-09-05 10:57:11 +02:00
commit d108881690
3 changed files with 17 additions and 1 deletions

View File

@ -1392,6 +1392,7 @@ ModifyProductDescAbility=Personalization of product descriptions in forms
ViewProductDescInFormAbility=Visualization of product descriptions in the forms (otherwise as popup tooltip)
MergePropalProductCard=Activate in product/service Attached Files tab an option to merge product PDF document to proposal PDF azur if product/service is in the proposal
ViewProductDescInThirdpartyLanguageAbility=Visualization of products descriptions in the thirdparty language
UseMaskOnClone=Use product next ref when we clone a product%s (available if mask configured)
UseSearchToSelectProductTooltip=Also if you have a large number of product (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
UseSearchToSelectProduct=Use a search form to choose a product (rather than a drop-down list).
UseEcoTaxeAbility=Support Eco-Taxe (WEEE)

View File

@ -1392,6 +1392,7 @@ ModifyProductDescAbility=Personnalisation des descriptions produits dans les for
ViewProductDescInFormAbility=Visualisation des descriptions produits dans les formulaires (sinon en tant que bulle d'aide)
MergePropalProductCard=Ajoute dans l'onglet Fichiers joints des produits/services, une option pour fusionner le document PDF du produit au PDF des propositions Azur si le produit/services est inclut dans la proposition.
ViewProductDescInThirdpartyLanguageAbility=Visualisation des descriptions produits dans la langue du tiers
UseMaskOnClone=Utiliser la prochaine référence lors du clonage d'un produit%s (disponible si le masque est configuré ci-dessus)
UseSearchToSelectProductTooltip=Si vous avez un nombre important de produits (>100 000), vous pourrez améliorer les performances en positionnant la constante PRODUCT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limité au début des chaines.
UseSearchToSelectProduct=Utilisez un champ avec auto-complétion pour choisir les produits (plutôt qu'une liste déroulante).
UseEcoTaxeAbility=Prise en charge des éco-taxes (DEEE)

View File

@ -1601,11 +1601,25 @@ else
}
}
// Load object modCodeProduct
$module=(! empty($conf->global->PRODUCT_CODEPRODUCT_ADDON)?$conf->global->PRODUCT_CODEPRODUCT_ADDON:'mod_codeproduct_leopard');
if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php')
{
$module = substr($module, 0, dol_strlen($module)-4);
}
$result=dol_include_once('/core/modules/product/'.$module.'.php');
if ($result > 0)
{
$modCodeProduct = new $module();
}
$tmpcode='';
if (! empty($modCodeProduct->code_auto)) $tmpcode=$modCodeProduct->getNextValue($object,$object->type);
// Define confirmation messages
$formquestionclone=array(
'text' => $langs->trans("ConfirmClone"),
array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => $langs->trans("CopyOf").' '.$object->ref, 'size'=>24),
array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24),
array('type' => 'checkbox', 'name' => 'clone_content','label' => $langs->trans("CloneContentProduct"), 'value' => 1),
array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true),
array('type' => 'checkbox', 'name' => 'clone_composition', 'label' => $langs->trans('CloneCompositionProduct'), 'value' => 1)