Skip to content

Commit

Permalink
Merge branch 'Dolibarr:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
DaBootO authored Jul 4, 2024
2 parents bf265c5 + 1d35417 commit 94ddd1f
Show file tree
Hide file tree
Showing 676 changed files with 2,541 additions and 1,920 deletions.
21 changes: 21 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@ English Dolibarr ChangeLog
--------------------------------------------------------------


***** ChangeLog for 21.0.0 compared to 20.0 *****

For users:
----------



For developers:
---------------



WARNING:
--------

The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Prepare your module for deprecation of triggers code XXX_INSERT to support also XXX_CREATE.
* More class properties (with old name in french) are now deprecated in favor of the property name in english.



***** ChangeLog for 20.0.0 compared to 19.0 *****

For users:
Expand Down
16 changes: 15 additions & 1 deletion dev/tools/codespell/codespell-ignore.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# List of words codespell will ignore
# one per line, case-sensitive (when not lowercase)

# PROVid
provid

# PostgreSQL
postgresql

# Name of contributores
noe
udo
tim

# Inside email
ba
blacklist
Expand Down Expand Up @@ -32,28 +39,35 @@ thead
ue
whitelist
ws

# Thirdparty should be Third party or Third-party but ignoring it because it's omnipresent
thirdparty

# Code string
ect
tempdate
sav
files'

# Used as array key
seeked
tweek

# Used as key
marge

# moral (var name)
mor

# Strings used as keys for translation
uptodate
reenable

# Function - rename to devalidate ?
unvalidate

# Some french strings
somme
caracteres
cas
sur
Datas
Expand Down
15 changes: 0 additions & 15 deletions dev/tools/codespell/codespell-lines-ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,6 @@
* @param string[] $TWeek array of week numbers
* @param string[] $TWeek array of week numbers (week 1 must be '01')
* @param array $TWeek Array of week numbers
* Copyright (C) 2019 Tim Otte <[email protected]>
* Copyright (C) 2019 Tim Otte <[email protected]>
* Copyright (C) 2019 Tim Otte <[email protected]>
* Copyright (C) 2020 Thibault FOUCART <[email protected]>
* Copyright (C) 2020-2021 Udo Tamm <[email protected]>
* Copyright (C) 2021 Noé Cendrier <[email protected]>
* Copyright (C) 2021 Noé Cendrier <[email protected]>
* Copyright (C) 2021 Noé Cendrier <[email protected]>
* Copyright (C) 2021 Noé Cendrier <[email protected]>
* Copyright (C) 2022 Udo Tamm <[email protected]>
* Copyright (C) 2022 Udo Tamm <[email protected]>
* Copyright (C) 2022-2023 Udo Tamm <[email protected]>
* Copyright (C) 2023 Udo Tamm <[email protected]>
* Copyright (C) 2024 Noé Cendrier <[email protected]>
* add german links 2020 Udo Tamm <[email protected]>
$TFirstDays = getFirstDayOfEachWeek($TWeek, $year);
$TFirstDays[reset($TWeek)] = '01'; //first day of month
$TLastDays = getLastDayOfEachWeek($TWeek, $year);
Expand Down
13 changes: 10 additions & 3 deletions dev/tools/rector/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@
__DIR__ . '/../../../scripts/',
__DIR__ . '/../../../test/phpunit/',
]);

$rectorConfig->skip([
'**/includes/**',
'**/custom/**',
'**/vendor/**',
'**/rector/**', // Disable this line to test the "test.php" file.
__DIR__ . '/../../../htdocs/custom/',
__DIR__ . '/../../../htdocs/install/doctemplates/*'
//'test.php',
]);
$rectorConfig->parallel(240);

Expand All @@ -70,9 +72,9 @@

//$rectorConfig->rule(ReplaceEachAssignmentWithKeyCurrentRector::class);


$rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\FloatvalToTypeCastRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\BoolvalToTypeCastRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class);
//Not yet ready: $rectorconfig->rule(Rector\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector::class);

Expand All @@ -82,11 +84,16 @@
$rectorConfig->rule(Dolibarr\Rector\Renaming\UserRightsToFunction::class);
//$rectorConfig->rule(Dolibarr\Rector\Renaming\UsePositiveExit::class);


// This fix <> into != but it breaks other rules, so added at end.
$rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class);


// Add all predefined rules to migrate to up to php 71.
// Warning this break tab spacing of arrays on several lines
/*$rectorConfig->sets([
LevelSetList::UP_TO_PHP_70
]);*/
LevelSetList::UP_TO_PHP_70
]);*/
// Add predefined rules for a given version only
//$rectorConfig->import(SetList::PHP_70);
//$rectorConfig->import(SetList::PHP_71);
Expand Down
41 changes: 23 additions & 18 deletions dev/tools/rector/src/Renaming/GlobalToFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public function getRuleDefinition(): RuleDefinition
[new CodeSample(
'$conf->global->CONSTANT',
'getDolGlobalInt(\'CONSTANT\')'
)]
);
)]
);
}

