diff --git a/htdocs/product/admin/stock_mouvement_extrafields.php b/htdocs/product/admin/stock_mouvement_extrafields.php index 0369c397e22..23e5aadc9cc 100644 --- a/htdocs/product/admin/stock_mouvement_extrafields.php +++ b/htdocs/product/admin/stock_mouvement_extrafields.php @@ -91,34 +91,31 @@ print dol_get_fiche_end(); // Buttons -if ($action != 'create' && $action != 'edit') -{ - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; +if ($action != 'create' && $action != 'edit') { + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } /* * Creation of an optional field */ -if ($action == 'create') -{ - print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); +if ($action == 'create') { + print '
'; + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* * Edition of an optional field */ -if ($action == 'edit' && !empty($attrname)) -{ - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); +if ($action == 'edit' && !empty($attrname)) { + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c141c9ab526..9a4eba6c97d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5122,7 +5122,7 @@ class Product extends CommonObject * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct) * @return int <0 if KO, >0 if OK */ - public function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0,$extrafields = null) + public function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null) { // phpcs:enable if ($id_entrepot) { @@ -5145,7 +5145,7 @@ class Product extends CommonObject $result = $movementstock->_create($user, $this->id, $id_entrepot, $op[$movement], $movement, $price, $label, $inventorycode, '', '', '', '', false, 0, $disablestockchangeforsubproduct); if ($result >= 0) { - if($extrafields){ + if ($extrafields) { $array_options = $extrafields->getOptionalsFromPost('stock_mouvement'); $movementstock->array_options = $array_options; $movementstock->insertExtraFields(); @@ -5181,7 +5181,7 @@ class Product extends CommonObject * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct) * @return int <0 if KO, >0 if OK */ - public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0,$extrafields = null) + public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null) { // phpcs:enable if ($id_entrepot) { @@ -5204,7 +5204,7 @@ class Product extends CommonObject $result = $movementstock->_create($user, $this->id, $id_entrepot, $op[$movement], $movement, $price, $label, $inventorycode, '', $dlc, $dluo, $lot, false, 0, $disablestockchangeforsubproduct); if ($result >= 0) { - if($extrafields){ + if ($extrafields) { $array_options = $extrafields->getOptionalsFromPost('stock_mouvement'); $movementstock->array_options = $array_options; $movementstock->insertExtraFields(); diff --git a/htdocs/product/stock/tpl/extrafields_add.tpl.php b/htdocs/product/stock/tpl/extrafields_add.tpl.php index 9cf61564ebe..62921f0a6e0 100644 --- a/htdocs/product/stock/tpl/extrafields_add.tpl.php +++ b/htdocs/product/stock/tpl/extrafields_add.tpl.php @@ -26,8 +26,7 @@ */ // Protection to avoid direct call of template -if (empty($conf) || !is_object($conf)) -{ +if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit; }