Prepare code to be able to choose what to show into footer

This commit is contained in:
Laurent Destailleur 2014-08-25 19:16:37 +02:00
parent b602b7098c
commit 7cb283d0ea
14 changed files with 42 additions and 24 deletions

View File

@ -651,7 +651,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
* @param int $marge_gauche Margin left (no more used) * @param int $marge_gauche Margin left (no more used)
* @param int $page_hauteur Page height (no more used) * @param int $page_hauteur Page height (no more used)
* @param Object $object Object shown in PDF * @param Object $object Object shown in PDF
* @param int $showdetails Show company details into footer. This param seems to not be used by standard version. * @param int $showdetails Show company details into footer. This param seems to not be used by standard version. (1=Show address, 2=Show managers, 3=Both)
* @param int $hidefreetext 1=Hide free text, 0=Show free text * @param int $hidefreetext 1=Hide free text, 0=Show free text
* @return int Return height of bottom margin including footer text * @return int Return height of bottom margin including footer text
*/ */
@ -681,10 +681,10 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
} }
// First line of company infos // First line of company infos
$line1=""; $line2=""; $line3=""; $line4="";
if ($showdetails) if ($showdetails && 1)
{ {
$line1="";
// Company name // Company name
if ($fromcompany->name) if ($fromcompany->name)
{ {
@ -716,7 +716,6 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
$line1.=($line1?" - ":"").$outputlangs->transnoentities("Fax").": ".$fromcompany->fax; $line1.=($line1?" - ":"").$outputlangs->transnoentities("Fax").": ".$fromcompany->fax;
} }
$line2="";
// URL // URL
if ($fromcompany->url) if ($fromcompany->url)
{ {
@ -728,9 +727,16 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
$line2.=($line2?" - ":"").$fromcompany->email; $line2.=($line2?" - ":"").$fromcompany->email;
} }
} }
if (($showdetails && 2) || ($fromcompany->country_code == 'DE'))
{
// Managers
if ($fromcompany->managers)
{
$line2.=($line2?" - ":"").$fromcompany->managers;
}
}
// Line 3 of company infos // Line 3 of company infos
$line3="";
// Juridical status // Juridical status
if ($fromcompany->forme_juridique_code) if ($fromcompany->forme_juridique_code)
{ {
@ -757,7 +763,6 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
} }
// Line 4 of company infos // Line 4 of company infos
$line4="";
// Prof Id 3 // Prof Id 3
if ($fromcompany->idprof3) if ($fromcompany->idprof3)
{ {

View File

@ -352,7 +352,8 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
global $conf; global $conf;
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
//return pdf_pagefoot($pdf,$outputlangs,'BANK_CHEQUERECEIPT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object); //$showdetails=0;
//return pdf_pagefoot($pdf,$outputlangs,'BANK_CHEQUERECEIPT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
$paramfreetext='BANK_CHEQUERECEIPT_FREE_TEXT'; $paramfreetext='BANK_CHEQUERECEIPT_FREE_TEXT';
$marge_basse=$this->marge_basse; $marge_basse=$this->marge_basse;
$marge_gauche=$this->marge_gauche; $marge_gauche=$this->marge_gauche;

View File

@ -1271,7 +1271,8 @@ class pdf_einstein extends ModelePDFCommandes
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'COMMANDE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'COMMANDE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -1228,7 +1228,8 @@ class pdf_proforma extends ModelePDFCommandes
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'COMMANDE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'COMMANDE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -610,7 +610,8 @@ class pdf_strato extends ModelePDFContract
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'CONTRACT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'CONTRACT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -657,7 +657,8 @@ class pdf_rouget extends ModelePdfExpedition
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'SHIPPING_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'SHIPPING_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -1455,7 +1455,8 @@ class pdf_crabe extends ModelePDFFactures
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -595,7 +595,8 @@ class pdf_soleil extends ModelePDFFicheinter
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'FICHINTER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'FICHINTER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -863,7 +863,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'DELIVERY_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'DELIVERY_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -454,7 +454,8 @@ class pdf_baleine extends ModelePDFProjects
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'PROJECT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'PROJECT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -1362,7 +1362,8 @@ class pdf_azur extends ModelePDFPropales
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'PROPALE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'PROPALE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -1052,7 +1052,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
*/ */
function _pagefoot(&$pdf, $object, $outputlangs,$hidefreetext=0) function _pagefoot(&$pdf, $object, $outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -1105,7 +1105,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
*/ */
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0) function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_ORDER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); $showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_ORDER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
} }
} }

View File

@ -1082,6 +1082,7 @@ NotificationsDesc=EMails notifications feature allows you to silently send autom
ModelModules=Documents templates ModelModules=Documents templates
DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT or .ODS files for OpenOffice, KOffice, TextEdit,...) DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT or .ODS files for OpenOffice, KOffice, TextEdit,...)
WatermarkOnDraft=Watermark on draft document WatermarkOnDraft=Watermark on draft document
JSOnPaimentBill=Activate feature to autofill payment lines on payment form
CompanyIdProfChecker=Rules on Professional Ids CompanyIdProfChecker=Rules on Professional Ids
MustBeUnique=Must be unique ? MustBeUnique=Must be unique ?
MustBeMandatory=Mandatory to create third parties ? MustBeMandatory=Mandatory to create third parties ?