diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 31022d839650d..ea91765b94a4b 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1032,7 +1032,7 @@ public function validate($user, $force_number='', $idwarehouse=0, $notrigger=0) // Check parameters if (preg_match('/^'.preg_quote($langs->trans("CopyOf").' ').'/', $this->ref_supplier)) { - $this->error=$langs->trans("ErrorFieldFormat",$langs->transnoentities("RefSupplier")); + $this->error=$langs->trans("ErrorFieldFormat",$langs->transnoentities("RefSupplier")).'. '.$langs->trans('RemoveString',$langs->transnoentitiesnoconv("CopyOf")); return -1; } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 14aa36756b8e1..3d5515d901c09 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -737,6 +737,7 @@ Miscellaneous=Miscellaneous Calendar=Calendar GroupBy=Group by... ViewFlatList=View flat list +RemoveString=Remove string '%s' # Week day Monday=Monday Tuesday=Tuesday diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index ce39fad4a1414..9fa2db53a25b6 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -661,7 +661,7 @@ function change_percent() { $formquestion=array( 'text' => $langs->trans("ConfirmClone"), - array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int')>0?GETPOST('socid', 'int'):$object->socid, 'socid', '', "None")), + array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int')>0?GETPOST('socid', 'int'):$object->socid, 'socid', '', "None", 0, 0, null, 0, 'minwidth200')), array('type' => 'checkbox', 'name' => 'clone_contacts', 'label' => $langs->trans("CloneContacts"), 'value' => true), array('type' => 'checkbox', 'name' => 'clone_tasks', 'label' => $langs->trans("CloneTasks"), 'value' => true), array('type' => 'checkbox', 'name' => 'move_date', 'label' => $langs->trans("CloneMoveDate"), 'value' => true), @@ -670,7 +670,7 @@ function change_percent() array('type' => 'checkbox', 'name' => 'clone_task_files', 'label' => $langs->trans("CloneTaskFiles"), 'value' => false) ); - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 300); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 300, 590); } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index d14645e5e99ff..a348fc3200a20 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -705,6 +705,13 @@ function setValid($user) if ($this->statut != 1) { + // Check parameters + if (preg_match('/^'.preg_quote($langs->trans("CopyOf").' ').'/', $this->title)) + { + $this->error=$langs->trans("ErrorFieldFormat",$langs->transnoentities("Label")).'. '.$langs->trans('RemoveString',$langs->transnoentitiesnoconv("CopyOf")); + return -1; + } + $this->db->begin(); $sql = "UPDATE " . MAIN_DB_PREFIX . "projet"; @@ -1196,6 +1203,7 @@ function createFromClone($fromid,$clone_contact=false,$clone_task=true,$clone_pr if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; $clone_project->ref=$defaultref; + $clone_project->title=$langs->trans("CopyOf").' '.$clone_project->title; // Create clone $result=$clone_project->create($user,$notrigger);