Skip to content

Commit 83ed28c

Browse files
authored
Merge branch 'Dolibarr:develop' into develop
2 parents f6acea5 + f7befc2 commit 83ed28c

File tree

249 files changed

+16981
-1402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+16981
-1402
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "CI-RELEASE"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
trigger-docker:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Generate a token
13+
id: generate-token
14+
uses: actions/create-github-app-token@v2
15+
with:
16+
app-id: ${{ vars.RELEASE_DOCKER_ID }}
17+
private-key: ${{ secrets.RELEASE_DOCKER_SECRET }}
18+
19+
- uses: peter-evans/repository-dispatch@v4
20+
with:
21+
token: ${{ steps.generate-token.outputs.token }}
22+
repository: Dolibarr/dolibarr-docker
23+
event-type: new-release
24+
client-payload: '{"version": "${{ github.event.release.tag_name }}"}'

dev/build/phpstan/phpstan-baseline.neon

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7356,24 +7356,6 @@ parameters:
73567356
count: 1
73577357
path: ../../../htdocs/core/modules/import/import_csv.modules.php
73587358

7359-
-
7360-
message: '#^Property ModeleImports\:\:\$errors \(array\<string\>\) does not accept array\<array\<string, mixed\>\|string\>\.$#'
7361-
identifier: assign.propertyType
7362-
count: 3
7363-
path: ../../../htdocs/core/modules/import/import_csv.modules.php
7364-
7365-
-
7366-
message: '#^Property ModeleImports\:\:\$errors \(array\<string\>\) does not accept array\<array\<string, string\>\|string\>\.$#'
7367-
identifier: assign.propertyType
7368-
count: 3
7369-
path: ../../../htdocs/core/modules/import/import_csv.modules.php
7370-
7371-
-
7372-
message: '#^Property ModeleImports\:\:\$warnings \(array\<string\>\) does not accept array\<array\<string, mixed\>\|string\>\.$#'
7373-
identifier: assign.propertyType
7374-
count: 1
7375-
path: ../../../htdocs/core/modules/import/import_csv.modules.php
7376-
73777359
-
73787360
message: '#^Variable \$key might not be defined\.$#'
73797361
identifier: variable.undefined
@@ -7422,24 +7404,6 @@ parameters:
74227404
count: 1
74237405
path: ../../../htdocs/core/modules/import/import_xlsx.modules.php
74247406

7425-
-
7426-
message: '#^Property ModeleImports\:\:\$errors \(array\<string\>\) does not accept array\<array\<string, mixed\>\|string\>\.$#'
7427-
identifier: assign.propertyType
7428-
count: 3
7429-
path: ../../../htdocs/core/modules/import/import_xlsx.modules.php
7430-
7431-
-
7432-
message: '#^Property ModeleImports\:\:\$errors \(array\<string\>\) does not accept array\<array\<string, string\>\|string\>\.$#'
7433-
identifier: assign.propertyType
7434-
count: 3
7435-
path: ../../../htdocs/core/modules/import/import_xlsx.modules.php
7436-
7437-
-
7438-
message: '#^Property ModeleImports\:\:\$warnings \(array\<string\>\) does not accept array\<array\<string, mixed\>\|string\>\.$#'
7439-
identifier: assign.propertyType
7440-
count: 1
7441-
path: ../../../htdocs/core/modules/import/import_xlsx.modules.php
7442-
74437407
-
74447408
message: '#^Variable \$where might not be defined\.$#'
74457409
identifier: variable.undefined
1.08 KB
Binary file not shown.

dev/tools/apstats.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
$outputpath = $argv[1];
6262
$outputdir = dirname($outputpath);
6363
$outputfile = basename($outputpath);
64-
$outputfilerss = preg_replace('/\.\w+$/i', '', $outputfile).'-security.rss';
64+
$outputfilerss = preg_replace('/\.\w+$/i', '', $outputfile).'-security.rss'; // Replace the .html by -security.rss
6565

