diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index f7210c92b8d..be0a4d597ba 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -68,7 +68,7 @@ return [ 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeArraySuspiciousNull'], 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanParamSignatureMismatch', 'PhanParamSuspiciousOrder'], 'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanParamSignatureMismatch'], - 'htdocs/core/triggers/interface_80_modStripe_Stripe.class.php' => ['PhanTypeMismatchPropertyProbablyReal'], + 'htdocs/core/triggers/interface_80_modStripe_Stripe.class.php' => ['PhanDeprecatedFunction', 'PhanTypeMismatchPropertyProbablyReal'], 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/intracommreport/list.php' => ['PhanAccessPropertyStaticAsNonStatic'], @@ -79,8 +79,9 @@ return [ 'htdocs/public/opensurvey/index.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/public/payment/paymentok.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/public/recruitment/index.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/societe/paymentmodes.php' => ['PhanTypeMismatchPropertyProbablyReal'], + 'htdocs/societe/paymentmodes.php' => ['PhanDeprecatedFunction', 'PhanTypeMismatchPropertyProbablyReal'], 'htdocs/societe/class/companybankaccount.class.php' => ['PhanParamSignatureMismatch'], + 'htdocs/stripe/admin/stripe.php' => ['PhanDeprecatedFunction'], 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/takepos/invoice.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/user/class/user.class.php' => ['PhanParamSignatureMismatch'], diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 1c4297caad8..50787253740 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -408,7 +408,7 @@ return [ 'suppress_issue_types' => [ // Dolibarr uses a lot of internal deprecated stuff, not reporting 'PhanDeprecatedProperty', - 'PhanDeprecatedFunction', + // 'PhanDeprecatedFunction', //'PhanCompatibleNegativeStringOffset', // 'PhanPluginDuplicateExpressionAssignment', // Nulls are likely mostly false positives diff --git a/htdocs/adherents/vcard.php b/htdocs/adherents/vcard.php index cd39e578045..56f82a7665d 100644 --- a/htdocs/adherents/vcard.php +++ b/htdocs/adherents/vcard.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2020-2021 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,6 +99,7 @@ $v->setPhoneNumber($object->fax, "TYPE=WORK;FAX"); $country = $object->country_code ? $object->country : ''; $v->setAddress("", "", $object->address, $object->town, $object->state, $object->zip, $country, "TYPE=WORK;POSTAL"); +// @phan-suppress-next-line PhanDeprecatedFunction (setLabel is the old method, new is setAddress) $v->setLabel("", "", $object->address, $object->town, $object->state, $object->zip, $country, "TYPE=WORK"); $v->setEmail($object->email); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index b03fe2ae009..8f89a1bb336 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2424,7 +2424,7 @@ class Commande extends CommonOrder /** * Applique une remise relative * - * @deprecated + * @deprecated Use setDiscount() instead. * @see setDiscount() * @param User $user User qui positionne la remise * @param float $remise Discount (percent) @@ -2435,6 +2435,7 @@ class Commande extends CommonOrder { // phpcs:enable dol_syslog(get_class($this)."::set_remise is deprecated, use setDiscount instead", LOG_NOTICE); + // @phan-suppress-next-line PhanDeprecatedFunction return $this->setDiscount($user, $remise, $notrigger); } diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 2adbd25a7d0..2046845b8db 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -12,6 +12,7 @@ * Copyright (C) 2016-2021 Ferran Marcet * Copyright (C) 2018-2023 Charlene Benke * Copyright (C) 2021-2023 Anthony Berton + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1107,7 +1108,7 @@ if ($resql) { // Payment term if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) { print ''; - $form->select_conditions_paiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1); + print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1); print ''; } // Payment mode diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index c161836279c..9b3e6733698 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4414,6 +4414,7 @@ class Facture extends CommonInvoice { // phpcs:enable dol_syslog(get_class($this)."::set_remise is deprecated, use setDiscount instead", LOG_NOTICE); + // @phan-suppress-next-line PhanDeprecatedFunction return $this->setDiscount($user, $remise, $notrigger); } diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index a8434eff2d9..08e8e248d7e 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,6 +68,7 @@ $v->setPhoneNumber($contact->fax, "TYPE=WORK;FAX"); $country = $contact->country_code ? $contact->country : ''; $v->setAddress("", "", $contact->address, $contact->town, $contact->state, $contact->zip, $country, "TYPE=WORK;POSTAL"); +// @phan-suppress-next-line PhanDeprecatedFunction setLabel applies the old method, setAddress is the new method. $v->setLabel("", "", $contact->address, $contact->town, $contact->state, $contact->zip, $country, "TYPE=WORK"); $v->setEmail($contact->email); diff --git a/htdocs/contrat/ticket.php b/htdocs/contrat/ticket.php index 7c7cce00982..a4b37e28f71 100644 --- a/htdocs/contrat/ticket.php +++ b/htdocs/contrat/ticket.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2012-2023 Charlene BENKE + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,10 +38,10 @@ require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; $langs->loadLangs(array('companies', 'contracts', 'tickets')); -$socid=GETPOSTINT('socid'); -$id=GETPOSTINT('id'); -$ref=GETPOST('ref', 'alpha'); -$action=GETPOST('action', 'alpha'); +$socid = GETPOSTINT('socid'); +$id = GETPOSTINT('id'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'alpha'); if ($id == '' && $ref == '') { dol_print_error(null, 'Bad parameter'); @@ -48,12 +49,12 @@ if ($id == '' && $ref == '') { } // Security check -$socid=0; +$socid = 0; if ($user->socid > 0) { - $socid=$user->socid; + $socid = $user->socid; } -$result=restrictedArea($user, 'contrat', $id); +$result = restrictedArea($user, 'contrat', $id); /* @@ -63,25 +64,25 @@ $result=restrictedArea($user, 'contrat', $id); llxHeader("", $langs->trans("Tickets"), "Contrat"); $form = new Form($db); -$userstatic=new User($db); +$userstatic = new User($db); -$object= new Contrat($db); -$result=$object->fetch($id, $ref); -$ret=$object->fetch_thirdparty(); +$object = new Contrat($db); +$result = $object->fetch($id, $ref); +$ret = $object->fetch_thirdparty(); $head = contract_prepare_head($object); -dol_fiche_head($head, 'ticket', $langs->trans("Contract"), -1, 'contract'); +dol_get_fiche_head($head, 'ticket', $langs->trans("Contract"), -1, 'contract'); $linkback = ''; -$linkback.= $langs->trans("BackToList").''; +$linkback .= $langs->trans("BackToList").''; -$morehtmlref=''; -$morehtmlref.=$object->ref; +$morehtmlref = ''; +$morehtmlref .= $object->ref; -$morehtmlref.='
'; +$morehtmlref .= '
'; // Ref customer -$morehtmlref.=$form->editfieldkey( +$morehtmlref .= $form->editfieldkey( "RefCustomer", 'ref_customer', $object->ref_customer, @@ -92,7 +93,7 @@ $morehtmlref.=$form->editfieldkey( 0, 1 ); -$morehtmlref.=$form->editfieldval( +$morehtmlref .= $form->editfieldval( "RefCustomer", 'ref_customer', $object->ref_customer, @@ -106,8 +107,8 @@ $morehtmlref.=$form->editfieldval( 1 ); // Ref supplier -$morehtmlref.='
'; -$morehtmlref.=$form->editfieldkey( +$morehtmlref .= '
'; +$morehtmlref .= $form->editfieldkey( "RefSupplier", 'ref_supplier', $object->ref_supplier, @@ -118,7 +119,7 @@ $morehtmlref.=$form->editfieldkey( 0, 1 ); -$morehtmlref.=$form->editfieldval( +$morehtmlref .= $form->editfieldval( "RefSupplier", 'ref_supplier', $object->ref_supplier, @@ -132,25 +133,25 @@ $morehtmlref.=$form->editfieldval( 1 ); // Thirdparty -$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); +$morehtmlref .= '
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' : '; + $morehtmlref .= '
'.$langs->trans('Project') . ' : '; if (! empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; + $morehtmlref .= ''; + $morehtmlref .= $proj->ref; + $morehtmlref .= ''; } else { - $morehtmlref.=''; + $morehtmlref .= ''; } } -$morehtmlref.='
'; +$morehtmlref .= '
'; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'none', $morehtmlref); @@ -161,7 +162,7 @@ print '
'; * Referrers types */ -$title=$langs->trans("ListTicketsLinkToContract"); +$title = $langs->trans("ListTicketsLinkToContract"); print ''; print ''; diff --git a/htdocs/core/class/commonnumrefgenerator.class.php b/htdocs/core/class/commonnumrefgenerator.class.php index 60104d09cd7..264a5417771 100644 --- a/htdocs/core/class/commonnumrefgenerator.class.php +++ b/htdocs/core/class/commonnumrefgenerator.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,7 +89,7 @@ abstract class CommonNumRefGenerator * * @param Translate $langs Object langs * @return string Model name - * @deprecated + * @deprecated Use getName() instead * @see getName() */ public function getNom($langs) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a02c5eafa31..11b660adc40 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4321,7 +4321,7 @@ class Form * > 0 : force deposit percentage (for example, from company object) * @param int $noprint if set to one we return the html to print, if 0 (default) we print it * @return void|string - * @deprecated + * @deprecated Use getSelectConditionsPaiements() instead and handle noprint locally. */ public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1, $noprint = 0) { diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 999603adf8a..f74ee4d124d 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -154,15 +155,15 @@ class FormSetup return $hookmanager->resPrint; } else { $out = ''; - $out.= $this->htmlBeforeOutputForm; + $out .= $this->htmlBeforeOutputForm; if ($editMode) { - $out.= '
formAttributes) . ' >'; + $out .= 'formAttributes) . ' >'; // generate hidden values from $this->formHiddenInputs if (!empty($this->formHiddenInputs) && is_array($this->formHiddenInputs)) { foreach ($this->formHiddenInputs as $hiddenKey => $hiddenValue) { - $out.= ''; + $out .= ''; } } } @@ -180,7 +181,7 @@ class FormSetup return $hookmanager->resPrint; } elseif ($editMode) { $out .= '
'; // Todo : remove .center by adding style to form-setup-button-container css class in all themes - $out.= $this->htmlOutputMoreButton; + $out .= $this->htmlOutputMoreButton; $out .= ''; // Todo fix dolibarr style for
'; + $out .= ''; - $out.= ''; + $out .= ''; - $out.= ''; - $out.= ''; + $out .= ''; + $out .= ''; } return $out; @@ -393,6 +394,7 @@ class FormSetup $item = new FormSetupItem($confKey); // need to be ignored from scrutinizer setTypeFromTypeString was created as deprecated to incite developer to use object oriented usage + // @phan-suppress-next-line PhanDeprecatedFunction /** @scrutinizer ignore-deprecated */ $item->setTypeFromTypeString($params['type']); if (!empty($params['enabled'])) { @@ -831,7 +833,9 @@ class FormSetupItem $out = (($this->langs->trans($this->confKey) != $this->confKey) ? $this->langs->trans($this->confKey) : $this->langs->trans('MissingTranslationForConfKey', $this->confKey)); // if conf defined on entity 0, prepend a picto to indicate it will apply across all entities - if (isModEnabled('multicompany') && $this->entity == 0) $out = img_picto($this->langs->trans('AllEntities'), 'fa-globe-americas em088 opacityhigh') . ' ' . $out; + if (isModEnabled('multicompany') && $this->entity == 0) { + $out = img_picto($this->langs->trans('AllEntities'), 'fa-globe-americas em088 opacityhigh') . ' ' . $out; + } return $out; } @@ -866,51 +870,51 @@ class FormSetupItem $out = ''; if ($this->type == 'title') { - $out.= $this->generateOutputField(); // title have no input + $out .= $this->generateOutputField(); // title have no input } elseif ($this->type == 'multiselect') { - $out.= $this->generateInputFieldMultiSelect(); + $out .= $this->generateInputFieldMultiSelect(); } elseif ($this->type == 'select') { - $out.= $this->generateInputFieldSelect(); + $out .= $this->generateInputFieldSelect(); } elseif ($this->type == 'selectUser') { - $out.= $this->generateInputFieldSelectUser(); + $out .= $this->generateInputFieldSelectUser(); } elseif ($this->type == 'textarea') { - $out.= $this->generateInputFieldTextarea(); - } elseif ($this->type== 'html') { - $out.= $this->generateInputFieldHtml(); - } elseif ($this->type== 'color') { - $out.= $this->generateInputFieldColor(); + $out .= $this->generateInputFieldTextarea(); + } elseif ($this->type == 'html') { + $out .= $this->generateInputFieldHtml(); + } elseif ($this->type == 'color') { + $out .= $this->generateInputFieldColor(); } elseif ($this->type == 'yesno') { if (!empty($conf->use_javascript_ajax)) { - $out.= ajax_constantonoff($this->confKey); + $out .= ajax_constantonoff($this->confKey); } else { - $out.= $this->form->selectyesno($this->confKey, $this->fieldValue, 1); + $out .= $this->form->selectyesno($this->confKey, $this->fieldValue, 1); } } elseif (preg_match('/emailtemplate:/', $this->type)) { - $out.= $this->generateInputFieldEmailTemplate(); + $out .= $this->generateInputFieldEmailTemplate(); } elseif (preg_match('/category:/', $this->type)) { - $out.=$this->generateInputFieldCategories(); + $out .= $this->generateInputFieldCategories(); } elseif (preg_match('/thirdparty_type/', $this->type)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $formcompany = new FormCompany($this->db); - $out.= $formcompany->selectProspectCustomerType($this->fieldValue, $this->confKey); + $out .= $formcompany->selectProspectCustomerType($this->fieldValue, $this->confKey); } elseif ($this->type == 'securekey') { - $out.= $this->generateInputFieldSecureKey(); + $out .= $this->generateInputFieldSecureKey(); } elseif ($this->type == 'product') { if (isModEnabled("product") || isModEnabled("service")) { $selected = (empty($this->fieldValue) ? '' : $this->fieldValue); - $out.= $this->form->select_produits($selected, $this->confKey, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, $this->cssClass, 0, '', null, 1); + $out .= $this->form->select_produits($selected, $this->confKey, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, $this->cssClass, 0, '', null, 1); } } elseif ($this->type == 'selectBankAccount') { if (isModEnabled("bank")) { $selected = (empty($this->fieldValue) ? '' : $this->fieldValue); - $out.= $this->form->select_comptes($selected, $this->confKey, 0, '', 0, '', 0, '', 1); + $out .= $this->form->select_comptes($selected, $this->confKey, 0, '', 0, '', 0, '', 1); } } elseif ($this->type == 'password') { - $out.= $this->generateInputFieldPassword('dolibarr'); + $out .= $this->generateInputFieldPassword('dolibarr'); } elseif ($this->type == 'genericpassword') { - $out.= $this->generateInputFieldPassword('generic'); + $out .= $this->generateInputFieldPassword('generic'); } else { - $out.= $this->generateInputFieldText(); + $out .= $this->generateInputFieldText(); } return $out; @@ -937,8 +941,8 @@ class FormSetupItem public function generateInputFieldTextarea() { $out = '\n"; + $out .= dol_htmlentities($this->fieldValue); + $out .= "\n"; return $out; } @@ -1021,7 +1025,7 @@ class FormSetupItem global $conf; $out = ''; if (!empty($conf->use_javascript_ajax)) { - $out.= ' '.img_picto($this->langs->trans('Generate'), 'refresh', 'id="generate_token'.$this->confKey.'" class="linkobject"'); + $out .= ' '.img_picto($this->langs->trans('Generate'), 'refresh', 'id="generate_token'.$this->confKey.'" class="linkobject"'); } // Add button to autosuggest a key @@ -1167,25 +1171,25 @@ class FormSetupItem if ($this->type == 'title') { // nothing to do } elseif ($this->type == 'textarea') { - $out.= dol_nl2br($this->fieldValue); + $out .= dol_nl2br($this->fieldValue); } elseif ($this->type == 'multiselect') { - $out.= $this->generateOutputFieldMultiSelect(); + $out .= $this->generateOutputFieldMultiSelect(); } elseif ($this->type == 'select') { - $out.= $this->generateOutputFieldSelect(); + $out .= $this->generateOutputFieldSelect(); } elseif ($this->type == 'selectUser') { - $out.= $this->generateOutputFieldSelectUser(); + $out .= $this->generateOutputFieldSelectUser(); } elseif ($this->type == 'html') { - $out.= $this->fieldValue; + $out .= $this->fieldValue; } elseif ($this->type == 'color') { - $out.= $this->generateOutputFieldColor(); + $out .= $this->generateOutputFieldColor(); } elseif ($this->type == 'yesno') { if (!empty($conf->use_javascript_ajax)) { - $out.= ajax_constantonoff($this->confKey); + $out .= ajax_constantonoff($this->confKey); } else { if ($this->fieldValue == 1) { - $out.= $langs->trans('yes'); + $out .= $langs->trans('yes'); } else { - $out.= $langs->trans('no'); + $out .= $langs->trans('no'); } } } elseif (preg_match('/emailtemplate:/', $this->type)) { @@ -1199,7 +1203,7 @@ class FormSetupItem if (is_numeric($template) && $template < 0) { $this->setErrors($formmail->errors); } - $out.= $this->langs->trans($template->label); + $out .= $this->langs->trans($template->label); } } elseif (preg_match('/category:/', $this->type)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; @@ -1213,16 +1217,16 @@ class FormSetupItem foreach ($ways as $way) { $toprint[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '
  • '; } - $out.='
      ' . implode(' ', $toprint) . '
    '; + $out .= '
      ' . implode(' ', $toprint) . '
    '; } elseif (preg_match('/thirdparty_type/', $this->type)) { - if ($this->fieldValue==2) { - $out.= $this->langs->trans("Prospect"); - } elseif ($this->fieldValue==3) { - $out.= $this->langs->trans("ProspectCustomer"); - } elseif ($this->fieldValue==1) { - $out.= $this->langs->trans("Customer"); - } elseif ($this->fieldValue==0) { - $out.= $this->langs->trans("NorProspectNorCustomer"); + if ($this->fieldValue == 2) { + $out .= $this->langs->trans("Prospect"); + } elseif ($this->fieldValue == 3) { + $out .= $this->langs->trans("ProspectCustomer"); + } elseif ($this->fieldValue == 1) { + $out .= $this->langs->trans("Customer"); + } elseif ($this->fieldValue == 0) { + $out .= $this->langs->trans("NorProspectNorCustomer"); } } elseif ($this->type == 'product') { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -1230,7 +1234,7 @@ class FormSetupItem $product = new Product($this->db); $resprod = $product->fetch($this->fieldValue); if ($resprod > 0) { - $out.= $product->ref; + $out .= $product->ref; } elseif ($resprod < 0) { $this->setErrors($product->errors); } @@ -1240,14 +1244,14 @@ class FormSetupItem $bankaccount = new Account($this->db); $resbank = $bankaccount->fetch($this->fieldValue); if ($resbank > 0) { - $out.= $bankaccount->label; + $out .= $bankaccount->label; } elseif ($resbank < 0) { $this->setErrors($bankaccount->errors); } } elseif ($this->type == 'password' || $this->type == 'genericpassword') { - $out.= str_repeat('*', strlen($this->fieldValue)); + $out .= str_repeat('*', strlen($this->fieldValue)); } else { - $out.= $this->fieldValue; + $out .= $this->fieldValue; } return $out; @@ -1270,7 +1274,7 @@ class FormSetupItem if (!empty($TSelected)) { foreach ($TSelected as $selected) { if (!empty($this->fieldOptions[$selected])) { - $outPut.= dolGetBadge('', $this->fieldOptions[$selected], 'info').' '; + $outPut .= dolGetBadge('', $this->fieldOptions[$selected], 'info').' '; } } } @@ -1285,7 +1289,7 @@ class FormSetupItem public function generateOutputFieldColor() { global $langs; - $this->fieldAttr['disabled']=null; + $this->fieldAttr['disabled'] = null; $color = colorArrayToHex(colorStringToArray($this->fieldValue, array()), ''); if ($color) { return ''; @@ -1299,7 +1303,7 @@ class FormSetupItem */ public function generateInputFieldColor() { - $this->fieldAttr['type']= 'color'; + $this->fieldAttr['type'] = 'color'; $default = $this->defaultFieldValue; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $formother = new FormOther($this->db); diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php index 7a283f5189f..d77658802bc 100644 --- a/htdocs/core/modules/barcode/modules_barcode.class.php +++ b/htdocs/core/modules/barcode/modules_barcode.class.php @@ -90,7 +90,7 @@ abstract class ModeleNumRefBarCode extends CommonNumRefGenerator $s .= $langs->trans("Name").': '.$this->name.'
    '; $s .= $langs->trans("Version").': '.$this->getVersion().'
    '; if ($type != -1) { - $s .= $langs->trans("ValidityControledByModule").': '.$this->getNom($langs).'
    '; + $s .= $langs->trans("ValidityControledByModule").': '.$this->getName($langs).'
    '; } $s .= '
    '; $s .= ''.$langs->trans("ThisIsModuleRules").':
    '; diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index cfe79891429..bf0959be743 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -125,7 +126,7 @@ abstract class ModeleProductCode extends CommonNumRefGenerator } $s = ''; if ($type == -1) { - $s .= $langs->trans("Name").': '.$this->getNom($langs).'
    '; + $s .= $langs->trans("Name").': '.$this->getName($langs).'
    '; $s .= $langs->trans("Version").': '.$this->getVersion().'
    '; } elseif ($type == 0) { $s .= $langs->trans("ProductCodeDesc").'
    '; @@ -133,7 +134,7 @@ abstract class ModeleProductCode extends CommonNumRefGenerator $s .= $langs->trans("ServiceCodeDesc").'
    '; } if ($type != -1) { - $s .= $langs->trans("ValidityControledByModule").': '.$this->getNom($langs).'
    '; + $s .= $langs->trans("ValidityControledByModule").': '.$this->getName($langs).'
    '; } $s .= '
    '; $s .= ''.$langs->trans("ThisIsModuleRules").':
    '; diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index 8cc1ddd8082..4e1bd2e5865 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -136,14 +136,14 @@ abstract class ModeleThirdPartyCode extends CommonNumRefGenerator $s = ''; if ($type == -1) { - $s .= $langs->trans("Name").': '.$this->getNom($langs).'
    '; + $s .= $langs->trans("Name").': '.$this->getName($langs).'
    '; } elseif ($type == 0) { $s .= $langs->trans("CustomerCodeDesc").'
    '; } elseif ($type == 1) { $s .= $langs->trans("SupplierCodeDesc").'
    '; } if ($type != -1) { - $s .= $langs->trans("ValidityControledByModule").': '.$this->getNom($langs).'
    '; + $s .= $langs->trans("ValidityControledByModule").': '.$this->getName($langs).'
    '; } $s .= '
    '; $s .= ''.$langs->trans("ThisIsModuleRules").':
    '; diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php index ad1b7cb1290..5efb5016c6c 100644 --- a/htdocs/dav/fileserver.php +++ b/htdocs/dav/fileserver.php @@ -247,7 +247,7 @@ $server->addPlugin($tempFF); */ // And off we go! -$server->exec(); +$server->start(); if (is_object($db)) { $db->close();
    '; - $out.= ''; - $out.= $this->form->textwithpicto($item->getNameText(), $item->getHelpText(), 1, 'info', '', 0, 3, 'tootips'.$item->confKey); - $out.= ''; - $out.= ''; + $out .= ''; + $out .= $this->form->textwithpicto($item->getNameText(), $item->getHelpText(), 1, 'info', '', 0, 3, 'tootips'.$item->confKey); + $out .= ''; + $out .= ''; + $out .= ''; if ($editMode) { - $out.= $item->generateInputField(); + $out .= $item->generateInputField(); } else { - $out.= $item->generateOutputField(); + $out .= $item->generateOutputField(); } if (!empty($item->errors)) { @@ -339,8 +340,8 @@ class FormSetup setEventMessages(null, $item->errors, 'errors'); } - $out.= '