Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Nov 28, 2024
2 parents 16cbc51 + d823f32 commit ee96925
Show file tree
Hide file tree
Showing 21 changed files with 131 additions and 310 deletions.
200 changes: 1 addition & 199 deletions build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,6 @@ parameters:
count: 4
path: ../../htdocs/accountancy/class/accountancycategory.class.php

-
message: '#^Property AccountancyCategory\:\:\$sdcpermonth type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../../htdocs/accountancy/class/accountancycategory.class.php

-
message: '#^Property AccountancyCategory\:\:\$sens \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
Expand Down Expand Up @@ -1488,18 +1482,6 @@ parameters:
count: 1
path: ../../htdocs/admin/mails.php

-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 3
path: ../../htdocs/admin/mails.php

-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 3
path: ../../htdocs/admin/mails.php

-
message: '#^Variable \$text in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable
Expand Down Expand Up @@ -17382,24 +17364,6 @@ parameters:
count: 2
path: ../../htdocs/core/tpl/list_print_total.tpl.php

-
message: '#^Variable \$action might not be defined\.$#'
identifier: variable.undefined
count: 5
path: ../../htdocs/core/tpl/object_currency_amount.tpl.php

-
message: '#^Variable \$object might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../htdocs/core/tpl/object_currency_amount.tpl.php

-
message: '#^Variable \$usercancreate might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../htdocs/core/tpl/object_currency_amount.tpl.php

-
message: '#^Left side of && is always true\.$#'
identifier: booleanAnd.leftAlwaysTrue
Expand Down Expand Up @@ -25026,18 +24990,6 @@ parameters:
count: 2
path: ../../htdocs/modulebuilder/template/myobject_agenda.php

-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 1
path: ../../htdocs/modulebuilder/template/myobject_agenda.php

-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../htdocs/modulebuilder/template/myobject_agenda.php

-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
Expand All @@ -25059,19 +25011,7 @@ parameters:
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 3
path: ../../htdocs/modulebuilder/template/myobject_card.php

-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
count: 1
path: ../../htdocs/modulebuilder/template/myobject_card.php

-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
count: 2
path: ../../htdocs/modulebuilder/template/myobject_card.php

-
Expand Down Expand Up @@ -25104,30 +25044,6 @@ parameters:
count: 1
path: ../../htdocs/modulebuilder/template/myobject_card.php

-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 5
path: ../../htdocs/modulebuilder/template/myobject_card.php

-
message: '#^Variable \$permissiontoadd in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable
count: 1
path: ../../htdocs/modulebuilder/template/myobject_card.php

-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 1
path: ../../htdocs/modulebuilder/template/myobject_contact.php

-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../htdocs/modulebuilder/template/myobject_contact.php

-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
Expand All @@ -25146,24 +25062,6 @@ parameters:
count: 1
path: ../../htdocs/modulebuilder/template/myobject_contact.php

-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 2
path: ../../htdocs/modulebuilder/template/myobject_contact.php

-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 1
path: ../../htdocs/modulebuilder/template/myobject_document.php

-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../htdocs/modulebuilder/template/myobject_document.php

-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
Expand Down Expand Up @@ -25194,18 +25092,6 @@ parameters:
count: 1
path: ../../htdocs/modulebuilder/template/myobject_list.php

-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 1
path: ../../htdocs/modulebuilder/template/myobject_list.php

-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../htdocs/modulebuilder/template/myobject_list.php

-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
Expand All @@ -25224,24 +25110,6 @@ parameters:
count: 1
path: ../../htdocs/modulebuilder/template/myobject_list.php

-
message: '#^Variable \$permissiontodelete in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable
count: 1
path: ../../htdocs/modulebuilder/template/myobject_list.php

-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 1
path: ../../htdocs/modulebuilder/template/myobject_note.php

-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 1
path: ../../htdocs/modulebuilder/template/myobject_note.php

-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
Expand Down Expand Up @@ -32688,24 +32556,6 @@ parameters:
count: 1
path: ../../htdocs/societe/paymentmodes.php

-
message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
identifier: argument.type
count: 3
path: ../../htdocs/societe/paymentmodes.php

-
message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
identifier: argument.type
count: 3
path: ../../htdocs/societe/paymentmodes.php

-
message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\<mixed\>\|string given\.$#'
identifier: argument.type
count: 3
path: ../../htdocs/societe/paymentmodes.php

-
message: '#^Ternary operator condition is always true\.$#'
identifier: ternary.alwaysTrue
Expand Down Expand Up @@ -32748,12 +32598,6 @@ parameters:
count: 2
path: ../../htdocs/societe/price.php

