Fixing style errors.

This commit is contained in:
stickler-ci 2022-02-08 15:37:23 +00:00
parent 27cbd16bb9
commit b80e9a9bdc
4 changed files with 12 additions and 16 deletions

View File

@ -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;
}

View File

@ -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 '<td class="center">'.$langs->trans('DisableStockChange').'</td>';
print '<td class="center">'.$langs->trans('MoChildGenerate').'</td>';
//print '<td class="center">'.$form->showCheckAddButtons('checkforselect', 1).'</td>';
// print '<td class="center"></td>';
// print '<td class="center"></td>';
print '</tr>';
$i = 0;

View File

@ -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';

View File

@ -43,15 +43,14 @@ $res = $tmpbom->fetch($line->fk_bom_child);
<?php
print '<tr class="oddeven'.(empty($this->tpl['strike']) ? '' : ' strikefordisabled').'">';
print '<td>';
if($res){
if ($res) {
print $tmpproduct->getNomUrl(1);
print ' '.$langs->trans("or").' ';
print $tmpbom->getNomUrl(1);
print ' <a class="collapse_bom" id="collapse-'.$line->id.'" href="#">';
print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open'));
print '</a>';
} else{
} else {
print $this->tpl['label'];
}
print '</td>';