Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2024-09-29 15:23:50 +02:00
commit 9e897b9dc6
10 changed files with 48 additions and 51 deletions

View file

@ -8,6 +8,7 @@ aplhanothtml->alphanohtml
aploha->alpha
aplohanothtml->alphanohtml
aplphanothtml->alphanohtml
centpecent->centpercent
choosed->chosen
cumuled->cumulative
dokument->document

View file

@ -1220,7 +1220,7 @@ class BlockedLog
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$fingerprint = dol_hash(print_r($mysoc, true).getRandomPassword(1), '5');
$fingerprint = dol_hash(print_r($mysoc, true).getRandomPassword(true), '5');
dolibarr_set_const($db, 'BLOCKEDLOG_ENTITY_FINGERPRINT', $fingerprint, 'chaine', 0, 'Numeric Unique Fingerprint', $conf->entity);

View file

@ -816,7 +816,7 @@ if ($type == Categorie::TYPE_MEMBER) {
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print_barre_liste($langs->trans("Member"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
print '<table class="noborder centpecent">'."\n";
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Name").'</td></tr>'."\n";
if (count($members) > 0) {
@ -1000,7 +1000,7 @@ if ($type == Categorie::TYPE_ACCOUNT) {
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print_barre_liste($langs->trans("Account"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit);
print '<table class="noborder centpecent">'."\n";
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";
if (count($accounts) > 0) {
@ -1090,7 +1090,7 @@ if ($type == Categorie::TYPE_PROJECT) {
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print_barre_liste($langs->trans("Project"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'project', 0, $newcardbutton, '', $limit);
print '<table class="noborder centpecent">'."\n";
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";
if (count($objects) > 0) {
@ -1179,7 +1179,7 @@ if ($type == Categorie::TYPE_USER) {
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print_barre_liste($langs->trans("Users"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'user', 0, '', '', $limit);
print '<table class="noborder centpecent">'."\n";
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Users").' <span class="badge">'.$num.'</span></td></tr>'."\n";
if (count($users) > 0) {
@ -1245,7 +1245,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) {
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print_barre_liste($langs->trans("Warehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, $newcardbutton, '', $limit);
print '<table class="noborder centpecent">'."\n";
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";
if (count($objects) > 0) {

View file

@ -2714,7 +2714,7 @@ if ($action == 'create') {
// Payment term
print '<tr><td>';
print '<table class="nobordernopadding centpecent"><tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('PaymentConditionsShort');
print '</td>';
if ($action != 'editconditions' && $usercancreate && $caneditfield) {

View file

@ -4653,17 +4653,17 @@ class Form
* Return list of payment methods
* Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.
*
* @param string $selected Id or code or preselected payment mode
* @param string $htmlname Name of select field
* @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
* @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code
* @param int $empty 1=can be empty, 0 otherwise
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
* @param int $maxlength Max length of label
* @param int $active Active or not, -1 = all
* @param string $morecss Add more CSS on select tag
* @param int $nooutput 1=Return string, do not send to output
* @return string|void String for the HTML select component
* @param string $selected Id or code or preselected payment mode
* @param string $htmlname Name of select field
* @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
* @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code
* @param int $empty 1=can be empty, 0 otherwise
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
* @param int $maxlength Max length of label
* @param int $active Active or not, -1 = all
* @param string $morecss Add more CSS on select tag
* @param int<0,1> $nooutput 1=Return string, do not send to output
* @return string|void String for the HTML select component
*/
public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '', $nooutput = 0)
{
@ -5120,7 +5120,7 @@ class Form
* @param string $moreattrib To add more attribute on select
* @param int $showcurrency Show currency in label
* @param string $morecss More CSS
* @param int $nooutput 1=Return string, do not send to output
* @param int<0,1> $nooutput 1=Return string, do not send to output
* @return int|string If noouput=0: Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...), If nooutput=1: Return a HTML select string.
*/
public function select_comptes($selected = '', $htmlname = 'accountid', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '', $nooutput = 0)
@ -5882,7 +5882,7 @@ class Form
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely except $selected,2=Disable)
* @param int $maxlength Max length
* @param int $forcefocus Force focus on field (works with javascript only)
* @param int $nooutput No print is done. String is returned.
* @param int<0,1> $nooutput No print is done. String is returned.
* @param string $textifnoproject Text to show if no project
* @param string $morecss More CSS
* @return string Return html content
@ -5940,7 +5940,7 @@ class Form
* @param int $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters)
* 0 : use default deposit percentage from entry
* > 0 : force deposit percentage (for example, from company object)
* @param int $nooutput No print is done. String is returned.
* @param int<0,1> $nooutput No print is done. String is returned.
* @return string HTML output or ''
*/
public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1, $nooutput = 0)
@ -6065,7 +6065,7 @@ class Form
* @param string $htmlname Html name of date input fields or 'none'
* @param int $displayhour Display hour selector
* @param int $displaymin Display minutes selector
* @param int $nooutput 1=No print output, return string
* @param int<0,1> $nooutput 1=No print output, return string
* @param string $type 'direct-debit' or 'bank-transfer'
* @return string
* @see selectDate()
@ -6154,7 +6154,7 @@ class Form
* @param int $active Active or not, -1 = all
* @param int $addempty 1=Add empty entry
* @param string $type Type ('direct-debit' or 'bank-transfer')
* @param int $nooutput 1=Return string, no output
* @param int<0,1> $nooutput 1=Return string, no output
* @return string HTML output or ''
*/
public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0, $type = '', $nooutput = 0)
@ -6446,7 +6446,7 @@ class Form
* @param int<0,1> $showtype Show third party type in combolist (customer, prospect or supplier)
* @param int<0,1> $forcecombo Force to use combo box
* @param array<array{method:string,url:string,htmlname:string,params:array<string,string>}> $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param int $nooutput No print output. Return it only.
* @param int<0,1> $nooutput No print output. Return it only.
* @param int[] $excludeids Exclude IDs from the select combo
* @param string $textifnothirdparty Text to show if no thirdparty
* @return string HTML output or ''
@ -6948,7 +6948,7 @@ class Form
* @param string $form_name Not used
* @param int $d 1=Show days, month, years
* @param int $addnowlink Add a link "Now"
* @param int $nooutput Do not output html string but return it
* @param int<0,1> $nooutput Do not output html string but return it
* @param int $disabled Disable input fields
* @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
* @param string $addplusone Add a link "+1 hour". Value must be name of another select_date field.
@ -7508,7 +7508,7 @@ class Form
* If 'text' input hour is in text and input min is a text,
* If 'textselect' input hour is in text and input min is a combo
* @param integer $minunderhours If 1, show minutes selection under the hours
* @param int $nooutput Do not output html string but return it
* @param int<0,1> $nooutput Do not output html string but return it
* @return string HTML component
*/
public function select_duration($prefix, $iSecond = '', $disabled = 0, $typehour = 'select', $minunderhours = 0, $nooutput = 0)
@ -9536,8 +9536,8 @@ class Form
* @param CommonObject $object Object we want to show links to
* @param string[] $restrictlinksto Restrict links to some elements, for example array('order') or array('supplier_order'). null or array() if no restriction.
* @param string[] $excludelinksto Do not show links of this type, for example array('order') or array('supplier_order'). null or array() if no exclusion.
* @param int $nooutput 1=Return array with content instead of printing it.
* @return string|array HTML block or array with htmlblock (depending on $nooutput value)
* @param int<0,1> $nooutput 1=Return array with content instead of printing it.
* @return array{linktoelem:string,htmltoenteralink:string}|string HTML block
*/
public function showLinkToObjectBlock($object, $restrictlinksto = array(), $excludelinksto = array(), $nooutput = 0)
{
@ -9766,18 +9766,18 @@ class Form
if ($linktoelemlist) {
$linktoelem = '
<dl class="dropdown" id="linktoobjectname">
';
<dl class="dropdown" id="linktoobjectname">
';
if (!empty($conf->use_javascript_ajax)) {
$linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>';
}
$linktoelem .= '<dd>
<div class="multiselectlinkto">
<ul class="ulselectedfields">' . $linktoelemlist . '
</ul>
</div>
</dd>
</dl>';
<div class="multiselectlinkto">
<ul class="ulselectedfields">' . $linktoelemlist . '
</ul>
</div>
</dd>
</dl>';
} else {
$linktoelem = '';
}
@ -9792,7 +9792,7 @@ class Form
});
});
</script>
';
';
}
if ($nooutput) {

View file

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2021 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2021 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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,15 +126,13 @@ function show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass)
* @param array<'count'|int|string,int|string|array> $result Array to show. This array is already encoded into charset_output
* @param int $level Level
* @param int $count Count
* @param string $var Var
* @param bool $var Var deprecated (replaced by css oddeven)
* @param int<0,1> $hide Hide
* @param int $subcount Subcount
* @return int
*/
function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount = 0)
{
global $bc, $conf;
$count--;
if ($count == 0) {
return -1; // To stop loop

View file

@ -274,7 +274,7 @@ print '<td width="80">&nbsp;</td></tr>'."\n";
print '<tr class="oddeven">';
print '<td width="80%">'.$langs->trans("ManageOpportunitiesStatus").'</td>';
print '<td width="60" class="right">';
print ajax_constantonoff("PROJECT_USE_OPPORTUNITIES", null, null, 0, 0, 1);
print ajax_constantonoff("PROJECT_USE_OPPORTUNITIES", array(), null, 0, 0, 1);
print '</td><td class="right">';
print "</td>";
print '</tr>';

View file

@ -6,7 +6,7 @@
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
*
* 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
@ -176,7 +176,7 @@ if ($socid) {
print dol_get_fiche_end();
print '<br>';
$params = '';
$params = array();
$backtopage = $_SERVER['PHP_SELF'].'?socid='.$object->id;
$newcardbutton = dolGetButtonTitle($langs->trans("NewProject"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&backtopageforcancel='.urlencode($backtopage), '', 1, $params);

View file

@ -593,7 +593,7 @@ print '</td></tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("SecurityTokenIsUnique").'</td><td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('PAYMENT_SECURITY_TOKEN_UNIQUE', null, null, 0, 0, 1);
print ajax_constantonoff('PAYMENT_SECURITY_TOKEN_UNIQUE', array(), null, 0, 0, 1);
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("PAYMENT_SECURITY_TOKEN_UNIQUE", $arrval, $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE);

View file

@ -70,7 +70,7 @@ parameters:
- '#\$httpStatusCode of class Luracast\\Restler\\RestException constructor expects string, int given.#'
- '#(?:(?:s(?:(?:et_error_handl|pl_autoload_regist)er)|array_filter)) expects \(callable#'
- '# (dol_print_date|correctExifImageOrientation) expects bool\|string#'
- '# (getRandomPassword|vatrate|DolEditor constructor) expects bool, int#'
- '# (vatrate|DolEditor constructor) expects bool, int#'
- '# SMTPs::(getFrom|getErrorsTo|getReplyTo)\(\) expects bool, string given.#'
- '# (dolibarr_set_const|getLocalTaxesFromRate) expects int\|string#'
- '#::(options)\(\) expects int\|string#'
@ -94,15 +94,12 @@ parameters:
- '#::HTML2OpenIDServer\(\) expects string, array given.#'
- '#create_line\(\) expects string, float given.#'
- '# dol_stringtotime expects string, DateTime given.#'
- '# show_ldap_content expects string, true given.#'
- '#expects string, bool\|mysqli_result\|resource given.#'
- '#( |::)((multi)?selectarray)\(\) expects array#'
- '# (reWriteAllMenus|check_authentication) expects array#'
- '#::(_validateMyObject|select_company)\(\) expects array<string#'
- '# dolGetButtonTitle expects array<string#'
- '# getNav expects array#'
- '# getCommonSubstitutionArray expects array#'
- '# ajax_constantonoff expects array, null given.#'
- '# ldap_search expects array\|LDAP#'
- '# ajax_combobox expects array#'
- '# Context::setError\(\) expects array, string#'