From ee98f3e6d79b7af29bfb64688041e7a7d9a8d0c3 Mon Sep 17 00:00:00 2001 From: John Botella Date: Wed, 26 Jun 2019 10:48:22 +0200 Subject: [PATCH] fix travis recommendations --- htdocs/admin/facture_situation.php | 46 +++++++++---------- htdocs/compta/facture/card.php | 1 - htdocs/compta/facture/class/facture.class.php | 2 +- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../facture/doc/pdf_sponge.modules.php | 11 ++++- 5 files changed, 35 insertions(+), 27 deletions(-) diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/facture_situation.php index 9b275944e3a..a63233329f3 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/facture_situation.php @@ -38,10 +38,10 @@ $langs->loadLangs(array('admin', 'errors', 'other', 'bills')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='invoice'; @@ -57,15 +57,15 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); -llxHeader("",$langs->trans("BillsSetup"),'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'); +llxHeader("", $langs->trans("BillsSetup"), 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); $head = invoice_admin_prepare_head(); dol_fiche_head($head, 'situation', $langs->trans("InvoiceSituation"), -1, 'invoice'); @@ -74,7 +74,7 @@ dol_fiche_head($head, 'situation', $langs->trans("InvoiceSituation"), -1, 'invoi * Numbering module */ -print load_fiche_titre($langs->trans("InvoiceSituation"),'',''); +print load_fiche_titre($langs->trans("InvoiceSituation"), '', ''); $var=0; print '
'; @@ -85,9 +85,9 @@ _updateBtn(); print ''; -_printOnOff('INVOICE_USE_SITUATION',$langs->trans('UseSituationInvoices')); -_printOnOff('INVOICE_USE_SITUATION_CREDIT_NOTE',$langs->trans('UseSituationInvoicesCreditNote')); -_printOnOff('INVOICE_USE_SITUATION_RETAINED_WARRANTY',$langs->trans('Retainedwarranty')); +_printOnOff('INVOICE_USE_SITUATION', $langs->trans('UseSituationInvoices')); +_printOnOff('INVOICE_USE_SITUATION_CREDIT_NOTE', $langs->trans('UseSituationInvoicesCreditNote')); +_printOnOff('INVOICE_USE_SITUATION_RETAINED_WARRANTY', $langs->trans('Retainedwarranty')); $metas = array( 'type' => 'number', @@ -95,7 +95,7 @@ $metas = array( 'min' => 0, 'max' => 100 ); -_printInputFormPart('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT',$langs->trans('RetainedwarrantyDefaultPercent'),'',$metas); +_printInputFormPart('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT', $langs->trans('RetainedwarrantyDefaultPercent'), '', $metas); @@ -136,12 +136,12 @@ function _updateBtn(){ /** * Print a On/Off button - * @param $confkey - * @param bool $title - * @param string $desc + * @param string $confkey the conf key + * @param bool $title Title of conf + * @param string $desc Description of * @return void */ -function _printOnOff($confkey, $title = false, $desc ='') +function _printOnOff($confkey, $title = false, $desc = '') { global $var, $bc, $langs; $var=!$var; @@ -161,11 +161,11 @@ function _printOnOff($confkey, $title = false, $desc ='') /** * Print a form part - * @param $confkey - * @param bool $title - * @param string $desc - * @param array $metas - * @param string $type + * @param string $confkey the conf key + * @param bool $title Title of conf + * @param string $desc Description of + * @param array $metas html meta + * @param string $type type of input textarea or input * @param bool $help * @return void */ @@ -186,7 +186,7 @@ function _printInputFormPart($confkey, $title = false, $desc ='', $metas = array } - $metas = array_merge ($defaultMetas, $metas); + $metas = array_merge($defaultMetas, $metas); $metascompil = ''; foreach ($metas as $key => $values) { @@ -197,7 +197,7 @@ function _printInputFormPart($confkey, $title = false, $desc ='', $metas = array print ''; - } } else // Credit note diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 8c8fd3365ca..c6b83793f77 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4409,7 +4409,7 @@ class Facture extends CommonInvoice $displayWarranty = true; // Check if this situation invoice is 100% for real if(!empty($this->lines)){ - foreach($this->lines as $i => $line ){ + foreach($this->lines as $i => $line){ if($line->product_type < 2 && $line->situation_percent < 100){ $displayWarranty = false; break; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index f30193b3a9e..8cac32d1f2d 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1354,7 +1354,7 @@ class pdf_crabe extends ModelePDFFactures // Check if this situation invoice is 100% for real if(!empty($object->lines)){ $displayWarranty = true; - foreach($object->lines as $i => $line ){ + foreach($object->lines as $i => $line){ if($line->product_type < 2 && $line->situation_percent < 100){ $displayWarranty = false; break; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index ed18eb1b954..2a1b0516112 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1643,7 +1643,7 @@ class pdf_sponge extends ModelePDFFactures elseif(!empty($object->lines) && $object->status == Facture::STATUS_DRAFT ){ // $object->situation_final need validation to be done so this test is need for draft $displayWarranty = true; - foreach($object->lines as $i => $line ){ + foreach($object->lines as $i => $line){ if($line->product_type < 2 && $line->situation_percent < 100){ $displayWarranty = false; break; @@ -1738,8 +1738,17 @@ class pdf_sponge extends ModelePDFFactures return ($tab2_top + ($tab2_hl * $index)); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of active generation modules + * + * @param DoliDB $db Database handler + * @param integer $maxfilenamelength Max length of value to show + * @return array List of templates + */ public static function liste_modeles($db, $maxfilenamelength = 0) { + // phpcs:enable return parent::liste_modeles($db, $maxfilenamelength); // TODO: Change the autogenerated stub }
'; if(!empty($help)){ - print $form->textwithtooltip( ($title?$title:$langs->trans($confkey)) , $langs->trans($help),2,1,img_help(1,'')); + print $form->textwithtooltip(($title?$title:$langs->trans($confkey)), $langs->trans($help), 2, 1, img_help(1, '')); } else { print $title?$title:$langs->trans($confkey); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 169577a2c1e..340527f16ae 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4684,7 +4684,6 @@ elseif ($id > 0 || ! empty($ref)) print $langs->trans("RetainedWarranty") . ' ('.$object->retained_warranty.'%)'; print !empty($object->retained_warranty_date_limit)?' '.$langs->trans("ToPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')):''; print ' :' . price($retainedWarranty) . '