Browse Source

Merge branch '16.0-mmi' of gogs.iprospective.fr:iProspective/dolibarr into 16.0-mmi

Mathieu Moulin 1 year ago
parent
commit
ac26f80daf

+ 28 - 0
htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php

@@ -329,6 +329,13 @@ class pdf_eratosthene extends ModelePDFCommandes
 				global $action;
 				$reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
 
+				// MMI update for height calculation
+				if (!empty($conf->global->MMI_DOCUMENT_PDF_HEIGHT_CALC)) {
+					$infottot_height = 0;
+					$parameters = array('object'=>$object, 'outputlangs'=>$outputlangs, 'infottot_height'=>&$infottot_height);
+					$reshook = $hookmanager->executeHooks('beforePDFCalculation', $parameters, $object, $action); 
+				}
+
 				// Set nblines with the new command lines content after hook
 				$nblines = count($object->lines);
 
@@ -338,6 +345,10 @@ class pdf_eratosthene extends ModelePDFCommandes
 				$pdf->SetAutoPageBreak(1, 0);
 
 				$heightforinfotot = 40; // Height reserved to output the info and total part
+				// MMI update for height calculation
+				if (!empty($conf->global->MMI_DOCUMENT_PDF_HEIGHT_CALC))
+					$heightforinfotot = $infottot_height;
+				//var_dump($heightforinfotot); die();
 				$heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page
 				$heightforfooter = $this->marge_basse + (empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 12 : 22); // Height reserved to output the footer (value include bottom margin)
 
@@ -1063,6 +1074,23 @@ class pdf_eratosthene extends ModelePDFCommandes
 			$posy = $pdf->GetY() + 1;
 		}
 
+		// MMI Hook
+		$parameters = array(
+			'object' => $object,
+			'outputlangs' => $outputlangs,
+			'pdf' => $pdf,
+			'posy' => &$posy,
+			'posxval' => $posxval,
+			'default_font_size' => $default_font_size,
+			'marge_gauche' => $this->marge_gauche,
+		);
+		$reshook = $hookmanager->executeHooks('drawInfoTable', $parameters, $this); // Note that $object may have been modified by hook
+		//var_dump($hookmanager); die();
+		//var_dump($reshook); die();
+		if ($reshook < 0) {
+			setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+		}
+
 		// Show payment mode
 		if ($object->mode_reglement_code
 			&& $object->mode_reglement_code != 'CHQ'

+ 1 - 1
htdocs/custom/milestone

@@ -1 +1 @@
-Subproject commit 9cd8a78f4cb1753fd957267610c9c0319e05b124
+Subproject commit 3766fb3d7154ebe009ae9609fca99e4096e4ef70

+ 1 - 1
htdocs/custom/mmidocuments

@@ -1 +1 @@
-Subproject commit bb6c903bf4de25828de07e2bfbe67292650ae19b
+Subproject commit d498264a6713adeabe6761bb72336686a6ec7e77

+ 1 - 1
htdocs/custom/mmiproject

@@ -1 +1 @@
-Subproject commit 87b6c0743212a4fe2c5ad3e38e3aa5da5ef6fba6
+Subproject commit 2c611eef2a8ad7c78be9749460dd005cd725aadc