Browse Source

Merge branch '16.0' into FIX#23087

Laurent Destailleur 2 years ago
parent
commit
17efd55af4

+ 6 - 6
.travis.yml

@@ -82,13 +82,13 @@ before_install:
 
 install:
 - |
-  echo "Updating Composer"
-  rm $TRAVIS_BUILD_DIR/composer.json
-  rm $TRAVIS_BUILD_DIR/composer.lock
+  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
-  composer self-update
-  composer -n init
-  composer -n config vendor-dir htdocs/includes
+  composer self-update 2.4.4
+  #composer -n init
+  #composer -n config vendor-dir htdocs/includes
   composer -n config -g vendor-dir htdocs/includes
   echo
 

+ 1 - 0
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

+ 0 - 1
htdocs/modulebuilder/template/admin/setup.php

@@ -55,7 +55,6 @@ 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

+ 2 - 2
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 (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 2) { // 2 = leads only
 	$titleboth = $langs->trans("Leads");
 	$titlenew = $langs->trans("NewLead");
 }

+ 2 - 2
htdocs/projet/tasks/time.php

@@ -164,7 +164,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 = array();
 	$search_array_options = array();
@@ -1346,7 +1346,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) {

+ 2 - 0
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;
@@ -69,6 +70,7 @@ class AdminLibTest extends PHPUnit\Framework\TestCase
 		$this->savdb=$db;
 
 		print __METHOD__." db->type=".$db->type." user->id=".$user->id;
+
 		//print " - db ".$db->db;
 		print "\n";
 	}

+ 2 - 2
test/phpunit/phpunittest.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE phpunit SYSTEM "phpunit.dtd" >
 <phpunit
-	backupGlobals="true"
-	backupStaticAttributes="false"
+	backupGlobals="false"
+	backupStaticAttributes="true"
 	convertErrorsToExceptions="true"
 	convertNoticesToExceptions="true"
 	convertWarningsToExceptions="true"