Correzioni minori percorsi
This commit is contained in:
parent
3ee73011f3
commit
4d24356153
|
@ -450,7 +450,7 @@ echo '
|
||||||
|
|
||||||
if (data !== undefined) {
|
if (data !== undefined) {
|
||||||
//Carico nel panel i dettagli del cliente
|
//Carico nel panel i dettagli del cliente
|
||||||
$.get("'.$rootdir.'/modules/interventi/ajax_details.php?op=dettagli&id_anagrafica="+$(this).val(), function(data){
|
$.get("'.base_path().'/modules/interventi/ajax_details.php?op=dettagli&id_anagrafica="+$(this).val(), function(data){
|
||||||
$("#dettagli_ciente").html(data);
|
$("#dettagli_ciente").html(data);
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -49,7 +49,7 @@ switch ($operazione) {
|
||||||
|
|
||||||
flash()->info(tr('Salvataggio completato!'));
|
flash()->info(tr('Salvataggio completato!'));
|
||||||
$dbo->commitTransaction();
|
$dbo->commitTransaction();
|
||||||
header('Location: '.$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'#tab_'.$id_plugin);
|
header('Location: '.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'#tab_'.$id_plugin);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -106,7 +106,7 @@ switch ($operazione) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$dbo->commitTransaction();
|
$dbo->commitTransaction();
|
||||||
header('Location: '.$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'#tab_'.$id_plugin);
|
header('Location: '.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'#tab_'.$id_plugin);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -117,7 +117,7 @@ switch ($operazione) {
|
||||||
flash()->info(tr('Componente eliminato!'));
|
flash()->info(tr('Componente eliminato!'));
|
||||||
|
|
||||||
$dbo->commitTransaction();
|
$dbo->commitTransaction();
|
||||||
header('Location: '.$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'#tab_'.$id_plugin);
|
header('Location: '.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'#tab_'.$id_plugin);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
121
view.php
121
view.php
|
@ -30,74 +30,75 @@ if (empty($file)) {
|
||||||
$link = base_path().'/'.$file->filepath;
|
$link = base_path().'/'.$file->filepath;
|
||||||
|
|
||||||
// Force download of the file
|
// Force download of the file
|
||||||
if (get('force') == '1') {
|
if (get('download') == '1') {
|
||||||
header('Content-Type: application/octet-stream');
|
header('Content-Type: application/octet-stream');
|
||||||
header('Content-Transfer-Encoding: Binary');
|
header('Content-Transfer-Encoding: Binary');
|
||||||
header('Content-disposition: attachment; filename="'.basename($file->original_name).'"');
|
header('Content-disposition: attachment; filename="'.basename($file->original_name).'"');
|
||||||
readfile($docroot.'/'.$file->filepath);
|
readfile(base_dir().'/'.$file->filepath);
|
||||||
|
//download(base_dir().'/'.$file->filepath, basename($file->original_name));
|
||||||
exit();
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($file->isFatturaElettronica()) {
|
||||||
|
$content = file_get_contents(base_dir().'/'.$file->filepath);
|
||||||
|
|
||||||
|
// Individuazione stylesheet
|
||||||
|
$default_stylesheet = 'asso-invoice';
|
||||||
|
|
||||||
|
$name = basename($file->original_name);
|
||||||
|
$filename = explode('.', $name)[0];
|
||||||
|
$pieces = explode('_', $filename);
|
||||||
|
$stylesheet = $pieces[2];
|
||||||
|
|
||||||
|
$stylesheet = base_dir().'/plugins/xml/'.$stylesheet.'.xsl';
|
||||||
|
$stylesheet = file_exists($stylesheet) ? $stylesheet : base_dir().'/plugins/xml/'.$default_stylesheet.'.xsl';
|
||||||
|
|
||||||
|
// XML
|
||||||
|
$xml = new DOMDocument();
|
||||||
|
$xml->loadXML($content);
|
||||||
|
|
||||||
|
// XSL
|
||||||
|
$xsl = new DOMDocument();
|
||||||
|
$xsl->load($stylesheet);
|
||||||
|
|
||||||
|
// XSLT
|
||||||
|
$xslt = new XSLTProcessor();
|
||||||
|
$xslt->importStylesheet($xsl);
|
||||||
|
|
||||||
|
echo '
|
||||||
|
<style>
|
||||||
|
#notifica {
|
||||||
|
min-width: 860px !important;
|
||||||
|
}
|
||||||
|
</style>';
|
||||||
|
|
||||||
|
echo $xslt->transformToXML($xml);
|
||||||
} else {
|
} else {
|
||||||
if ($file->isFatturaElettronica()) {
|
echo '
|
||||||
$content = file_get_contents(base_dir().'/'.$file->filepath);
|
<style>
|
||||||
|
body, iframe, img{
|
||||||
// Individuazione stylesheet
|
border: 0;
|
||||||
$default_stylesheet = 'asso-invoice';
|
margin: 0;
|
||||||
|
max-width: 100%;
|
||||||
$name = basename($file->original_name);
|
}
|
||||||
$filename = explode('.', $name)[0];
|
iframe{
|
||||||
$pieces = explode('_', $filename);
|
width:100%;
|
||||||
$stylesheet = $pieces[2];
|
height:100%;
|
||||||
|
min-height: 500px;
|
||||||
$stylesheet = base_dir().'/plugins/xml/'.$stylesheet.'.xsl';
|
}
|
||||||
$stylesheet = file_exists($stylesheet) ? $stylesheet : base_dir().'/plugins/xml/'.$default_stylesheet.'.xsl';
|
</style>';
|
||||||
|
|
||||||
// XML
|
|
||||||
$xml = new DOMDocument();
|
|
||||||
$xml->loadXML($content);
|
|
||||||
|
|
||||||
// XSL
|
|
||||||
$xsl = new DOMDocument();
|
|
||||||
$xsl->load($stylesheet);
|
|
||||||
|
|
||||||
// XSLT
|
|
||||||
$xslt = new XSLTProcessor();
|
|
||||||
$xslt->importStylesheet($xsl);
|
|
||||||
|
|
||||||
|
if ($file->isImage()) {
|
||||||
echo '
|
echo '
|
||||||
<style>
|
<img src="'.$link.'"></img>';
|
||||||
#notifica {
|
|
||||||
min-width: 860px !important;
|
|
||||||
}
|
|
||||||
</style>';
|
|
||||||
|
|
||||||
echo $xslt->transformToXML($xml);
|
|
||||||
} else {
|
} else {
|
||||||
|
if ($file->isPDF()) {
|
||||||
|
$src = \Prints::getPDFLink($file->filepath);
|
||||||
|
}
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<style>
|
<iframe src="'.base_path().'/view.php?file_id='.$file_id.'&download=1">
|
||||||
body, iframe, img{
|
<a src="'.base_path().'/view.php?file_id='.$file_id.'&download=1">'.tr('Il browser non supporta i contenuti iframe: clicca qui per raggiungere il file originale').'</a>
|
||||||
border: 0;
|
</iframe>';
|
||||||
margin: 0;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
iframe{
|
|
||||||
width:100%;
|
|
||||||
height:100%;
|
|
||||||
min-height: 500px;
|
|
||||||
}
|
|
||||||
</style>';
|
|
||||||
|
|
||||||
if ($file->isImage()) {
|
|
||||||
echo '
|
|
||||||
<img src="'.$link.'"></img>';
|
|
||||||
} else {
|
|
||||||
if ($file->isPDF()) {
|
|
||||||
$src = \Prints::getPDFLink($file->filepath);
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '
|
|
||||||
<iframe src="'.base_path().'/view.php?file_id='.$file_id.'&force=1">
|
|
||||||
<a src="'.base_path().'/view.php?file_id='.$file_id.'&force=1">'.tr('Il browser non supporta i contenuti iframe: clicca qui per raggiungere il file originale').'</a>
|
|
||||||
</iframe>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue