Individuazione automatica del logo stampe

This commit is contained in:
Thomas Zilio 2018-02-25 11:06:14 +01:00
parent 38e8fb7198
commit 31c80cd14b
13 changed files with 22 additions and 17 deletions

View File

@ -9,17 +9,10 @@
* La personalizzazione specifica dell'header deve comunque seguire lo standard della cartella custom: anche se il file header.php non esiste nella stampa originaria, se si vuole personalizzare l'header bisogna crearlo all'interno della cartella custom.
*/
// Individuazione dell'immagine
$logo = $infos['full_directory'].'/logo_azienda.jpg';
if (!file_exists($logo)) {
$logo = '$default_logo$';
}
// Header
return '
<div class="row">
<div class="col-xs-6">
<img src="'.$logo.'" alt="Logo" border="0"/>
<img src="$logo$" alt="Logo" border="0"/>
</div>
<div class="col-xs-6 text-right">
<p><b>'.$f_ragionesociale.'</b></p>

View File

@ -2,7 +2,7 @@
<table $body_table_params$>
<!-- Intestazione fornitore -->
<tr><td style="width:105mm; font-size:8pt; color:#555;">
<img src="$docroot$/templates/fatturato/logo_azienda.jpg" alt="Logo" border="0" />
<img src="$logo$" alt="Logo" border="0" />
</td></tr>
</table>
<br/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -112,19 +112,31 @@ $logo_file = DOCROOT.'/templates/base|custom|/logo_azienda.jpg';
$original_file = str_replace('|custom|', '', $logo_file);
$custom_file = str_replace('|custom|', '/custom', $logo_file);
$default_logo = $original_file;
if (file_exists($custom_file)) {
$logo_file = $custom_file;
} elseif (file_exists($original_file)) {
$logo_file = $original_file;
$default_logo = $custom_file;
}
$default_logo = $logo_file;
// Logo specifico della stampa
$logo_file = DOCROOT.'/templates/'.Prints::get($id_print)['directory'].'|custom|/logo_azienda.jpg';
$original_file = str_replace('|custom|', '', $logo_file);
$custom_file = str_replace('|custom|', '/custom', $logo_file);
if (file_exists($custom_file)) {
$logo = $custom_file;
} elseif (file_exists($original_file)) {
$logo = $original_file;
} else {
$logo = $default_logo;
}
// Valori aggiuntivi per la sostituzione
$replaces = array_merge($replaces, [
'default_header' => $default_header,
'default_footer' => $default_footer,
'default_logo' => $default_logo,
'logo' => $logo,
'docroot' => DOCROOT,
'rootdir' => ROOTDIR,
'directory' => Prints::get($id_print)['full_directory'],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -2,7 +2,7 @@
<table $body_table_params$>
<!-- Intestazione fornitore -->
<tr><td style="width:105mm; font-size:8pt; color:#555;">
<img src="$docroot$/templates/magazzino_inventario/logo_azienda.jpg" alt="Logo" border="0" />
<img src="$logo$" alt="Logo" border="0" />
</td></tr>
</table>
<br/>

View File

@ -17,7 +17,7 @@
</big>
</td>
<td valign="top" align="right">
<img src="$docroot$/templates/registro_iva/logo_azienda.jpg" alt="Logo" style="width:60mm;" border="0">
<img src="$logo$" alt="Logo" style="width:60mm;" border="0">
</td>
</tr>
</table>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -2,7 +2,7 @@
<table $body_table_params$>
<!-- Intestazione fornitore -->
<tr><td style="width:110mm; font-size:8pt; color:#555;">
<img src="$docroot$/templates/riepilogo_interventi/logo_azienda.jpg" alt="Logo" border="0" /><br/>
<img src="$logo$" alt="Logo" border="0" /><br/>
$f_ragionesociale$
$f_indirizzo$
$f_citta_full$

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -12,6 +12,6 @@ echo '
<p>'.(!empty($f_telefono) ? tr('Tel').': ' : '').'$f_telefono$</p>
</div>
<div class="col-xs-6 text-right">
<img src="'.__DIR__.'/logo_azienda.jpg" alt="Logo" border="0"/>
<img src="$logo$" alt="Logo" border="0"/>
</div>
</div>';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB