diff --git a/ChangeLog b/ChangeLog index b8a1dc52180..8a64ec49e1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,7 +12,8 @@ For users: - New: VAT number is stored in one field. This is more "international". - New: task #9782 : Add possibility to delete a warehouse. - New: task #9640 : Add label for stock movements. -- New: task #9916 : Add FREE text for interventions card +- New: task #9916 : Add FREE text for interventions card. +- New: Can define the new product ref when cloning. - Fix: bug #28055 : Unable to modify the date of a cloned command. - Fix: bug #27891. - Fix: Change of numbering module was not effective. diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index e73999cc2e7..22f6b2eb412 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1639,34 +1639,35 @@ class Form $more=''; if ($formquestion) { - $more.=''; - $more.=''; - $more.=''; + $more.='
'.$formquestion['text'].'
'."\n"; + $more.=''."\n"; + $more.=''."\n"; foreach ($formquestion as $key => $input) { if ($input['type'] == 'text') { - $more.=''; + $more.=''."\n"; } if ($input['type'] == 'select') { $more.=''; + $more.=''."\n"; } if ($input['type'] == 'checkbox') { $more.=''; - $more.='
'.$formquestion['text'].'
'.$input['label'].'
'.$input['label'].'
'; $more.=$this->selectarray($input['name'],$input['values'],'',1); - $more.='
'.$input['label'].'  '; + //$more.=''.$input['label'].'  '; + $more.=''.$input['label'].' '; $more.='\n"; @@ -1705,14 +1706,14 @@ class Form } else { - print '
'; + print ''."\n"; print ''; - print ''; + print ''."\n"; - print ''; + print '
'."\n"; // Ligne titre - print ''; + print ''."\n"; // Ligne formulaire print $more; @@ -1725,9 +1726,9 @@ class Form print $this->selectyesno("confirm",$newselectedchoice); print ''; print ''; - print ''; + print ''."\n"; - print '
'.img_picto('','recent').' '.$title.'
'.img_picto('','recent').' '.$title.'
'; + print '
'."\n"; if (is_array($formquestion)) { diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 7bf805a9409..c0352179368 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -151,4 +151,5 @@ CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s ? CloneContentProduct=Clone all main informations of product/service ClonePricesProduct=Clone main informations and prices -ProductIsUsed=This product is used \ No newline at end of file +ProductIsUsed=This product is used +NewRefForClone=Ref. of new product/service \ No newline at end of file diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 947450bcaf5..90b1dc9e7da 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -151,4 +151,5 @@ CloneProduct=Cloner produit/service ConfirmCloneProduct=Etes-vous sur de vouloir cloner le produit ou service %s ? CloneContentProduct=Cloner les informations générales du produit/service uniquement ClonePricesProduct=Cloner les informations générales et les prix -ProductIsUsed=Ce produit est utilisé \ No newline at end of file +ProductIsUsed=Ce produit est utilisé +NewRefForClone=Réf. du nouveau produit/service \ No newline at end of file diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index d7ffc6ee9bd..9d61ff545ef 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -233,7 +233,7 @@ if ($_POST["action"] == 'confirm_clone' && $_POST['confirm'] == 'yes' && ($user- $originalId = $_GET["id"]; if ($product->fetch($_GET["id"]) > 0) { - $product->ref = $langs->trans("CopyOf").' '.$product->ref; + $product->ref = $_REQUEST["clone_ref"]; $product->status = 0; $product->finished = 1; $product->id = null; @@ -1206,7 +1206,8 @@ if ($_GET["action"] == 'clone') // Create an array for form $formquestion=array( 'text' => $langs->trans("ConfirmClone"), - array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContentProduct"), 'value' => 1), + array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => $langs->trans("CopyOf").' '.$product->ref, '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) ); // Paiement incomplet. On demande si motif = escompte ou autre