diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 1befc5c4332..a2080f282ab 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1580,7 +1580,7 @@ class BookKeeping extends CommonObject $this->db->begin(); // Call triggers - if (! $error && ! $notrigger) { + if (!$notrigger) { $result = $this->call_trigger('BOOKKEEPING_DELETE', $user); if ($result < 0) { $error++; diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index fb79053c145..f863f849ddb 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -281,7 +281,8 @@ class TimeSpent extends CommonObject */ public function createFromClone(User $user, $fromid) { - global $langs, $extrafields; + global $extrafields; + $error = 0; dol_syslog(__METHOD__, LOG_DEBUG); @@ -296,16 +297,13 @@ class TimeSpent extends CommonObject // Reset some properties unset($object->id); unset($object->fk_user_creat); + unset($object->user_creation_id); unset($object->import_key); // Clear fields if (property_exists($object, 'ref')) { $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; } - if (property_exists($object, 'label')) { - // @phan-suppress-next-line PhanUndeclaredProperty - $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; - } if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; } diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 77357da66d6..f83e2bd845b 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -352,6 +352,7 @@ class ConferenceOrBoothAttendee extends CommonObject // Reset some properties unset($object->id); unset($object->fk_user_creat); + unset($object->user_creation_id); unset($object->import_key); // Clear fields @@ -359,9 +360,6 @@ class ConferenceOrBoothAttendee extends CommonObject // @phan-suppress-next-line PhanTypeInvalidDimOffset $object->ref = empty($this->fields['ref']['default']) ? "(PROV)" : $this->fields['ref']['default']; } - if (property_exists($object, 'label')) { - $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; - } if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; } diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 10e55284fba..ad3ab437bdb 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -276,15 +276,13 @@ class EvaluationLine extends CommonObjectLine // Reset some properties unset($object->id); unset($object->fk_user_creat); + unset($object->user_creation_id); unset($object->import_key); // Clear fields if (property_exists($object, 'ref')) { $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; } - if (property_exists($object, 'label')) { - $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; - } if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; } diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 427f47f2e26..194b836f2a2 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -293,15 +293,13 @@ class Position extends CommonObject // Reset some properties unset($object->id); unset($object->fk_user_creat); + unset($object->user_ceation_id); unset($object->import_key); // Clear fields if (property_exists($object, 'ref')) { $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_" . $object->ref : $this->fields['ref']['default']; } - if (property_exists($object, 'label')) { - $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf") . " " . $object->label : $this->fields['label']['default']; - } if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; } diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index f4adc185f7b..bec9e3b5999 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -344,6 +344,7 @@ class Skill extends CommonObject // Reset some properties unset($object->id); unset($object->fk_user_creat); + unset($object->user_creation_id); unset($object->import_key); // Clear fields diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index c5d9f1dc155..f42001024b5 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -265,15 +265,13 @@ class Skilldet extends CommonObjectLine // Reset some properties unset($object->id); unset($object->fk_user_creat); + unset($object->user_creation_id); unset($object->import_key); // Clear fields if (property_exists($object, 'ref')) { $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; } - if (property_exists($object, 'label')) { - $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; - } if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; } diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 34fb53116c6..e70775cd7ca 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -279,6 +279,7 @@ class SkillRank extends CommonObject // Reset some properties unset($object->id); unset($object->fk_user_creat); + unset($object->user_creation_id); unset($object->import_key); if (!empty($fk_object) && $fk_object > 0) { unset($object->fk_object); @@ -289,9 +290,6 @@ class SkillRank extends CommonObject if (property_exists($object, 'ref')) { $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; } - if (property_exists($object, 'label')) { - $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; - } if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; } diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 6593b6e40b2..666cda46456 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -307,6 +307,7 @@ class Partnership extends CommonObject // Reset some properties unset($object->id); unset($object->fk_user_creat); + unset($object->user_creation_id); unset($object->import_key); // Clear fields @@ -314,9 +315,6 @@ class Partnership extends CommonObject // @phan-suppress-next-line PhanTypeMismatchProperty $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; } - if (property_exists($object, 'label')) { - $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; - } if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; } diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index 5f8372f6c83..a2f627acd75 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -328,15 +328,16 @@ class ProductFournisseurPrice extends CommonObject // Reset some properties unset($object->id); unset($object->fk_user_creat); + unset($object->user_creation_id); unset($object->import_key); // Clear fields if (property_exists($object, 'ref')) { $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; } - if (property_exists($object, 'label')) { + /*if (property_exists($object, 'label')) { $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; - } + }*/ if (property_exists($object, 'status')) { $object->status = self::STATUS_DRAFT; }