Skip to content

Commit

Permalink
Merge branch 'develop' into develop_new_ticket_files_links_in_actionc…
Browse files Browse the repository at this point in the history
…omm_public_access
  • Loading branch information
eldy authored Dec 24, 2024
2 parents 34029c0 + 89cddfa commit 79d9211
Show file tree
Hide file tree
Showing 73 changed files with 1,390 additions and 922 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Definition:

As the Developer:

1. Check you agree with the terms of the [DCO - Developer's Certificate of Origin](https://github.com/Dolibarr/dolibarr/DCO)
1. Check you agree with the terms of the [DCO - Developer's Certificate of Origin](https://github.com/Dolibarr/dolibarr/blob/develop/DCO)
2. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr).
3. Clone your fork.
4. Choose a branch(See the [Branches](#branches) section below).
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-18-autolabel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/changed-lines-count-labeler.yml
continue-on-error: true
continue-on-error: true
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
# git commit -a -m "My message" --no-verify
# (Recommendation: run git commit -a .. once, then with `--no-verify`)
- id: no-commit-to-branch
args: [--branch, develop, --pattern, \d+.0]
args: [--branch, develop, --pattern, \d+.0$]
# This checks that xml files are correct
- id: check-xml
exclude: |
Expand Down
126 changes: 18 additions & 108 deletions build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ parameters:
path: ../../htdocs/accountancy/class/accountingaccount.class.php

-
message: '#^Call to function array_key_exists\(\) with ''error'' and array\{ref\: mixed, label\: mixed, acquisition_value_ht\: mixed, depreciation\: non\-empty\-array\<int\|string, array\{date\: mixed, ref\: mixed, lines\: non\-empty\-array\<int\|string, mixed\>\}\>, disposal\?\: array\{date\: mixed, amount\: mixed, subject_to_vat\: bool\}\} will always evaluate to false\.$#'
message: '#^Call to function array_key_exists\(\) with ''error'' and array\{ref\: mixed, label\: mixed, acquisition_value_ht\: mixed, depreciation\: non\-empty\-array\<array\{date\: mixed, ref\: mixed, lines\: non\-empty\-array\<mixed\>\}\>, disposal\?\: array\{date\: mixed, amount\: mixed, subject_to_vat\: bool\}\} will always evaluate to false\.$#'
identifier: function.impossibleType
count: 1
path: ../../htdocs/accountancy/class/accountingjournal.class.php
Expand Down Expand Up @@ -625,7 +625,7 @@ parameters:
path: ../../htdocs/accountancy/class/lettering.class.php

-
message: '#^Parameter \#1 \$link_by_element of method Lettering\:\:getGroupElements\(\) expects array\<array\<string, int\>\>, array\<int\|string, array\<string, string\>\> given\.$#'
message: '#^Parameter \#1 \$link_by_element of method Lettering\:\:getGroupElements\(\) expects array\<array\<string, int\>\>, array\<array\<string, string\>\> given\.$#'
identifier: argument.type
count: 1
path: ../../htdocs/accountancy/class/lettering.class.php
Expand Down Expand Up @@ -894,10 +894,16 @@ parameters:
count: 1
path: ../../htdocs/adherents/card.php

-
message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/adherents/class/adherent.class.php

-
message: '#^Call to function is_array\(\) with array\<mixed\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 2
count: 1
path: ../../htdocs/adherents/class/adherent.class.php

-
Expand Down Expand Up @@ -3343,7 +3349,7 @@ parameters:
path: ../../htdocs/categories/class/categorie.class.php

-
message: '#^Method Categorie\:\:get_full_arbo\(\) should return \-1\|array\<int, array\{rowid\: int, id\: int, fk_parent\: int, label\: string, description\: string, color\: string, position\: string, visible\: int, \.\.\.\}\> but returns array\<int\|string, array\{rowid\: mixed, id\: mixed, fk_parent\: mixed, label\: mixed, description\: mixed, color\: mixed, position\: mixed, visible\: mixed, \.\.\.\}\>\.$#'
message: '#^Method Categorie\:\:get_full_arbo\(\) should return \-1\|array\<int, array\{rowid\: int, id\: int, fk_parent\: int, label\: string, description\: string, color\: string, position\: string, visible\: int, \.\.\.\}\> but returns array\<array\{rowid\: mixed, id\: mixed, fk_parent\: mixed, label\: mixed, description\: mixed, color\: mixed, position\: mixed, visible\: mixed, \.\.\.\}\>\.$#'
identifier: return.type
count: 1
path: ../../htdocs/categories/class/categorie.class.php
Expand All @@ -3361,7 +3367,7 @@ parameters:
path: ../../htdocs/categories/class/categorie.class.php

-
message: '#^Property Categorie\:\:\$cats \(array\<int, array\{rowid\: int, id\: int, fk_parent\: int, label\: string, description\: string, color\: string, position\: string, visible\: int, \.\.\.\}\>\) does not accept array\<int\|string, array\{rowid\: mixed, id\: mixed, fk_parent\: mixed, label\: mixed, description\: mixed, color\: mixed, position\: mixed, visible\: mixed, \.\.\.\}\>\.$#'
message: '#^Property Categorie\:\:\$cats \(array\<int, array\{rowid\: int, id\: int, fk_parent\: int, label\: string, description\: string, color\: string, position\: string, visible\: int, \.\.\.\}\>\) does not accept array\<array\{rowid\: mixed, id\: mixed, fk_parent\: mixed, label\: mixed, description\: mixed, color\: mixed, position\: mixed, visible\: mixed, \.\.\.\}\>\.$#'
identifier: assign.propertyType
count: 2
path: ../../htdocs/categories/class/categorie.class.php
Expand Down Expand Up @@ -5311,7 +5317,7 @@ parameters:
path: ../../htdocs/compta/cashcontrol/class/cashcontrol.class.php

-
message: '#^Call to function is_array\(\) with non\-empty\-array\<int\|string, \(float\|int\)\> will always evaluate to true\.$#'
message: '#^Call to function is_array\(\) with non\-empty\-array\<\(float\|int\)\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/compta/cashcontrol/report.php
Expand Down Expand Up @@ -6601,7 +6607,7 @@ parameters:
path: ../../htdocs/compta/resultat/index.php

-
message: '#^Call to function is_array\(\) with non\-empty\-array\<int\|string, array\{NP\: mixed, N\?\: \(float\|int\), M\?\: non\-empty\-array\<0\|1\|2\|3\|4\|5\|6\|7\|8\|9\|10\|11, mixed\>\}\> will always evaluate to true\.$#'
message: '#^Call to function is_array\(\) with non\-empty\-array\<array\{NP\: mixed, N\?\: \(float\|int\), M\?\: non\-empty\-array\<0\|1\|2\|3\|4\|5\|6\|7\|8\|9\|10\|11, mixed\>\}\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/compta/resultat/result.php
Expand Down Expand Up @@ -7969,7 +7975,7 @@ parameters:
path: ../../htdocs/core/actions_linkedfiles.inc.php

-
message: '#^Call to function is_array\(\) with non\-empty\-array\<int\|string, array\{paths\: array\{mixed\}, names\: array\{string\}, mimes\: array\{mixed\}\}\> will always evaluate to true\.$#'
message: '#^Call to function is_array\(\) with non\-empty\-array\<array\{paths\: array\{mixed\}, names\: array\{string\}, mimes\: array\{mixed\}\}\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/core/actions_massactions.inc.php
Expand Down Expand Up @@ -10537,7 +10543,7 @@ parameters:
path: ../../htdocs/core/class/notify.class.php

-
message: '#^Call to function is_array\(\) with non\-empty\-array\<int\|string, string\> will always evaluate to true\.$#'
message: '#^Call to function is_array\(\) with non\-empty\-array\<string\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/core/class/openid.class.php
Expand Down Expand Up @@ -13597,7 +13603,7 @@ parameters:
path: ../../htdocs/core/modules/hrm/mod_evaluation_standard.php

-
message: '#^Call to function is_array\(\) with non\-empty\-array will always evaluate to true\.$#'
message: '#^Call to function is_array\(\) with non\-empty\-list\<string\|null\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/core/modules/import/import_csv.modules.php
Expand Down Expand Up @@ -16902,18 +16908,6 @@ parameters:
count: 1
path: ../../htdocs/core/tpl/objectline_view.tpl.php

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

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

-
message: '#^Variable \$objp might not be defined\.$#'
identifier: variable.undefined
Expand Down Expand Up @@ -23299,7 +23293,7 @@ parameters:
path: ../../htdocs/master.inc.php

-
message: '#^Call to function is_array\(\) with array\<int\|string, array\{modulenamewithcase\: mixed, moduledescriptorrelpath\: string, moduledescriptorfullpath\: mixed, moduledescriptorrootpath\: mixed, moduletype\?\: ''external''\|''internal''\}\> will always evaluate to true\.$#'
message: '#^Call to function is_array\(\) with array\<array\{modulenamewithcase\: mixed, moduledescriptorrelpath\: string, moduledescriptorfullpath\: mixed, moduledescriptorrootpath\: mixed, moduletype\?\: ''external''\|''internal''\}\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/modulebuilder/index.php
Expand Down Expand Up @@ -24858,18 +24852,6 @@ parameters:
count: 1
path: ../../htdocs/product/canvas/product/actions_card_product.class.php

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

-
message: '#^Variable \$refalreadyexists might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/product/canvas/product/tpl/card_create.tpl.php

-
message: '#^Property ActionsCardService\:\:\$field_list has no type specified\.$#'
identifier: missingType.property
Expand All @@ -24882,30 +24864,6 @@ parameters:
count: 1
path: ../../htdocs/product/canvas/service/actions_card_service.class.php

-
message: '#^Cannot access property \$control on mixed\.$#'
identifier: property.nonObject
count: 2
path: ../../htdocs/product/canvas/service/tpl/card_create.tpl.php

-
message: '#^Variable \$canvas might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/product/canvas/service/tpl/card_create.tpl.php

-
message: '#^Variable \$refalreadyexists might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/product/canvas/service/tpl/card_create.tpl.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/product/canvas/service/tpl/card_create.tpl.php

-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
Expand Down Expand Up @@ -30312,12 +30270,6 @@ parameters:
count: 1
path: ../../htdocs/salaries/list.php

-
message: '#^Variable \$resteapayer might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/salaries/list.php

-
message: '#^Variable \$selected might not be defined\.$#'
identifier: variable.undefined
Expand All @@ -30336,12 +30288,6 @@ parameters:
count: 2
path: ../../htdocs/salaries/paiement_salary.php

-
message: '#^Variable \$sumpaid might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../htdocs/salaries/paiement_salary.php

-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
Expand Down Expand Up @@ -30432,24 +30378,6 @@ parameters:
count: 1
path: ../../htdocs/societe/ajax/company.php

-
message: '#^Variable \$canvas might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/societe/canvas/company/tpl/card_create.tpl.php

-
message: '#^Variable \$canvas might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/societe/canvas/company/tpl/card_edit.tpl.php

-
message: '#^Variable \$canvas might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/societe/canvas/company/tpl/card_view.tpl.php

-
message: '#^Variable \$db might not be defined\.$#'
identifier: variable.undefined
Expand All @@ -30474,24 +30402,6 @@ parameters:
count: 3
path: ../../htdocs/societe/canvas/company/tpl/card_view.tpl.php

-
message: '#^Variable \$canvas might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/societe/canvas/individual/tpl/card_create.tpl.php

-
message: '#^Variable \$canvas might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/societe/canvas/individual/tpl/card_edit.tpl.php

-
message: '#^Variable \$canvas might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/societe/canvas/individual/tpl/card_view.tpl.php

-
message: '#^Variable \$objcanvas might not be defined\.$#'
identifier: variable.undefined
Expand Down Expand Up @@ -30937,7 +30847,7 @@ parameters:
path: ../../htdocs/societe/notify/card.php

-
message: '#^Call to function is_array\(\) with array\<int\|string, array\{available\: mixed, currency\: mixed, pending\?\: \(array\|float\|int\)\}\> will always evaluate to true\.$#'
message: '#^Call to function is_array\(\) with array\<array\{available\: mixed, currency\: mixed, pending\?\: \(array\|float\|int\)\}\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/societe/paymentmodes.php
Expand Down
6 changes: 3 additions & 3 deletions dev/tools/phan/baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ return [
// PhanTypeMismatchProperty : 130+ occurrences
// PhanPluginUnknownArrayMethodParamType : 120+ occurrences
// PhanPluginUnknownPropertyType : 110+ occurrences
// PhanPossiblyUndeclaredVariable : 80+ occurrences
// PhanPossiblyUndeclaredVariable : 65+ occurrences
// PhanRedefineFunction : 45+ occurrences
// PhanTypeExpectedObjectPropAccess : 45+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 40+ occurrences
Expand Down Expand Up @@ -507,7 +507,7 @@ return [
'htdocs/recruitment/admin/setup_candidatures.php' => ['PhanEmptyForeach'],
'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'],
'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'],
'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'],
'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'],
'htdocs/recruitment/index.php' => ['PhanUndeclaredGlobalVariable'],
Expand All @@ -523,7 +523,7 @@ return [
'htdocs/salaries/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
'htdocs/salaries/paiement_salary.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/salaries/paiement_salary.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
Expand Down
14 changes: 6 additions & 8 deletions htdocs/accountancy/class/bookkeeping.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class BookKeeping extends CommonObject
public $doc_date;

/**
* @var int Deadline for payment
* @var int|null|'' Deadline for payment
*/
public $date_lim_reglement;

Expand Down Expand Up @@ -2926,7 +2926,7 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep
$result = $this->db->query($sql);
if (!$result) {
$this->errors[] = 'Error: ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
$error++;
}
$objtmp = $this->db->fetch_object($result);
Expand All @@ -2938,7 +2938,7 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep

$bookkeeping->numero_compte = $obj->numero_compte;
$accountingaccount = new AccountingAccount($this->db);
$accountingaccount->fetch('', $obj->numero_compte);
$accountingaccount->fetch(0, $obj->numero_compte);
$bookkeeping->label_compte = $accountingaccount->label; // latest account label used

$bookkeeping->label_operation = $new_fiscal_period->label;
Expand All @@ -2953,8 +2953,7 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep

$result = $bookkeeping->create($user);
if ($result < 0) {
$this->error = $bookkeeping->error;
$this->errors = $bookkeeping->errors;
$this->setErrorsFromObject($bookkeeping);
$error++;
break;
}
Expand Down Expand Up @@ -2990,7 +2989,7 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep
$result = $this->db->query($sql);
if (!$result) {
$this->errors[] = 'Error: ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
$error++;
}
$objtmp = $this->db->fetch_object($result);
Expand All @@ -3015,8 +3014,7 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep

$result = $bookkeeping->create($user);
if ($result < 0) {
$this->error = $bookkeeping->error;
$this->errors = $bookkeeping->errors;
$this->setErrorsFromObject($bookkeeping);
$error++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ function initfieldrequired() {

// EMail
print '<tr><td>'.(getDolGlobalString("ADHERENT_MAIL_REQUIRED") ? '<span class="fieldrequired">' : '').$langs->trans("EMail").(getDolGlobalString("ADHERENT_MAIL_REQUIRED") ? '</span>' : '').'</td>';
print '<td>'.img_picto('', 'object_email', 'class="pictofixedwidth"').'<input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET("member_email") ? GETPOST("member_email", '', 2) : $object->email).'"></td></tr>';
print '<td>'.img_picto('', 'object_email', 'class="pictofixedwidth"').'<input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET("member_email") ? GETPOST("member_email", 'alphanohtml', 2) : $object->email).'"></td></tr>';

// Website
print '<tr><td>'.$form->editfieldkey('Web', 'member_url', GETPOST('member_url', 'alpha'), $object, 0).'</td>';
Expand Down
Loading

0 comments on commit 79d9211

Please sign in to comment.