From bf128fc234f6ea60a687eca285db24665e9095f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 28 Jun 2023 18:52:18 +0200 Subject: [PATCH 01/31] Fix warning --- htdocs/societe/list.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 4c5f0251485..7af26acc3ae 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1641,10 +1641,12 @@ while ($i < min($num, $limit)) { // Staff if (!empty($arrayfields['staff.code']['checked'])) { print ''; - if (!is_array($staffArray) || count($staffArray) == 0) { - $staffArray = $formcompany->effectif_array(1); + if (!empty($obj->staff_code)) { + if (empty($conf->cache['staffArray'])) { + $conf->cache['staffArray'] = $formcompany->effectif_array(1); + } + print $conf->cache['staffArray'][$obj->staff_code]; } - print $staffArray[$obj->staff_code]; print ''; if (!$i) { $totalarray['nbfield']++; From 2d1b6c7154cc179a029f40ffbd3be49812abe631 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 29 Jun 2023 12:32:49 +0200 Subject: [PATCH 02/31] add call_trigger variable --- htdocs/contact/class/contact.class.php | 9 +++++---- htdocs/societe/class/societe.class.php | 22 ++++++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index bc26f05611b..6f3a296cc1b 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -432,10 +432,11 @@ class Contact extends CommonObject /** * Add a contact into database * - * @param User $user Object user that create - * @return int <0 if KO, >0 if OK + * @param User $user Object user that create + * @param int $call_trigger 0=no, 1=yes + * @return int <0 if KO, >0 if OK */ - public function create($user) + public function create($user, $call_trigger = 1) { global $conf, $langs; @@ -513,7 +514,7 @@ class Contact extends CommonObject } } - if (!$error) { + if (!$error && $call_trigger) { // Call trigger $result = $this->call_trigger('CONTACT_CREATE', $user); if ($result < 0) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 941b992bdc8..7e2e86bca94 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -872,10 +872,11 @@ class Societe extends CommonObject * Create third party in database. * $this->code_client = -1 and $this->code_fournisseur = -1 means automatic assignement. * - * @param User $user Object of user that ask creation - * @return int >=0 if OK, <0 if KO + * @param User $user Object of user that ask creation + * @param int $call_trigger 0=no, 1=yes + * @return int >=0 if OK, <0 if KO */ - public function create(User $user) + public function create(User $user, $call_trigger = 1) { global $langs, $conf, $mysoc; @@ -1009,7 +1010,7 @@ class Societe extends CommonObject $this->add_commercial($user, $user->id); } - if ($ret >= 0) { + if ($ret >= 0 && $call_trigger) { // Call trigger $result = $this->call_trigger('COMPANY_CREATE', $user); if ($result < 0) { @@ -1052,12 +1053,13 @@ class Societe extends CommonObject /** * Create a contact/address from thirdparty * - * @param User $user Object user - * @param int $no_email 1=Do not send mailing, 0=Ok to recieve mailling - * @param array $tags Array of tag to affect to contact - * @return int <0 if KO, >0 if OK + * @param User $user Object user + * @param int $no_email 1=Do not send mailing, 0=Ok to recieve mailling + * @param array $tags Array of tag to affect to contact + * @param int $call_trigger 0=no, 1=yes + * @return int <0 if KO, >0 if OK */ - public function create_individual(User $user, $no_email = 0, $tags = array()) + public function create_individual(User $user, $no_email = 0, $tags = array(), $call_trigger = 1) { global $conf; @@ -1085,7 +1087,7 @@ class Societe extends CommonObject $this->setUpperOrLowerCase(); $contact->phone_pro = $this->phone; - $contactId = $contact->create($user); + $contactId = $contact->create($user, $call_trigger); if ($contactId < 0) { $error++; $this->error = $contact->error; From 7862409a256ab2c41894ca69c6f0753d33cdd587 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 30 Jun 2023 09:29:49 +0200 Subject: [PATCH 03/31] fix variable --- htdocs/contact/class/contact.class.php | 6 +++--- htdocs/societe/class/societe.class.php | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 6f3a296cc1b..0e20662837d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -433,10 +433,10 @@ class Contact extends CommonObject * Add a contact into database * * @param User $user Object user that create - * @param int $call_trigger 0=no, 1=yes + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - public function create($user, $call_trigger = 1) + public function create($user, $notrigger = 0) { global $conf, $langs; @@ -514,7 +514,7 @@ class Contact extends CommonObject } } - if (!$error && $call_trigger) { + if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('CONTACT_CREATE', $user); if ($result < 0) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 7e2e86bca94..bc62db57465 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -873,10 +873,10 @@ class Societe extends CommonObject * $this->code_client = -1 and $this->code_fournisseur = -1 means automatic assignement. * * @param User $user Object of user that ask creation - * @param int $call_trigger 0=no, 1=yes + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int >=0 if OK, <0 if KO */ - public function create(User $user, $call_trigger = 1) + public function create(User $user, $notrigger = 0) { global $langs, $conf, $mysoc; @@ -1010,7 +1010,7 @@ class Societe extends CommonObject $this->add_commercial($user, $user->id); } - if ($ret >= 0 && $call_trigger) { + if ($ret >= 0 && !$notrigger) { // Call trigger $result = $this->call_trigger('COMPANY_CREATE', $user); if ($result < 0) { @@ -1056,10 +1056,10 @@ class Societe extends CommonObject * @param User $user Object user * @param int $no_email 1=Do not send mailing, 0=Ok to recieve mailling * @param array $tags Array of tag to affect to contact - * @param int $call_trigger 0=no, 1=yes + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - public function create_individual(User $user, $no_email = 0, $tags = array(), $call_trigger = 1) + public function create_individual(User $user, $no_email = 0, $tags = array(), $notrigger = 0) { global $conf; @@ -1087,7 +1087,7 @@ class Societe extends CommonObject $this->setUpperOrLowerCase(); $contact->phone_pro = $this->phone; - $contactId = $contact->create($user, $call_trigger); + $contactId = $contact->create($user, $notrigger); if ($contactId < 0) { $error++; $this->error = $contact->error; From aea1d25ea072b9737dfb551eb02c21e6e8df596c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Jun 2023 20:11:45 +0200 Subject: [PATCH 04/31] Disable github CI, Travis is back --- ...thub_ci_php71_pgsql.yml => github_ci_php71_pgsql.yml.disabled} | 0 ...thub_ci_php81_mysql.yml => github_ci_php81_mysql.yml.disabled} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{github_ci_php71_pgsql.yml => github_ci_php71_pgsql.yml.disabled} (100%) rename .github/workflows/{github_ci_php81_mysql.yml => github_ci_php81_mysql.yml.disabled} (100%) diff --git a/.github/workflows/github_ci_php71_pgsql.yml b/.github/workflows/github_ci_php71_pgsql.yml.disabled similarity index 100% rename from .github/workflows/github_ci_php71_pgsql.yml rename to .github/workflows/github_ci_php71_pgsql.yml.disabled diff --git a/.github/workflows/github_ci_php81_mysql.yml b/.github/workflows/github_ci_php81_mysql.yml.disabled similarity index 100% rename from .github/workflows/github_ci_php81_mysql.yml rename to .github/workflows/github_ci_php81_mysql.yml.disabled From e075cb5c3a56ef5ef98f8da5bbd754e61fa92c1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Jun 2023 20:17:37 +0200 Subject: [PATCH 05/31] Removed not used file --- .github/workflows/stale-issues.yml.disabled | 25 --------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/stale-issues.yml.disabled diff --git a/.github/workflows/stale-issues.yml.disabled b/.github/workflows/stale-issues.yml.disabled deleted file mode 100644 index 6e7dad5dc9b..00000000000 --- a/.github/workflows/stale-issues.yml.disabled +++ /dev/null @@ -1,25 +0,0 @@ -# See syntax file on https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -name: "Close stale issues (bugs and feature requests)" - -on: - schedule: - - cron: "0 20 * * *" - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: Dolibarr/stale@master - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 15 days (you should still be able to re-open it if required).' - stale-issue-label: 'Issue Stale (automatic label)' - exempt-issue-label: 'Priority High / Blocking' - days-before-stale: 365 - days-before-close: -1 - operations-per-run: 100 - #stale-pr-message: 'This PR is stale because it has been open 1 year with no activity. If this PR is still mergeable (no conflict, nor Continuous Integration errors), please comment to confirm this merge is still expected. Without comment, this issue will be closed automatically by stale bot in 15 days.' - stale-pr-label: 'PR Stale (automatic label)' - stale-pr-message: - exempt-pr-label: 'Priority Top Strategic' - \ No newline at end of file From 886c6b8576f2165ee69838e4a124d8b00bebebbf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Jul 2023 17:25:29 +0200 Subject: [PATCH 06/31] Fix phpcs --- htdocs/societe/class/societe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index bc62db57465..c7c709b3b4e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -873,7 +873,7 @@ class Societe extends CommonObject * $this->code_client = -1 and $this->code_fournisseur = -1 means automatic assignement. * * @param User $user Object of user that ask creation - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int >=0 if OK, <0 if KO */ public function create(User $user, $notrigger = 0) @@ -1056,7 +1056,7 @@ class Societe extends CommonObject * @param User $user Object user * @param int $no_email 1=Do not send mailing, 0=Ok to recieve mailling * @param array $tags Array of tag to affect to contact - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ public function create_individual(User $user, $no_email = 0, $tags = array(), $notrigger = 0) From 4ca1796e6137b2bda7bc74447985c294ad3d3680 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Jul 2023 17:26:07 +0200 Subject: [PATCH 07/31] Fix phpcs --- htdocs/contact/class/contact.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 0e20662837d..15e237903a2 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -433,12 +433,12 @@ class Contact extends CommonObject * Add a contact into database * * @param User $user Object user that create - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ public function create($user, $notrigger = 0) { - global $conf, $langs; + global $conf; $error = 0; $now = dol_now(); From df2b88a9d23d7ef488d1dd28b04ba4468ff79b3e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Jul 2023 20:33:10 +0200 Subject: [PATCH 08/31] Fix public access --- htdocs/public/members/public_list.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 700c0383516..cd7e51460ab 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -111,6 +111,10 @@ if (!$sortfield) { * View */ +if (empty($conf->global->MEMBER_PUBLIC_ENABLED)) { + httponly_accessforbidden('Public access of list of members is not enabled'); +} + $form = new Form($db); $morehead = ''; From 6cbd046fcf8253233bcd014a4175e7a9788c81ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Jul 2023 21:00:43 +0200 Subject: [PATCH 09/31] Add maintenance tool --- test/other/test_uncrypt.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 test/other/test_uncrypt.php diff --git a/test/other/test_uncrypt.php b/test/other/test_uncrypt.php new file mode 100755 index 00000000000..f57815aa2a2 --- /dev/null +++ b/test/other/test_uncrypt.php @@ -0,0 +1,20 @@ +#!/usr/bin/env php + Date: Sun, 2 Jul 2023 21:05:36 +0200 Subject: [PATCH 10/31] Fix initdemo script --- dev/initdemo/initdemopassword.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/initdemo/initdemopassword.sh b/dev/initdemo/initdemopassword.sh index 12b09a02186..6f00beed36c 100755 --- a/dev/initdemo/initdemopassword.sh +++ b/dev/initdemo/initdemopassword.sh @@ -152,7 +152,7 @@ fi if [ "x${demopasshash}" != "xpassword_hash" ] then - echo '' > /tmp/tmp.php + echo '' > /tmp/tmp.php newpass=`php -f /tmp/tmp.php` rm /tmp/tmp.php else From 8d91ffcd22a590c5763487df453c946711bd1fde Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Jul 2023 21:15:29 +0200 Subject: [PATCH 11/31] Fix separator --- htdocs/comm/action/peruser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 1830ad239a3..a12d3098de7 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -1394,10 +1394,10 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $ids1 = ''; $ids2 = ''; if (!empty($cases1[$h]) && is_array($cases1[$h]) && count($cases1[$h]) && array_keys($cases1[$h])) { - $ids1 = join(',', array_keys($cases1[$h])); + $ids1 = join(', ', array_keys($cases1[$h])); } if (!empty($cases2[$h]) && is_array($cases2[$h]) && count($cases2[$h]) && array_keys($cases2[$h])) { - $ids2 = join(',', array_keys($cases2[$h])); + $ids2 = join(', ', array_keys($cases2[$h])); } if ($h == $begin_h) { From 7f866cb65fdd0b768fe3a9bb1f879f31a7405393 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Jul 2023 15:37:24 +0200 Subject: [PATCH 12/31] Fix tcpdi --- htdocs/includes/tcpdi/tcpdi_parser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/includes/tcpdi/tcpdi_parser.php b/htdocs/includes/tcpdi/tcpdi_parser.php index 13e9839f2b4..88cde975306 100644 --- a/htdocs/includes/tcpdi/tcpdi_parser.php +++ b/htdocs/includes/tcpdi/tcpdi_parser.php @@ -104,7 +104,7 @@ class tcpdi_parser { * XREF data. * @protected */ - protected $xref = array(); + public $xref = array(); /** * Object streams. @@ -147,7 +147,7 @@ class tcpdi_parser { * * @private array */ - private $pages; + public $pages; /** * Page count From 5a752493fbe0dda4e9e52280a817cb79fc0a6d08 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Jul 2023 15:40:48 +0200 Subject: [PATCH 13/31] Revert "Fix tcpdi" This reverts commit 7f866cb65fdd0b768fe3a9bb1f879f31a7405393. --- htdocs/includes/tcpdi/tcpdi_parser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/includes/tcpdi/tcpdi_parser.php b/htdocs/includes/tcpdi/tcpdi_parser.php index 88cde975306..13e9839f2b4 100644 --- a/htdocs/includes/tcpdi/tcpdi_parser.php +++ b/htdocs/includes/tcpdi/tcpdi_parser.php @@ -104,7 +104,7 @@ class tcpdi_parser { * XREF data. * @protected */ - public $xref = array(); + protected $xref = array(); /** * Object streams. @@ -147,7 +147,7 @@ class tcpdi_parser { * * @private array */ - public $pages; + private $pages; /** * Page count From 34f3ecd49eec28327999bc911fae6b693405d8a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Jul 2023 18:04:00 +0200 Subject: [PATCH 14/31] Trans --- htdocs/langs/en_US/mrp.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 9e1c8bb64ce..cce2c72d54c 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -113,3 +113,4 @@ MoChildGenerate=Generate Child Mo ParentMo=MO Parent MOChild=MO Child BomCantAddChildBom=The nomenclature %s is already present in the tree leading to the nomenclature %s +BOMNetNeeds = BOM Net Needs From 8e7d9578cae855acc35746832d7da6a117c5a711 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Jul 2023 21:57:43 +0200 Subject: [PATCH 15/31] Typo --- htdocs/commande/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index fdfd57a5cf6..6a599354e48 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2038,6 +2038,8 @@ if ($action == 'create' && $usercancreate) { } } + print "\n"; + print ''; print dol_get_fiche_end(); From e3a0220658b7dfc05bfb499ace614fda170e4f3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Jul 2023 00:57:52 +0200 Subject: [PATCH 16/31] Bug has been fixed. --- htdocs/core/class/commonobject.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e50bf2b5d09..33ca155d89e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3675,7 +3675,8 @@ abstract class CommonObject $diff = price2num($total_tva_by_vats[$obj->vatrate] - $tmpvat, 'MT', 1); //print 'Line '.$i.' rowid='.$obj->rowid.' vat_rate='.$obj->vatrate.' total_ht='.$obj->total_ht.' total_tva='.$obj->total_tva.' total_ttc='.$obj->total_ttc.' total_ht_by_vats='.$total_ht_by_vats[$obj->vatrate].' total_tva_by_vats='.$total_tva_by_vats[$obj->vatrate].' (new calculation = '.$tmpvat.') total_ttc_by_vats='.$total_ttc_by_vats[$obj->vatrate].($diff?" => DIFF":"")."
\n"; if ($diff) { - if (abs($diff) > 0.1) { + if (abs($diff) > (10 * pow(10, -1 * getDolGlobalInt('MAIN_MAX_DECIMALS_TOT', 0)))) { + // If error is more than 10 times the accurancy of rounding. This should not happen. $errmsg = 'A rounding difference was detected into TOTAL but is too high to be corrected. Some data in your line may be corrupted. Try to edit each line manually.'; dol_syslog($errmsg, LOG_WARNING); dol_print_error('', $errmsg); From be4d1de436e4ed43fbd700c1ca790e8c8fb17f74 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 4 Jul 2023 14:57:01 +0200 Subject: [PATCH 17/31] fix: in BOM we don't have standard PDF model, if not set in config should not generate --- htdocs/bom/class/bom.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 5bc09528026..cb7246797ce 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1269,7 +1269,7 @@ class BOM extends CommonObject $outputlangs->load("products"); if (!dol_strlen($modele)) { - $modele = 'standard'; + $modele = ''; if ($this->model_pdf) { $modele = $this->model_pdf; @@ -1279,8 +1279,11 @@ class BOM extends CommonObject } $modelpath = "core/modules/bom/doc/"; - - return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + if (!empty($modele)) { + return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + } else { + return 0; + } } /** From 810a2ec6508092f108577139d1b48efa02387754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Jul 2023 09:54:45 +0200 Subject: [PATCH 18/31] fix no various payment in project overview test was inverted here https://github.com/Dolibarr/dolibarr/commit/edf79382bf474b7ee30cc30168531a9f9c1b7ef1 --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index a5541ffb4da..01eb346cadb 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -616,7 +616,7 @@ $listofreferent = array( 'lang'=>'banks', 'buttonnew'=>'AddVariousPayment', 'testnew'=>$user->hasRight('banque', 'modifier'), - 'test'=>!empty($conf->banque->enabled) && $user->hasRight('banque', 'lire') && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)), + 'test'=>!empty($conf->banque->enabled) && $user->hasRight('banque', 'lire') && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)), /* No need for this, available on dedicated tab "Agenda/Events" 'agenda'=>array( 'name'=>"Agenda", From 522fc061a82caca9b91436d87de735d7adfdec46 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 5 Jul 2023 10:14:31 +0200 Subject: [PATCH 19/31] add a check on service rights --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index b1ba563da95..202d1b6cbee 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -488,7 +488,7 @@ $typeid = $type; // List of products or services (type is type of category) if ($type == Categorie::TYPE_PRODUCT) { - if ($user->hasRight("product", "read")) { + if ($user->hasRight("product", "read") || $user->hasRight("service", "read")) { $permission = ($user->rights->produit->creer || $user->rights->service->creer); $prods = $object->getObjectsInCateg($type, 0, $limit, $offset); From 3477930db22192460caa314b2a5311085f045fa9 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Wed, 5 Jul 2023 17:34:04 +0200 Subject: [PATCH 20/31] fix #25275: tms default timestamp --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index f76136790c1..30ca2cc19fe 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -70,6 +70,7 @@ ALTER TABLE llx_bom_bom ADD COLUMN bomtype integer DEFAULT 0; UPDATE llx_emailcollector_emailcollector SET ref = 'Collect_Ticket_Requests' WHERE ref = 'Collect_Ticket_Requets'; UPDATE llx_emailcollector_emailcollector SET ref = 'Collect_Responses_In' WHERE ref = 'Collect_Responses'; +ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; UPDATE llx_document_model set nom = 'standard' where nom = 'Standard' and type ='stock'; From e6e915a5f1aad0d168fd41243af42c63d768aea4 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Wed, 5 Jul 2023 17:35:25 +0200 Subject: [PATCH 21/31] fix #25275: tms default timestamp --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index a1b6a210a5b..fbf0dc3a601 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -42,6 +42,8 @@ -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_directories FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_files FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); +ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; + ALTER TABLE llx_ecm_files ADD COLUMN note_private text AFTER fk_user_m; ALTER TABLE llx_ecm_files ADD COLUMN note_public text AFTER note_private; From 770ecceea0c1ac6f84662b56a793d5d8be01ee76 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Wed, 5 Jul 2023 17:54:15 +0200 Subject: [PATCH 22/31] fix #25275: tms default timestamp --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 67ff6f1fab3..baf189959b3 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -35,6 +35,8 @@ -- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN date_partnership_end date NULL; -- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN date_partnership_end DROP NOT NULL; +ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; + ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging real DEFAULT NULL; -- VMYSQL4.3 ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging real DEFAULT NULL; -- VPGSQL8.2 ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging real DEFAULT NULL USING packaging::real; From 72de19dd292dab505a7be0c5702ea6faae9480cc Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Wed, 5 Jul 2023 17:57:13 +0200 Subject: [PATCH 23/31] fix #25275: tms default timestamp --- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 7668d3bf558..b088fbd3084 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -51,6 +51,9 @@ -- VPGSQL8.2 ALTER TABLE llx_c_payment_term ALTER COLUMN rowid SET DEFAULT nextval('llx_c_payment_term_rowid_seq'); -- VPGSQL8.2 SELECT setval('llx_c_payment_term_rowid_seq', MAX(rowid)) FROM llx_c_payment_term; + +ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; + ALTER TABLE llx_entrepot ADD COLUMN barcode varchar(180) DEFAULT NULL; ALTER TABLE llx_entrepot ADD COLUMN fk_barcode_type integer DEFAULT NULL; From 5d26fa875768e67c1d4d7cc28ff7697276462a83 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Wed, 5 Jul 2023 17:58:29 +0200 Subject: [PATCH 24/31] fix #25275: tms default timestamp --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index c0b91d5191f..b55b794868c 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -33,6 +33,9 @@ -- Missing in v16 or lower + +ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; + ALTER TABLE llx_accounting_account DROP FOREIGN KEY fk_accounting_account_fk_pcg_version; ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32) NOT NULL; ALTER TABLE llx_accounting_account ADD CONSTRAINT fk_accounting_account_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accounting_system (pcg_version); From d432620708235e2eca0646a60aa0f0d019c78b12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 22:03:38 +0200 Subject: [PATCH 25/31] Fix pgsql regression --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 30ca2cc19fe..b5c39709581 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -70,7 +70,7 @@ ALTER TABLE llx_bom_bom ADD COLUMN bomtype integer DEFAULT 0; UPDATE llx_emailcollector_emailcollector SET ref = 'Collect_Ticket_Requests' WHERE ref = 'Collect_Ticket_Requets'; UPDATE llx_emailcollector_emailcollector SET ref = 'Collect_Responses_In' WHERE ref = 'Collect_Responses'; -ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +-- VMYSQL4.1 ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; UPDATE llx_document_model set nom = 'standard' where nom = 'Standard' and type ='stock'; From c61e4b0e25402e563925e5b0447c010ac1679ac8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 22:07:49 +0200 Subject: [PATCH 26/31] Better migration code --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index b5c39709581..ce80d854617 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -70,7 +70,7 @@ ALTER TABLE llx_bom_bom ADD COLUMN bomtype integer DEFAULT 0; UPDATE llx_emailcollector_emailcollector SET ref = 'Collect_Ticket_Requests' WHERE ref = 'Collect_Ticket_Requets'; UPDATE llx_emailcollector_emailcollector SET ref = 'Collect_Responses_In' WHERE ref = 'Collect_Responses'; --- VMYSQL4.1 ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +-- VMYSQL4.3 ALTER TABLE llx_emailcollector_emailcollector MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; UPDATE llx_document_model set nom = 'standard' where nom = 'Standard' and type ='stock'; From 924ba40c230093e3b692c659831dd36f7a71b5e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 22:09:34 +0200 Subject: [PATCH 27/31] Fix migration --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index fbf0dc3a601..1ba948599e9 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -42,7 +42,7 @@ -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_directories FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_files FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +-- VMYSQL4.3 ALTER TABLE llx_emailcollector_emailcollector MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; ALTER TABLE llx_ecm_files ADD COLUMN note_private text AFTER fk_user_m; ALTER TABLE llx_ecm_files ADD COLUMN note_public text AFTER note_private; From 4e1d9f13ea958e6a5234832959a947089b659b1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 22:10:35 +0200 Subject: [PATCH 28/31] Fix migration --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index baf189959b3..28aa6a5c248 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -35,7 +35,7 @@ -- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN date_partnership_end date NULL; -- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN date_partnership_end DROP NOT NULL; -ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +-- VMYSQL4.3 ALTER TABLE llx_emailcollector_emailcollector MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging real DEFAULT NULL; -- VMYSQL4.3 ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging real DEFAULT NULL; From 684194ce0bda42c065b0606d5a2b921f315c6007 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 22:11:07 +0200 Subject: [PATCH 29/31] Fix migration --- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index b088fbd3084..0bc83dee74c 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -51,8 +51,7 @@ -- VPGSQL8.2 ALTER TABLE llx_c_payment_term ALTER COLUMN rowid SET DEFAULT nextval('llx_c_payment_term_rowid_seq'); -- VPGSQL8.2 SELECT setval('llx_c_payment_term_rowid_seq', MAX(rowid)) FROM llx_c_payment_term; - -ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +-- VMYSQL4.3 ALTER TABLE llx_emailcollector_emailcollector MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; ALTER TABLE llx_entrepot ADD COLUMN barcode varchar(180) DEFAULT NULL; ALTER TABLE llx_entrepot ADD COLUMN fk_barcode_type integer DEFAULT NULL; From 7b59df2c9373983feb6f64681ec174d059e9c2b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 22:11:44 +0200 Subject: [PATCH 30/31] Fix migration --- htdocs/install/mysql/migration/16.0.0-17.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index b55b794868c..50a37908d36 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -34,7 +34,7 @@ -- Missing in v16 or lower -ALTER TABLE llx_emailcollector_emailcollector CHANGE COLUMN tms tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; +-- VMYSQL4.3 ALTER TABLE llx_emailcollector_emailcollector MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; ALTER TABLE llx_accounting_account DROP FOREIGN KEY fk_accounting_account_fk_pcg_version; ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32) NOT NULL; From dccaf116a25d7fcb6f9889f4e6af1b7dd547d516 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 6 Jul 2023 12:03:16 +0200 Subject: [PATCH 31/31] fix bankentries label for supplier payments --- htdocs/compta/prelevement/class/bonprelevement.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 92c0db1f55e..bb751332ec1 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -522,11 +522,13 @@ class BonPrelevement extends CommonObject } else { if ($this->type == 'bank-transfer') { $modeforaddpayment = 'payment_supplier'; + $labelforaddpayment = '(BankTransferPayment)'; } else { $modeforaddpayment = 'payment'; + $labelforaddpayment = '(WithdrawalPayment)'; } - $result = $paiement->addPaymentToBank($user, $modeforaddpayment, '(WithdrawalPayment)', $bankaccount, '', ''); + $result = $paiement->addPaymentToBank($user, $modeforaddpayment, $labelforaddpayment, $bankaccount, '', ''); if ($result < 0) { $error++;