From 208306cb7119a98d5e915d9b9285978551b93a62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 28 Dec 2022 12:42:44 +0100 Subject: [PATCH] Clean code --- htdocs/adherents/cartes/carte.php | 2 +- htdocs/compta/bank/card.php | 23 +++++++++++++---------- htdocs/compta/paiement/card.php | 6 ++---- htdocs/compta/paiement/cheque/card.php | 9 --------- htdocs/contrat/card.php | 2 +- htdocs/core/class/html.formsms.class.php | 2 +- htdocs/fourn/commande/card.php | 10 +++++----- htdocs/fourn/facture/card.php | 2 ++ htdocs/printing/admin/printing.php | 2 +- htdocs/product/card.php | 2 +- htdocs/stripe/admin/stripe.php | 2 +- 11 files changed, 28 insertions(+), 34 deletions(-) diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index e9eb00d23f7..5eb3403b825 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -307,7 +307,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) { } asort($arrayoflabels); print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); -print '
'.$langs->trans("Login").': '; +print '
'.$langs->trans("Login").': '; print '
'; print ''; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index a923f3a0829..15cb5123e0f 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -515,6 +515,7 @@ if ($action == 'create') { // Show fields of bank account $sizecss = ''; foreach ($object->getFieldsToShow() as $val) { + $content = ''; if ($val == 'BankCode') { $name = 'code_banque'; $sizecss = 'minwidth100'; @@ -534,7 +535,7 @@ if ($action == 'create') { } print ''.$langs->trans($val).''; - print ''; + print ''; print ''; } $ibankey = FormBank::getIBANLabel($object); @@ -545,10 +546,10 @@ if ($action == 'create') { // IBAN print ''.$langs->trans($ibankey).''; - print ''; + print ''; print ''.$langs->trans($bickey).''; - print ''; + print ''; if (isModEnabled('paymentbybanktransfer')) { print ''.$langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation").''; @@ -559,7 +560,7 @@ if ($action == 'create') { print ''.$langs->trans("BankAccountDomiciliation").''; print '"; print ''.$langs->trans("BankAccountOwner").''; @@ -730,6 +731,7 @@ if ($action == 'create') { // Show fields of bank account foreach ($object->getFieldsToShow() as $val) { + $content = ''; if ($val == 'BankCode') { $content = $object->code_banque; } elseif ($val == 'DeskCode') { @@ -1034,31 +1036,32 @@ if ($action == 'create') { // If bank account print ''.$langs->trans("BankName").''; - print ''; + print ''; print ''; // Show fields of bank account foreach ($object->getFieldsToShow() as $val) { + $content = ''; if ($val == 'BankCode') { $name = 'code_banque'; - $size = 8; + $css = 'with100'; $content = $object->code_banque; } elseif ($val == 'DeskCode') { $name = 'code_guichet'; - $size = 8; + $css = 'with100'; $content = $object->code_guichet; } elseif ($val == 'BankAccountNumber') { $name = 'number'; - $size = 18; + $css = 'with200'; $content = $object->number; } elseif ($val == 'BankAccountNumberKey') { $name = 'cle_rib'; - $size = 3; + $css = 'with50'; $content = $object->cle_rib; } print ''.$langs->trans($val).''; - print ''; + print ''; print ''; } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 4930ce9e53c..cc39a790527 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -415,8 +415,6 @@ if ($resql) { $i = 0; $total = 0; - $moreforfilter = ''; - print '
'; print '
'; @@ -511,9 +509,9 @@ if ($resql) { print '
'; if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { - if ($user->socid == 0 && $object->statut == 0 && $_GET['action'] == '') { + if ($user->socid == 0 && $object->statut == 0 && $action == '') { if ($user->rights->facture->paiement) { - print ''.$langs->trans('Valid').''; + print ''.$langs->trans('Valid').''; } } } diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 43443fb292e..1aebdace757 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -485,13 +485,6 @@ if ($action == 'new') { if (count($lines[$bid])) { foreach ($lines[$bid] as $lid => $value) { - //$account_id = $bid; FIXME not used - - // FIXME $accounts[$bid] is a label ! - /*if (! isset($accounts[$bid])) - $accounts[$bid]=0; - $accounts[$bid] += 1;*/ - print ''; print ''.dol_print_date($value["date"], 'day').''; print ''.$value["numero"]."\n"; @@ -525,8 +518,6 @@ if ($action == 'new') { print ''; print ''; print ''; - - $i++; } } print ""; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 7aad6ca9c54..220356310fa 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2025,7 +2025,7 @@ if ($action == 'create') { print ''; print ''; - print ''.$langs->trans("Comment").''; + print ''.$langs->trans("Comment").''; print ''; print '   '; print ''; diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index f08640c6e55..28092a72da6 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -250,7 +250,7 @@ function limitChars(textarea, limit, infodiv) if ($this->withtoreadonly) { print (!is_array($this->withto) && !is_numeric($this->withto)) ? $this->withto : ""; } else { - print "withto) && $this->withto != '1' ? (isset($_REQUEST["sendto"]) ?GETPOST("sendto") : $this->withto) : "+")."\">"; + print 'withto) : "+").'">'; if (!empty($this->withtosocid) && $this->withtosocid > 0) { $liste = array(); foreach ($soc->thirdparty_and_contact_phone_array() as $key => $value) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 68d90406012..b627832ca3c 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2654,7 +2654,8 @@ if ($action == 'create') { $formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1); print ''; - print ''.$langs->trans("Comment").''; + print ''.$langs->trans("Comment").''; + print ''; print ''; print '     '; @@ -2720,7 +2721,7 @@ if ($action == 'create') { print $form->selectarray("type", $liv); print ''; - print ''.$langs->trans("Comment").''; + print ''.$langs->trans("Comment").''; print ''; print ''; print '     '; @@ -2784,13 +2785,12 @@ if ($action == 'create') { print "
".$langs->trans("ErrorOccurredReviseAndRetry")."
"; print ''; } else { - $textinput_size = "50"; // Webservice url print ''.$langs->trans("WebServiceURL").''.dol_print_url($ws_url).''; //Remote User - print ''.$langs->trans("User").''; + print ''.$langs->trans("User").''; //Remote Password - print ''.$langs->trans("Password").''; + print ''.$langs->trans("Password").''; //Submit button print ''; print ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index bc9ab3cf2fd..b193048047a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2649,6 +2649,7 @@ if ($action == 'create') { $resteapayer = price2num($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT'); // Multicurrency + $multicurrency_resteapayer = 0; if (isModEnabled("multicurrency")) { $multicurrency_totalpaid = $object->getSommePaiement(1); $multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1); @@ -2694,6 +2695,7 @@ if ($action == 'create') { // Confirmation de la conversion de l'avoir en reduc if ($action == 'converttoreduc') { + $type_fac = ''; if ($object->type == FactureFournisseur::TYPE_STANDARD) { $type_fac = 'ExcessPaid'; } elseif ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) { diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index fb8426abc1b..c81272e6a55 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -161,7 +161,7 @@ if ($mode == 'setup' && $user->admin) { case "password": print ''; print ''.$langs->trans($key['varname']).''; - print ''; print ' '.($key['example'] != '' ? $langs->trans("Example").' : '.$key['example'] : '').''; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 173c96fd297..0956d55097f 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2382,7 +2382,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; print ''; - print ''; + print ''; print ' '; print ''; } else { diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 6cbefc14185..fb97508c852 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -525,7 +525,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code print ''; print $langs->trans("CSSUrlForPaymentForm").''; -print ''; +print ''; print '   '.$langs->trans("Example").': http://mysite/mycss.css'; print '';