Fixing style errors.

This commit is contained in:
stickler-ci 2022-01-28 16:36:15 +00:00
parent e70604c485
commit 807ff75b6a
3 changed files with 17 additions and 21 deletions

View File

@ -91,34 +91,31 @@ print dol_get_fiche_end();
// Buttons // Buttons
if ($action != 'create' && $action != 'edit') if ($action != 'create' && $action != 'edit') {
{ print '<div class="tabsAction">';
print '<div class="tabsAction">'; print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>"; print "</div>";
print "</div>";
} }
/* /*
* Creation of an optional field * Creation of an optional field
*/ */
if ($action == 'create') if ($action == 'create') {
{ print '<br><div id="newattrib"></div>';
print '<br><div id="newattrib"></div>'; print load_fiche_titre($langs->trans('NewAttribute'));
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 * Edition of an optional field
*/ */
if ($action == 'edit' && !empty($attrname)) if ($action == 'edit' && !empty($attrname)) {
{ print "<br>";
print "<br>"; print load_fiche_titre($langs->trans("FieldEdition", $attrname));
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 // End of page

View File

@ -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) * @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 * @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 // phpcs:enable
if ($id_entrepot) { 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); $result = $movementstock->_create($user, $this->id, $id_entrepot, $op[$movement], $movement, $price, $label, $inventorycode, '', '', '', '', false, 0, $disablestockchangeforsubproduct);
if ($result >= 0) { if ($result >= 0) {
if($extrafields){ if ($extrafields) {
$array_options = $extrafields->getOptionalsFromPost('stock_mouvement'); $array_options = $extrafields->getOptionalsFromPost('stock_mouvement');
$movementstock->array_options = $array_options; $movementstock->array_options = $array_options;
$movementstock->insertExtraFields(); $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) * @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 * @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 // phpcs:enable
if ($id_entrepot) { 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); $result = $movementstock->_create($user, $this->id, $id_entrepot, $op[$movement], $movement, $price, $label, $inventorycode, '', $dlc, $dluo, $lot, false, 0, $disablestockchangeforsubproduct);
if ($result >= 0) { if ($result >= 0) {
if($extrafields){ if ($extrafields) {
$array_options = $extrafields->getOptionalsFromPost('stock_mouvement'); $array_options = $extrafields->getOptionalsFromPost('stock_mouvement');
$movementstock->array_options = $array_options; $movementstock->array_options = $array_options;
$movementstock->insertExtraFields(); $movementstock->insertExtraFields();

View File

@ -26,8 +26,7 @@
*/ */
// Protection to avoid direct call of template // 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"; print "Error, template page can't be called as URL";
exit; exit;
} }