From b80e9a9bdc12998c934bc2fc364dd7aa866bfd8a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 8 Feb 2022 15:37:23 +0000 Subject: [PATCH] Fixing style errors. --- htdocs/core/actions_addupdatedelete.inc.php | 8 ++++---- htdocs/mrp/class/mo.class.php | 4 ++-- htdocs/mrp/mo_card.php | 11 ++++------- htdocs/mrp/tpl/originproductline.tpl.php | 5 ++--- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 20e9db63ff1..807f9ffd614 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -139,7 +139,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation - if(!empty($noback)) { + if (!empty($noback)) { header("Location: " . $urltogo); exit; } @@ -309,7 +309,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) { // Delete OK setEventMessages("RecordDeleted", null, 'mesgs'); - if(!empty($noback)) { + if (!empty($noback)) { header("Location: " . $backurlforlist); exit; } @@ -355,7 +355,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs'); - if(!empty($noback)) { + if (!empty($noback)) { header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); exit; } @@ -496,7 +496,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd)) $newid = $result; } - if(!empty($noback)) { + if (!empty($noback)) { header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $newid); // Open record of new object exit; } diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index c02a19d9d66..fc7a9437df6 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1216,7 +1216,7 @@ class Mo extends CommonObject $objectline = new MoLine($this->db); $TFilters = array('customsql'=>'fk_mo = '.((int) $this->id)); - if(!empty($rolefilter)) $TFilters['role'] = $rolefilter; + if (!empty($rolefilter)) $TFilters['role'] = $rolefilter; $result = $objectline->fetchAll('ASC', 'position', 0, 0, $TFilters); if (is_numeric($result)) { @@ -1343,7 +1343,7 @@ class Mo extends CommonObject print ''.$langs->trans('DisableStockChange').''; print ''.$langs->trans('MoChildGenerate').''; //print ''.$form->showCheckAddButtons('checkforselect', 1).''; -// print ''; + // print ''; print ''; $i = 0; diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index d405e7fe341..7a496b73bd9 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -122,7 +122,7 @@ if (empty($reshook)) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; - } else { + } else { $backtopage = DOL_URL_ROOT.'/mrp/mo_card.php?id='.($id > 0 ? $id : '__ID__'); } } @@ -137,7 +137,7 @@ if (empty($reshook)) { // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen - if($action == 'add' && empty($id)){ + if ($action == 'add' && empty($id)) { $noback = ""; include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -146,15 +146,14 @@ if (empty($reshook)) { $moline = new MoLine($db); $objectbomchildline = new BOMLine($db); - foreach($TBomLineId as $id_bom_line){ - + foreach ($TBomLineId as $id_bom_line) { $object = new Mo($db); $objectbomchildline->fetch($id_bom_line); $TMoLines = $moline->fetchAll('', '', '1', '', array('origin_id' => $id_bom_line)); - foreach ($TMoLines as $moline){ + foreach ($TMoLines as $moline) { $_POST['fk_bom'] = $objectbomchildline->fk_bom_child; $_POST['fk_parent_line'] = $moline->id; $_POST['qty'] = $moline->qty; @@ -162,14 +161,12 @@ if (empty($reshook)) { } include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; - } $noback = 0; header("Location: ".$urltogo); exit; - } include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 67046404cd2..d261764f1c8 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -43,15 +43,14 @@ $res = $tmpbom->fetch($line->fk_bom_child); tpl['strike']) ? '' : ' strikefordisabled').'">'; print ''; -if($res){ +if ($res) { print $tmpproduct->getNomUrl(1); print ' '.$langs->trans("or").' '; print $tmpbom->getNomUrl(1); print ' '; print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open')); print ''; - -} else{ +} else { print $this->tpl['label']; } print '';