Browse Source

Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop

Laurent Destailleur 2 years ago
parent
commit
403d6137e8

+ 1 - 0
ChangeLog

@@ -280,6 +280,7 @@ Following changes may create regressions for some external modules, but were nec
 * You must use "$objectoffield" to manipulate the current object inside the formulare of computed custom extrafields instead of $obj/$object.
 * Making a global search is sending the parameter using always the name search_all (instead of sometimes sall and search_all)
 * The property $url_last_version must be public if defined into module descriptor files;
+* Filters in class field definitions must be a Dolibarr filter syntax string.
 
 ***** ChangeLog for 16.0.5 compared to 16.0.4 *****
 

+ 5 - 1
build/debian/rules

@@ -19,6 +19,10 @@ override_dh_auto_clean:
 override_dh_auto_build:
 # Do nothing. Added to disable launchpad to use bugged dh_auto_build search for ant
 
+# Force the compression format for control files
+override_dh_builddeb:
+	dh_builddeb -- -Zxz
+
 #override_dh_compress:
 #	dh_compress --no-act -X.png
 
@@ -124,4 +128,4 @@ override_dh_fixperms:
 	# Give rights to the webserver on the upload directory
 	chown www-data:www-data debian/dolibarr/var/lib/dolibarr/documents
 	chmod 2775 debian/dolibarr/var/lib/dolibarr/documents
-	
+

+ 3 - 1
build/debian/source/options

@@ -1,3 +1,5 @@
-# Force use of gzip compression by dpkg-buildpackage
+# Force use of gzip compression by dpkg-buildpackage for the tarball *.debian.tar.gz
+# See also option --compression from command line of dpkg-buildpackage
+# Format for the control files are defined into the rules file in override_dh_builddeb section
 compression = "gzip"
 #compression-level = 9

+ 3 - 3
build/makepack-dolibarr.pl

