From 394b3375a13de06b9e283dcf784111c41da09a72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Jun 2008 18:55:24 +0000 Subject: [PATCH] [Task #7349] Patch + Correction mise en page adresse contact sur PDF --- htdocs/admin/commande.php | 23 +++++++++++ htdocs/admin/facture.php | 23 +++++++++++ htdocs/admin/fichinter.php | 38 +++++++++++++++++++ htdocs/admin/propale.php | 24 ++++++++++++ .../modules/commande/pdf_edison.modules.php | 23 ++++++++++- .../modules/commande/pdf_einstein.modules.php | 28 +++++++++++--- .../modules/facture/pdf_crabe.modules.php | 31 ++++++++++++--- .../modules/facture/pdf_huitre.modules.php | 21 ++++++++++ .../modules/facture/pdf_oursin.modules.php | 21 ++++++++++ .../modules/fichinter/pdf_soleil.modules.php | 21 ++++++++++ .../propale/pdf_propale_azur.modules.php | 32 ++++++++++++---- .../propale/pdf_propale_jaune.modules.php | 27 +++++++++++-- htdocs/langs/en_US/admin.lang | 4 ++ htdocs/langs/fr_FR/admin.lang | 4 ++ 14 files changed, 298 insertions(+), 22 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 0ecd7f5dea8..0ad3f1f0677 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Andre Cianfarani * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -131,6 +132,11 @@ if ($_GET["action"] == 'setmod') dolibarr_set_const($db, "COMMANDE_ADDON",$_GET["value"]); } +if ($_POST["action"] == 'set_COMMANDE_DRAFT_WATERMARK') +{ + dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($_POST["COMMANDE_DRAFT_WATERMARK"])); +} + if ($_POST["action"] == 'set_COMMANDE_FREE_TEXT') { dolibarr_set_const($db, "COMMANDE_FREE_TEXT",trim($_POST["COMMANDE_FREE_TEXT"])); @@ -354,6 +360,11 @@ while (($file = readdir($handle))!==false) $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg); $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg); $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang); + // \TODO : $htmltooltip.='
'.$langs->trans("Escompte").': '.yn($module->option_escompte); + $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note); + $htmltooltip.='
'.$langs->trans("FreeLegalTextOnOrders").': '.yn($module->option_freetext); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark); + print ''; print $html->textwithhelp('',$htmltooltip,1,0); print ''; @@ -425,6 +436,18 @@ print '' print "\n"; print ''; +//Use draft Watermark +$var=!$var; +print "
"; +print ""; +print ''; +print $langs->trans("WatermarkOnDraftOrders").'
'; +print ''; +print ''; +print ''; +print "\n"; +print '
'; + print ''; print '
'; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 438dfa18870..a20a939f14e 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -145,6 +146,11 @@ if ($_POST["action"] == 'setribchq') dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$_POST["chq"]); } +if ($_POST["action"] == 'set_FACTURE_DRAFT_WATERMARK') +{ + dolibarr_set_const($db, "FACTURE_DRAFT_WATERMARK",trim($_POST["FACTURE_DRAFT_WATERMARK"])); +} + if ($_POST["action"] == 'set_FACTURE_FREE_TEXT') { dolibarr_set_const($db, "FACTURE_FREE_TEXT",trim($_POST["FACTURE_FREE_TEXT"])); @@ -427,6 +433,12 @@ while (($file = readdir($handle))!==false) $htmltooltip.='
'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1); $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + //TODO : $htmltooltip.='
'.$langs->trans("Escompte").': '.yn($module->option_escompte); + $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note); + $htmltooltip.='
'.$langs->trans("FreeLegalTextOnInvoices").': '.yn($module->option_freetext); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftInvoices").': '.yn($module->option_draft_watermark); + + print ''; print $html->textwithhelp('',$htmltooltip,1,0); print ''; @@ -608,6 +620,17 @@ print '' print "\n"; print ''; +$var=!$var; +print "
"; +print ""; +print ''; +print $langs->trans("WatermarkOnDraftBill").'
'; +print ''; +print ''; +print ''; +print "\n"; +print '
'; + print ''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 9487dd91c86..28cddb6aae6 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -50,6 +51,11 @@ if ($_POST["action"] == 'updateMask') if ($maskconst) dolibarr_set_const($db,$maskconst,$maskvalue); } +if ($_POST["action"] == 'set_FICHINTER_DRAFT_WATERMARK') +{ + dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($_POST["FICHINTER_DRAFT_WATERMARK"])); +} + if ($_GET["action"] == 'specimen') { $modele=$_GET["module"]; @@ -327,6 +333,10 @@ while (($file = readdir($handle))!==false) $htmltooltip.='
'.$langs->trans("Height").': '.$module->page_hauteur; $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark); print ''; print $html->textwithhelp('',$htmltooltip,1,0); print ''; @@ -341,6 +351,34 @@ closedir($handle); print ''; +//Autres Options +print "
"; +print_titre($langs->trans("OtherOptions")); + +print ''; +print ''; +print ''; +print ''; +print "\n"; +print "\n"; +$var=true; + +//Use draft Watermark +$var=!$var; +print ""; +print ""; +print '\n"; +print ''; + + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; +print $langs->trans("WatermarkOnDraftInterventionCards").'
'; +print ''; +print '
'; +print ''; +print "
'; + +print '
'; $db->close(); diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index daa5f565fed..7df46ea9546 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -77,6 +78,11 @@ if ($_GET["action"] == 'specimen') } } +if ($_POST["action"] == 'set_PROPALE_DRAFT_WATERMARK') +{ + dolibarr_set_const($db, "PROPALE_DRAFT_WATERMARK",trim($_POST["PROPALE_DRAFT_WATERMARK"])); +} + if ($_POST["action"] == 'set_PROPALE_FREE_TEXT') { dolibarr_set_const($db, "PROPALE_FREE_TEXT",trim($_POST["PROPALE_FREE_TEXT"])); @@ -378,6 +384,13 @@ while (($file = readdir($handle))!==false) $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg); $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg); $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang); + //TODO : $htmltooltip.='
'.$langs->trans("Escompte").': '.yn($module->option_escompte); + $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note); + $htmltooltip.='
'.$langs->trans("FreeLegalTextOnProposal").': '.yn($module->option_freetext); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark); + + + print ''; print $html->textwithhelp('',$htmltooltip,1,0); print ''; @@ -488,6 +501,17 @@ print '' print "\n"; print ''; +$var=!$var; +print "
"; +print ""; +print ''; +print $langs->trans("WatermarkOnDraftProposal").'
'; +print ''; +print ''; +print ''; +print "\n"; +print '
'; + print ''; diff --git a/htdocs/includes/modules/commande/pdf_edison.modules.php b/htdocs/includes/modules/commande/pdf_edison.modules.php index 42c3b45d257..eab62df824b 100644 --- a/htdocs/includes/modules/commande/pdf_edison.modules.php +++ b/htdocs/includes/modules/commande/pdf_edison.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -55,6 +56,7 @@ class pdf_edison extends ModelePDFCommandes $this->format = array($this->page_largeur,$this->page_hauteur); $this->option_multilang = 0; // Dispo en plusieurs langues + $this->option_draft_watermark = 1; //Support add of a watermark on drafts $this->error = ""; } @@ -309,9 +311,28 @@ class pdf_edison extends ModelePDFCommandes function _pagehead(&$pdf, $com) { - global $langs,$mysoc; + global $conf,$langs,$mysoc; $langs->load("orders"); + //Affiche le filigrane brouillon - Print Draft Watermark + if($com->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) + { + $watermark_angle=atan($this->page_hauteur/$this->page_largeur); + $watermark_x=5; + $watermark_y=$this->page_hauteur-25; //Set to $this->page_hauteur-50 or less if problems + $watermark_width=$this->page_hauteur; + $pdf->SetFont('Arial','B',50); + $pdf->SetTextColor(255,192,203); + //rotate + $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',cos($watermark_angle),sin($watermark_angle),-sin($watermark_angle),cos($watermark_angle),$watermark_x*$pdf->k,($pdf->h-$watermark_y)*$pdf->k,-$watermark_x*$pdf->k,-($pdf->h-$watermark_y)*$pdf->k)); + //print watermark + $pdf->SetXY($watermark_x,$watermark_y); + $pdf->Cell($watermark_width,25,clean_html($conf->global->COMMANDE_DRAFT_WATERMARK),0,2,"C",0); + //antirotate + $pdf->_out('Q'); + } + //Print content + $pdf->SetXY(10,8); if (defined("MAIN_INFO_SOCIETE_NOM")) { diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index 843aedf11d2..9cbdca3a02e 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -75,6 +76,7 @@ class pdf_einstein extends ModelePDFCommandes $this->option_escompte = 1; // Affiche si il y a eu escompte $this->option_credit_note = 1; // Gère les avoirs $this->option_freetext = 1; // Support add of a personalised text + $this->option_draft_watermark = 1; //Support add of a watermark on drafts if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') $this->franchise=1; @@ -762,6 +764,25 @@ class pdf_einstein extends ModelePDFCommandes $outputlangs->load("propal"); $outputlangs->load("companies"); + //Affiche le filigrane brouillon - Print Draft Watermark + if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) + { + $watermark_angle=atan($this->page_hauteur/$this->page_largeur); + $watermark_x=5; + $watermark_y=$this->page_hauteur-25; //Set to $this->page_hauteur-50 or less if problems + $watermark_width=$this->page_hauteur; + $pdf->SetFont('Arial','B',50); + $pdf->SetTextColor(255,192,203); + //rotate + $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',cos($watermark_angle),sin($watermark_angle),-sin($watermark_angle),cos($watermark_angle),$watermark_x*$pdf->k,($pdf->h-$watermark_y)*$pdf->k,-$watermark_x*$pdf->k,-($pdf->h-$watermark_y)*$pdf->k)); + //print watermark + $pdf->SetXY($watermark_x,$watermark_y); + $pdf->Cell($watermark_width,25,clean_html($conf->global->COMMANDE_DRAFT_WATERMARK),0,2,"C",0); + //antirotate + $pdf->_out('Q'); + } + //Print content + $pdf->SetTextColor(0,0,60); $pdf->SetFont('Arial','B',13); @@ -893,15 +914,12 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY(102,$posy+3); $pdf->SetFont('Arial','B',11); $pdf->MultiCell(106,4, $object->client->nom, 0, 'L'); - $posy+=4; // Nom client - $pdf->SetXY(102,$posy+4); - $pdf->SetFont('Arial','',9); - $pdf->MultiCell(106,4, $object->contact->getFullName($outputlangs,1), 0, 'L'); + $carac_client = "\n".$object->contact->getFullName($outputlangs,1); // Caractéristiques client - $carac_client=$object->contact->adresse; + $carac_client.=$object->contact->adresse; $carac_client.="\n".$object->contact->cp . " " . $object->contact->ville."\n"; if ($this->emetteur->pays_code != $object->contact->pays_code) { diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index e87314ba651..47d3af1556a 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -74,7 +75,9 @@ class pdf_crabe extends ModelePDFFactures $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 1; // Affiche si il y a eu escompte $this->option_credit_note = 1; // Gère les avoirs - $this->option_freetext = 1; // Support add of a personalised text + $this->option_freetext = 1; // Support add of a personalised text + $this->option_draft_watermark = 1; //Support add of a watermark on drafts + if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') $this->franchise=1; @@ -917,6 +920,25 @@ class pdf_crabe extends ModelePDFFactures $outputlangs->load("propal"); $outputlangs->load("companies"); + //Affiche le filigrane brouillon - Print Draft Watermark + if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) ) + { + $watermark_angle=atan($this->page_hauteur/$this->page_largeur); + $watermark_x=5; + $watermark_y=$this->page_hauteur-25; //Set to $this->page_hauteur-50 or less if problems + $watermark_width=$this->page_hauteur; + $pdf->SetFont('Arial','B',50); + $pdf->SetTextColor(255,192,203); + //rotate + $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',cos($watermark_angle),sin($watermark_angle),-sin($watermark_angle),cos($watermark_angle),$watermark_x*$pdf->k,($pdf->h-$watermark_y)*$pdf->k,-$watermark_x*$pdf->k,-($pdf->h-$watermark_y)*$pdf->k)); + //print watermark + $pdf->SetXY($watermark_x,$watermark_y); + $pdf->Cell($watermark_width,25,clean_html($conf->global->FACTURE_DRAFT_WATERMARK),0,2,"C",0); + //antirotate + $pdf->_out('Q'); + } + //Print content + $pdf->SetTextColor(0,0,60); $pdf->SetFont('Arial','B',13); @@ -1085,15 +1107,12 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY(102,$posy+3); $pdf->SetFont('Arial','B',11); $pdf->MultiCell(106,4, $object->client->nom, 0, 'L'); - $posy+=4; // Nom client - $pdf->SetXY(102,$posy+4); - $pdf->SetFont('Arial','',9); - $pdf->MultiCell(106,4, $object->contact->getFullName($outputlangs,1), 0, 'L'); + $carac_client = "\n".$object->contact->getFullName($outputlangs,1); // Caractéristiques client - $carac_client=$object->contact->adresse; + $carac_client.="\n".$object->contact->adresse; $carac_client.="\n".$object->contact->cp . " " . $object->contact->ville."\n"; if ($this->emetteur->pays_code != $object->contact->pays_code) { diff --git a/htdocs/includes/modules/facture/pdf_huitre.modules.php b/htdocs/includes/modules/facture/pdf_huitre.modules.php index 5fae1b037ec..7df7f546ac0 100644 --- a/htdocs/includes/modules/facture/pdf_huitre.modules.php +++ b/htdocs/includes/modules/facture/pdf_huitre.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -71,6 +72,7 @@ class pdf_huitre extends ModelePDFFactures $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 0; // Affiche si il y a eu escompte $this->option_credit_note = 0; // Gère les avoirs + $this->option_draft_watermark = 1; //Support add of a watermark on drafts // Recupere emmetteur $this->emetteur=$mysoc; @@ -506,6 +508,25 @@ class pdf_huitre extends ModelePDFFactures $tab4_sl = 4; $ligne = 2; + //Affiche le filigrane brouillon - Print Draft Watermark + if($fac->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) ) + { + $watermark_angle=atan($this->page_hauteur/$this->page_largeur); + $watermark_x=5; + $watermark_y=$this->page_hauteur-50; + $watermark_width=$this->page_hauteur; + $pdf->SetFont('Arial','B',50); + $pdf->SetTextColor(255,192,203); + //rotate + $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',cos($watermark_angle),sin($watermark_angle),-sin($watermark_angle),cos($watermark_angle),$watermark_x*$pdf->k,($pdf->h-$watermark_y)*$pdf->k,-$watermark_x*$pdf->k,-($pdf->h-$watermark_y)*$pdf->k)); + //print watermark + $pdf->SetXY($watermark_x,$watermark_y); + $pdf->Cell($watermark_width,25,clean_html($conf->global->FACTURE_DRAFT_WATERMARK),0,2,"C",0); + //antirotate + $pdf->_out('Q'); + } + //Print content + $pdf->SetXY(10,5); // Logo diff --git a/htdocs/includes/modules/facture/pdf_oursin.modules.php b/htdocs/includes/modules/facture/pdf_oursin.modules.php index 6c4495b232a..c61c32d6410 100644 --- a/htdocs/includes/modules/facture/pdf_oursin.modules.php +++ b/htdocs/includes/modules/facture/pdf_oursin.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005 Sylvain SCATTOLINI * Copyright (C) 2006 Rodolphe Quiedeville + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -72,6 +73,7 @@ class pdf_oursin extends ModelePDFFactures $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 0; // Affiche si il y a eu escompte $this->option_credit_note = 1; // Gère les avoirs + $this->option_draft_watermark = 1; //Support add of a watermark on drafts if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') $this->franchise=1; @@ -639,6 +641,25 @@ class pdf_oursin extends ModelePDFFactures $langs->load("bills"); $langs->load("propal"); $langs->load("companies"); + + //Affiche le filigrane brouillon - Print Draft Watermark + if($fac->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) ) + { + $watermark_angle=atan($this->page_hauteur/$this->page_largeur); + $watermark_x=5; + $watermark_y=$this->page_hauteur-50; + $watermark_width=$this->page_hauteur; + $pdf->SetFont('Arial','B',50); + $pdf->SetTextColor(255,192,203); + //rotate + $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',cos($watermark_angle),sin($watermark_angle),-sin($watermark_angle),cos($watermark_angle),$watermark_x*$pdf->k,($pdf->h-$watermark_y)*$pdf->k,-$watermark_x*$pdf->k,-($pdf->h-$watermark_y)*$pdf->k)); + //print watermark + $pdf->SetXY($watermark_x,$watermark_y); + $pdf->Cell($watermark_width,25,clean_html($conf->global->FACTURE_DRAFT_WATERMARK),0,2,"C",0); + //antirotate + $pdf->_out('Q'); + } + //Print content $pdf->SetTextColor(0,0,60); $pdf->SetFont('Arial','B',13); diff --git a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php index 3230d186509..08709509005 100644 --- a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php +++ b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -67,6 +68,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->option_condreg = 0; // Affiche conditions règlement $this->option_codeproduitservice = 0; // Affiche code produit-service $this->option_multilang = 0; // Dispo en plusieurs langues + $this->option_draft_watermark = 1; //Support add of a watermark on drafts // Recupere code pays de l'emmetteur $this->emetteur=$mysoc; @@ -137,6 +139,25 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->Open(); $pdf->AddPage(); + //Affiche le filigrane brouillon - Print Draft Watermark + if($fichinter->statut==0 && (! empty($conf->global->FICHINTER_DRAFT_WATERMARK)) ) + { + $watermark_angle=atan($this->page_hauteur/$this->page_largeur); + $watermark_x=5; + $watermark_y=$this->page_hauteur-50; + $watermark_width=$this->page_hauteur; + $pdf->SetFont('Arial','B',50); + $pdf->SetTextColor(255,192,203); + //rotate + $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',cos($watermark_angle),sin($watermark_angle),-sin($watermark_angle),cos($watermark_angle),$watermark_x*$pdf->k,($pdf->h-$watermark_y)*$pdf->k,-$watermark_x*$pdf->k,-($pdf->h-$watermark_y)*$pdf->k)); + //print watermark + $pdf->SetXY($watermark_x,$watermark_y); + $pdf->Cell($watermark_width,25,clean_html($conf->global->FICHINTER_DRAFT_WATERMARK),0,2,"C",0); + //antirotate + $pdf->_out('Q'); + } + //Print content + $posy=$this->marge_haute; $pdf->SetXY($this->marge_gauche,$posy); diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index bd7b639be13..3375c796ac2 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -74,7 +75,8 @@ class pdf_propale_azur extends ModelePDFPropales $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 1; // Affiche si il y a eu escompte $this->option_credit_note = 1; // Gère les avoirs - $this->option_freetext = 1; // Support add of a personalised text + $this->option_freetext = 1; // Support add of a personalised text + $this->option_draft_watermark = 1; //Support add of a watermark on drafts if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') $this->franchise=1; @@ -786,7 +788,26 @@ class pdf_propale_azur extends ModelePDFPropales $outputlangs->load("bills"); $outputlangs->load("propal"); $outputlangs->load("companies"); - + + //Affiche le filigrane brouillon - Print Draft Watermark + if($object->statut==0 && (! empty($conf->global->PROPALE_DRAFT_WATERMARK)) ) + { + $watermark_angle=atan($this->page_hauteur/$this->page_largeur); + $watermark_x=5; + $watermark_y=$this->page_hauteur-25; //Set to $this->page_hauteur-50 or less if problems + $watermark_width=$this->page_hauteur; + $pdf->SetFont('Arial','B',50); + $pdf->SetTextColor(255,192,203); + //rotate + $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',cos($watermark_angle),sin($watermark_angle),-sin($watermark_angle),cos($watermark_angle),$watermark_x*$pdf->k,($pdf->h-$watermark_y)*$pdf->k,-$watermark_x*$pdf->k,-($pdf->h-$watermark_y)*$pdf->k)); + //print watermark + $pdf->SetXY($watermark_x,$watermark_y); + $pdf->Cell($watermark_width,25,clean_html($conf->global->PROPALE_DRAFT_WATERMARK),0,2,"C",0); + //antirotate + $pdf->_out('Q'); + } + + //Prepare la suite $pdf->SetTextColor(0,0,60); $pdf->SetFont('Arial','B',13); @@ -919,15 +940,12 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->SetXY(102,$posy+3); $pdf->SetFont('Arial','B',11); $pdf->MultiCell(106,4, $object->client->nom, 0, 'L'); - $posy+=4; // Nom client - $pdf->SetXY(102,$posy+4); - $pdf->SetFont('Arial','',9); - $pdf->MultiCell(106,4, $object->contact->getFullName($outputlangs,1), 0, 'L'); + $carac_client = "\n".$object->contact->getFullName($outputlangs,1); // Caractéristiques client - $carac_client=$object->contact->adresse; + $carac_client.="\n".$object->contact->adresse; $carac_client.="\n".$object->contact->cp . " " . $object->contact->ville."\n"; if ($this->emetteur->pays_code != $object->contact->pays_code) { diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php index e50f9480600..314ed9b0bd7 100644 --- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -16,14 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * or see http://www.gnu.org/ - * - * $Id$ */ /** \file htdocs/includes/modules/propale/pdf_propale_jaune.modules.php \ingroup propale \brief Fichier de la classe permettant de générer les propales au modèle Jaune - \version $Revision$ + \version $Id$ */ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); @@ -54,6 +53,8 @@ class pdf_propale_jaune extends ModelePDFPropales $this->page_largeur = 210; $this->page_hauteur = 297; $this->format = array($this->page_largeur,$this->page_hauteur); + + $this->option_draft_watermark = 1; //Support add of a watermark on drafts $this->error = ""; @@ -284,6 +285,26 @@ class pdf_propale_jaune extends ModelePDFPropales function _pagehead(&$pdf, $propale) { + //Affiche le filigrane brouillon - Print Draft Watermark + if($propale->statut==0 && defined("PROPALE_DRAFT_WATERMARK") ) + { + $watermark_angle=deg2rad(55); + $watermark_x=5; + $watermark_y=$this->page_hauteur-50; + $watermark_width=300; + $pdf->SetFont('Arial','B',50); + $pdf->SetTextColor(255,192,203); + //rotate + $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm',cos($watermark_angle),sin($watermark_angle),-sin($watermark_angle),cos($watermark_angle),$watermark_x*$pdf->k,($pdf->h-$watermark_y)*$pdf->k,-$watermark_x*$pdf->k,-($pdf->h-$watermark_y)*$pdf->k)); + //print watermark + $pdf->SetXY($watermark_x,$watermark_y); + $pdf->Cell($watermark_width,25,clean_html(PROPALE_DRAFT_WATERMARK),0,2,"C",0); + //antirotate + $pdf->_out('Q'); + } + + //print Content + $pdf->SetXY(12,42); if (defined("FAC_PDF_INTITULE")) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 52b902239ab..1ffec4cebc0 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -642,6 +642,7 @@ EnableEditDeleteValidInvoice=Enable the possibility to edit/delete valid invoice SuggestPaymentByRIBOnAccount=Suggest payment by withdraw on account SuggestPaymentByChequeToAddress=Suggest payment by cheque to FreeLegalTextOnInvoices=Free text on invoices +WatermarkOnDraftInvoices=Watermark on draft invoices (any if empty) ##### Proposals ##### PropalSetup=Commercial proposals module setup CreateForm=Create forms @@ -657,6 +658,7 @@ AddShippingDateAbility=Add shipping date ability AddDeliveryAddressAbility=Add delivery date ability UseOptionLineIfNoQuantity=A line of product/service with a zero amount is considered as an option FreeLegalTextOnProposal=Free text on commercial proposals +WatermarkOnDraftProposal=Watermark on draft commercial proposals (any if empty) ##### Orders ##### OrdersSetup=Orders' management setup OrdersNumberingModules=Orders numbering modules @@ -664,9 +666,11 @@ OrdersModelModule=Order documents models HideTreadedOrders=Hide the treated or canceled orders in the list ValidOrderAfterPropalClosed=To validate the order after proposal closer, makes it possible not to step by the provisional order FreeLegalTextOnOrders=Free text on orders +WatermarkOnDraftOrders=Watermark on draft orders (any if empty) ##### Fiche inter ##### FicheinterNumberingModules=Intervention numbering modules TemplatePDFInterventions=Intervention card documents models +WatermarkOnDraftInterventionCards=Watermark on intervention card documents (any if empty) ##### Clicktodial ##### ClickToDialSetup=Click To Dial module setup ClickToDialUrlDesc=Url called when a click on phone picto is done.
Complete url will be: URL?login=...&password=...&caller=...&called=phonecalled diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 64521ced820..4d97ca9eea4 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -640,6 +640,7 @@ EnableEditDeleteValidInvoice=Activer la possibilit SuggestPaymentByRIBOnAccount=Proposer paiement par RIB sur le compte SuggestPaymentByChequeToAddress=Proposer paiement par chèque à l'ordre et adresse de FreeLegalTextOnInvoices=Mention complémentaire sur les factures +WatermarkOnDraftInvoices=Filigrane sur les brouillons de factures (aucun si vide) ##### Proposals ##### PropalSetup=Configuration du module Propositions Commerciales CreateForm=Création formulaire @@ -655,6 +656,7 @@ AddShippingDateAbility=Possibilit AddDeliveryAddressAbility=Possibilité de sélectionner une adresse de livraison UseOptionLineIfNoQuantity=Une ligne de produit/service ayant une quantité nulle est considérée comme une option FreeLegalTextOnProposal=Mention complémentaire sur les propositions +WatermarkOnDraftProposal=Filigrane sur les brouillons de propositions (aucun si vide) ##### Orders ##### OrdersSetup=Configuration du module Commandes OrdersNumberingModules=Modules de numérotation des commandes @@ -662,9 +664,11 @@ OrdersModelModule=Mod HideTreadedOrders=Cacher les commandes traitées ou annulées de la liste ValidOrderAfterPropalClosed=Valider la commande après la clôture de la propale, permet de ne pas passer par la commande provisoire FreeLegalTextOnOrders=Mention complémentaire sur les commandes +WatermarkOnDraftOrders=Filigrane sur les brouillons de commandes (aucun si vide) ##### Fiche inter ##### FicheinterNumberingModules=Modules de numérotation des fiches interventions TemplatePDFInterventions=Modèle de documents des fiches d'interventions +WatermarkOnDraftInterventionCards=Filigrane sur les brouillons des fiches d'interventions (aucun si vide) ##### Clicktodial ##### ClickToDialSetup=Configuration du module Click To Dial ClickToDialUrlDesc=Url appelée lors dun clic sur le picto téléphone.
L'url complète appelée sera: URL?login=...&password=...&caller=...&called=telappelé