6666
if (!is_dir($outputdir)) {
6767
print 'Error: dir '.$outputdir.' does not exists or is not writable'."\n";
@@ -271,7 +271,7 @@
271271
$delay = (3600 * 24 * 30 * $nbofmonth);
272272
$arrayofalerts = array();
273273

274-
$commandcheck = "git log --all --shortstat --no-renames --use-mailmap --pretty=".escapeshellarg('format:%cI;%H;%aN;%aE;%ce;%s')." --since=".escapeshellarg(dol_print_date(dol_now() - $delay, '%Y-%m-%d'))." | grep -i -E ".escapeshellarg("(#yogosha|CVE|Sec:|Sec |Sec$)");
274+
$commandcheck = "git log --all --shortstat --no-renames --use-mailmap --pretty=".escapeshellarg('format:%cI;%H;%aN;%aE;%ce;%s')." --since=".escapeshellarg(dol_print_date(dol_now() - $delay, '%Y-%m-%d'))." | grep -i -E ".escapeshellarg("(#yogosha|CVE|Sec:|Sec |^Sec$)");
275275
print 'Execute git log to get commits related to security: '.$commandcheck."\n";
276276
$output_arrglpu = array();
277277
$resexecglpu = 0;
@@ -280,7 +280,7 @@
280280
// Parse the line to split interesting data
281281
$tmpval = cleanVal2($valgitlog);
282282

283-
if (preg_match('/(#yogosha|CVE[\s\-]*\d|Sec:|Sec\s|Sec$)/i', $tmpval['title'])) { // Recommended git comment: "Sec: Fix #..."
283+
if (preg_match('/(#yogosha|CVE[\s\-]*\d|Sec:|Sec\s|^Sec$)/i', $tmpval['title'])) { // Recommended git comment: "Sec: Fix #..."
284284
$alreadyfound = '';
285285
$alreadyfoundcommitid = '';
286286
foreach ($arrayofalerts as $val) { // Loop on already found alerts
@@ -932,7 +932,7 @@
932932
$html .= '</div>';
933933

934934
$html .= '<br>';
935-
$html .= 'Note:Search is done in git repository on regex string "#yogosha|CVE[\s\-]*\d|Sec:|Sec\s" (not case sensitive)<br>';
935+
$html .= 'Note:Search is done in git repository on regex string "#yogosha|CVE[\s\-]*\d|Sec:|Sec |^Sec\s" (not case sensitive)<br>';
936936
$html .= 'You can use this URL for RSS notifications: <a href="/'.$outputfilerss.'">'.$outputfilerss.'</a><br><br>';
937937

938938
$html .= '</section>';

dev/tools/phan/baseline.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
*/
1010
return [
1111
// # Issue statistics:
12-
// PhanUndeclaredProperty : 420+ occurrences
13-
// PhanTypeMismatchProperty : 95+ occurrences
12+
// PhanUndeclaredProperty : 410+ occurrences
1413
// PhanTypeMismatchArgument : 65+ occurrences
1514
// PhanUndeclaredGlobalVariable : 60+ occurrences
1615
// PhanTypeMismatchArgumentNullable : 20+ occurrences
16+
// PhanTypeMismatchProperty : 20+ occurrences
1717
// PhanTypeInvalidDimOffset : 15+ occurrences
1818
// PhanTypeMismatchDimFetch : 10+ occurrences
1919
// PhanUndeclaredMethod : 6 occurrences
@@ -116,10 +116,8 @@ return [
116116
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
117117
'htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php' => ['PhanTypeMismatchArgumentNullable'],
118118
'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanTypeMismatchArgument'],
119-
'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanUndeclaredProperty'],
120119
'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'],
121-
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
122-
'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'],
120+
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable'],
123121
'htdocs/core/modules/member/modules_cards.php' => ['PhanTypeMismatchArgument'],
124122
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanUndeclaredProperty'],
125123
'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'],

htdocs/admin/fediverse.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,13 @@
129129
} else {
130130
$jsonData = json_encode($socialNetworkData);
131131
$result = dolibarr_set_const($db, "SOCIAL_NETWORKS_DATA_".$socialNetworkName, $jsonData, 'chaine', 0, '', $conf->entity);
132+
if ($result <= 0) {
133+
$error++;
134+
setEventMessages($langs->trans("ErrorInputRequired"), null, 'errors');
135+
}
132136
}
133137
}
134-
if ($result) {
138+
if (!$error) {
135139
$db->commit();
136140
header("Location: ".$_SERVER["PHP_SELF"]);
137141
exit;

htdocs/admin/hrm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@
651651
if ($resprod > 0) {
652652
print $product->ref;
653653
} elseif ($resprod < 0) {
654-
setEventMessages(null, $object->errors, "errors");
654+
setEventMessages($product->error, $product->errors, "errors");
655655
}
656656
} else {
657657
print getDolGlobalString($constname);

htdocs/admin/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119

120120
print img_picto('', 'company', 'class="paddingright valignmiddle double"');
121121
print ' ';
122-
print '<a class="nounderlineimp" href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit&token='.newToken()).'">'.$langs->transnoentities("Setup").' - '.$langs->transnoentities("MenuCompanySetup").'</a>';
122+
print '<a class="nounderlineimp fontsize-1-1" href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit&token='.newToken()).'">'.$langs->transnoentities("Setup").' - '.$langs->transnoentities("MenuCompanySetup").'</a>';
123123
print '<br><br>';
124124
print $langs->trans("SetupDescription3b");
125125
if (!empty($setupcompanynotcomplete)) {
@@ -151,7 +151,7 @@
151151
// Show info setup module
152152
print img_picto('', 'cog', 'class="paddingright valignmiddle double"');
153153
print ' ';
154-
print '<a class="nounderlineimp" href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Modules").'</a>';
154+
print '<a class="nounderlineimp fontsize-1-1" href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Modules").'</a>';
155155
print '<br><br>'.$langs->trans("SetupDescription4b");
156156
if ($nbmodulesnotautoenabled < getDolGlobalInt('MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) { // If only minimal initial modules enabled
157157
$langs->load("errors");

htdocs/admin/mails_templates.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,17 +543,17 @@
543543
if ($i) {
544544
$sql .= ", ";
545545
}
546-
$sql .= $field."=";
546+
$sql .= $field." = ";
547547

548548
if ((GETPOST($keycode) == '' && in_array($keycode, array('langcode'))) || (!in_array($keycode, array('langcode', 'position', 'private', 'defaultfortype')) && !GETPOST($keycode))) {
549549
$sql .= "null"; // langcode,... must be '' if not defined so the unique key that include lang will work
550-
} elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') {
550+
} elseif ($keycode == 'langcode' && (GETPOST($keycode) == '0' || GETPOST($keycode) == '-1')) {
551551
$sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work
552552
} elseif ($keycode == 'fk_user') {
553553
if (!$user->admin) { // A non admin user can only edit its own template
554-
$sql .= " ".((int) $user->id);
554+
$sql .= ((int) $user->id);
555555
} else {
556-
$sql .= " ".(GETPOSTINT($keycode));
556+
$sql .= (GETPOSTINT($keycode) > 0 ? GETPOSTINT($keycode) : "null");
557557
}
558558
} elseif ($keycode == 'content') {
559559
$sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'";

htdocs/admin/sms.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,21 @@
122122
try {
123123
$smsfile = new CSMSFile($sendto, $smsfrom, $body, $deliveryreceipt, $deferred, $priority, $class); // This define OvhSms->login, pass, session and account
124124
} catch (Exception $e) {
125+
$error++;
125126
setEventMessages($e->getMessage(), null, 'error');
126127
}
127-
$result = $smsfile->sendfile(); // This send SMS
128+
if (!$error) {
129+
$result = $smsfile->sendfile(); // This send SMS
130+
if (!$result) {
131+
$error++;
132+
setEventMessages($smsfile->error, $smsfile->errors, 'mesgs');
133+
}
134+
}
128135

129-
if ($result) {
136+
if (!$error) {
130137
setEventMessages($langs->trans("SmsSuccessfulySent", $smsfrom, $sendto), null, 'mesgs');
131-
setEventMessages($smsfile->error, $smsfile->errors, 'mesgs');
132138
} else {
133139
setEventMessages($langs->trans("ResultKo"), null, 'errors');
134-
setEventMessages($smsfile->error, $smsfile->errors, 'errors');
135140
}
136141

137142
$action = '';

0 commit comments

Comments
 (0)