From 2e1b762596f7274b4baa198e5d58daf0e4d54317 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Dec 2018 15:01:49 +0100 Subject: [PATCH] Fix phpcs --- .../reception/doc/pdf_squille.modules.php | 5 +- .../modules/reception/mod_reception_beryl.php | 2 + htdocs/reception/card.php | 56 ++++++------------- htdocs/reception/class/reception.class.php | 7 +-- 4 files changed, 24 insertions(+), 46 deletions(-) diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index d7374fe4239..85724a8b42a 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -98,6 +98,7 @@ class pdf_squille extends ModelePdfReception } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build pdf onto disk * @@ -111,6 +112,7 @@ class pdf_squille extends ModelePdfReception */ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$conf,$langs,$hookmanager; $object->fetch_thirdparty(); @@ -637,7 +639,6 @@ class pdf_squille extends ModelePdfReception { $object->trueVolume= ($object->trueWidth * $object->trueHeight * $object->trueDepth); $object->volume_units=$object->size_units * 3; - } if ($totalWeight!='') $totalWeighttoshow=showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs); @@ -665,7 +666,6 @@ class pdf_squille extends ModelePdfReception $pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1); - } // Total Weight @@ -769,7 +769,6 @@ class pdf_squille extends ModelePdfReception $pdf->SetXY($this->posxtotalht-1, $tab_top+1); $pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxtotalht), 2, $outputlangs->transnoentities("TotalHT"),'','C'); } - } } diff --git a/htdocs/core/modules/reception/mod_reception_beryl.php b/htdocs/core/modules/reception/mod_reception_beryl.php index 4471637b41f..ee45d245cd2 100644 --- a/htdocs/core/modules/reception/mod_reception_beryl.php +++ b/htdocs/core/modules/reception/mod_reception_beryl.php @@ -130,6 +130,7 @@ class mod_reception_beryl extends ModelNumRefReception return $this->prefix.$yymm."-".$num; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -139,6 +140,7 @@ class mod_reception_beryl extends ModelNumRefReception */ function reception_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } \ No newline at end of file diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 511394d58bf..884f4609eca 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -574,7 +574,6 @@ if (empty($reshook)) { $error++; } - } unset($_POST["lineid"]); } @@ -616,11 +615,8 @@ if (empty($reshook)) $line->fk_product = $lines[$i]->fk_product; - - if ($lines[$i]->fk_product > 0) { - // single warehouse reception line $stockLocation = "entl".$line_id; $qty = "qtyl".$line_id; @@ -645,16 +641,11 @@ if (empty($reshook)) $line->sellby = strtotime($sellbydate); } - - if ($line->update($user) < 0) { setEventMessages($line->error, $line->errors, 'errors'); $error++; } - - - } else // Product no predefined { @@ -713,7 +704,6 @@ if (empty($reshook)) $mode='emailfromreception'; $trackid='shi'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - } @@ -1191,15 +1181,8 @@ if ($action == 'create') } print "\n"; - - - - } - - - //Display lines extrafields if (is_array($extralabelslines) && count($extralabelslines)>0) { @@ -1308,7 +1291,6 @@ else if ($id || $ref) if ($action == 'annuler') { $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelReception'),$langs->trans("ConfirmCancelReception",$object->ref),'confirm_cancel','',0,1); - } if (! $formconfirm) { @@ -1475,7 +1457,6 @@ else if ($id || $ref) print ' '; print ' '; print ''; - } else { @@ -1904,23 +1885,22 @@ else if ($id || $ref) { if ($lines[$i]->fk_product > 0) { - print ''; - print ''; - // Qty to receive or received - print '' . '' . ''; - // Warehouse source - print '' . $formproduct->selectWarehouses($lines[$i]->fk_entrepot, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1). ''; - // Batch number managment - if($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch)){ - print '
'; - print $langs->trans('EatByDate').' : '; - print $form->select_date($lines[$i]->eatby,'dlc' .$line_id , '', '', 1, ""). '
'; - print $langs->trans('SellByDate').' : '; - print $form->select_date($lines[$i]->sellby,'dluo' .$line_id , '', '', 1, ""); - print ''; - } - print ''; - + print ''; + print ''; + // Qty to receive or received + print '' . '' . ''; + // Warehouse source + print '' . $formproduct->selectWarehouses($lines[$i]->fk_entrepot, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1). ''; + // Batch number managment + if($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch)){ + print '
'; + print $langs->trans('EatByDate').' : '; + print $form->select_date($lines[$i]->eatby,'dlc' .$line_id , '', '', 1, ""). '
'; + print $langs->trans('SellByDate').' : '; + print $form->select_date($lines[$i]->sellby,'dluo' .$line_id , '', '', 1, ""); + print ''; + } + print ''; } else { @@ -1967,7 +1947,6 @@ else if ($id || $ref) $detail =''; if ($lines[$i]->product->status_batch) { - $detail.= $langs->trans("Batch").': '.$lines[$i]->batch; $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($lines[$i]->sellby,"day"); $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($lines[$i]->eatby,"day"); @@ -2066,8 +2045,7 @@ else if ($id || $ref) print '
'; $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index eac97f4d5fd..59200b53bd8 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -619,7 +619,6 @@ class Reception extends CommonObject $this->error=$this->db->error(); return -2; } - } // Change status of order to "reception in process" @@ -1286,6 +1285,7 @@ class Reception extends CommonObject return -2; } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch deliveries method and return an array. Load array this->meths(rowid=>label). @@ -1313,6 +1313,7 @@ class Reception extends CommonObject } } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch all deliveries method and return an array. Load array this->listmeths. @@ -1394,7 +1395,6 @@ class Reception extends CommonObject $sql.= ' WHERE rowid='.$id; $resql = $this->db->query($sql); - } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps @@ -1412,7 +1412,6 @@ class Reception extends CommonObject $sql.= ' WHERE rowid='.$id; $resql = $this->db->query($sql); - } @@ -1598,6 +1597,7 @@ class Reception extends CommonObject return -1; } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Classify the reception as invoiced (used when WORKFLOW_BILL_ON_RECEPTION is on) @@ -1912,7 +1912,6 @@ class Reception extends CommonObject } } - if (!$error) { $this->statut=self::STATUS_DRAFT; $this->db->commit();