@@ -1050,16 +1050,16 @@ if ($nboftargetok) {
 			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";
-			$cmd="dpkg-buildpackage -us -uc";
+			$cmd="dpkg-buildpackage -us -uc --compression=gzip";
 			print "Launch DEB build ($cmd)\n";
 			$ret=`$cmd 2>&1 3>&1`;
 			print $ret."\n";
 
 			chdir("$olddir");
-			
+
 			print "You can check bin package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n";
 			print "You can check src package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}.dsc\"\n";
-			
+
 			# Move to final dir
 			print "Move *_all.deb *.dsc *.orig.tar.gz *.changes to $NEWDESTI\n";
 			$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;

+ 1 - 1
htdocs/compta/facture/card.php

@@ -3908,7 +3908,7 @@ if ($action == 'create') {
 		print $objectsrc->getNomUrl(1);
 		// We check if Origin document (id and type is known) has already at least one invoice attached to it
 		$objectsrc->fetchObjectLinked($originid, $origin, '', 'facture');
-		if (is_array($objectsrc->linkedObjects['facture']) && count($objectsrc->linkedObjects['facture']) >= 1) {
+		if (isset($objectsrc->linkedObjects['facture']) && is_array($objectsrc->linkedObjects['facture']) && count($objectsrc->linkedObjects['facture']) >= 1) {
 			setEventMessages('WarningBillExist', null, 'warnings');
 			echo ' - '.$langs->trans('LatestRelatedBill').' '.end($objectsrc->linkedObjects['facture'])->getNomUrl(1);
 		}

+ 3 - 0
htdocs/compta/facture/list.php

@@ -2590,6 +2590,9 @@ if ($resql) {
 			$i++;
 		}
 
+		// Use correct digits number for totals
+		$totalarray['val']['total_margin'] = price2num($totalarray['val']['total_margin'], 'MT');
+
 		// Show total line
 		include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
 	}

+ 1 - 1
htdocs/core/tpl/objectline_create.tpl.php

@@ -763,7 +763,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
 							jQuery('#date_end').removeClass('inputmandatory');
 						}
 
-						if (<?php echo (int) $inputalsopricewithtax; ?> == 1 && data.pricebasetype == 'TTC') {
+						if (<?php echo (int) $inputalsopricewithtax; ?> == 1 && data.pricebasetype == 'TTC' && <?php print getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX') ? 'false' : 'true'; ?>) {
 							console.log("objectline_create.tpl set content of price_ttc");
 							jQuery("#price_ttc").val(data.price_ttc);
 						} else {

+ 4 - 3
htdocs/knowledgemanagement/knowledgerecord_list.php

@@ -1,6 +1,7 @@
 <?php
-/* Copyright (C) 2007-2017 Laurent Destailleur  <eldy@users.sourceforge.net>
- * Copyright (C) 2021       Frédéric France         <frederic.france@netlogic.fr>
+/* Copyright (C) 2007-2017	Laurent Destailleur		<eldy@users.sourceforge.net>
+ * Copyright (C) 2021		Frédéric France			<frederic.france@netlogic.fr>
+ * Copyright (C) 2023		Anthony Berton			<anthony.berton@bb2a.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -297,7 +298,7 @@ if (!empty($searchCategoryKnowledgemanagementList)) {
 		if (intval($searchCategoryKnowledgemanagement) == -2) {
 			$searchCategoryKnowledgemanagementSqlList[] = "NOT EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement)";
 		} elseif (intval($searchCategoryKnowledgemanagement) > 0) {
-			if ($searchCategoryKnowledgemanagementOperator == 0) {
+			if (empty($searchCategoryKnowledgemanagementOperator)) {
 				$searchCategoryKnowledgemanagementSqlList[] = " EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement AND ck.fk_categorie = ".((int) $searchCategoryKnowledgemanagement).")";
 			} else {
 				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryKnowledgemanagement);

+ 1 - 0
htdocs/langs/en_US/bills.lang

@@ -285,6 +285,7 @@ SetRevenuStamp=Set revenue stamp
 Billed=Billed
 RecurringInvoices=Recurring invoices
 RecurringInvoice=Recurring invoice
+RecurringInvoiceSource=Recurring invoice ar source
 RepeatableInvoice=Template invoice
 RepeatableInvoices=Template invoices
 RecurringInvoicesJob=Generation of recurring invoices (sales invoices)

+ 1 - 1
htdocs/master.inc.php

@@ -234,7 +234,7 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) {
 		$conf->global->INVOICE_DISABLE_REPLACEMENT = 1;
 	}
 
-	if ($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) {
+	if (($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) && !isset($conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX)) {
 		// For countries using the 2nd or 3rd tax, we disable input/edit of lines using the price including tax (because 2nb and 3rd tax not yet taken into account).
 		// Work In Progress to support all taxes into unit price entry when MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES is set.
 		$conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX = 1;

+ 2 - 2
htdocs/projet/list.php

@@ -742,7 +742,7 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
 	$param .= '&contextpage='.urlencode($contextpage);
 }
 if ($limit > 0 && $limit != $conf->liste_limit) {
-	$param .= '&limit='.urlencode($limit);
+	$param .= '&limit='.((int) $limit);
 }
 if ($search_all != '') {
 	$param .= '&search_all='.urlencode($search_all);
@@ -989,7 +989,7 @@ $moreforfilter .= '</div>';
 
 $moreforfilter .= '<div class="divsearchfield">';
 $tmptitle = $langs->trans('ProjectsWithThisContact');
-$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->selectcontacts(0, $search_project_contact ? $search_project_contact : '', 'search_project_contact', $tmptitle, '', '', 0, 'maxwidth250 widthcentpercentminusx');
+$moreforfilter .= img_picto($tmptitle, 'contact', 'class="pictofixedwidth"').$form->selectcontacts(0, $search_project_contact ? $search_project_contact : '', 'search_project_contact', $tmptitle, '', '', 0, 'maxwidth250 widthcentpercentminusx');
 $moreforfilter .= '</div>';
 
 // If the user can view thirdparties other than his'