forked from Wavyzz/dolibarr
Fix CI warnings
This commit is contained in:
@@ -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++;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user