diff --git a/pdfgen.php b/pdfgen.php index 27e93cb00..5e37a6a71 100644 --- a/pdfgen.php +++ b/pdfgen.php @@ -88,6 +88,9 @@ if (!$old_format) { } $head = ob_get_clean(); + // Footer di default + $head = !empty($head) ? $head : '$default_header$'; + // Generazione dei contenuti del footer ob_start(); if (file_exists($docroot.'/templates/'.$ptype.'/custom/footer.php')) { @@ -119,7 +122,7 @@ if (!$old_format) { } // Footer di default -$foot = !empty($foot) ? $foot : '$pagination$'; +$foot = !empty($foot) ? $foot : '$default_footer$'; // Operazioni di sostituzione include $docroot.'/templates/replace.php'; diff --git a/templates/base/footer.php b/templates/base/footer.php new file mode 100644 index 000000000..c737fbf61 --- /dev/null +++ b/templates/base/footer.php @@ -0,0 +1,17 @@ + + + + '.tr('Stampato con OpenSTAManager').' + + + + '.tr('Pagina _PAGE_ di _TOTAL_', [ + '_PAGE_' => '{PAGENO}', + '_TOTAL_' => '{nb}', + ]).' + + +'; diff --git a/templates/base/header.php b/templates/base/header.php new file mode 100644 index 000000000..a481349d4 --- /dev/null +++ b/templates/base/header.php @@ -0,0 +1,16 @@ + +
+ Logo +
+
+

'.$f_ragionesociale.'

+

'.$f_indirizzo.' '.$f_citta_full.'

+

'.(!empty($f_piva) ? tr('P.Iva').': '.$f_piva : '').'

+

'.(!empty($f_codicefiscale) ? tr('C.F.').': '.$f_codicefiscale : '').'

+

'.(!empty($f_capsoc) ? tr('Cap.Soc.').': '.$f_capsoc : '').'

+

'.(!empty($f_telefono) ? tr('Tel').': '.$f_telefono : '').'

+
+'; diff --git a/templates/contratti/header.php b/templates/contratti/header.php deleted file mode 100644 index 42d9396b0..000000000 --- a/templates/contratti/header.php +++ /dev/null @@ -1,16 +0,0 @@ - -
- Logo -
-
-

$f_ragionesociale$

-

$f_indirizzo$ $f_citta_full$

-

'.(!empty($f_piva) ? tr('P.Iva').': ' : '').'$f_piva$

-

'.(!empty($f_codicefiscale) ? tr('C.F.').': ' : '').'$f_codicefiscale$

-

'.(!empty($f_capsoc) ? tr('Cap.Soc.').': ' : '').'$f_capsoc$

-

'.(!empty($f_telefono) ? tr('Tel').': ' : '').'$f_telefono$

-
-'; diff --git a/templates/ddt/footer.php b/templates/ddt/footer.php index 92d1c5f17..88f12544f 100644 --- a/templates/ddt/footer.php +++ b/templates/ddt/footer.php @@ -167,4 +167,4 @@ echo ' '; echo ' -$pagination$'; +$default_footer$'; diff --git a/templates/fatture/footer.php b/templates/fatture/footer.php index 0f1c9dd25..1eae9dc10 100644 --- a/templates/fatture/footer.php +++ b/templates/fatture/footer.php @@ -197,4 +197,4 @@ echo ' -$pagination$'; +$default_footer$'; diff --git a/templates/fatture_accompagnatorie/fattura_body.html b/templates/fatture_accompagnatorie/fattura_body.html index 29be77546..8eea7b2fb 100644 --- a/templates/fatture_accompagnatorie/fattura_body.html +++ b/templates/fatture_accompagnatorie/fattura_body.html @@ -51,5 +51,5 @@
- $pagination$ + $default_footer$ diff --git a/templates/info.php b/templates/info.php index bdfa5e53b..21435c9a2 100644 --- a/templates/info.php +++ b/templates/info.php @@ -1,28 +1,5 @@ DOCROOT, - 'rootdir' => ROOTDIR, - 'footer' => !empty($footer) ? $footer : '', - 'dicitura_fissa_fattura' => get_var('Dicitura fissa fattura'), - 'pagination' => ' - - - - - - -
- '.tr('Stampato con OpenSTAManager').' - - '.tr('Pagina _PAGE_ di _TOTAL_', [ - '_PAGE_' => '{PAGENO}', - '_TOTAL_' => '{nb}', - ]).' -
', -]; - // Retrocompatibilità $id_cliente = $id_cliente ?: $idcliente; @@ -103,3 +80,13 @@ foreach ($replace as $prefix => $values) { $replaces[$prefix.$key] = $value; } } + +// Valori aggiuntivi per la sostituzione +$replaces = [ + 'docroot' => DOCROOT, + 'rootdir' => ROOTDIR, + 'footer' => !empty($footer) ? $footer : '', + 'dicitura_fissa_fattura' => get_var('Dicitura fissa fattura'), + 'default_header' => include DOCROOT.'/templates/base/header.php', + 'default_footer' => include DOCROOT.'/templates/base/footer.php', +]; diff --git a/templates/interventi/header.php b/templates/interventi/header.php deleted file mode 100644 index 42d9396b0..000000000 --- a/templates/interventi/header.php +++ /dev/null @@ -1,16 +0,0 @@ - -
- Logo -
-
-

$f_ragionesociale$

-

$f_indirizzo$ $f_citta_full$

-

'.(!empty($f_piva) ? tr('P.Iva').': ' : '').'$f_piva$

-

'.(!empty($f_codicefiscale) ? tr('C.F.').': ' : '').'$f_codicefiscale$

-

'.(!empty($f_capsoc) ? tr('Cap.Soc.').': ' : '').'$f_capsoc$

-

'.(!empty($f_telefono) ? tr('Tel').': ' : '').'$f_telefono$

-
-'; diff --git a/templates/preventivi/header.php b/templates/preventivi/header.php deleted file mode 100644 index 42d9396b0..000000000 --- a/templates/preventivi/header.php +++ /dev/null @@ -1,16 +0,0 @@ - -
- Logo -
-
-

$f_ragionesociale$

-

$f_indirizzo$ $f_citta_full$

-

'.(!empty($f_piva) ? tr('P.Iva').': ' : '').'$f_piva$

-

'.(!empty($f_codicefiscale) ? tr('C.F.').': ' : '').'$f_codicefiscale$

-

'.(!empty($f_capsoc) ? tr('Cap.Soc.').': ' : '').'$f_capsoc$

-

'.(!empty($f_telefono) ? tr('Tel').': ' : '').'$f_telefono$

-
-'; diff --git a/templates/preventivi_cons/header.php b/templates/preventivi_cons/header.php deleted file mode 100644 index 42d9396b0..000000000 --- a/templates/preventivi_cons/header.php +++ /dev/null @@ -1,16 +0,0 @@ - -
- Logo -
-
-

$f_ragionesociale$

-

$f_indirizzo$ $f_citta_full$

-

'.(!empty($f_piva) ? tr('P.Iva').': ' : '').'$f_piva$

-

'.(!empty($f_codicefiscale) ? tr('C.F.').': ' : '').'$f_codicefiscale$

-

'.(!empty($f_capsoc) ? tr('Cap.Soc.').': ' : '').'$f_capsoc$

-

'.(!empty($f_telefono) ? tr('Tel').': ' : '').'$f_telefono$

-
-';