From 0be0c1a1c15bf072bf2199cddf5a634db78825c7 Mon Sep 17 00:00:00 2001 From: mrozniecki Date: Tue, 10 Sep 2024 14:01:04 +0200 Subject: [PATCH 01/33] Backport #yogosha18281 --- htdocs/core/class/translate.class.php | 12 ++++++++++-- htdocs/core/js/lib_head.js.php | 2 +- htdocs/core/lib/functions.lib.php | 11 +++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 4b538021da4..4a5cd7e493a 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -580,7 +580,7 @@ class Translate */ private function getTradFromKey($key) { - global $conf, $db; + global $db; if (!is_string($key)) { //xdebug_print_function_stack('ErrorBadValueForParamNotAString'); @@ -660,7 +660,7 @@ class Translate } } - // Crypt string into HTML + // Encode string into HTML $str = htmlentities($str, ENT_COMPAT, $this->charset_output); // Do not convert simple quotes in translation (strings in html are embraced by "). Use dol_escape_htmltag around text in HTML content // Restore reliable HTML tags into original translation string @@ -670,6 +670,10 @@ class Translate $str ); + // Remove dangerous sequence we should never have. Not needed into a translated response. + // %27 is entity code for ' and is replaced by browser automatically when translation is inside a javascript code called by a click like on a href link. + $str = str_replace(array('%27', '''), '', $str); + if ($maxsize) { $str = dol_trunc($str, $maxsize); } @@ -739,6 +743,10 @@ class Translate $str = sprintf($str, $param1, $param2, $param3, $param4, $param5); // Replace %s and %d except for FormatXXX strings. } + // Remove dangerous sequence we should never have. Not needed into a translated response. + // %27 is entity code for ' and is replaced by browser automatically when translation is inside a javascript code called by a click like on a href link. + $str = str_replace(array('%27', '''), '', $str); + return $str; } else { /*if ($key[0] == '$') { diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index c33cb7eb748..33f8526b000 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -996,7 +996,7 @@ function document_preview(file, type, title) var ValidImageTypes = ["image/gif", "image/jpeg", "image/png", "image/webp"]; var showOriginalSizeButton = false; - console.log("document_preview A click was done. file="+file+", type="+type+", title="+title); + console.log("document_preview A click was done: file="+file+", type="+type+", title="+title); if ($.inArray(type, ValidImageTypes) < 0) { /* Not an image */ diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 785889eab78..f3bbbc682c0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10349,7 +10349,7 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata = 0, $param if ($alldata == 1) { if ($isAllowedForPreview) { - return array('target'=>'_blank', 'css'=>'documentpreview', 'url'=>DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : ''), 'mime'=>dol_mimetype($relativepath)); + return array('target'=>'_blank', 'css'=>'documentpreview', 'url'=>DOL_URL_ROOT.'/document.php?modulepart='.urlencode($modulepart).'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : ''), 'mime'=>dol_mimetype($relativepath)); } else { return array(); } @@ -10357,7 +10357,14 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata = 0, $param // old behavior, return a string if ($isAllowedForPreview) { - return 'javascript:document_preview(\''.dol_escape_js(DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : '')).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js($langs->trans('Preview')).'\')'; + $tmpurl = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($modulepart).'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : ''); + $title = $langs->trans("Preview"); + //$title = '%27-alert(document.domain)-%27'; + //$tmpurl = 'file='.urlencode("'-alert(document.domain)-'_small.jpg"); + + // We need to urlencode the parameter after the dol_escape_js($tmpurl) because $tmpurl may contain n url with param file=abc%27def if file has a ' inside. + // and when we click on href with this javascript string, a urlcode is done by browser, converted the %27 of file param + return 'javascript:document_preview(\''.urlencode(dol_escape_js($tmpurl)).'\', \''.urlencode(dol_mimetype($relativepath)).'\', \''.urlencode(dol_escape_js($title)).'\')'; } else { return ''; } From 1ee3c5e5a078f090f314e5731dd7efd930082e43 Mon Sep 17 00:00:00 2001 From: mrozniecki Date: Fri, 13 Sep 2024 12:08:58 +0200 Subject: [PATCH 02/33] Backport fix title --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f3bbbc682c0..12cacbb1549 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10358,7 +10358,7 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata = 0, $param // old behavior, return a string if ($isAllowedForPreview) { $tmpurl = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($modulepart).'&attachment=0&file='.urlencode($relativepath).($param ? '&'.$param : ''); - $title = $langs->trans("Preview"); + $title = $langs->transnoentities("Preview"); //$title = '%27-alert(document.domain)-%27'; //$tmpurl = 'file='.urlencode("'-alert(document.domain)-'_small.jpg"); From bad8ee865d1b78eeda7960388350921b0c4afe2c Mon Sep 17 00:00:00 2001 From: mrozniecki Date: Fri, 20 Sep 2024 14:34:34 +0200 Subject: [PATCH 03/33] Fix title encode --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 12cacbb1549..a0dfce0b0e0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10364,7 +10364,7 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata = 0, $param // We need to urlencode the parameter after the dol_escape_js($tmpurl) because $tmpurl may contain n url with param file=abc%27def if file has a ' inside. // and when we click on href with this javascript string, a urlcode is done by browser, converted the %27 of file param - return 'javascript:document_preview(\''.urlencode(dol_escape_js($tmpurl)).'\', \''.urlencode(dol_mimetype($relativepath)).'\', \''.urlencode(dol_escape_js($title)).'\')'; + return 'javascript:document_preview(\''.urlencode(dol_escape_js($tmpurl)).'\', \''.urlencode(dol_mimetype($relativepath)).'\', \''.rawurlencode(dol_escape_js($title)).'\')'; } else { return ''; } From f1868ee1626426ce8517bbb4ac92472b74d03e39 Mon Sep 17 00:00:00 2001 From: Etienne BENDER Date: Mon, 9 Dec 2024 10:50:29 +0100 Subject: [PATCH 04/33] Replace dol_syslog throws by default log level --- htdocs/core/lib/functions.lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dd1536e1245..4c423494196 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1658,8 +1658,11 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = if (!empty($message)) { // Test log level $logLevels = array(LOG_EMERG=>'EMERG', LOG_ALERT=>'ALERT', LOG_CRIT=>'CRITICAL', LOG_ERR=>'ERR', LOG_WARNING=>'WARN', LOG_NOTICE=>'NOTICE', LOG_INFO=>'INFO', LOG_DEBUG=>'DEBUG'); + $defaultLogLevel = getDolGlobalInt('DEFAULT_SYSLOG_LEVEL', $logLevels[LOG_ERR]); + if (!array_key_exists($level, $logLevels)) { - throw new Exception('Incorrect log level'); + dol_syslog('The given log level does not correspond to any of the available levels: '.$level, LOG_ERR); + $level = $defaultLogLevel; } if ($level > $conf->global->SYSLOG_LEVEL) { return; From a96d13d5aaf7f81bdf57aa7b445e425ee954bd12 Mon Sep 17 00:00:00 2001 From: Etienne BENDER Date: Mon, 9 Dec 2024 10:56:35 +0100 Subject: [PATCH 05/33] Add translation for bad log level --- htdocs/core/lib/functions.lib.php | 7 +++---- htdocs/langs/en_US/errors.lang | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4c423494196..19839800a7a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1627,7 +1627,7 @@ function dol_ucwords($string, $encoding = "UTF-8") */ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = '', $restricttologhandler = '', $logcontext = null) { - global $conf, $user, $debugbar; + global $conf, $user, $debugbar, $langs; // If syslog module enabled if (empty($conf->syslog->enabled)) { @@ -1658,11 +1658,10 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = if (!empty($message)) { // Test log level $logLevels = array(LOG_EMERG=>'EMERG', LOG_ALERT=>'ALERT', LOG_CRIT=>'CRITICAL', LOG_ERR=>'ERR', LOG_WARNING=>'WARN', LOG_NOTICE=>'NOTICE', LOG_INFO=>'INFO', LOG_DEBUG=>'DEBUG'); - $defaultLogLevel = getDolGlobalInt('DEFAULT_SYSLOG_LEVEL', $logLevels[LOG_ERR]); if (!array_key_exists($level, $logLevels)) { - dol_syslog('The given log level does not correspond to any of the available levels: '.$level, LOG_ERR); - $level = $defaultLogLevel; + dol_syslog($langs->trans('ErrorBadLogLevel', $level), LOG_ERR); + $level = getDolGlobalInt('DEFAULT_SYSLOG_LEVEL', $logLevels[LOG_ERR]); } if ($level > $conf->global->SYSLOG_LEVEL) { return; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 046809b9405..ccc5bc87eea 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -155,6 +155,7 @@ ErrorPHPNeedModule=Error, your PHP must have module %s installed to use t ErrorOpenIDSetupNotComplete=You setup Dolibarr config file to allow OpenID authentication, but URL of OpenID service is not defined into constant %s ErrorWarehouseMustDiffers=Source and target warehouses must differs ErrorBadFormat=Bad format! +ErrorBadLogLevel=The given log level does not correspond to any of the available levels: %s ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, this member is not yet linked to any third party. Link member to an existing third party or create a new third party before creating subscription with invoice. ErrorThereIsSomeDeliveries=Error, there is some deliveries linked to this shipment. Deletion refused. ErrorCantDeletePaymentReconciliated=Can't delete a payment that had generated a bank entry that was reconciled From 6aee2db1d4d344f7e498964c44dfbd44650e0a5e Mon Sep 17 00:00:00 2001 From: Etienne BENDER Date: Tue, 17 Dec 2024 09:01:04 +0100 Subject: [PATCH 06/33] Remove use of getDolGlobalInt() --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 19839800a7a..b876186836b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1661,7 +1661,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = if (!array_key_exists($level, $logLevels)) { dol_syslog($langs->trans('ErrorBadLogLevel', $level), LOG_ERR); - $level = getDolGlobalInt('DEFAULT_SYSLOG_LEVEL', $logLevels[LOG_ERR]); + $level = $logLevels[LOG_ERR]; } if ($level > $conf->global->SYSLOG_LEVEL) { return; From 0da6e258817c8fa814d44302ba0f2d7ccf910623 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 19 Dec 2024 11:23:45 +0100 Subject: [PATCH 07/33] FIX backport from develop to avoid php warning --- htdocs/core/ajax/ajaxtooltip.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/core/ajax/ajaxtooltip.php b/htdocs/core/ajax/ajaxtooltip.php index 129658ef8fd..4dcf81f0d95 100644 --- a/htdocs/core/ajax/ajaxtooltip.php +++ b/htdocs/core/ajax/ajaxtooltip.php @@ -34,23 +34,40 @@ if (!defined('NOREQUIREHTML')) { if (!defined('NOREQUIREAJAX')) { define('NOREQUIREAJAX', '1'); } +if (!defined('NOHEADERNOFOOTER')) { + define('NOHEADERNOFOOTER', '1'); +} + include '../../main.inc.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ $id = GETPOST('id', 'aZ09'); $objecttype = GETPOST('objecttype', 'aZ09arobase'); // 'module' or 'myobject@mymodule', 'mymodule_myobject' $params = array('fromajaxtooltip' => 1); if (GETPOSTISSET('infologin')) { - $params['infologin'] = GETPOST('infologin', 'int'); + $params['infologin'] = GETPOSTINT('infologin'); } if (GETPOSTISSET('option')) { $params['option'] = GETPOST('option', 'restricthtml'); } - +$element_ref = ''; +if (is_numeric($id)) { + $id = (int) $id; +} else { + $element_ref = $id; + $id = 0; +} // Load object according to $element -$object = fetchObjectByElement($id, $objecttype); +$object = fetchObjectByElement($id, $objecttype, $element_ref); if (empty($object->element)) { httponly_accessforbidden('Failed to get object with fetchObjectByElement(id='.$id.', objecttype='.$objecttype.')'); } @@ -78,10 +95,11 @@ top_httphead(); $html = ''; if (is_object($object)) { + '@phan-var-force CommonObject $object'; if ($object->id > 0 || !empty($object->ref)) { /** @var CommonObject $object */ $html = $object->getTooltipContent($params); - } elseif ($res == 0) { + } elseif ($id > 0) { $html = $langs->trans('Deleted'); } unset($object); From be95c92c45814ac0e73dad46b70ac0ef5f8cd294 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Dec 2024 18:07:02 +0100 Subject: [PATCH 08/33] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b876186836b..7fe94ff83c4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1627,7 +1627,7 @@ function dol_ucwords($string, $encoding = "UTF-8") */ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = '', $restricttologhandler = '', $logcontext = null) { - global $conf, $user, $debugbar, $langs; + global $conf, $user, $debugbar; // If syslog module enabled if (empty($conf->syslog->enabled)) { @@ -1660,7 +1660,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = $logLevels = array(LOG_EMERG=>'EMERG', LOG_ALERT=>'ALERT', LOG_CRIT=>'CRITICAL', LOG_ERR=>'ERR', LOG_WARNING=>'WARN', LOG_NOTICE=>'NOTICE', LOG_INFO=>'INFO', LOG_DEBUG=>'DEBUG'); if (!array_key_exists($level, $logLevels)) { - dol_syslog($langs->trans('ErrorBadLogLevel', $level), LOG_ERR); + dol_syslog('Error Bad Log Level '.$level, LOG_ERR); $level = $logLevels[LOG_ERR]; } if ($level > $conf->global->SYSLOG_LEVEL) { From fedcec58a67614ba6619ededae1916a9b5572a0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Dec 2024 18:09:50 +0100 Subject: [PATCH 09/33] Update errors.lang --- htdocs/langs/en_US/errors.lang | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index ccc5bc87eea..046809b9405 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -155,7 +155,6 @@ ErrorPHPNeedModule=Error, your PHP must have module %s installed to use t ErrorOpenIDSetupNotComplete=You setup Dolibarr config file to allow OpenID authentication, but URL of OpenID service is not defined into constant %s ErrorWarehouseMustDiffers=Source and target warehouses must differs ErrorBadFormat=Bad format! -ErrorBadLogLevel=The given log level does not correspond to any of the available levels: %s ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, this member is not yet linked to any third party. Link member to an existing third party or create a new third party before creating subscription with invoice. ErrorThereIsSomeDeliveries=Error, there is some deliveries linked to this shipment. Deletion refused. ErrorCantDeletePaymentReconciliated=Can't delete a payment that had generated a bank entry that was reconciled From e3c44568a026271e3c5c28a0dee01b405618ba2e Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 19 Dec 2024 18:31:15 +0100 Subject: [PATCH 10/33] Test github action --- .github/workflows/pr-18.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 692faf4ad2d..5523dc1a55c 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -20,12 +20,21 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Install GitHub CLI - run: | - sudo apt update - sudo apt install gh -y + #- name: Install GitHub CLI + # run: | + # sudo apt update + # sudo apt install gh -y - - name: Assign reviewer + - name: Assign reviewer method 1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + url: ${{ github.event.pull_request.html_url }} + run: | + gh pr edit "$url" --add-assignee rycks --add-reviewer rycks + gh pr merge "$url" --merge --auto + + + - name: Assign reviewer method 2 env: #REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer From 0300209b3d205acfed8dbd8c8afda159c9c02d79 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 24 Dec 2024 02:00:37 +0100 Subject: [PATCH 11/33] Missing new line --- .github/workflows/pr-18-autolabel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-18-autolabel.yaml b/.github/workflows/pr-18-autolabel.yaml index 4f7b08ea725..feb9ee17c97 100644 --- a/.github/workflows/pr-18-autolabel.yaml +++ b/.github/workflows/pr-18-autolabel.yaml @@ -18,4 +18,4 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} configuration-path: .github/changed-lines-count-labeler.yml - continue-on-error: true \ No newline at end of file + continue-on-error: true From da7679dfda069a69040d904cee968f0c3feec87d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 26 Dec 2024 11:15:22 +0100 Subject: [PATCH 12/33] FIX #28702 --- htdocs/core/actions_sendmails.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 55e97603bc5..326d7c795c9 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -203,6 +203,15 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO } elseif ($val == 'contact') { // Key selected means current contact $tmparray[] = dol_string_nospecial($contact->getFullName($langs), ' ', array(",")).' <'.$contact->email.'>'; $sendtoid[] = $contact->id; + } elseif ($val && $object->element == 'project' && empty($object->socid)) { // $val is the Id of a contact + $contact = new Contact($db); + $ret = $contact->fetch((int) $val); + if ($ret > 0 && !empty($contact->socid)) { + $thirdparty = new Societe($db); + $thirdparty->fetch($contact->socid); + $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); + $sendtoid[] = ((int) $val); + } } elseif ($val) { // $val is the Id of a contact $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); $sendtoid[] = ((int) $val); From ce851de22649286f9c250564d10d9b6fa72c0f40 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 29 Dec 2024 10:28:56 +0100 Subject: [PATCH 13/33] FIX avoid php8 warnings --- htdocs/loan/card.php | 2 +- htdocs/loan/document.php | 3 +-- htdocs/loan/info.php | 3 +-- htdocs/loan/note.php | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 803717ae085..ba51649a417 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -451,7 +451,7 @@ if ($id > 0) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else { diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 74b96bf0877..37359c563e1 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -141,8 +141,7 @@ if ($object->id) { $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status - $morehtmlstatus = $morehtmlright; - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); print '
'; print '
'; diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index b437a73b845..aafc48768f7 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -103,8 +103,7 @@ $morehtmlref .= '
'; $linkback = ''.$langs->trans("BackToList").''; -$morehtmlstatus = $morehtmlright; -dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); print '
'; print '
'; diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 62d84a1adbc..750c5c4660e 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -130,8 +130,7 @@ if ($id > 0) { $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status - $morehtmlstatus = $morehtmlright; - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); print '
'; print '
'; From 5384b99cfcecb96943d5552e097ad8883f7757f0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 29 Dec 2024 10:36:58 +0100 Subject: [PATCH 14/33] Revert "FIX avoid php8 warnings" This reverts commit ce851de22649286f9c250564d10d9b6fa72c0f40. --- htdocs/loan/card.php | 2 +- htdocs/loan/document.php | 3 ++- htdocs/loan/info.php | 3 ++- htdocs/loan/note.php | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index ba51649a417..803717ae085 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -451,7 +451,7 @@ if ($id > 0) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else { diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 37359c563e1..74b96bf0877 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -141,7 +141,8 @@ if ($object->id) { $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); + $morehtmlstatus = $morehtmlright; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index aafc48768f7..b437a73b845 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -103,7 +103,8 @@ $morehtmlref .= '
'; $linkback = ''.$langs->trans("BackToList").''; -dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); +$morehtmlstatus = $morehtmlright; +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 750c5c4660e..62d84a1adbc 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -130,7 +130,8 @@ if ($id > 0) { $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); + $morehtmlstatus = $morehtmlright; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; print '
'; From 289900565edf377aca7c03d0c25e6f15a0ec479e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 29 Dec 2024 10:42:29 +0100 Subject: [PATCH 15/33] FIX avoid php8 warnings --- htdocs/loan/card.php | 1 + htdocs/loan/document.php | 1 + htdocs/loan/info.php | 1 + htdocs/loan/note.php | 1 + 4 files changed, 4 insertions(+) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 803717ae085..61f0823560d 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -447,6 +447,7 @@ if ($id > 0) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { + $maxlength = 0; //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); $morehtmlref .= '
'; $morehtmlref .= ''; diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 74b96bf0877..825d1cf6249 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -87,6 +87,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; * View */ +$morehtmlright = ''; $form = new Form($db); $title = $langs->trans("Loan").' - '.$langs->trans("Documents"); diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index b437a73b845..1489868f19b 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -50,6 +50,7 @@ $result = restrictedArea($user, 'loan', $id, '', ''); * View */ +$morehtmlright = ''; $form = new Form($db); $title = $langs->trans("Loan").' - '.$langs->trans("Info"); diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 62d84a1adbc..6cfe6089b19 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -73,6 +73,7 @@ if (empty($reshook)) { * View */ +$morehtmlright = ''; $form = new Form($db); $title = $langs->trans("Loan").' - '.$langs->trans("Notes"); From 8c1eab62da2f5a33da262d4ead36b7d13160c424 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 29 Dec 2024 14:54:04 +0100 Subject: [PATCH 16/33] Prepare 20.0.3 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 881f26d4f41..7558696ba00 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -35,7 +35,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '20.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '20.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 1ceaad78d66f382007f9e852168141cdc2432a85 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 29 Dec 2024 14:58:48 +0100 Subject: [PATCH 17/33] Prepare 20.0.3 --- ChangeLog | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0d9469e9194..cca97eb20d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,66 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 20.0.3 compared to 20.0.2 ***** +FIX: 17.0 - missing error handling for FactureRec::fetch in card-rec.php +FIX: 17.0 - warnings due to uninitialized variables + delete code that doesn't apply to recurring invoices (AFAIK, there is no recurring credit note feature) +FIX: #31159 - TVA Account by country is not used (#31984) +FIX: #31724 (#31885) +FIX: #31890 store empty line extrafields (#32152) +FIX: #31997 +FIX: #32007 missing parameter on function multiSelectArrayWithCheckbox (#32008) +FIX: #32021 +FIX: #32171 (#32172) +FIX: #32178: repair.php: fix missing 'as' with Postgres (#32179) +FIX: #32259 +FIX: #32317 Error with report by month sales tax +FIX: #32391 +FIX: #32402 Social Contribution - Update - Drop the attached employee +FIX: #32408 Dict - module Event organisation is stable now +FIX: #32467 +FIX: Accounting Closure Duplicates, Subledger accounts, Account Labels and more... Update bookkeeping.class.php +FIX: add a line in expensereport refused +FIX: All contacts were loaded even if no thirdparty was selected (#31877) +FIX: asset: missing ref_ext field used in CommonObject::isExistingObject() (#31870) +FIX: assets: division by zero when trying to calculate depreciation on assets that don't have it (#31858) +FIX: avoid php8 warnings +FIX: broken feature, check if module is enabled +FIX: broken feature, entity can not be empty ! +FIX: broken feature, wrong GETPOSTINT parameter +FIX: BUG #32454 (Third party creating vendor) +FIX: calculate start date of cloned task from cloned project (#31799) +FIX: can not convert to reduc if draft status +FIX: comparing strings with numbers can be touchy +FIX: Debug option not working replaced by the one that works. +FIX: default user in stat page +FIX: Ensure extraparams cannot be selected by the user (#32132) +FIX: GETPOST "$check" parameter can't be empty +FIX: Hidden dropdown download link in project +FIX: stop doing a full closure without duplicate lines generated by an unclean database +FIX: in projet/element.php total_time is always back to 0 +FIX: (invoice): mutlicurrency_tx correct value +FIX: invoice: revenue stamp wrongly converted to int (#31840) +FIX: issue #28222 Edit date extrafield displayed on all on lines (#31914) +FIX: "location_incoterms" is a string +FIX: missing hook parameters +FIX: missing saving MAIN_SECURITY_MAX_NUMBER_FAILED_AUTH +FIX: old copy not needed in supplier order create method (#31733) +FIX: send mail to BCC when email formatted as Fullname (#31983) +FIX: set birthday alert (#32133) +FIX: Status not correct in Public ticket list (#31922) +FIX: swiftmailer: correctly set errors-to header (#31826) +FIX: TakePos barcode rule (#31857) +FIX: Takepos: set the country of the default customer (#31915) +FIX: Update Accounting closure with missing too many A-Nouveau #30039) +FIX: Update on a sold line of bank entry set the type to empty, now it's fixed #22539 (#31888) +FIX: update status on create supplier order for trigger (#31642) +FIX: use tax with code on supplier order line give tax code missing in supplier invoice (#32018) +FIX: warning in agenda when user have no color and AGENDA_NO_TRANSPARENT_ON_NOT_BUSY=1 +FIX: when create intervention from propal (or other object), element link is missing after creation (#32035) +FIX: with no perm on supplier, must not see supplier of the best price +FIX: wrong check +FIX: wrong trigger name (MODIFY instead UPDATE) + ***** ChangeLog for 20.0.2 compared to 20.0.1 ***** FIX: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713) FIX: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446) From cc81ff24ad5bff43126c0aa37b286678af3c858a Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 29 Dec 2024 15:11:42 +0100 Subject: [PATCH 18/33] Fix packager for ubuntu 24.04 --- build/makepack-dolibarr.pl | 178 ++++++++++++++++++------------------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 629672d06c4..020caba8398 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -4,7 +4,7 @@ # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps) # \author (c)2004-2023 Laurent Destailleur # -# This is list of constant you can set to have generated packages moved into a specific dir: +# This is list of constant you can set to have generated packages moved into a specific dir: #DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild' #DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable' #DESTIMODULES='/media/HDDATA1_LD/Mes Sites/Web/Admin1/wwwroot/files/modules' @@ -36,7 +36,7 @@ $PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/ "RPM_FEDORA"=>"rpmbuild", "RPM_MANDRIVA"=>"rpmbuild", "RPM_OPENSUSE"=>"rpmbuild", -"DEB"=>"dpkg dpatch", +"DEB"=>"dpkg", "FLATPACK"=>"flatpack", "EXEDOLIWAMP"=>"ISCC.exe", "SNAPSHOT"=>"tar" @@ -129,7 +129,7 @@ if (! $TEMP || ! -d $TEMP) { print "$PROG.$Extension aborted.\n"; sleep 2; exit 2; -} +} $BUILDROOT="$TEMP/buildroot"; @@ -172,7 +172,7 @@ $newbuild = $BUILD; $newbuild =~ s/(dev|alpha)/1/gi; # dev $newbuild =~ s/beta(.?)/2/gi; # beta (we want beta1, beta2, betax to be same package name) $newbuild =~ s/rc(.?)/3/gi; # rc (we want rc1, rc2, rcx to be same package name) -if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale is same than rc. +if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale is same than rc. # now newbuild is 0-1 or 0-4 for example. Note that for native package (see debian/source/format), we should not use a dash part but to get a better version management $build = $newbuild; $build =~ s/-.*$//g; @@ -190,8 +190,8 @@ for (0..@ARGV-1) { if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; } if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; } if ($ARGV[$_] =~ /^-*prefix=(.+)/i) { - $PREFIX=$1; - $FILENAMESNAPSHOT.="-".$PREFIX; + $PREFIX=$1; + $FILENAMESNAPSHOT.="-".$PREFIX; } } if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTIBETARC is defined @@ -210,7 +210,7 @@ print "Target directory (DESTI) : $DESTI\n"; # Choose package targets #----------------------- if ($target) { - if ($target eq "ALL") { + if ($target eq "ALL") { foreach my $key (@LISTETARGET) { if ($key ne 'SNAPSHOT' && $key ne 'SF' && $key ne 'ASSO') { $CHOOSEDTARGET{$key}=1; } } @@ -236,10 +236,10 @@ else { printf(" %2d - %-14s (%s)\n",$cpt,"ASSO (publish)","Need ".$REQUIREMENTPUBLISH{"ASSO"}); $cpt=99; printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".$REQUIREMENTPUBLISH{"SF"}); - + # Ask which target to build print "Choose one target number or several separated with space (0 - ".$cpt."): "; - $NUM_SCRIPT=; + $NUM_SCRIPT=; chomp($NUM_SCRIPT); if ($NUM_SCRIPT !~ /^[0-9\s]+$/) { @@ -286,11 +286,11 @@ foreach my $target (sort keys %CHOOSEDTARGET) { print "Error: You asked creation of several rpms. Because all rpm have same name, you must defined an environment variable DESTI to tell packager where it can create subdirs for each generated package.\n"; exit; } - $atleastonerpm=1; - } - foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) + $atleastonerpm=1; + } + foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) { - # Test + # Test print "Test requirement for target $target: Search '$req'... "; $newreq=$req; $newparam=''; if ($newreq eq 'zip') { $newparam.='-h'; } @@ -299,12 +299,12 @@ foreach my $target (sort keys %CHOOSEDTARGET) { print "Test command ".$cmd."... "; $ret=`$cmd`; $coderetour=$?; $coderetour2=$coderetour>>8; - if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) { + if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) { # Not found error, we try in PROGPATH $ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`; $coderetour=$?; $coderetour2=$coderetour>>8; $REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req"; - } + } if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) { # Not found error @@ -333,7 +333,7 @@ $nbofpublishneedchangelog=0; foreach my $target (sort keys %CHOOSEDTARGET) { if ($target eq '-CHKSUM') { $nbofpublishneedchangelog++; } if ($CHOOSEDTARGET{$target} < 0) { next; } - if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM') + if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM') { $nboftargetneedbuildroot++; } @@ -397,10 +397,10 @@ if ($nboftargetok) { print "Go to directory $SOURCE\n"; $olddir=getcwd(); chdir("$SOURCE"); - + print "Clean $SOURCE/htdocs/includes/autoload.php\n"; $ret=`rm -f $SOURCE/htdocs/includes/autoload.php`; - + $ret=`git ls-files . --exclude-standard --others`; if ($ret) { @@ -409,7 +409,7 @@ if ($nboftargetok) { print "Canceled.\n"; exit; } - + print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filelist_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n"; $ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`; print $ret."\n"; @@ -427,13 +427,13 @@ if ($nboftargetok) { print "Go to directory $SOURCE\n"; $olddir=getcwd(); chdir("$SOURCE"); - + print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; $ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`; if ($ret =~ /(already exists|existe déjà)/) { print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? "; - $QUESTIONOVERWRITETAG=; + $QUESTIONOVERWRITETAG=; chomp($QUESTIONOVERWRITETAG); if ($QUESTIONOVERWRITETAG =~ /(o|y)/) { @@ -452,7 +452,7 @@ if ($nboftargetok) { } chdir("$olddir"); } - + # Update buildroot if required #----------------------------- if ($nboftargetneedbuildroot) @@ -462,7 +462,7 @@ if ($nboftargetok) { print "Delete directory $BUILDROOT\n"; $ret=`rm -fr "$BUILDROOT"`; - + mkdir "$BUILDROOT"; mkdir "$BUILDROOT/$PROJECT"; print "Copy $SOURCE into $BUILDROOT/$PROJECT\n"; @@ -491,7 +491,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/phpstan.neon.dist`; $ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`; $ret=`rm -f $BUILDROOT/$PROJECT/README-*.md`; - + $ret=`rm -fr $BUILDROOT/$PROJECT/build/html`; $ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`; @@ -560,20 +560,20 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot11.png`; $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`; - # Security to avoid to package data files + # Security to avoid to package data files print "Remove documents dir\n"; $ret=`rm -fr $BUILDROOT/$PROJECT/document`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`; - + print "Remove subdir of custom dir\n"; print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n"; $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n"; $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files - # Removed known external modules to avoid any error when packaging from env where external modules are tested + # Removed known external modules to avoid any error when packaging from env where external modules are tested $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/abricot*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/accountingexport*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`; @@ -599,15 +599,15 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/common/fontawesome-5/svgs`; - + # Removed other test files $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; $ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`; - - # Removed files installed by the awful composer + + # Removed files installed by the awful composer $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/bin`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries @@ -642,7 +642,7 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`; - + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/bin`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/bin`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/*/bin`; @@ -652,14 +652,14 @@ if ($nboftargetok) { # Build package for each target #------------------------------ - foreach my $target (sort keys %CHOOSEDTARGET) + foreach my $target (sort keys %CHOOSEDTARGET) { if ($CHOOSEDTARGET{$target} < 0) { next; } if ($target eq '-CHKSUM') { next; } - + print "\nBuild package for target $target\n"; - if ($target eq 'SNAPSHOT') + if ($target eq 'SNAPSHOT') { $NEWDESTI=$DESTI; @@ -683,13 +683,13 @@ if ($nboftargetok) { next; } - if ($target eq 'TGZ') + if ($target eq 'TGZ') { $NEWDESTI=$DESTI; if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/standard'); - if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } + if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } } print "Remove target $FILENAMETGZ.tgz...\n"; @@ -703,7 +703,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$FILENAMETGZ/build/exe`; $ret=`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages - + print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n"; $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" $FILENAMETGZ"; print "$cmd\n"; @@ -715,14 +715,14 @@ if ($nboftargetok) { next; } - if ($target eq 'XZ') + if ($target eq 'XZ') { $NEWDESTI=$DESTI; if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/standard'); if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } - } + } print "Remove target $FILENAMEXZ.xz...\n"; unlink("$NEWDESTI/$FILENAMEXZ.xz"); @@ -735,7 +735,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$FILENAMEXZ/build/exe`; $ret=`rm -fr $BUILDROOT/$FILENAMEXZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages - + print "Compress $FILENAMEXZ into $FILENAMEXZ.xz...\n"; print "Go to directory $BUILDROOT\n"; @@ -751,15 +751,15 @@ if ($nboftargetok) { $ret=`mv "$BUILDROOT/$FILENAMEXZ.xz" "$NEWDESTI/$FILENAMEXZ.xz"`; next; } - - if ($target eq 'ZIP') + + if ($target eq 'ZIP') { $NEWDESTI=$DESTI; if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/standard'); if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } - } + } print "Remove target $FILENAMEZIP.zip...\n"; unlink("$NEWDESTI/$FILENAMEZIP.zip"); @@ -782,14 +782,14 @@ if ($nboftargetok) { print $cmd."\n"; $ret= `$cmd`; chdir("$olddir"); - + # Move to final dir print "Move $FILENAMEZIP.zip to $NEWDESTI/$FILENAMEZIP.zip\n"; $ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$NEWDESTI/$FILENAMEZIP.zip"`; next; } - - if ($target =~ /RPM/) # Linux only + + if ($target =~ /RPM/) # Linux only { $NEWDESTI=$DESTI; $subdir="package_rpm_generic"; @@ -800,7 +800,7 @@ if ($nboftargetok) { { mkdir($DESTI.'/'.$subdir); if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; } - } + } if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; } @@ -813,7 +813,7 @@ if ($nboftargetok) { print "Create directory $BUILDROOT/$FILENAMETGZ2\n"; $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`; - + print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n"; $cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'"; $ret=`$cmd`; @@ -839,7 +839,7 @@ if ($nboftargetok) { if ($target =~ /FEDO/i) { $BUILDFICSRC="${FILENAME}_fedora.spec"; } if ($target =~ /MAND/i) { $BUILDFICSRC="${FILENAME}_mandriva.spec"; } if ($target =~ /OPEN/i) { $BUILDFICSRC="${FILENAME}_opensuse.spec"; } - + use Date::Language; $lang=Date::Language->new('English'); $datestring = $lang->time2str("%a %b %e %Y", time); @@ -857,7 +857,7 @@ if ($nboftargetok) { } close SPECFROM; close SPECTO; - + print "Copy patch file to $RPMDIR/SOURCES\n"; $ret=`cp "$SOURCE/build/rpm/dolibarr-forrpm.patch" "$RPMDIR/SOURCES"`; $ret=`chmod 644 $RPMDIR/SOURCES/dolibarr-forrpm.patch`; @@ -879,14 +879,14 @@ if ($nboftargetok) { next; } - if ($target eq 'DEB') + if ($target eq 'DEB') { $NEWDESTI=$DESTI; if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/package_debian-ubuntu'); if (-d $DESTI.'/package_debian-ubuntu') { $NEWDESTI=$DESTI.'/package_debian-ubuntu'; } - } + } $olddir=getcwd(); @@ -967,13 +967,13 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/select2/LICENSE`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mike42/escpos-php/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mobiledetect/mobiledetectlib/LICENSE.txt`; - + # Removed files we don't need (already removed) #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source`; - + # Rename upstream changelog to match debian rules $ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`; - + # Prepare source package (init debian dir) print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`; @@ -1011,7 +1011,7 @@ if ($nboftargetok) { $ret=`cp -f "$SOURCE/build/debian/dolibarr.postrm" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/dolibarr.templates" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/install.forced.php.install" "$BUILDROOT/$PROJECT.tmp/debian"`; - + # Set owners and permissions #print "Set owners on files/dir\n"; #$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; @@ -1042,8 +1042,8 @@ if ($nboftargetok) { $ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - - + + print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; $cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; $ret=`$cmd`; @@ -1051,14 +1051,14 @@ if ($nboftargetok) { print "Go into directory $BUILDROOT\n"; chdir("$BUILDROOT"); - + # We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native) print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n"; $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build"; print $cmd."\n"; $ret=`$cmd`; - # Creation of source package + # Creation of source package print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"); #$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; @@ -1077,12 +1077,12 @@ if ($nboftargetok) { $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`; - #$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option + #$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option $ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`; next; } - + if ($target eq 'EXEDOLIWAMP') { $NEWDESTI=$DESTI; @@ -1090,22 +1090,22 @@ if ($nboftargetok) { { mkdir($DESTI.'/package_windows'); if (-d $DESTI.'/package_windows') { $NEWDESTI=$DESTI.'/package_windows'; } - } + } print "Remove target $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe...\n"; unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"; - + if ($OS eq 'windows') { print "Check that ISCC.exe is in your PATH.\n"; } else { print "Check that in your Wine setup, you have created a Z: drive that point to your / directory.\n"; } - + $SOURCEBACK=$SOURCE; $SOURCEBACK =~ s/\//\\/g; print "Prepare file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" from \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n"; - + #$ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`; open(IN, '<' . $SOURCE."/build/exe/doliwamp/doliwamp.iss") or die $!; open(OUT, '>' . "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss") or die $!; @@ -1118,7 +1118,7 @@ if ($nboftargetok) { close(OUT); print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" on OS $OS\n"; - + if ($OS eq 'windows') { $cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\""; } else { @@ -1132,26 +1132,26 @@ if ($nboftargetok) { print "Move \"$SOURCE\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n"; rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"); print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n"; - + use File::Copy; #$ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`; $ret=move("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe", "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"); - + print "Remove tmp file $SOURCE/build/exe/doliwamp/doliwamp.tmp.iss\n"; #$ret=`rm "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`; $ret=unlink("$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"); - + next; } } # Publish package for each target #-------------------------------- - foreach my $target (sort keys %CHOOSEDPUBLISH) + foreach my $target (sort keys %CHOOSEDPUBLISH) { if ($CHOOSEDPUBLISH{$target} < 0) { next; } - + print "\nList of files to publish (BUILD=$BUILD)\n"; %filestoscansf=( "$DESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"=>'none', # none means it won't be published on SF @@ -1209,26 +1209,26 @@ if ($nboftargetok) { print "\n"; } - if ($target eq 'SF' || $target eq 'ASSO') + if ($target eq 'SF' || $target eq 'ASSO') { print "\n"; - + if ($target eq 'SF') { $PUBLISH = $PUBLISHSTABLE; } if ($target eq 'ASSO' && $BUILD =~ /[a-z]/i) { $PUBLISH = $PUBLISHBETARC.'/lastbuild'; } if ($target eq 'ASSO' && $BUILD =~ /^[0-9]+$/) { $PUBLISH = $PUBLISHBETARC.'/stable'; } - + $NEWPUBLISH=$PUBLISH; print "Publish to target $NEWPUBLISH. Click enter or CTRL+C...\n"; # Ask which target to build - $NUM_SCRIPT=; + $NUM_SCRIPT=; chomp($NUM_SCRIPT); print "Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n"; $ret=`mkdir -p "/tmp/emptydir/"`; - + %filestoscan=%filestoscansf; - + foreach my $file (sort keys %filestoscan) { $found=0; @@ -1238,30 +1238,30 @@ if ($nboftargetok) { if ($target eq 'SF') { if ($filestoscan{$file} eq 'none') { next; - } + } $destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD; } elsif ($target eq 'ASSO' and $NEWPUBLISH =~ /stable/) { $destFolder="$NEWPUBLISH/$filestoscanstableasso{$file}"; - } + } elsif ($target eq 'ASSO' and $NEWPUBLISH !~ /stable/) { $destFolder="$NEWPUBLISH"; - } + } else # No more used { $dirnameonly=$file; - $dirnameonly =~ s/.*\/([^\/]+)\/[^\/]+$/$1/; + $dirnameonly =~ s/.*\/([^\/]+)\/[^\/]+$/$1/; $filenameonly=$file; - $filenameonly =~ s/.*\/[^\/]+\/([^\/])+$/$1/; + $filenameonly =~ s/.*\/[^\/]+\/([^\/])+$/$1/; $destFolder="$NEWPUBLISH/$dirnameonly"; } print "\n"; print "Publish file ".$file." to ".$destFolder."\n"; - # mkdir + # mkdir #my $ssh = Net::SSH::Perl->new("frs.sourceforge.net"); - #$ssh->login("$user","$pass"); + #$ssh->login("$user","$pass"); #use String::ShellQuote qw( shell_quote ); #$ssh->cmd('mkdir '.shell_quote($destFolder).' && exit'); @@ -1270,20 +1270,20 @@ if ($nboftargetok) { #$sftp->mkdir($destFolder) #$command="ssh eldy,dolibarr\@frs.sourceforge.net mkdir -p \"$destFolder\""; - #print "$command\n"; + #print "$command\n"; #my $ret=`$command 2>&1`; $command="rsync -s -e 'ssh' --recursive /tmp/emptydir/ \"".$destFolder."\""; - print "$command\n"; + print "$command\n"; my $ret=`$command 2>&1`; $command="rsync -s -e 'ssh' \"$file\" \"".$destFolder."\""; - print "$command\n"; + print "$command\n"; my $ret2=`$command 2>&1`; print "$ret2\n"; } } - } + } } print "\n----- Summary -----\n"; From 8ccdbf374bdd43721202c0fc456385b5a6d2821d Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 29 Dec 2024 15:57:17 +0100 Subject: [PATCH 19/33] Update test --- .github/workflows/test.yaml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 30ccca5b0e9..5a41c986098 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,10 +9,9 @@ on: env: ENVGHT: ${{ secrets.GITHUB_TOKEN }} ENVGHU: ${{ github.token }} - VARAAA: ${{ vars.AAA }} - SECBBB: ${{ secrets.BBB }} - VARREPORGCCC: ${{ vars.CCC }} - ENVFIX: "abc" + TEST_ACCESS_KEY: ${{ secrets.TEST_ACCESS_KEY }} + TEST_VAR_REPO: ${{ vars.TEST_VAR_REPO }} + ENVLOCAL: "varenvlocal" jobs: testjob: @@ -25,14 +24,6 @@ jobs: echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH" echo "repo-token: ${{secrets.GITHUB_TOKEN}}" - echo "variable org: ${{vars.AAA}}" - echo "env prg: ${{env.AAA}}" - echo "env prg: ${{env.VARAAA}}" - echo "secret org: ${{secrets.BBB}}" - echo "variable repository of orga: ${{vars.CCC}}" - echo "ENVGHT: ${{env.ENVGHT}}" - echo "ENVGHU: ${{env.ENVGHU}}" - echo "VARAAA: ${{vars.AAA}}" - echo "ENVAAA: ${{env.VARAAA}}" - echo "VARREPORGCCC: ${{env.VARREPORGCCC}}" - echo "ENVFIX: ${{env.ENVFIX}}" + echo "secret repository TEST_ACCESS_KEY: ${{secrets.TEST_ACCESS_KEY}}" + echo "variable repository : ${{vars.TEST_VAR_REPO}}" + echo "ENVLOCAL: ${{env.ENVLOCAL}}" From 92963af09f8c0f8c1aafff2934824e9f6b155f58 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 29 Dec 2024 17:04:54 +0100 Subject: [PATCH 20/33] Fix yml syntax --- .github/workflows/pr-18.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 5523dc1a55c..f3ffa3a2e24 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -26,14 +26,14 @@ jobs: # sudo apt install gh -y - name: Assign reviewer method 1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - url: ${{ github.event.pull_request.html_url }} - run: | - gh pr edit "$url" --add-assignee rycks --add-reviewer rycks - gh pr merge "$url" --merge --auto + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + url: ${{ github.event.pull_request.html_url }} + run: | + gh pr edit "$url" --add-assignee rycks --add-reviewer rycks + gh pr merge "$url" --merge --auto + - - name: Assign reviewer method 2 env: #REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer From 90a09b53da8b2e405ce112ca218267a0f625912f Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 29 Dec 2024 18:09:46 +0100 Subject: [PATCH 21/33] Fix cke warning --- htdocs/theme/eldy/global.inc.php | 5 +++-- htdocs/theme/md/style.css.php | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 5100b3af292..f93c410bd73 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6191,8 +6191,9 @@ a.cke_dialog_ui_button_ok span { a.cke_button, a.cke_combo_button { height: 18px !important; } -/* .cke_notifications_area { display: none; } */ - +div.cke_notifications_area .cke_notification_warning { + visibility: hidden; +} /* ============================================================================== */ /* ACE editor */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index bfbef5d2a8e..09de0954513 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6159,6 +6159,9 @@ a.cke_dialog_ui_button_ok span { a.cke_button, a.cke_combo_button { height: 18px !important; } +div.cke_notifications_area .cke_notification_warning { + visibility: hidden; +} /* ============================================================================== */ From 1e0479d19d4daeabda9ddf4a61fa381136154b83 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sun, 29 Dec 2024 18:11:59 +0100 Subject: [PATCH 22/33] Prepare 20.0.4 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 7558696ba00..4e38fe07568 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -35,7 +35,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '20.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '20.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 220090813d03e51aa6986791a5315e48f5cbef06 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Mon, 30 Dec 2024 10:28:23 +0100 Subject: [PATCH 23/33] there is no "name" field into llx_socpeople table --- htdocs/comm/contact.php | 12 ++++++------ htdocs/fourn/contact.php | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 19be738a50e..11ba439f86b 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -37,7 +37,7 @@ if (!$sortorder) { $sortorder = "ASC"; } if (!$sortfield) { - $sortfield = "p.name"; + $sortfield = "p.lastname"; } if ($page < 0) { $page = 0; @@ -81,7 +81,7 @@ if ($type == "f") { */ $sql = "SELECT s.rowid, s.nom as name, st.libelle as stcomm"; -$sql .= ", p.rowid as cidp, p.name, p.firstname, p.email, p.phone"; +$sql .= ", p.rowid as cidp, p.lastname, p.firstname, p.email, p.phone"; $sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,"; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; @@ -106,7 +106,7 @@ if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } if (!empty($search_lastname)) { - $sql .= " AND p.name LIKE '%".$db->escape($search_lastname)."%'"; + $sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'"; } if (!empty($search_firstname)) { $sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'"; @@ -115,8 +115,8 @@ if (!empty($search_company)) { $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'"; } if (!empty($contactname)) { // acces a partir du module de recherche - $sql .= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') "; - $sortfield = "p.name"; + $sql .= " AND (p.lastname LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') "; + $sortfield = "p.lastname"; $sortorder = "ASC"; } @@ -136,7 +136,7 @@ if ($resql) { print ''; print ''; - print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.name", $begin, $param, "", $sortfield, $sortorder); + print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.lastname", $begin, $param, "", $sortfield, $sortorder); print_liste_field_titre("Firstname", $_SERVER["PHP_SELF"], "p.firstname", $begin, $param, "", $sortfield, $sortorder); print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", $begin, $param, "", $sortfield, $sortorder); print_liste_field_titre("Email"); diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index a4504e8f83e..4b96b6b7659 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -55,7 +55,7 @@ if (!$sortorder) { $sortorder = "ASC"; } if (!$sortfield) { - $sortfield = "p.name"; + $sortfield = "p.lastname"; } $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; @@ -85,12 +85,12 @@ if (dol_strlen($stcomm)) { } if (dol_strlen($begin)) { - $sql .= " AND p.name LIKE '$begin%'"; + $sql .= " AND p.lastname LIKE '$begin%'"; } if ($contactname) { - $sql .= " AND p.name LIKE '%".strtolower($contactname)."%'"; - $sortfield = "p.name"; + $sql .= " AND p.lastname LIKE '%".strtolower($contactname)."%'"; + $sortfield = "p.lastname"; $sortorder = "ASC"; } @@ -110,7 +110,7 @@ if ($result) { print '
'; print ''; - print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.name", $begin, "", "", $sortfield, $sortorder); + print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.lastname", $begin, "", "", $sortfield, $sortorder); print_liste_field_titre("Firstname", $_SERVER["PHP_SELF"], "p.firstname", $begin, "", "", $sortfield, $sortorder); print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", $begin, "", "", $sortfield, $sortorder); print_liste_field_titre("Email"); From f91aadfe772602a6f5b6f73e54d049bab62a06d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Tue, 10 Dec 2024 13:16:57 +0100 Subject: [PATCH 24/33] Force the sales representative if they don't have permissions Force the sales representative if they don't have permissions --- htdocs/societe/list.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index df0efa51394..6ca82d69fbb 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -590,6 +590,11 @@ $sql .= " WHERE s.entity IN (".getEntity('societe').")"; if (!$user->hasRight('fournisseur', 'lire')) { $sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible } + +//Force the sales representative if they don't have permissions +if (!$user->hasRight('societe', 'client', 'voir') && !$socid) { + $search_sale = $user->id; +} // Search on sale representative if ($search_sale && $search_sale != '-1') { if ($search_sale == -2) { From 5890a8a7361915a5ac5f3c7865488f174d0c3a26 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 31 Dec 2024 05:20:02 +0100 Subject: [PATCH 25/33] FIX glob is better for search files with wilcard + avoid warning --- htdocs/install/upgrade2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 1b910bf388a..fe10299aac7 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4133,8 +4133,8 @@ function migrate_delete_old_files($db, $langs, $conf) foreach ($filetodeletearray as $filetodelete) { //print ''DOL_DOCUMENT_ROOT.$filetodelete."
\n"; - if (file_exists(DOL_DOCUMENT_ROOT.$filetodelete) || preg_match('/\*/', $filetodelete)) { - //print "Process file ".$filetodelete."\n"; + if (count(glob(DOL_DOCUMENT_ROOT.$filetodelete)) > 0) { + print "Process file ".$filetodelete."\n"; $result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, 0, 0, null, true, false); if (!$result) { $langs->load("errors"); From 4f673b0e2044d5a56a1d53156ec2600d5aab07a8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 31 Dec 2024 05:25:19 +0100 Subject: [PATCH 26/33] FIX remove debug --- htdocs/install/upgrade2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index fe10299aac7..171693b5863 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4134,7 +4134,7 @@ function migrate_delete_old_files($db, $langs, $conf) foreach ($filetodeletearray as $filetodelete) { //print ''DOL_DOCUMENT_ROOT.$filetodelete."
\n"; if (count(glob(DOL_DOCUMENT_ROOT.$filetodelete)) > 0) { - print "Process file ".$filetodelete."\n"; + //print "Process file ".$filetodelete."\n"; $result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, 0, 0, null, true, false); if (!$result) { $langs->load("errors"); From bca2134b6d6228aca3f422c13a2368e0d90cca5c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 31 Dec 2024 06:46:21 +0100 Subject: [PATCH 27/33] FIX units used scale and scale is an integer --- htdocs/product/class/html.formproduct.class.php | 2 +- htdocs/product/class/product.class.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index beee19cc7cf..8b28e474485 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -615,7 +615,7 @@ class FormProduct $return .= ''; } - $return .= ajax_combobox($name); + $return .= ajax_combobox($name, array(), 0, 0, 'resolve', '-99'); // avoid to have hidden value if scale = -1 (eg DM size) return $return; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f14814bc210..7db4a3480b3 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2697,18 +2697,18 @@ class Product extends CommonObject $this->net_measure = $obj->net_measure; $this->net_measure_units = $obj->net_measure_units; $this->weight = $obj->weight; - $this->weight_units = $obj->weight_units; + $this->weight_units = (is_null($obj->weight_units) ? 0 : $obj->weight_units); $this->length = $obj->length; - $this->length_units = $obj->length_units; + $this->length_units = (is_null($obj->length_units) ? 0 : $obj->length_units); $this->width = $obj->width; - $this->width_units = $obj->width_units; + $this->width_units = (is_null($obj->width_units) ? 0 : $obj->width_units); $this->height = $obj->height; - $this->height_units = $obj->height_units; + $this->height_units = (is_null($obj->height_units) ? 0 : $obj->height_units); $this->surface = $obj->surface; - $this->surface_units = $obj->surface_units; + $this->surface_units = (is_null($obj->surface_units) ? 0 : $obj->surface_units); $this->volume = $obj->volume; - $this->volume_units = $obj->volume_units; + $this->volume_units = (is_null($obj->volume_units) ? 0 : $obj->volume_units); $this->barcode = $obj->barcode; $this->barcode_type = $obj->fk_barcode_type; From f231ec6429ceaf800cf7085925881305ea8778b8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 31 Dec 2024 07:34:17 +0100 Subject: [PATCH 28/33] FIX #18713 --- htdocs/bom/bom_list.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 3300a8a0305..8dfd6269944 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -310,6 +310,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON t.fk_product = p.rowid"; // Add table from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -634,7 +635,11 @@ foreach ($object->fields as $key => $val) { } $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label if (!empty($arrayfields['t.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; + if ($key == "fk_product") { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'p.ref', '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; + } else { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; + } $totalarray['nbfield']++; } } From 06a0769b9073a7b1d5b030f13ead5595e41ae900 Mon Sep 17 00:00:00 2001 From: Quentin-Seekness <72733832+Quentin-Seekness@users.noreply.github.com> Date: Tue, 31 Dec 2024 09:51:37 +0100 Subject: [PATCH 29/33] FIX: Bug on select user on time.php (all project list) In the context of time.php, if we list all projects, $id (of the task) is not defined (because it is used when we are in the One task context). --- htdocs/projet/tasks/time.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index a83e573b2d4..4f7541724fc 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -2579,7 +2579,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print '
'; if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { if (empty($object->id)) { - $object->fetch($id); + $idTask = (!empty($id)) ? $id : $task_time->fk_element; + $object->fetch($idTask); } $contactsoftask = $object->getListContactId('internal'); if (!in_array($task_time->fk_user, $contactsoftask)) { @@ -2743,7 +2744,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) { if (empty($object->id)) { - $object->fetch($id); + $idTask = (!empty($id)) ? $id : $task_time->fk_element; + $object->fetch($idTask); } $contactsoftask = $object->getListContactId('internal'); if (!in_array($task_time->fk_user, $contactsoftask)) { From 9821429d4ca778ce7da647cfa371f8c9c71ae7d8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 31 Dec 2024 11:06:27 +0100 Subject: [PATCH 30/33] FIX swap tests --- htdocs/install/upgrade2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 171693b5863..53c9d12c399 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4133,7 +4133,7 @@ function migrate_delete_old_files($db, $langs, $conf) foreach ($filetodeletearray as $filetodelete) { //print ''DOL_DOCUMENT_ROOT.$filetodelete."
\n"; - if (count(glob(DOL_DOCUMENT_ROOT.$filetodelete)) > 0) { + if (preg_match('/\*/', $filetodelete) || file_exists(DOL_DOCUMENT_ROOT.$filetodelete)) { //print "Process file ".$filetodelete."\n"; $result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, 0, 0, null, true, false); if (!$result) { From c273495261f30d995c876533789eb64fa0493688 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 31 Dec 2024 17:12:37 +0100 Subject: [PATCH 31/33] Fix ci --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d6bd08b6223..83c36349416 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3998,7 +3998,7 @@ abstract class CommonObject $num = $this->db->num_rows($resql); $i = 0; while ($i < $num) { - $obj = $this->db->fetch_object($resql); + $obj = $this->db->fetch_object($resql); if ($justsource || $justtarget) { if ($justsource) { $this->linkedObjectsIds[$obj->targettype][$obj->rowid] = $obj->fk_target; From a0b6aa28a73b1cdd4cbd2db82a6c227b073ee8ce Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 31 Dec 2024 17:13:43 +0100 Subject: [PATCH 32/33] Fix phpcs --- htdocs/core/class/commonobject.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 83c36349416..cf013497aec 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3998,7 +3998,7 @@ abstract class CommonObject $num = $this->db->num_rows($resql); $i = 0; while ($i < $num) { - $obj = $this->db->fetch_object($resql); + $obj = $this->db->fetch_object($resql); if ($justsource || $justtarget) { if ($justsource) { $this->linkedObjectsIds[$obj->targettype][$obj->rowid] = $obj->fk_target; @@ -4058,11 +4058,11 @@ abstract class CommonObject $classpath = 'adherents/class'; $module = 'adherent'; } elseif ($objecttype == 'contact') { - $module = 'societe'; - } elseif ($objecttype == 'action') { - $module = 'agenda'; - $subelement = 'actionComm'; - } + $module = 'societe'; + } elseif ($objecttype == 'action') { + $module = 'agenda'; + $subelement = 'actionComm'; + } // Set classfile $classfile = strtolower($subelement); From e41dfcbbb3e7ade96799d0d45ccb43de03f92572 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 31 Dec 2024 17:17:00 +0100 Subject: [PATCH 33/33] Fix phpcs --- htdocs/core/class/commonobject.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a5edaaf2280..2463e47ca90 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4011,7 +4011,7 @@ abstract class CommonObject $num = $this->db->num_rows($resql); $i = 0; while ($i < $num) { - $obj = $this->db->fetch_object($resql); + $obj = $this->db->fetch_object($resql); if ($justsource || $justtarget) { if ($justsource) { $this->linkedObjectsIds[$obj->targettype][$obj->rowid] = $obj->fk_target; @@ -4071,11 +4071,11 @@ abstract class CommonObject $classpath = 'adherents/class'; $module = 'adherent'; } elseif ($objecttype == 'contact') { - $module = 'societe'; - } elseif ($objecttype == 'action') { - $module = 'agenda'; - $subelement = 'actionComm'; - } + $module = 'societe'; + } elseif ($objecttype == 'action') { + $module = 'agenda'; + $subelement = 'actionComm'; + } // Set classfile $classfile = strtolower($subelement);