-
message: '#^Variable \$extrafields might not be defined\.$#'
identifier: variable.undefined
count: 14
path: ../../htdocs/societe/price.php

-
message: '#^Variable \$prodcustprice might not be defined\.$#'
identifier: variable.undefined
Expand Down Expand Up @@ -34686,48 +34530,6 @@ parameters:
count: 2
path: ../../htdocs/variants/list.php

-
message: '#^Cannot access property \$lines on mixed\.$#'
identifier: property.nonObject
count: 1
path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php

-
message: '#^Variable \$action might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php

-
message: '#^Variable \$hookmanager might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php

-
message: '#^Variable \$langs might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php

-
message: '#^Variable \$action might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/variants/tpl/productattributevalueline_title.tpl.php

-
message: '#^Variable \$langs might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/variants/tpl/productattributevalueline_title.tpl.php

-
message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
Expand Down
4 changes: 2 additions & 2 deletions dev/setup/pre-commit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ CI also runs pre-commit to help maintain code quality.

Note:
Code for precommits are saved into:
.cache/pre-commit/repo*/pre_commit_hooks/php-*.sh
.cache/pre-commit/repo.../pre_commit_hooks/php-....sh
and
.cache/pre-commit/repo*/py_env-python3/lib/python*/site-packages/pre_commit_hooks/no_commit_to_branch.py
.cache/pre-commit/repo.../py_env-python3/lib/python.../site-packages/pre_commit_hooks/no_commit_to_branch.py
4 changes: 2 additions & 2 deletions htdocs/accountancy/class/accountancycategory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
Expand Down Expand Up @@ -129,7 +129,7 @@ class AccountancyCategory // extends CommonObject
public $sdc;

/**
* @var array Sum debit credit per month
* @var array<string,float> Sum debit credit per month
*/
public $sdcpermonth;

Expand Down
10 changes: 5 additions & 5 deletions htdocs/admin/mails.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

$usersignature = $user->signature;
// For action = test or send, we ensure that content is not html, even for signature, because for this we want a test with NO html.
if ($action == 'test' || ($action == 'send' && $trackid = 'test')) {
if ($action == 'test' || ($action == 'send' && $trackid == 'test')) {
$usersignature = dol_string_nohtmltag($usersignature, 2);
}

Expand Down Expand Up @@ -1003,7 +1003,7 @@ function change_smtp_auth_method() {

if (!getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) {
if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') != 'mail' || !$linuxlike) {
if (function_exists('fsockopen') && $port && $server) {
if (function_exists('fsockopen') /* && $port && $server */) { // $port and $server can't be empty
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect&token='.newToken().'&date='.dol_now().'#formmailaftertstconnect">'.$langs->trans("DoTestServerAvailability").'</a>';
}
} else {
Expand Down Expand Up @@ -1044,19 +1044,19 @@ function change_smtp_auth_method() {
// mthode php mail
if (getDolGlobalString('MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD')) { // Not defined by default. Depend on platform.
// List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com'
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPFDMARC");
$text .= /* ($text ? '<br><br>' : ''). */$langs->trans("WarningPHPMailSPFDMARC");
} else {
// MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
if (getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')) {
// List of IP shown as record to add in SPF if we use the mail method
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPFDMARC");
$text .= /* ($text ? '<br><br>' : ''). */$langs->trans("WarningPHPMailSPFDMARC");
}
}
} else {
// method smtps or swiftmail
if (getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD')) { // Should be required only if you have preset the Dolibarr to use your own SMTP and you want to warn users to update their domain name to match your SMTP server.
// List of string to add in SPF if we use the smtp method. Example 'include:spf.mydomain.com'
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD'));
$text .= /* ($text ? '<br><br>' : ''). */$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD'));
}
if (getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')) { // Not defined by default. Depend on platform.
// List of IP shown as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]'
Expand Down
9 changes: 0 additions & 9 deletions htdocs/compta/facture/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -4254,15 +4254,6 @@ function setRadioForTypeOfInvoice() {
* Show object in view mode
*/

$result = $object->fetch($id, $ref);
if ($result <= 0) {
dol_print_error($db, $object->error, $object->errors);
exit();
}

// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

if ($user->socid > 0 && $user->socid != $object->socid) {
accessforbidden('', 0, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/contact/perso.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

$result = $object->update_perso($id, $user);
if ($result > 0) {
$object->oldcopy = dol_clone($object, 2); // @phan-suppres-current-line PhanTypeMismatchProperty
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty

// Logo/Photo save
$dir = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos';
Expand Down
Loading

0 comments on commit ee96925

Please sign in to comment.