diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index f1c65395d79..b3163511150 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -817,7 +817,10 @@ class BOM extends CommonObject $this->labelstatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); } - return dolGetStatus($this->labelstatus[$status], $this->labelstatus[$status], '', 'status'.$status, $mode); + $statusType = 'status'.$status; + if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; + + return dolGetStatus($this->labelstatus[$status], $this->labelstatus[$status], '', $statusType, $mode); } /** diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index a9b77b38ff2..6b5f34b2528 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -664,7 +664,10 @@ class MyObject extends CommonObject $this->labelstatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); } - return dolGetStatus($this->labelstatus[$status], $this->labelstatus[$status], '', 'status'.$status, $mode); + $statusType = 'status'.$status; + if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; + + return dolGetStatus($this->labelstatus[$status], $this->labelstatus[$status], '', $statusType, $mode); } /** diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index c53fe528849..fcf8b1f8a06 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -322,7 +322,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project if (! empty($conf->projet->enabled)) { diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 03085c89d3e..4f069e885bd 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -553,7 +553,10 @@ class Mo extends CommonObject $this->labelstatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); } - return dolGetStatus($this->labelstatus[$status], $this->labelstatus[$status], '', 'status'.$status, $mode); + $statusType = 'status'.$status; + //if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; + + return dolGetStatus($this->labelstatus[$status], $this->labelstatus[$status], '', $statusType, $mode); } /** diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 9e4846570c7..7a26660d6dc 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -281,7 +281,8 @@ if (($id || $ref) && $action == 'edit') // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - $res = $object->fetch_optionals(); + $res = $object->fetch_thirdparty(); + $res = $object->fetch_optionals(); $head = moPrepareHead($object); dol_fiche_head($head, 'card', $langs->trans("MO"), -1, $object->picto); @@ -325,7 +326,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', null, null, '', 1);*/ // Thirdparty - $morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + $morehtmlref.=$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project if (! empty($conf->projet->enabled)) {