From 1a16e41ce3f49d17c807fa159842ad645fd8af3d Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 14 Dec 2022 16:04:35 +0100 Subject: [PATCH 01/14] FIX : Can't see all time spent by all user --- htdocs/projet/tasks/time.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index ef8ac6aa9df..3be8c731545 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -162,7 +162,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_date_update = ''; $search_task_ref = ''; $search_task_label = ''; - $search_user = 0; + $search_user = -1; $search_valuebilled = ''; $toselect = ''; $search_array_options = array(); @@ -1277,7 +1277,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (empty($search_user)) { $search_user = $user->id; } - $sql .= " AND t.fk_user = ".((int) $search_user); + if($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user); } if ($search_note) { From 70b6b3d82d5053816d3f9b6be918588a52727a30 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 14 Dec 2022 15:21:42 +0000 Subject: [PATCH 02/14] Fixing style errors. --- htdocs/projet/tasks/time.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 3be8c731545..67024ee8fa5 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1277,7 +1277,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (empty($search_user)) { $search_user = $user->id; } - if($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user); + if ($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user); } if ($search_note) { From c0a0b977bf223d884dad6b2e41bf909ebbad7a0f Mon Sep 17 00:00:00 2001 From: hystepik Date: Fri, 16 Dec 2022 16:20:43 +0100 Subject: [PATCH 03/14] Fix #19485 : add of missing tickets trad key for menu --- htdocs/langs/en_US/ticket.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 0b54b1d5fa8..9897422d0c9 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -27,6 +27,7 @@ Permission56003=Delete tickets Permission56004=Manage tickets Permission56005=See tickets of all third parties (not effective for external users, always be limited to the third party they depend on) +Tickets=Tickets TicketDictType=Ticket - Types TicketDictCategory=Ticket - Groupes TicketDictSeverity=Ticket - Severities From 55b51b94f11c89c0d3f116ccce7b1b01a94171ab Mon Sep 17 00:00:00 2001 From: Braito Date: Tue, 20 Dec 2022 10:13:47 +0100 Subject: [PATCH 04/14] php 8 warning --- htdocs/projet/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index aabf14e8655..c4b5c29a149 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -489,11 +489,11 @@ llxHeader("", $title, $help_url); $titleboth = $langs->trans("LeadsOrProjects"); $titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default -if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { +if (!getDolGlobalInt('PROJECT_USE_OPPORTUNITIES')) { $titleboth = $langs->trans("Projects"); $titlenew = $langs->trans("NewProject"); } -if ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only +if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only $titleboth = $langs->trans("Leads"); $titlenew = $langs->trans("NewLead"); } From ec32d284eb0acb59ff9bc720f6170934579006d8 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 20 Dec 2022 11:31:44 +0100 Subject: [PATCH 05/14] FIX : Product list in setup.php in new Module --- htdocs/modulebuilder/template/admin/setup.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 1c46028b142..9ee07b3a1fd 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -55,6 +55,8 @@ global $langs, $user; // Libraries require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once '../lib/mymodule.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + //require_once "../class/myclass.class.php"; // Translations From 2f64eaff0514d8d3b1506fdbf26c485f000cfeb1 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 20 Dec 2022 12:25:20 +0100 Subject: [PATCH 06/14] FIX : CI --- htdocs/modulebuilder/template/admin/setup.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 9ee07b3a1fd..7bf97081341 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -57,6 +57,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once '../lib/mymodule.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + //require_once "../class/myclass.class.php"; // Translations From 1681674cdf7d0b14f4986630bb8b3bc58937fd27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Dec 2022 20:45:11 +0100 Subject: [PATCH 07/14] Update card.php --- htdocs/projet/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c4b5c29a149..7fe1f8f77e0 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -493,7 +493,7 @@ if (!getDolGlobalInt('PROJECT_USE_OPPORTUNITIES')) { $titleboth = $langs->trans("Projects"); $titlenew = $langs->trans("NewProject"); } -if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only +if (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 2) { // 2 = leads only $titleboth = $langs->trans("Leads"); $titlenew = $langs->trans("NewLead"); } From a0f282d100b9d87ad92690e60dffcb2ae053751a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Dec 2022 23:34:32 +0100 Subject: [PATCH 08/14] Try a fix of phpunit regression --- test/phpunit/phpunittest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/phpunit/phpunittest.xml b/test/phpunit/phpunittest.xml index 84b31a8dd3b..8157d3f3e7a 100644 --- a/test/phpunit/phpunittest.xml +++ b/test/phpunit/phpunittest.xml @@ -1,8 +1,8 @@ Date: Thu, 22 Dec 2022 00:02:22 +0100 Subject: [PATCH 09/14] Add log to test phpunit pb --- test/phpunit/AdminLibTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index 9ce135da263..0273960fb30 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -69,6 +69,8 @@ class AdminLibTest extends PHPUnit\Framework\TestCase $this->savdb=$db; print __METHOD__." db->type=".$db->type." user->id=".$user->id; + var_dump($GLOBALS); + //print " - db ".$db->db; print "\n"; } From 49e8b53fabaddd349b316104026ac4b6270687bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 00:33:03 +0100 Subject: [PATCH 10/14] Try fix for phpunit regression --- .travis.yml | 2 +- test/phpunit/AdminLibTest.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 45be1a9a6ba..4cf634d6b03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,7 +86,7 @@ install: rm $TRAVIS_BUILD_DIR/composer.json rm $TRAVIS_BUILD_DIR/composer.lock composer -V - composer self-update + composer self-update 2.4.4 composer -n init composer -n config vendor-dir htdocs/includes composer -n config -g vendor-dir htdocs/includes diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index 0273960fb30..95a54fe6502 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -69,7 +69,6 @@ class AdminLibTest extends PHPUnit\Framework\TestCase $this->savdb=$db; print __METHOD__." db->type=".$db->type." user->id=".$user->id; - var_dump($GLOBALS); //print " - db ".$db->db; print "\n"; From 599aa6009a686ced404e35879d4439e4510779c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 00:37:33 +0100 Subject: [PATCH 11/14] Try to solve phpunit regression --- test/phpunit/AdminLibTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index 95a54fe6502..a40e2257f3e 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -46,6 +46,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class AdminLibTest extends PHPUnit\Framework\TestCase { + protected $backupGlobalsBlacklist = array('conf', 'user', 'langs', 'db'); protected $savconf; protected $savuser; protected $savlangs; From bd90d783c7eedb015069e84e7a0da37e11117178 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 00:48:56 +0100 Subject: [PATCH 12/14] Reduce code --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4cf634d6b03..ec2205eb718 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,8 +87,8 @@ install: rm $TRAVIS_BUILD_DIR/composer.lock composer -V composer self-update 2.4.4 - composer -n init - composer -n config vendor-dir htdocs/includes + #composer -n init + #composer -n config vendor-dir htdocs/includes composer -n config -g vendor-dir htdocs/includes echo From e75617268b1e6ee71cbbfd77363fdbf0952329c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 01:04:06 +0100 Subject: [PATCH 13/14] Log --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ec2205eb718..62d04901e17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,7 +82,7 @@ before_install: install: - | - echo "Updating Composer" + echo "Updating Composer (version 2.5 is bugged and generate phpunit error Exception: Serialization of 'Closure' is not allowed)" rm $TRAVIS_BUILD_DIR/composer.json rm $TRAVIS_BUILD_DIR/composer.lock composer -V From 5dfd9af695eb06aa9015539c033df633adac055e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Dec 2022 01:07:02 +0100 Subject: [PATCH 14/14] Removed not required rm --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d23f98a7eca..39b0f2042a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -83,8 +83,8 @@ before_install: install: - | echo "Updating Composer (version 2.5 is bugged and generate phpunit error Exception: Serialization of 'Closure' is not allowed)" - rm $TRAVIS_BUILD_DIR/composer.json - rm $TRAVIS_BUILD_DIR/composer.lock + #rm $TRAVIS_BUILD_DIR/composer.json + #rm $TRAVIS_BUILD_DIR/composer.lock composer -V composer self-update 2.4.4 #composer -n init