/**
Expand Down Expand Up @@ -133,7 +133,7 @@ public function refactor(Node $node)
$node->dim = new FuncCall(
new Name('getDolGlobalString'),
[new Arg($constName)]
);
);
}
return $node;
}
Expand Down Expand Up @@ -208,7 +208,7 @@ public function refactor(Node $node)
$leftConcat = new FuncCall(
new Name('getDolGlobalString'),
[new Arg($constName)]
);
);
$rightConcat = $node->right;
}
if ($this->isGlobalVar($node->right)) {
Expand All @@ -219,7 +219,7 @@ public function refactor(Node $node)
$rightConcat = new FuncCall(
new Name('getDolGlobalString'),
[new Arg($constName)]
);
);
$leftConcat = $node->left;
}
if (!isset($leftConcat, $rightConcat)) {
Expand All @@ -238,6 +238,7 @@ public function refactor(Node $node)
$node = $nodes->getFirstExpr();
}


// Now process all comparison like:
// $conf->global->... Operator Value

Expand All @@ -264,11 +265,14 @@ public function refactor(Node $node)
$typeofcomparison = 'NotIdentical';
//var_dump($node->left);
}

if (empty($typeofcomparison)) {
return;
}

if (!$this->isGlobalVar($node->left)) {
$isconfglobal = $this->isGlobalVar($node->left);
if (!$isconfglobal) {
// The left side is not conf->global->xxx, so we leave
return;
}

Expand All @@ -282,7 +286,8 @@ public function refactor(Node $node)
$funcName = 'getDolGlobalString';
break;
default:
return;
$funcName = 'getDolGlobalString';
break;
}

$constName = $this->getConstName($node->left);
Expand All @@ -295,9 +300,9 @@ public function refactor(Node $node)
new FuncCall(
new Name($funcName),
[new Arg($constName)]
),
),
$node->right
);
);
}
if ($typeofcomparison == 'NotEqual') {
return new NotEqual(
Expand All @@ -313,36 +318,36 @@ public function refactor(Node $node)
new FuncCall(
new Name($funcName),
[new Arg($constName)]
),
),
$node->right
);
);
}
if ($typeofcomparison == 'GreaterOrEqual') {
return new GreaterOrEqual(
new FuncCall(
new Name($funcName),
[new Arg($constName)]
),
),
$node->right
);
);
}
if ($typeofcomparison == 'Smaller') {
return new Smaller(
new FuncCall(
new Name($funcName),
[new Arg($constName)]
),
),
$node->right
);
);
}
if ($typeofcomparison == 'SmallerOrEqual') {
return new SmallerOrEqual(
new FuncCall(
new Name($funcName),
[new Arg($constName)]
),
),
$node->right
);
);
}
if ($typeofcomparison == 'NotIdentical') {
return new NotIdentical(
Expand Down Expand Up @@ -382,7 +387,7 @@ function (Node $node): bool {
}
return \true;
}
);
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

$accounting = new AccountingAccount($db);

// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('accountancyadminaccount'));


Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/accountmodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
}


// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('admin'));

// This page is a generic page to edit dictionaries
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/categories_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

$search_country_id = GETPOST('search_country_id', 'int');

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('admin'));

// This page is a generic page to edit dictionaries
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/fiscalyear.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
'1' => 'CloseFiscalYear'
);

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new Fiscalyear($db);
$hookmanager->initHooks(array('fiscalyearlist'));

Expand Down
4 changes: 2 additions & 2 deletions htdocs/accountancy/admin/fiscalyear_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@

$error = 0;

// Initialize technical objects
// Initialize a technical objects
$object = new Fiscalyear($db);
$extrafields = new ExtraFields($db);

// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.

// List of status
static $tmpstatus2label = array(
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/journals_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

$search_country_id = GETPOST('search_country_id', 'int');

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('admin'));

// This page is a generic page to edit dictionaries
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/bookkeeping/balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
$sortfield = "t.numero_compte";
}

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new BookKeeping($db);
$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array

Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/bookkeeping/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
$sortfield = "t.piece_num,t.rowid";
}

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new BookKeeping($db);
$hookmanager->initHooks(array('bookkeepingexport'));

Expand Down
4 changes: 2 additions & 2 deletions htdocs/accountancy/bookkeeping/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
$sortfield = "t.piece_num,t.rowid";
}

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new BookKeeping($db);
$hookmanager->initHooks(array('bookkeepinglist'));

Expand Down Expand Up @@ -996,7 +996,7 @@
print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrapfordate">';
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/bookkeeping/listbyaccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
$sortfield = "t.doc_date,t.rowid";
}

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new BookKeeping($db);
$formfile = new FormFile($db);
$hookmanager->initHooks(array($context_default));
Expand Down
Loading

0 comments on commit 94ddd1f

Please sign in to comment.