diff --git a/bug.php b/bug.php
index f72270b95..580c7421f 100644
--- a/bug.php
+++ b/bug.php
@@ -73,11 +73,7 @@
$pageTitle = tr('Bug');
-if (file_exists($docroot.'/include/custom/top.php')) {
- include $docroot.'/include/custom/top.php';
-} else {
- include $docroot.'/include/top.php';
-}
+include_once App::filepath('include|custom|', 'top.php');
if (empty($mail['from_address']) || empty($mail['server'])) {
echo '
@@ -194,8 +190,4 @@
';
-if (file_exists($docroot.'/include/custom/bottom.php')) {
- include $docroot.'/include/custom/bottom.php';
-} else {
- include $docroot.'/include/bottom.php';
-}
+include_once App::filepath('include|custom|', 'bottom.php');
diff --git a/controller.php b/controller.php
index 6d80c2011..a21e50765 100644
--- a/controller.php
+++ b/controller.php
@@ -8,11 +8,7 @@
redirect(ROOTDIR.'/index.php');
}
-if (file_exists($docroot.'/include/custom/top.php')) {
- include $docroot.'/include/custom/top.php';
-} else {
- include $docroot.'/include/top.php';
-}
+include_once App::filepath('include|custom|', 'top.php');
// Lettura parametri iniziali del modulo
$module = Modules::get($id_module);
@@ -89,8 +85,4 @@
// Widget in basso
echo '{( "name": "widgets", "id_module": "'.$id_module.'", "position": "right", "place": "controller" )}';
-if (file_exists($docroot.'/include/custom/bottom.php')) {
- include $docroot.'/include/custom/bottom.php';
-} else {
- include $docroot.'/include/bottom.php';
-}
+include_once App::filepath('include|custom|', 'bottom.php');
diff --git a/editor.php b/editor.php
index 9af217c74..e1bbdd774 100755
--- a/editor.php
+++ b/editor.php
@@ -8,11 +8,7 @@
redirect(ROOTDIR.'/index.php');
}
-if (file_exists($docroot.'/include/custom/top.php')) {
- include $docroot.'/include/custom/top.php';
-} else {
- include $docroot.'/include/top.php';
-}
+include_once App::filepath('include|custom|', 'top.php');
// Lettura parametri iniziali del modulo
$module = Modules::get($id_module);
@@ -308,8 +304,4 @@ function(data) {
'.tr("Attendere").'...");
$("#install").prop(\'disabled\', true);
$("#test").prop(\'disabled\', true);
-
+
$("#config_form").submit();
}
@@ -263,14 +259,14 @@
data: {
test: 1,
},
- type: "post",
+ type: "post",
success: function(data){
data = parseFloat(data.trim());
-
+
$("#test").html(prev_html);
$("#test").prop(\'disabled\', false);
$("#install").prop(\'disabled\', false);
-
+
if(data == 0){
swal("'.tr('Errore della configurazione').'", "'.tr('La configurazione non è corretta').'.", "error");
} else if(data == 1){
@@ -583,10 +579,6 @@
';
}
-if (file_exists($docroot.'/include/custom/bottom.php')) {
- include_once $docroot.'/include/custom/bottom.php';
-} else {
- include_once $docroot.'/include/bottom.php';
-}
+include_once App::filepath('include|custom|', 'bottom.php');
exit();
diff --git a/include/update.php b/include/update.php
index 324cd1410..245ee87c0 100644
--- a/include/update.php
+++ b/include/update.php
@@ -119,11 +119,7 @@
if (Update::isUpdateLocked() && filter('force') === null) {
$pageTitle = tr('Aggiornamento in corso!');
- if (file_exists($docroot.'/include/custom/top.php')) {
- include_once $docroot.'/include/custom/top.php';
- } else {
- include_once $docroot.'/include/top.php';
- }
+ include_once App::filepath('include|custom|', 'top.php');
echo '
@@ -137,11 +133,7 @@
';
- if (file_exists($docroot.'/include/custom/bottom.php')) {
- include_once $docroot.'/include/custom/bottom.php';
- } else {
- include_once $docroot.'/include/bottom.php';
- }
+ include_once App::filepath('include|custom|', 'bottom.php');
exit();
}
@@ -151,11 +143,7 @@
$button = !$dbo->isInstalled() ? tr('Installa!') : tr('Aggiorna!');
$pageTitle = !$dbo->isInstalled() ? tr('Installazione') : tr('Aggiornamento');
- if (file_exists($docroot.'/include/custom/top.php')) {
- include_once $docroot.'/include/custom/top.php';
- } else {
- include_once $docroot.'/include/top.php';
- }
+ include_once App::filepath('include|custom|', 'top.php');
echo '
diff --git a/index.php b/index.php
index 4f1c896ab..c33681e0f 100644
--- a/index.php
+++ b/index.php
@@ -59,11 +59,7 @@
$pageTitle = tr('Login');
-if (file_exists($docroot.'/include/custom/top.php')) {
- include_once $docroot.'/include/custom/top.php';
-} else {
- include_once $docroot.'/include/top.php';
-}
+include_once App::filepath('include|custom|', 'top.php');
// Controllo se è una beta e in caso mostro un warning
if (str_contains($version, 'beta')) {
@@ -175,8 +171,4 @@ function brute() {
});
';
-if (file_exists($docroot.'/include/custom/bottom.php')) {
- include_once $docroot.'/include/custom/bottom.php';
-} else {
- include_once $docroot.'/include/bottom.php';
-}
+include_once App::filepath('include|custom|', 'bottom.php');
diff --git a/info.php b/info.php
index ca8a09ffa..7175c534a 100644
--- a/info.php
+++ b/info.php
@@ -6,11 +6,7 @@
$paths = App::getPaths();
-if (file_exists($docroot.'/include/custom/top.php')) {
- include $docroot.'/include/custom/top.php';
-} else {
- include $docroot.'/include/top.php';
-}
+include_once App::filepath('include|custom|', 'top.php');
echo '
@@ -168,8 +164,4 @@
';
-if (file_exists($docroot.'/include/custom/bottom.php')) {
- include $docroot.'/include/custom/bottom.php';
-} else {
- include $docroot.'/include/bottom.php';
-}
+include_once App::filepath('include|custom|', 'bottom.php');
diff --git a/log.php b/log.php
index 0f0a723ea..1670e5b5b 100644
--- a/log.php
+++ b/log.php
@@ -4,11 +4,7 @@
$pageTitle = tr('Log');
-if (file_exists($docroot.'/include/custom/top.php')) {
- include $docroot.'/include/custom/top.php';
-} else {
- include $docroot.'/include/top.php';
-}
+include_once App::filepath('include|custom|', 'top.php');
echo '
@@ -81,8 +77,4 @@
';
-if (file_exists($docroot.'/include/custom/bottom.php')) {
- include $docroot.'/include/custom/bottom.php';
-} else {
- include $docroot.'/include/bottom.php';
-}
+include_once App::filepath('include|custom|', 'bottom.php');
diff --git a/modules/anagrafiche/plugins/statistiche.php b/modules/anagrafiche/plugins/statistiche.php
index f0dc3f156..54d2eec04 100644
--- a/modules/anagrafiche/plugins/statistiche.php
+++ b/modules/anagrafiche/plugins/statistiche.php
@@ -2,16 +2,15 @@
include_once __DIR__.'/../../../core.php';
+include_once Modules::filepath('Preventivi', 'modutil.php');
+
// Interventi
if (in_array('Cliente', explode(',', $records[0]['tipianagrafica']))) {
- //Clienti
- $rsi = $dbo->fetchArray('SELECT ragione_sociale, (SELECT MIN(orario_inizio) FROM in_interventi_tecnici WHERE idintervento=in_interventi.id) AS data, (SELECT SUM(prezzo_ore_consuntivo+prezzo_km_consuntivo+prezzo_dirittochiamata) FROM in_interventi_tecnici WHERE idintervento=in_interventi.id) AS totale FROM in_interventi INNER JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica WHERE in_interventi.idanagrafica='.prepare($id_record));
-
-}else if (in_array('Tecnico', explode(',', $records[0]['tipianagrafica']))) {
-
- //Tecnici
- $rsi = $dbo->fetchArray('SELECT ragione_sociale, (SELECT MIN(orario_inizio) FROM in_interventi_tecnici WHERE idintervento=in_interventi.id) AS data, (SELECT SUM(prezzo_ore_consuntivo+prezzo_km_consuntivo+prezzo_dirittochiamata) FROM in_interventi_tecnici WHERE idintervento=in_interventi.id AND in_interventi_tecnici.idtecnico = '.prepare($id_record).' ) AS totale FROM in_interventi INNER JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica INNER JOIN in_interventi_tecnici ON in_interventi.id = in_interventi_tecnici.idintervento WHERE in_interventi_tecnici.idtecnico='.prepare($id_record));
-
+ //Clienti
+ $rsi = $dbo->fetchArray('SELECT ragione_sociale, (SELECT MIN(orario_inizio) FROM in_interventi_tecnici WHERE idintervento=in_interventi.id) AS data, (SELECT SUM(prezzo_ore_consuntivo+prezzo_km_consuntivo+prezzo_dirittochiamata) FROM in_interventi_tecnici WHERE idintervento=in_interventi.id) AS totale FROM in_interventi INNER JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica WHERE in_interventi.idanagrafica='.prepare($id_record));
+} elseif (in_array('Tecnico', explode(',', $records[0]['tipianagrafica']))) {
+ //Tecnici
+ $rsi = $dbo->fetchArray('SELECT ragione_sociale, (SELECT MIN(orario_inizio) FROM in_interventi_tecnici WHERE idintervento=in_interventi.id) AS data, (SELECT SUM(prezzo_ore_consuntivo+prezzo_km_consuntivo+prezzo_dirittochiamata) FROM in_interventi_tecnici WHERE idintervento=in_interventi.id AND in_interventi_tecnici.idtecnico = '.prepare($id_record).' ) AS totale FROM in_interventi INNER JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica INNER JOIN in_interventi_tecnici ON in_interventi.id = in_interventi_tecnici.idintervento WHERE in_interventi_tecnici.idtecnico='.prepare($id_record));
}
$totale_interventi = 0;
$data_start = strtotime('now');
@@ -51,13 +50,12 @@
// Preventivi
$rsi = $dbo->fetchArray('SELECT co_preventivi.id AS idpreventivo, data_accettazione AS data, ragione_sociale, budget FROM co_preventivi INNER JOIN an_anagrafiche ON co_preventivi.idanagrafica=an_anagrafiche.idanagrafica WHERE co_preventivi.idanagrafica='.prepare($id_record));
-include_once $docroot.'/modules/preventivi/modutil.php';
$totale_preventivi = 0;
$data_start = strtotime('now');
for ($i = 0; $i < count($rsi); ++$i) {
//$totale_preventivi += $rsi[$i]['budget'];
- $totale_preventivi += get_imponibile_preventivo($rsi[$i]['idpreventivo']);
+ $totale_preventivi += get_imponibile_preventivo($rsi[$i]['idpreventivo']);
// Calcolo data più bassa per la ricerca
if (strtotime($rsi[$i]['data']) < $data_start) {
$data_start = strtotime($rsi[$i]['data']);
diff --git a/modules/articoli/edit.php b/modules/articoli/edit.php
index 6b5655fdd..05bb1ec7f 100644
--- a/modules/articoli/edit.php
+++ b/modules/articoli/edit.php
@@ -2,6 +2,9 @@
include_once __DIR__.'/../../core.php';
+// Necesario per funzione \Util\Ini::getList
+include_once Modules::filepath('MyImpianti', 'modutil.php');
+
$_SESSION['superselect']['id_categoria'] = $records[0]['id_categoria'];
?>