浏览代码

MMIDocuments : OPtions to display complement and CGP title

Mathieu Moulin 1 年之前
父节点
当前提交
8ec8af41a8

+ 10 - 5
htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php

@@ -1932,8 +1932,11 @@ class pdf_eratosthene extends ModelePDFCommandes
 		//var_dump($object); die();
 		//var_dump($object->array_options['options_cgv_cpv']); die();
 		$complement = [];
-		if (!empty($object->array_options['options_cgv_cpv']))
-			$complement[] = '<h3>'.$outputlangs->transnoentities("DocumentMoreInfoCGP")."</h3>\r\n".$object->array_options['options_cgv_cpv'];
+		if (!empty($object->array_options['options_cgv_cpv'])) {
+			if (!empty($conf->global->MMIDOCUMENT_CGP_TITLE))
+				$complement[] = '<h3>'.$outputlangs->transnoentities("DocumentMoreInfoCGP")."</h3>";
+			$complement[] = $object->array_options['options_cgv_cpv'];
+		}
 		if (!empty($object->array_options['options_propal_decennale'])) {
 			if (!empty($conf->global->MMIPROJECT_DECENNALE_TITLE))
 				$complement[] = '<h3>'.$outputlangs->transnoentities("DocumentMoreInfoDecennale")."</h3>";
@@ -1976,9 +1979,11 @@ class pdf_eratosthene extends ModelePDFCommandes
 		$pdf->SetFont('', '', $default_font_size - 2);
 
 		// Titre
-		$pdf->SetXY($posx, $tab_top);
-		$tab_titre = 4;
-		$pdf->WriteHTMLCell($largcol, $tab_titre, $posx, $posy+$marg_top, '<b>'.$outputlangs->transnoentities("DocumentMoreInfo").'</b>', 0);
+		if (!empty($conf->global->DOCUMENT_COMPLEMENT_TITLE)) {
+			$pdf->SetXY($posx, $tab_top);
+			$tab_titre = 4;
+			$pdf->WriteHTMLCell($largcol, $tab_titre, $posx, $posy+$marg_top, '<b>'.$outputlangs->transnoentities("DocumentMoreInfo").'</b>', 0);
+		}
 		// Texte
 		$pdf->SetXY($posx, $tab_top + $tab_titre);
 		$tab_text = $this->heightComplement($pdf, $text, $default_font_size);

+ 10 - 5
htdocs/core/modules/facture/doc/pdf_sponge.modules.php

@@ -2526,8 +2526,11 @@ class pdf_sponge extends ModelePDFFactures
 		//var_dump($object); die();
 		//var_dump($object->array_options['options_cgv_cpv']); die();
 		$complement = [];
-		if (!empty($object->array_options['options_cgv_cpv']))
-			$complement[] = '<p><b>'.$outputlangs->transnoentities("DocumentMoreInfoCGP")."</b></p>\r\n".$object->array_options['options_cgv_cpv'];
+		if (!empty($object->array_options['options_cgv_cpv'])) {
+			if (!empty($conf->global->MMIDOCUMENT_CGP_TITLE))
+				$complement[] = '<h3>'.$outputlangs->transnoentities("DocumentMoreInfoCGP")."</h3>";
+			$complement[] = $object->array_options['options_cgv_cpv'];
+		}
 		if (!empty($object->array_options['options_propal_decennale'])) {
 			if (!empty($conf->global->MMIPROJECT_DECENNALE_TITLE))
 				$complement[] = '<h3>'.$outputlangs->transnoentities("DocumentMoreInfoDecennale")."</h3>";
@@ -2570,9 +2573,11 @@ class pdf_sponge extends ModelePDFFactures
 		$pdf->SetFont('', '', $default_font_size - 2);
 
 		// Titre
-		$pdf->SetXY($posx, $tab_top);
-		$tab_titre = 4;
-		$pdf->WriteHTMLCell($largcol, $tab_titre, $posx, $posy+$marg_top, '<b>'.$outputlangs->transnoentities("DocumentMoreInfo").'</b>', 0);
+		if (!empty($conf->global->DOCUMENT_COMPLEMENT_TITLE)) {
+			$pdf->SetXY($posx, $tab_top);
+			$tab_titre = 4;
+			$pdf->WriteHTMLCell($largcol, $tab_titre, $posx, $posy+$marg_top, '<b>'.$outputlangs->transnoentities("DocumentMoreInfo").'</b>', 0);
+		}
 		// Texte
 		$pdf->SetXY($posx, $tab_top + $tab_titre);
 		$tab_text = $this->heightComplement($pdf, $text, $default_font_size);

+ 10 - 5
htdocs/core/modules/propale/doc/pdf_cyan.modules.php

@@ -2055,8 +2055,11 @@ class pdf_cyan extends ModelePDFPropales
 		//var_dump($object); die();
 		//var_dump($object->array_options['options_cgv_cpv']); die();
 		$complement = [];
-		if (!empty($object->array_options['options_cgv_cpv']))
-			$complement[] = '<h3>'.$outputlangs->transnoentities("DocumentMoreInfoCGP")."</h3>\r\n".$object->array_options['options_cgv_cpv'];
+		if (!empty($object->array_options['options_cgv_cpv'])) {
+			if (!empty($conf->global->MMIDOCUMENT_CGP_TITLE))
+				$complement[] = '<h3>'.$outputlangs->transnoentities("DocumentMoreInfoCGP")."</h3>";
+			$complement[] = $object->array_options['options_cgv_cpv'];
+		}
 		if (!empty($object->array_options['options_propal_decennale'])) {
 			if (!empty($conf->global->MMIPROJECT_DECENNALE_TITLE))
 				$complement[] = '<h3>'.$outputlangs->transnoentities("DocumentMoreInfoDecennale")."</h3>";
@@ -2098,9 +2101,11 @@ class pdf_cyan extends ModelePDFPropales
 		$pdf->SetFont('', '', $default_font_size - 2);
 
 		// Titre
-		$pdf->SetXY($posx, $tab_top);
-		$tab_titre = 4;
-		$pdf->WriteHTMLCell($largcol, $tab_titre, $posx, $posy+$marg_top, '<b>'.$outputlangs->transnoentities("DocumentMoreInfo").'</b>', 0);
+		if (!empty($conf->global->DOCUMENT_COMPLEMENT_TITLE)) {
+			$pdf->SetXY($posx, $tab_top);
+			$tab_titre = 4;
+			$pdf->WriteHTMLCell($largcol, $tab_titre, $posx, $posy+$marg_top, '<b>'.$outputlangs->transnoentities("DocumentMoreInfo").'</b>', 0);
+		}
 		// Texte
 		$pdf->SetXY($posx, $tab_top + $tab_titre);
 		$tab_text = $this->heightComplement($pdf, $text, $default_font_size);

+ 1 - 1
htdocs/custom/mmidocuments

@@ -1 +1 @@
-Subproject commit 893570973670332bc9d1d726ed003562b0eebeec
+Subproject commit a783e326b15469ffb6472b60fb0fc8718ad0ceaf