diff --git a/actions.php b/actions.php index 99e4542e7..8d3c2734a 100755 --- a/actions.php +++ b/actions.php @@ -88,7 +88,7 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') { } } - redirect_legacy(base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : '')); + redirect_legacy(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : '')); } } @@ -350,7 +350,7 @@ if ($structure->permission == 'rw') { $bulk = empty($bulk) ? [] : $bulk; if (in_array(post('op'), array_keys($bulk))) { - redirect_legacy(base_url().'/controller.php?id_module='.$id_module, 'js'); + redirect_legacy(base_path().'/controller.php?id_module='.$id_module, 'js'); } else { // Esecuzione delle operazioni del modulo ($include_file = $structure->filepath('actions.php')) ? include $include_file : null; diff --git a/ajax_dataload.php b/ajax_dataload.php index 66155ec55..0c7cd67fc 100755 --- a/ajax_dataload.php +++ b/ajax_dataload.php @@ -180,11 +180,11 @@ if (!empty($query)) { // Link per i moduli if (empty($id_plugin)) { - $column['data-link'] = base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.$hash; + $column['data-link'] = base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.$hash; } // Link per i plugin else { - $column['data-link'] = base_url().'/add.php?id_module='.$id_module.'&id_record='.$id_record.'&id_plugin='.$id_plugin.'&id_parent='.$id_parent.'&edit=1'.$hash; + $column['data-link'] = base_path().'/add.php?id_module='.$id_module.'&id_record='.$id_record.'&id_plugin='.$id_plugin.'&id_parent='.$id_parent.'&edit=1'.$hash; $column['data-type'] = 'dialog'; } @@ -197,7 +197,7 @@ if (!empty($query)) { } // Replace base_link() per le query - $value = str_replace('base_link()', base_url(), $value); + $value = str_replace('base_link()', base_path(), $value); $result[] = str_replace('|attr|', implode(' ', $attributes), '
'.$value.'
'); } diff --git a/bug.php b/bug.php index 03c3e9e07..62753cb98 100755 --- a/bug.php +++ b/bug.php @@ -87,7 +87,7 @@ if (filter('op') == 'send') { delete($backup_file); } - redirect_legacy(base_url().'/bug.php'); + redirect_legacy(base_path().'/bug.php'); throw new \LegacyExitException(); } diff --git a/config/csrf_config.php b/config/csrf_config.php index 73ddb6241..61b740868 100755 --- a/config/csrf_config.php +++ b/config/csrf_config.php @@ -26,10 +26,10 @@ return [ 'GET' => 0, 'POST' => 0, ], - 'jsUrl' => base_url().'/assets/dist/js/csrf/csrfprotector.js', + 'jsUrl' => base_path().'/assets/dist/js/csrf/csrfprotector.js', 'tokenLength' => 10, 'cookieConfig' => [ - 'path' => base_url(), + 'path' => base_path(), 'secure' => isHTTPS(true), ], 'verifyGetFor' => [], diff --git a/controller.php b/controller.php index 942b7fb06..b45a90177 100755 --- a/controller.php +++ b/controller.php @@ -20,9 +20,9 @@ include_once __DIR__.'/core.php'; if (!empty($id_record) && !empty($id_module)) { - redirect_legacy(base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record); + redirect_legacy(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record); } elseif (empty($id_module)) { - redirect_legacy(base_url().'/'); + redirect_legacy(base_path().'/'); } include_once AppLegacy::filepath('include|custom|', 'top.php'); diff --git a/editor.php b/editor.php index 6d0df7728..1998c1893 100755 --- a/editor.php +++ b/editor.php @@ -25,9 +25,9 @@ use Carbon\Carbon; $read_only = $structure->permission == 'r'; if (empty($id_record) && !empty($id_module) && empty($id_plugin)) { - redirect_legacy(base_url().'/controller.php?id_module='.$id_module); + redirect_legacy(base_path().'/controller.php?id_module='.$id_module); } elseif (empty($id_record) && empty($id_module) && empty($id_plugin)) { - redirect_legacy(base_url().'/'); + redirect_legacy(base_path().'/'); } include_once AppLegacy::filepath('include|custom|', 'top.php'); @@ -73,7 +73,7 @@ if (empty($record) || !$has_access) {
- + '.tr('Indietro').' '; @@ -159,7 +159,7 @@ if (empty($record) || !$has_access) { // Pulsanti di default echo '
- + '.tr("Torna all'elenco").' @@ -441,7 +441,7 @@ echo '{( "name": "widgets", "id_module": "'.$id_module.'", "id_record": "'.$id_r if (!empty($record)) { echo '
- + '.tr('Indietro').' '; } @@ -519,7 +519,7 @@ if (!empty($advanced_sessions)) { ?> function getActiveUsers(){ - $.getJSON('/ajax.php?op=active_users', { + $.getJSON('/ajax.php?op=active_users', { id_module: , id_record: }, diff --git a/include/common/articolo.php b/include/common/articolo.php index c1ac5f9c8..0d30782f3 100755 --- a/include/common/articolo.php +++ b/include/common/articolo.php @@ -86,7 +86,7 @@ $disabled = empty($result['idarticolo']); echo '
-
@@ -94,14 +94,14 @@ echo '
-
-
diff --git a/include/common/form.php b/include/common/form.php index 430d0fa09..116547030 100755 --- a/include/common/form.php +++ b/include/common/form.php @@ -21,7 +21,7 @@ $result['id'] = isset($result['id']) ? $result['id'] : null; // Form di inserimento riga documento echo ' -
+ diff --git a/include/common/importa.php b/include/common/importa.php index 3d12c085c..221fd534f 100755 --- a/include/common/importa.php +++ b/include/common/importa.php @@ -55,7 +55,7 @@ if ($righe->isEmpty()) { return; } -$link = !empty($documento_finale) ? base_url().'/editor.php?id_module='.$final_module['id'].'&id_record='.$documento_finale->id : base_url().'/controller.php?id_module='.$final_module['id']; +$link = !empty($documento_finale) ? base_path().'/editor.php?id_module='.$final_module['id'].'&id_record='.$documento_finale->id : base_path().'/controller.php?id_module='.$final_module['id']; echo ' diff --git a/include/init/configuration.php b/include/init/configuration.php index 6e1af3c89..3b2f1f43c 100755 --- a/include/init/configuration.php +++ b/include/init/configuration.php @@ -149,14 +149,14 @@ if (post('db_host') !== null) {

'.tr('Sembra che non ci siano i permessi di scrittura sul file _FILE_', [ '_FILE_' => 'config.inc.php', ]).'

- +
;
- '.tr('Torna indietro').' + '.tr('Torna indietro').'

@@ -184,9 +184,9 @@ if (post('db_host') !== null) { "dir" : "ltr", "lang" : "it-IT", "name" : "OpenSTAManager", - "scope" : "'.base_url().'", + "scope" : "'.base_path().'", "display" : "fullscreen", - "start_url" : "'.base_url().'", + "start_url" : "'.base_path().'", "short_name" : "OSM", "theme_color" : "transparent", "description" : "OpenSTAManager", @@ -203,7 +203,7 @@ if (post('db_host') !== null) { }'; file_put_contents('manifest.json', $manifest); - redirect_legacy(base_url().'/index.php'); + redirect_legacy(base_path().'/index.php'); throw new \LegacyExitException(); } } @@ -219,7 +219,7 @@ if ((file_exists('config.inc.php') || $valid_config) && !$dbo->isConnected()) {

'.tr("Si è verificato un'errore durante la connessione al database").'.

'.tr('Controllare di aver inserito correttamente i dati di accesso, e che il database atto ad ospitare i dati del gestionale sia esistente').'.

- '.tr('Riprova').' + '.tr('Riprova').'
'; } @@ -240,7 +240,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) { '_FILE_' => 'config.inc.php', ]).'.

'.tr("Nel caso il problema persista, rivolgersi all'assistenza ufficiale").'.

- '.tr('Riprova').' + '.tr('Riprova').'
'; } @@ -295,7 +295,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) { $("#test").prop("disabled", true); $("#install").prop("disabled", true); $(this).closest("form").ajaxSubmit({ - url: "'.base_url().'/index.php", + url: "'.base_path().'/index.php", data: { test: 1, }, diff --git a/include/init/init.php b/include/init/init.php index 786fd4544..69d33c025 100755 --- a/include/init/init.php +++ b/include/init/init.php @@ -114,7 +114,7 @@ if (post('action') == 'init') { } } - redirect_legacy(base_url(), 'js'); + redirect_legacy(base_path(), 'js'); throw new \LegacyExitException(); } diff --git a/include/init/update.php b/include/init/update.php index e94036962..0ef654a2c 100755 --- a/include/init/update.php +++ b/include/init/update.php @@ -104,7 +104,7 @@ if (filter('action') == 'do_update') { } echo ' - + '.tr('Continua').' '; } @@ -125,7 +125,7 @@ if (filter('action') == 'do_update') {

'.tr("E' attualmente in corso la procedura di aggiornamento del software, e pertanto siete pregati di attendere fino alla sua conclusione").'.

'.tr("Nel caso il problema persista, rivolgersi all'amministratore o all'assistenza ufficiale").'.

- '.tr('Riprova').' + '.tr('Riprova').'
'; diff --git a/include/top.php b/include/top.php index b6f070afb..4b8ff41cb 100755 --- a/include/top.php +++ b/include/top.php @@ -42,7 +42,7 @@ echo ' if (file_exists(base_dir().'/manifest.json')) { echo ' - '; + '; } // CSS @@ -181,7 +181,7 @@ if (auth()->check()) { globals = { content_was_modified: false, - rootdir: "'.base_url().'", + rootdir: "'.base_path().'", js: "'.$paths['js'].'", css: "'.$paths['css'].'", img: "'.$paths['img'].'", @@ -259,7 +259,7 @@ if (auth()->check()) { '; -} - -if (!empty(flash()->getMessage('error'))) { - echo ' - '; -} - -echo ' -
-
- '.tr('OSM Logo').' -
- -
-
- - -
- - {[ "type": "password", "name": "password", "autocomplete": "current-password", "placeholder": "'.tr('Password').'", "icon-before": "" ]} - - -
- - - - -
- - - '; - -include_once AppLegacy::filepath('include|custom|', 'bottom.php'); diff --git a/lib/functions.php b/lib/functions.php index 7efffbd64..cc4351d22 100755 --- a/lib/functions.php +++ b/lib/functions.php @@ -300,9 +300,9 @@ function redirectOperation($id_module, $id_record) $hash = $hash == '#tab_0' ? '' : $hash; if ($backto == 'record-edit') { - redirect_legacy(base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.$hash); + redirect_legacy(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.$hash); } elseif ($backto == 'record-list') { - redirect_legacy(base_url().'/controller.php?id_module='.$id_module.$hash); + redirect_legacy(base_path().'/controller.php?id_module='.$id_module.$hash); } throw new \LegacyExitException(); @@ -350,7 +350,7 @@ function getURLPath() if (substr($path, 0, strlen($prefix)) == $prefix) { $path = substr($path, strlen($prefix)); } else { - $path = str_replace(base_dir(), base_url(), $path); + $path = str_replace(base_dir(), base_path(), $path); } return slashes($path); @@ -404,7 +404,7 @@ function check_query($query) * * @return string */ -function base_url() +function base_path() { return url('/legacy/'); } diff --git a/modules/aggiornamenti/edit.php b/modules/aggiornamenti/edit.php index 7352ab24a..05ad7b7e6 100755 --- a/modules/aggiornamenti/edit.php +++ b/modules/aggiornamenti/edit.php @@ -76,9 +76,9 @@ if (function_exists('customComponents')) { } } -//Fix per funzione base_url non trovata in fase di aggiornamento da versione < 2.4.19 -if (!function_exists('base_url')) { - function base_url() +//Fix per funzione base_path non trovata in fase di aggiornamento da versione < 2.4.19 +if (!function_exists('base_path')) { + function base_path() { return ROOTDIR; } @@ -193,7 +193,7 @@ function search(button) {
-
+ {[ "type": "file", "name": "blob", "required": 1, "accept": ".zip" ]} diff --git a/modules/aggiornamenti/src/UpdateHook.php b/modules/aggiornamenti/src/UpdateHook.php index bcceb8bb5..325bf0ce1 100755 --- a/modules/aggiornamenti/src/UpdateHook.php +++ b/modules/aggiornamenti/src/UpdateHook.php @@ -48,7 +48,7 @@ class UpdateHook extends CachedManager } $module = module('Aggiornamenti'); - $link = base_url().'/controller.php?id_module='.$module->id; + $link = base_path().'/controller.php?id_module='.$module->id; $message = tr("E' disponibile la versione _VERSION_ del gestionale", [ '_VERSION_' => $update, diff --git a/modules/aggiornamenti/upload_modules.php b/modules/aggiornamenti/upload_modules.php index a8c30f2a6..4c4ded3b5 100755 --- a/modules/aggiornamenti/upload_modules.php +++ b/modules/aggiornamenti/upload_modules.php @@ -110,4 +110,4 @@ if (file_exists($extraction_dir.'/VERSION')) { delete($extraction_dir); // Redirect -redirect_legacy(base_url().'/editor.php?id_module='.$id_module); +redirect_legacy(base_path().'/editor.php?id_module='.$id_module); diff --git a/modules/anagrafiche/ajax/search.php b/modules/anagrafiche/ajax/search.php index 120189a89..fe185fe35 100755 --- a/modules/anagrafiche/ajax/search.php +++ b/modules/anagrafiche/ajax/search.php @@ -67,7 +67,7 @@ $rs = $dbo->fetchArray($query); foreach ($rs as $r) { $result = []; - $result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; + $result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; $result['title'] = $r['ragione_sociale']; $result['title'] .= !empty($r['deleted_at']) ? ' ('.tr('eliminata').')' : ''; $result['category'] = 'Anagrafiche'; @@ -114,7 +114,7 @@ $plugin = $dbo->fetchArray("SELECT id FROM zz_plugins WHERE name='Referenti'"); foreach ($rs as $r) { $result = []; - $result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'].'#tab_'.$plugin[0]['id']; + $result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'].'#tab_'.$plugin[0]['id']; $result['title'] = $r['nome']; $result['category'] = 'Referenti'; diff --git a/modules/anagrafiche/edit.php b/modules/anagrafiche/edit.php index 7faf13339..eb54652f7 100755 --- a/modules/anagrafiche/edit.php +++ b/modules/anagrafiche/edit.php @@ -458,13 +458,13 @@ if ($is_cliente or $is_fornitore or $is_tecnico) { echo '
diff --git a/modules/anagrafiche/plugins/allegati.php b/modules/anagrafiche/plugins/allegati.php index dc23df3a6..cd94151f3 100755 --- a/modules/anagrafiche/plugins/allegati.php +++ b/modules/anagrafiche/plugins/allegati.php @@ -113,14 +113,14 @@ echo ' echo ' - + '; // Anteprime supportate dal browser if ($file->hasPreview()) { echo ' - '; } else { @@ -133,7 +133,7 @@ echo ' echo ' - + '.$file->name.' diff --git a/modules/articoli/ajax/complete.php b/modules/articoli/ajax/complete.php index 9e8343038..2e8f6e753 100755 --- a/modules/articoli/ajax/complete.php +++ b/modules/articoli/ajax/complete.php @@ -44,7 +44,7 @@ switch ($resource) { ($documenti[$i]['n2_documento'] != '') ? $n_documento = $documenti[$i]['n2_documento'] : $n_documento = $documenti[$i]['n_documento']; $link_id = module($documenti[$i]['modulo'])['id']; - echo "".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.dateFormat($documenti[$i]['data_documento'])." \n"; + echo "".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.dateFormat($documenti[$i]['data_documento'])." \n"; echo "".moneyFormat($documenti[$i]['costo_unitario'])."\n"; array_push($ids, '"'.$documenti[$i]['id'].'"'); } @@ -73,7 +73,7 @@ switch ($resource) { ($documenti[$i]['n2_documento'] != '') ? $n_documento = $documenti[$i]['n2_documento'] : $n_documento = $documenti[$i]['n_documento']; $link_id = module($documenti[$i]['modulo'])['id']; - echo "".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.dateFormat($documenti[$i]['data_documento'])." \n"; + echo "".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.dateFormat($documenti[$i]['data_documento'])." \n"; echo "".moneyFormat($documenti[$i]['costo_unitario'])."\n"; array_push($ids, '"'.$documenti[$i]['id'].'"'); } @@ -101,7 +101,7 @@ switch ($resource) { ($documenti[$i]['n2_documento'] != '') ? $n_documento = $documenti[$i]['n2_documento'] : $n_documento = $documenti[$i]['n_documento']; $link_id = module($documenti[$i]['modulo'])['id']; - echo "".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.dateFormat($documenti[$i]['data_documento'])." \n"; + echo "".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.dateFormat($documenti[$i]['data_documento'])." \n"; echo "".moneyFormat($documenti[$i]['costo_unitario'])."\n"; array_push($ids, '"'.$documenti[$i]['id'].'"'); } diff --git a/modules/articoli/ajax/search.php b/modules/articoli/ajax/search.php index 000991863..2775392f5 100755 --- a/modules/articoli/ajax/search.php +++ b/modules/articoli/ajax/search.php @@ -49,7 +49,7 @@ $rs = $dbo->fetchArray($query); foreach ($rs as $r) { $result = []; - $result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; + $result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; $result['title'] = $r['codice'].' - '.$r['descrizione']; $result['category'] = 'Articoli'; diff --git a/modules/articoli/bulk.php b/modules/articoli/bulk.php index eb760006c..671361cc5 100644 --- a/modules/articoli/bulk.php +++ b/modules/articoli/bulk.php @@ -111,8 +111,8 @@ switch (post('op')) { session('superselect.id_articolo_barcode') = $id_records; $id_print = Prints::getPrints()['Barcode']; - redirect(base_url().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('barcode', '!=', '')->first()->id); - exit(); + redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('barcode', '!=', '')->first()->id); + throw new \LegacyExitException();; break; @@ -178,7 +178,7 @@ switch (post('op')) { $database->commitTransaction(); redirect(base_path().'/editor.php?id_module='.module('Preventivi')['id'].'&id_record='.$id_preventivo); - exit(); + throw new \LegacyExitException();; break; diff --git a/modules/articoli/edit.php b/modules/articoli/edit.php index d5a250406..eb8d19898 100755 --- a/modules/articoli/edit.php +++ b/modules/articoli/edit.php @@ -429,8 +429,8 @@ $(document).ready(function(){ input('prezzo_acquisto').disable(); } - $("#prezziacquisto").load("/ajax_complete.php?module=Articoli&op=getprezziacquisto&idarticolo="+ + "&limit=20"); + $("#prezziacquisto").load("/ajax_complete.php?module=Articoli&op=getprezziacquisto&idarticolo="+ + "&limit=20"); - $("#prezzivendita").load("/ajax_complete.php?module=Articoli&op=getprezzivendita&idarticolo="+ + "&limit=20"); + $("#prezzivendita").load("/ajax_complete.php?module=Articoli&op=getprezzivendita&idarticolo="+ + "&limit=20"); }); diff --git a/modules/articoli/plugins/articoli.movimenti.php b/modules/articoli/plugins/articoli.movimenti.php index b18aa441f..c8c32aea4 100755 --- a/modules/articoli/plugins/articoli.movimenti.php +++ b/modules/articoli/plugins/articoli.movimenti.php @@ -27,20 +27,20 @@ echo '
'; if (empty($_GET['movimentazione_completa'])) { echo ' - + '.tr('Mostra tutti i movimenti').' '; } else { echo ' - + '.tr('Mostra gli ultimi 20 movimenti').' '; } echo ' - + '.tr('Visualizza dettagli').' '; diff --git a/modules/articoli/src/Articolo.php b/modules/articoli/src/Articolo.php index 84ceaa876..565f73604 100755 --- a/modules/articoli/src/Articolo.php +++ b/modules/articoli/src/Articolo.php @@ -176,7 +176,7 @@ class Articolo extends Model $image = $directory.$this->immagine; $image_thumbnail = $directory.$fileinfo['filename'].'_thumb600.'.$fileinfo['extension']; - $url = file_exists(base_dir().$image_thumbnail) ? base_url().$image_thumbnail : base_url().$image; + $url = file_exists(base_dir().$image_thumbnail) ? base_path().$image_thumbnail : base_path().$image; return $url; } diff --git a/modules/articoli/widgets/stampa_inventario.php b/modules/articoli/widgets/stampa_inventario.php index 98fe5bbd9..a1040bd80 100755 --- a/modules/articoli/widgets/stampa_inventario.php +++ b/modules/articoli/widgets/stampa_inventario.php @@ -23,7 +23,7 @@ include_once __DIR__.'/../../../core.php'; $id_print = $dbo->fetchOne('SELECT zz_prints.id FROM zz_prints INNER JOIN zz_modules ON zz_prints.id_module=zz_modules.id WHERE zz_modules.name="Articoli" AND zz_prints.name="Inventario magazzino"')['id']; echo ' - +
diff --git a/modules/backups/edit.php b/modules/backups/edit.php index 91e045de0..8cf378ed1 100755 --- a/modules/backups/edit.php +++ b/modules/backups/edit.php @@ -234,7 +234,7 @@ if (file_exists($backup_dir)) { loadSize("'.$id.'", "c-'.$id.'"); - '.tr('Scarica').' + '.tr('Scarica').'
diff --git a/modules/categorie_articoli/actions.php b/modules/categorie_articoli/actions.php index 8dc326c57..8643f77d4 100755 --- a/modules/categorie_articoli/actions.php +++ b/modules/categorie_articoli/actions.php @@ -42,8 +42,8 @@ switch (filter('op')) { // Redirect alla categoria se si sta modificando una sottocategoria $database->commitTransaction(); - redirect(base_url().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record)); - exit(); + redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record)); + throw new \LegacyExitException();; break; @@ -85,8 +85,8 @@ switch (filter('op')) { } else { // Redirect alla categoria se si sta aggiungendo una sottocategoria $database->commitTransaction(); - redirect(base_url().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record)); - exit(); + redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record)); + throw new \LegacyExitException();; } break; diff --git a/modules/categorie_articoli/add.php b/modules/categorie_articoli/add.php index ad3c0d841..9bad36961 100755 --- a/modules/categorie_articoli/add.php +++ b/modules/categorie_articoli/add.php @@ -27,7 +27,7 @@ if (isset($id_record)) { ?>

diff --git a/modules/categorie_articoli/row-list.php b/modules/categorie_articoli/row-list.php index b9edaa16f..f39439e78 100755 --- a/modules/categorie_articoli/row-list.php +++ b/modules/categorie_articoli/row-list.php @@ -29,7 +29,7 @@ foreach ($subcategorie as $sub) { '.$sub['colore'].' '.$sub['nota'].' - + diff --git a/modules/combinazioni_articoli/edit.php b/modules/combinazioni_articoli/edit.php index 798c7eac7..554a352bd 100644 --- a/modules/combinazioni_articoli/edit.php +++ b/modules/combinazioni_articoli/edit.php @@ -114,7 +114,7 @@ function modificaVariante(id) { function rimuoviVariante(id) { if( confirm(\'Rimuovere la variante dalla combinazione?\') ){ - $.post( \''.base_url().'/modules/combinazioni_articoli/actions.php\', { op: \'remove-variante\', id_articolo: + id }, function(data){ location.href=\''.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'\'; } ); + $.post( \''.base_path().'/modules/combinazioni_articoli/actions.php\', { op: \'remove-variante\', id_articolo: + id }, function(data){ location.href=\''.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'\'; } ); } } diff --git a/modules/contratti/edit.php b/modules/contratti/edit.php index 5ed625987..2ffbc7cba 100755 --- a/modules/contratti/edit.php +++ b/modules/contratti/edit.php @@ -248,7 +248,7 @@ if (!empty($rs)) { - @@ -300,7 +300,7 @@ if (!empty($rs)) { - diff --git a/modules/dashboard/ajax.php b/modules/dashboard/ajax.php index 65839b235..abcdfeb79 100644 --- a/modules/dashboard/ajax.php +++ b/modules/dashboard/ajax.php @@ -109,7 +109,7 @@ switch (filter('op')) { 'title' => '
'.(($sessione['is_completato']) ? '' : '').' '.(($sessione['have_attachments']) ? '' : '').'
'.'Int. '.$sessione['codice'].' '.$sessione['cliente'].'
'.tr('Tecnici').': '.$sessione['nome_tecnico'], 'start' => $sessione['orario_inizio'], 'end' => $sessione['orario_fine'], - 'link' => base_url().'/editor.php?id_module='.$modulo_interventi->id.'&id_record='.$sessione['idintervento'], + 'link' => base_path().'/editor.php?id_module='.$modulo_interventi->id.'&id_record='.$sessione['idintervento'], 'backgroundColor' => $backgroundcolor, 'textColor' => color_inverse($backgroundcolor), 'borderColor' => ($bordercolor == '#FFFFFF') ? color_darken($bordercolor, 100) : $bordercolor, @@ -149,7 +149,7 @@ switch (filter('op')) { 'title' => '
'.(($preventivo['is_completato']) ? '' : '').' '.(($preventivo['have_attachments']) ? '' : '').'
'.'Accettazione prev. '.$preventivo['numero'].' '.$preventivo['nome'].'
'.tr('Cliente').': '.$preventivo['cliente'], 'start' => $preventivo['data_accettazione'], 'end' => $preventivo['data_accettazione'], - 'url' => base_url().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'], + 'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'], 'backgroundColor' => '#ff7f50', 'textColor' => color_inverse('#ff7f50'), 'borderColor' => '#ff7f50', @@ -166,7 +166,7 @@ switch (filter('op')) { 'title' => '
'.(($preventivo['is_completato']) ? '' : '').' '.(($preventivo['have_attachments']) ? '' : '').'
'.'Conclusione prev. '.$preventivo['numero'].' '.$preventivo['nome'].'
'.tr('Cliente').': '.$preventivo['cliente'], 'start' => $preventivo['data_conclusione'], 'end' => $preventivo['data_conclusione'], - 'url' => base_url().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'], + 'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'], 'backgroundColor' => '#ff7f50', 'textColor' => color_inverse('#ff7f50'), 'borderColor' => '#ff7f50', diff --git a/modules/ddt/ajax/search.php b/modules/ddt/ajax/search.php index 20adea3a1..f983012c8 100755 --- a/modules/ddt/ajax/search.php +++ b/modules/ddt/ajax/search.php @@ -51,7 +51,7 @@ foreach ($rs as $r) { $numero = empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno']; - $result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; + $result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; $result['title'] = $r['tipologia'].' num. '.$numero.' del '.dateFormat($r['data']); $result['category'] = $r['tipologia']; diff --git a/modules/ddt/buttons.php b/modules/ddt/buttons.php index 37d959cdd..d204dc15a 100755 --- a/modules/ddt/buttons.php +++ b/modules/ddt/buttons.php @@ -27,7 +27,7 @@ if (!empty($ddt->id_ddt_trasporto_interno)) { echo ' '; diff --git a/modules/ddt/edit.php b/modules/ddt/edit.php index 98269bb10..5a5542943 100755 --- a/modules/ddt/edit.php +++ b/modules/ddt/edit.php @@ -358,12 +358,12 @@ if (!$block_edit) { $ddt_query = 'SELECT COUNT(*) AS tot FROM dt_ddt WHERE idstatoddt IN (SELECT id FROM dt_statiddt WHERE descrizione IN(\'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoddt=(SELECT id FROM or_tipiordine WHERE dir="'.($dir == 'entrata' ? 'uscita' : 'entrata').'") AND dt_ddt.id IN (SELECT idddt FROM dt_righe_ddt WHERE dt_righe_ddt.idddt = dt_ddt.id AND (qta - qta_evasa) > 0)'; $ddt = $dbo->fetchArray($ddt_query)[0]['tot']; echo ' - + '.tr('Ddt').' '; echo ' - + '.tr('Ordine').' '; diff --git a/modules/fatture/add_intervento.php b/modules/fatture/add_intervento.php index b9b0e3e81..a5cf85fad 100755 --- a/modules/fatture/add_intervento.php +++ b/modules/fatture/add_intervento.php @@ -46,7 +46,7 @@ echo ' '_NUM_' => $numero, ]).'

- + '; diff --git a/modules/fatture/add_serial.php b/modules/fatture/add_serial.php index e9235c81c..d51b42b28 100755 --- a/modules/fatture/add_serial.php +++ b/modules/fatture/add_serial.php @@ -75,7 +75,7 @@ $rs = $dbo->fetchArray('SELECT mg_articoli.id AS idarticolo, mg_articoli.codice, echo '

'.tr('Articolo').': '.$rs[0]['codice'].' - '.$rs[0]['descrizione'].'

- + diff --git a/modules/fatture/ajax/search.php b/modules/fatture/ajax/search.php index d7d0a807d..6e6268ea9 100755 --- a/modules/fatture/ajax/search.php +++ b/modules/fatture/ajax/search.php @@ -53,7 +53,7 @@ foreach ($rs as $r) { $numero = empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno']; - $result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; + $result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; $result['title'] = $r['tipologia'].' num. '.$numero.' del '.dateFormat($r['data']); $result['category'] = $r['tipologia']; diff --git a/modules/fatture/bulk.php b/modules/fatture/bulk.php index 21d424b95..85ea77438 100755 --- a/modules/fatture/bulk.php +++ b/modules/fatture/bulk.php @@ -494,7 +494,7 @@ $operations['registrazione-contabile'] = [ 'title' => tr('Registrazione contabile'), 'type' => 'modal', 'origine' => 'fatture', - 'url' => base_url().'/add.php?id_module='.module('Prima nota')['id'], + 'url' => base_path().'/add.php?id_module='.module('Prima nota')['id'], ], ]; diff --git a/modules/fatture/buttons.php b/modules/fatture/buttons.php index c5680105e..6cfbe2b81 100755 --- a/modules/fatture/buttons.php +++ b/modules/fatture/buttons.php @@ -42,11 +42,11 @@ if ($dir == 'entrata') { @@ -80,7 +80,7 @@ if (!empty($record['is_fiscale'])) { } echo ' - + '.tr('Registra insoluto').' '; @@ -98,7 +98,7 @@ if (!empty($record['is_fiscale'])) { } echo ' - + '.tr('Registra contabile').' '; diff --git a/modules/fatture/variables.php b/modules/fatture/variables.php index e78280ff5..9563731e2 100755 --- a/modules/fatture/variables.php +++ b/modules/fatture/variables.php @@ -32,9 +32,9 @@ FROM co_documenti WHERE co_documenti.id='.prepare($id_record)); if (!empty(setting('Logo stampe'))) { - $logo_azienda = base_url().'/'.Models\Upload::where('filename', setting('Logo stampe'))->first()->fileurl; + $logo_azienda = base_path().'/'.Models\Upload::where('filename', setting('Logo stampe'))->first()->fileurl; } else { - $logo_azienda = str_replace(base_dir(), base_url(), AppLegacy::filepath('templates/base|custom|/logo_azienda.jpg')); + $logo_azienda = str_replace(base_dir(), base_path(), AppLegacy::filepath('templates/base|custom|/logo_azienda.jpg')); $logo_azienda = str_replace('\\', '/', $logo_azienda); } diff --git a/modules/giacenze_sedi/init.php b/modules/giacenze_sedi/init.php index 1de32beab..da34197c2 100644 --- a/modules/giacenze_sedi/init.php +++ b/modules/giacenze_sedi/init.php @@ -21,5 +21,5 @@ include_once __DIR__.'/../../core.php'; if (isset($id_record)) { $id_module = module('Articoli')['id']; - redirect_legacy(base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record); + redirect_legacy(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record); } diff --git a/modules/impianti/ajax/search.php b/modules/impianti/ajax/search.php index 9d72c3fe0..70af21ff5 100644 --- a/modules/impianti/ajax/search.php +++ b/modules/impianti/ajax/search.php @@ -49,7 +49,7 @@ $rs = $dbo->fetchArray($query); foreach ($rs as $r) { $result = []; - $result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; + $result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; $result['title'] = $r['matricola'].' - '.$r['nome']; $result['category'] = 'Impianti'; diff --git a/modules/impianti/edit.php b/modules/impianti/edit.php index 9bb84950f..049b49b9c 100644 --- a/modules/impianti/edit.php +++ b/modules/impianti/edit.php @@ -25,7 +25,7 @@ if (!empty($record['immagine'])) { $default_img = '/'.Uploads::getDirectory($id_module).'/'.$fileinfo['filename'].'_thumb600.'.$fileinfo['extension']; - $img = file_exists(base_dir().$default_img) ? base_url().$default_img : base_url().'/'.Uploads::getDirectory($id_module).'/'.$record['immagine']; + $img = file_exists(base_dir().$default_img) ? base_path().$default_img : base_path().'/'.Uploads::getDirectory($id_module).'/'.$record['immagine']; } ?> diff --git a/modules/impianti/plugins/my_impianti.interventi.php b/modules/impianti/plugins/my_impianti.interventi.php index 0e7c09ce4..0dea0ab05 100644 --- a/modules/impianti/plugins/my_impianti.interventi.php +++ b/modules/impianti/plugins/my_impianti.interventi.php @@ -123,7 +123,7 @@ foreach ($impianti_collegati as $impianto) { '.tr("Componenti soggetti all'intervento").' - + '; @@ -159,7 +159,7 @@ $sedi = $dbo->fetchArray('SELECT id, nomesede, citta FROM an_sedi WHERE idanagra echo '

'.tr('Impianti disponibili').'

- +
@@ -169,7 +169,7 @@ echo '

- + '; diff --git a/modules/import/actions.php b/modules/import/actions.php index 1727f1367..7a318e382 100755 --- a/modules/import/actions.php +++ b/modules/import/actions.php @@ -49,7 +49,7 @@ switch (filter('op')) { // Generazione del file $import_manager::createExample($filepath); - echo base_url().'/'.$file; + echo base_path().'/'.$file; } break; diff --git a/modules/interventi/add.php b/modules/interventi/add.php index c9b904237..e2c1698bd 100755 --- a/modules/interventi/add.php +++ b/modules/interventi/add.php @@ -27,6 +27,14 @@ $id_sede = filter('idsede'); $richiesta = filter('richiesta'); $id_tipo = filter('id_tipo'); +$id_cliente = null; +$id_cliente_finale = null; +$id_preventivo = null; +$data_richiesta = null; +$data_scadenza = null; +$impianti_collegati = null; +$id_zona = null; + $origine_dashboard = get('ref') !== null; $module_anagrafiche = module('Anagrafiche'); $id_plugin_sedi = Plugins::get('Sedi')['id']; @@ -48,7 +56,7 @@ if ($user['gruppo'] == 'Tecnici' && !empty($user['idanagrafica'])) { } // Stato di default associato all'attivitò -$stato = $dbo->fetchArray("SELECT * FROM in_statiintervento WHERE codice = 'WIP'"); +$stato = $dbo->fetchOne("SELECT * FROM in_statiintervento WHERE codice = 'WIP'"); $id_stato = $stato['idstatointervento']; // Se è indicata un'anagrafica relativa, si carica il tipo di intervento di default impostato @@ -518,7 +526,7 @@ echo ' if (data !== undefined) { // Carico nel panel i dettagli del cliente - $.get("'.base_url().'/ajax_complete.php?module=Interventi&op=dettagli&id_anagrafica=" + value, function(data){ + $.get("'.base_path().'/ajax_complete.php?module=Interventi&op=dettagli&id_anagrafica=" + value, function(data){ $("#dettagli_cliente").html(data); }); } else { diff --git a/modules/interventi/ajax/search.php b/modules/interventi/ajax/search.php index 9f395bb76..021539071 100755 --- a/modules/interventi/ajax/search.php +++ b/modules/interventi/ajax/search.php @@ -53,7 +53,7 @@ $rs = $dbo->fetchArray($query); foreach ($rs as $r) { $result = []; - $result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; + $result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; $result['title'] = 'Intervento '.$r['codice'].' del '.dateFormat($r['data']); $result['category'] = 'Interventi'; diff --git a/modules/interventi/ajax_tecnici.php b/modules/interventi/ajax_tecnici.php index 9ad267e4c..c8a9b427f 100755 --- a/modules/interventi/ajax_tecnici.php +++ b/modules/interventi/ajax_tecnici.php @@ -245,7 +245,7 @@ if (!$is_completato) { } echo ' - + diff --git a/modules/partitario/add_conto.php b/modules/partitario/add_conto.php index 32e5852f1..a6499d8dd 100755 --- a/modules/partitario/add_conto.php +++ b/modules/partitario/add_conto.php @@ -22,7 +22,7 @@ include_once __DIR__.'/../../core.php'; $id_conto = get('id'); $lvl = get('lvl'); -?>
+?> diff --git a/modules/partitario/edit_conto.php b/modules/partitario/edit_conto.php index 0c9584c71..b5506de4d 100755 --- a/modules/partitario/edit_conto.php +++ b/modules/partitario/edit_conto.php @@ -31,7 +31,7 @@ if ($lvl == 2) { $info = $dbo->fetchOne($query); -?> +?> diff --git a/modules/preventivi/ajax/search.php b/modules/preventivi/ajax/search.php index ebfcab5a6..0e248f589 100755 --- a/modules/preventivi/ajax/search.php +++ b/modules/preventivi/ajax/search.php @@ -46,7 +46,7 @@ $rs = $dbo->fetchArray($query); foreach ($rs as $r) { $result = []; - $result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; + $result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id']; $result['title'] = 'Preventivo '.$r['numero']; if ($r['data_accettazione'] == '0000-00-00') { diff --git a/modules/preventivi/widgets/preventivi.dashboard.php b/modules/preventivi/widgets/preventivi.dashboard.php index a3f53a8dd..8ddc9add9 100755 --- a/modules/preventivi/widgets/preventivi.dashboard.php +++ b/modules/preventivi/widgets/preventivi.dashboard.php @@ -42,7 +42,7 @@ if (!empty($rs)) { $attr = ''; } - echo ''.$preventivo['nome']."
".$preventivo['ragione_sociale'].''; + echo ''.$preventivo['nome']."
".$preventivo['ragione_sociale'].''; echo ''.$data_accettazione.''; echo ''.$data_conclusione.''; } diff --git a/modules/primanota/add.php b/modules/primanota/add.php index e9665bd0c..8db816db4 100755 --- a/modules/primanota/add.php +++ b/modules/primanota/add.php @@ -260,7 +260,7 @@ if (!empty(get('id_anagrafica'))) { $id_anagrafica = $dbo->fetchOne('SELECT idanagrafica FROM co_documenti WHERE id IN('.(get('id_documenti') ?: '0').')')['idanagrafica']; } echo ' - + diff --git a/modules/primanota/edit.php b/modules/primanota/edit.php index 7d361e934..427a7a8b9 100755 --- a/modules/primanota/edit.php +++ b/modules/primanota/edit.php @@ -37,7 +37,7 @@ include_once __DIR__.'/../../core.php'; $modulo = ($rs[0]['dir'] == 'entrata') ? 'Fatture di vendita' : 'Fatture di acquisto'; ?>

- +
fetchArray('SELECT dir FROM co_tipidocumento INNER JOIN co_documenti ON co_tipidocumento.id=co_documenti.idtipodocumento WHERE co_documenti.id='.prepare($rs_doc[$i]['iddocumento'])); $modulo = ($rs[0]['dir'] == 'entrata') ? 'Fatture di vendita' : 'Fatture di acquisto'; ?> -
  • +
  • diff --git a/modules/scadenzario/bulk.php b/modules/scadenzario/bulk.php index e8c0f1ef0..296cd5582 100755 --- a/modules/scadenzario/bulk.php +++ b/modules/scadenzario/bulk.php @@ -75,7 +75,7 @@ $operations['registrazione-contabile'] = [ 'title' => tr('Registrazione contabile'), 'type' => 'modal', 'origine' => 'scadenzario', - 'url' => base_url().'/add.php?id_module='.module('Prima nota')['id'], + 'url' => base_path().'/add.php?id_module='.module('Prima nota')['id'], ], ]; diff --git a/modules/scadenzario/edit.php b/modules/scadenzario/edit.php index efb5ca2f5..19a0eeff4 100755 --- a/modules/scadenzario/edit.php +++ b/modules/scadenzario/edit.php @@ -189,7 +189,7 @@ echo ' if ($totale_da_pagare != 0) { echo ' diff --git a/modules/scadenzario/variables.php b/modules/scadenzario/variables.php index 617296ef3..8593df2ea 100755 --- a/modules/scadenzario/variables.php +++ b/modules/scadenzario/variables.php @@ -29,7 +29,7 @@ FROM co_scadenziario INNER JOIN an_anagrafiche ON co_documenti.idanagrafica=an_anagrafiche.idanagrafica WHERE co_scadenziario.pagato != co_scadenziario.da_pagare AND co_scadenziario.iddocumento = (SELECT iddocumento FROM co_scadenziario s WHERE id='.prepare($id_record).')'); -$logo_azienda = str_replace(base_dir(), base_url(), AppLegacy::filepath('templates/base|custom|/logo_azienda.jpg')); +$logo_azienda = str_replace(base_dir(), base_path(), AppLegacy::filepath('templates/base|custom|/logo_azienda.jpg')); // Variabili da sostituire return [ diff --git a/modules/smtp/actions.php b/modules/smtp/actions.php index 1385c4be3..8fd8b05f1 100755 --- a/modules/smtp/actions.php +++ b/modules/smtp/actions.php @@ -86,7 +86,7 @@ switch (filter('op')) { // Link di redirect dopo la configurazione $modulo_account_email = Module::pool('Account email'); - $oauth2->after_configuration = base_url().'/editor.php?id_module='.$modulo_account_email->id.'&id_record='.$id_record; + $oauth2->after_configuration = base_path().'/editor.php?id_module='.$modulo_account_email->id.'&id_record='.$id_record; $oauth2->save(); @@ -139,7 +139,7 @@ switch (filter('op')) { case 'oauth2': $oauth2 = $account->oauth2; - $redirect = base_url().'/oauth2.php?id='.$oauth2->id; + $redirect = base_path().'/oauth2.php?id='.$oauth2->id; redirect($redirect); break; diff --git a/modules/smtp/edit.php b/modules/smtp/edit.php index 7a17f7e1f..4467ec5c0 100755 --- a/modules/smtp/edit.php +++ b/modules/smtp/edit.php @@ -132,7 +132,7 @@ echo '
    diff --git a/modules/stampe_contabili/edit.php b/modules/stampe_contabili/edit.php index 00acef128..95426ac56 100755 --- a/modules/stampe_contabili/edit.php +++ b/modules/stampe_contabili/edit.php @@ -34,11 +34,11 @@ echo '
    - + - + - +
    @@ -84,7 +84,7 @@ echo '
    - + '.Prints::getLink('Mastrino', 1, 'btn-primary col-md-3 col-md-push-1', '
    '.tr('Situazione').'
    '.tr('patrimoniale'), '|default| fa-2x', 'lev=1').' diff --git a/modules/statistiche/edit.php b/modules/statistiche/edit.php index f9bbca4df..2ea98ee7b 100755 --- a/modules/statistiche/edit.php +++ b/modules/statistiche/edit.php @@ -22,7 +22,7 @@ include_once __DIR__.'/../../core.php'; use Modules\Statistiche\Stats; echo ' -'; +'; $start = session('period_start'); $end = session('period_end'); diff --git a/modules/stato_email/edit.php b/modules/stato_email/edit.php index bb6ac61b4..29ddea8bd 100755 --- a/modules/stato_email/edit.php +++ b/modules/stato_email/edit.php @@ -145,7 +145,7 @@ foreach ($uploads as $upload) { echo ' - '.$upload->name.' + '.$upload->name.' '.$upload->pivot->name.' '; diff --git a/modules/stato_servizi/src/ServicesHook.php b/modules/stato_servizi/src/ServicesHook.php index fb17e5b85..45144d250 100644 --- a/modules/stato_servizi/src/ServicesHook.php +++ b/modules/stato_servizi/src/ServicesHook.php @@ -75,7 +75,7 @@ class ServicesHook extends Manager return [ 'icon' => null, 'message' => $message, - 'link' => base_url().'/controller.php?id_module='.$module->id, + 'link' => base_path().'/controller.php?id_module='.$module->id, 'show' => Services::isEnabled() && !empty($message), ]; } diff --git a/modules/stato_servizi/widgets/spazio_utilizzato.php b/modules/stato_servizi/widgets/spazio_utilizzato.php index 8db608611..662786607 100755 --- a/modules/stato_servizi/widgets/spazio_utilizzato.php +++ b/modules/stato_servizi/widgets/spazio_utilizzato.php @@ -22,7 +22,7 @@ include_once __DIR__.'/../../../core.php'; $module = module('Stato dei servizi'); echo ' -'; +'; // Operazioni JavaScript echo ' diff --git a/modules/utenti/actions.php b/modules/utenti/actions.php index ea7859f38..c241c8668 100755 --- a/modules/utenti/actions.php +++ b/modules/utenti/actions.php @@ -116,7 +116,7 @@ switch (filter('op')) { $utente->save(); - redirect_legacy(base_url().'/modules/utenti/info.php'); + redirect_legacy(base_path().'/modules/utenti/info.php'); break; diff --git a/modules/utenti/info.php b/modules/utenti/info.php index d086e8b68..bd5eb4f11 100755 --- a/modules/utenti/info.php +++ b/modules/utenti/info.php @@ -39,7 +39,7 @@ if (!empty($rs)) { $anagrafica = $rs[0]; } -$api = base_url().'/api/?token='.$token; +$api = base_path().'/api/?token='.$token; $module = module('Utenti e permessi'); echo ' diff --git a/modules/utenti/user.php b/modules/utenti/user.php index badcf8af6..0d855c233 100755 --- a/modules/utenti/user.php +++ b/modules/utenti/user.php @@ -46,7 +46,7 @@ if (!empty($user)) { } echo ' - + diff --git a/modules/utenti/variables.php b/modules/utenti/variables.php index 208abd249..ecfc95f1e 100755 --- a/modules/utenti/variables.php +++ b/modules/utenti/variables.php @@ -24,5 +24,5 @@ $reset_token = $record->reset_token; return [ 'username' => $record->username, 'reset_token' => $reset_token, - 'reset_link' => base_url().'/reset.php?reset_token='.$reset_token, + 'reset_link' => base_path().'/reset.php?reset_token='.$reset_token, ]; diff --git a/modules/viste/edit.php b/modules/viste/edit.php index 25b64bc9e..fd5be85fa 100755 --- a/modules/viste/edit.php +++ b/modules/viste/edit.php @@ -132,7 +132,7 @@ function testQuery(){ $("#main_loading").fadeIn(); $.ajax({ - url: "'.base_url().'/actions.php?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&op=test", + url: "'.base_path().'/actions.php?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&op=test", cache: false, type: "post", processData: false, diff --git a/oauth2.php b/oauth2.php index 0039bd1bd..fbfdae011 100644 --- a/oauth2.php +++ b/oauth2.php @@ -55,8 +55,8 @@ if (empty($redirect)) { } if (empty($_GET['error'])) { - redirect($redirect); - exit(); + redirect_legacy($redirect); + throw new \LegacyExitException();; } else { echo $_GET['error'].'
    '.$_GET['error_description'].'

    diff --git a/pdfgen.php b/pdfgen.php index 254b6cbe4..efe378703 100755 --- a/pdfgen.php +++ b/pdfgen.php @@ -43,7 +43,7 @@ if (empty($result)) {
    - + '.tr('Indietro').'
    '; diff --git a/plugins/componenti/edit.php b/plugins/componenti/edit.php index a336b8d32..2933355a0 100644 --- a/plugins/componenti/edit.php +++ b/plugins/componenti/edit.php @@ -138,7 +138,7 @@ foreach ($elenchi as $elenco) {
    - + @@ -251,7 +251,7 @@ echo ' const id_componente = tr.data("id"); if(confirm("'.tr('Vuoi sostituire questo componente?').'")) { - redirect("'.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=sostituisci&backto=record-edit&id_plugin='.$id_plugin.'&id_componente=" + id_componente + "&hash=tab_'.$structure->id.'"); + redirect("'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=sostituisci&backto=record-edit&id_plugin='.$id_plugin.'&id_componente=" + id_componente + "&hash=tab_'.$structure->id.'"); } } @@ -260,7 +260,7 @@ echo ' const id_componente = tr.data("id"); if(confirm("'.tr('Vuoi eliminare questo componente?').'")){ - redirect("'.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=rimuovi&backto=record-edit&id_plugin='.$id_plugin.'&id_componente=" + id_componente + "&hash=tab_'.$structure->id.'"); + redirect("'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=rimuovi&backto=record-edit&id_plugin='.$id_plugin.'&id_componente=" + id_componente + "&hash=tab_'.$structure->id.'"); } } diff --git a/plugins/exportFE/edit.php b/plugins/exportFE/edit.php index 9dab553f9..a69d5d108 100755 --- a/plugins/exportFE/edit.php +++ b/plugins/exportFE/edit.php @@ -88,7 +88,7 @@ if ($fattura !== null) { - + '.tr('Visualizza').' '; diff --git a/plugins/importFE/actions.php b/plugins/importFE/actions.php index 48e1bb9c1..10413e051 100755 --- a/plugins/importFE/actions.php +++ b/plugins/importFE/actions.php @@ -155,7 +155,7 @@ switch (filter('op')) { $process_result = Interaction::processInvoice($filename); if ($process_result != '') { flash()->error($process_result); - redirect_legacy(base_url().'/controller.php?id_module='.$id_module); + redirect_legacy(base_path().'/controller.php?id_module='.$id_module); return; } @@ -165,9 +165,9 @@ switch (filter('op')) { $file = $files[$id_record - 1]; if (get('sequence') == null) { - redirect_legacy(base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_fattura); + redirect_legacy(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_fattura); } elseif (!empty($file)) { - redirect(base_url().'/editor.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'&id_record='.$id_record.'&sequence=1'); + redirect(base_path().'/editor.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'&id_record='.$id_record.'&sequence=1'); flash()->warning(tr('È stata appena creata la fattura numero _NUM_ del _DATA_ (_ANAGRAFICA_)', [ '_NUM_' => $fattura->numero, '_DATA_' => dateFormat($fattura->data), @@ -175,7 +175,7 @@ switch (filter('op')) { ])); } else { flash()->info(tr('Tutte le fatture salvate sono state importate!')); - redirect_legacy(base_url().'/controller.php?id_module='.$id_module); + redirect_legacy(base_path().'/controller.php?id_module='.$id_module); } break; diff --git a/plugins/importFE/generate.php b/plugins/importFE/generate.php index 941202f24..cfc18d047 100755 --- a/plugins/importFE/generate.php +++ b/plugins/importFE/generate.php @@ -29,7 +29,7 @@ $(document).ready(function() { }); '; -$skip_link = $has_next ? base_url().'/editor.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'&id_record='.($id_record + 1).'&sequence='.get('sequence') : base_url().'/editor.php?id_module='.$id_module; +$skip_link = $has_next ? base_path().'/editor.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'&id_record='.($id_record + 1).'&sequence='.get('sequence') : base_path().'/editor.php?id_module='.$id_module; if (empty($fattura_pa)) { if (!empty($error)) { diff --git a/plugins/importFE/init.php b/plugins/importFE/init.php index 8613c5af4..8d1b484f5 100755 --- a/plugins/importFE/init.php +++ b/plugins/importFE/init.php @@ -43,6 +43,6 @@ if (isset($id_record)) { if (empty($record)) { flash()->warning(tr('Nessuna fattura da importare!')); - redirect_legacy(base_url().'/controller.php?id_module='.$id_module); + redirect_legacy(base_path().'/controller.php?id_module='.$id_module); } } diff --git a/plugins/importFE/src/InvoiceHook.php b/plugins/importFE/src/InvoiceHook.php index b522296af..d35c1407c 100755 --- a/plugins/importFE/src/InvoiceHook.php +++ b/plugins/importFE/src/InvoiceHook.php @@ -53,7 +53,7 @@ class InvoiceHook extends CachedManager return $value->name == 'Fatturazione Elettronica'; }); - $link = base_url().'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id; + $link = base_path().'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id; } $message = tr('Ci sono _NUM_ fatture passive da importare', [ diff --git a/plugins/pianificazione_interventi/edit.php b/plugins/pianificazione_interventi/edit.php index beedae861..09f22fefa 100755 --- a/plugins/pianificazione_interventi/edit.php +++ b/plugins/pianificazione_interventi/edit.php @@ -153,7 +153,7 @@ if (!$elenco_promemoria->isEmpty()) { - diff --git a/plugins/pianificazione_interventi/row-list.php b/plugins/pianificazione_interventi/row-list.php index f092aa225..b0a81692b 100755 --- a/plugins/pianificazione_interventi/row-list.php +++ b/plugins/pianificazione_interventi/row-list.php @@ -133,7 +133,7 @@ if (!$righe->isEmpty()) { if ($riga->abilita_serial) { echo ' - '; } diff --git a/plugins/pianificazione_interventi/widgets/promemoria_da_pianificare.php b/plugins/pianificazione_interventi/widgets/promemoria_da_pianificare.php index 099ad5e3d..fe260e3ff 100644 --- a/plugins/pianificazione_interventi/widgets/promemoria_da_pianificare.php +++ b/plugins/pianificazione_interventi/widgets/promemoria_da_pianificare.php @@ -118,7 +118,7 @@ foreach ($raggruppamenti as $mese => $raggruppamento) { // Pulsanti echo ' - diff --git a/plugins/presentazioni_bancarie/edit.php b/plugins/presentazioni_bancarie/edit.php index 997fb9ad1..de22c7b5d 100644 --- a/plugins/presentazioni_bancarie/edit.php +++ b/plugins/presentazioni_bancarie/edit.php @@ -73,6 +73,6 @@ function esporta(button) { let pagati = input("pagati").get(); let processati = input("processati").get(); - redirect("'.base_url().'/editor.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'&records=" + records + "&pagati=" + pagati + "&processati=" + processati); + redirect("'.base_path().'/editor.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'&records=" + records + "&pagati=" + pagati + "&processati=" + processati); } '; diff --git a/plugins/presentazioni_bancarie/src/Gestore.php b/plugins/presentazioni_bancarie/src/Gestore.php index 9c567da43..2a9828029 100644 --- a/plugins/presentazioni_bancarie/src/Gestore.php +++ b/plugins/presentazioni_bancarie/src/Gestore.php @@ -358,7 +358,7 @@ class Gestore // Generazione filename $filename = $this->id_riba.'.txt'; $file = $path.'/'.$filename; - $files[] = base_url().'/'.$file; + $files[] = base_path().'/'.$file; // Salvataggio del file file_put_contents(base_dir().'/'.$file, $content); @@ -372,7 +372,7 @@ class Gestore // Generazione filename $filename = $this->id_credito_diretto.'.xml'; $file = $path.'/'.$filename; - $files[] = base_url().'/'.$file; + $files[] = base_path().'/'.$file; // Salvataggio del file file_put_contents(base_dir().'/'.$file, $xml); @@ -395,7 +395,7 @@ class Gestore // Generazione filename $filename = $this->id_debito_diretto.'.xml'; $file = $path.'/'.$filename; - $files[] = base_url().'/'.$file; + $files[] = base_path().'/'.$file; // Salvataggio del file file_put_contents(base_dir().'/'.$file, $xml); diff --git a/plugins/receiptFE/src/NotificheRicevuteHook.php b/plugins/receiptFE/src/NotificheRicevuteHook.php index b777c81d3..1debc354d 100644 --- a/plugins/receiptFE/src/NotificheRicevuteHook.php +++ b/plugins/receiptFE/src/NotificheRicevuteHook.php @@ -74,7 +74,7 @@ class NotificheRicevuteHook extends Manager 'icon' => 'fa fa-ticket text-yellow', 'message' => $message, 'show' => $con_errore != 0 || $in_attesa != 0, - 'link' => base_url().'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id, + 'link' => base_path().'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id, ]; } diff --git a/plugins/receiptFE/src/ReceiptHook.php b/plugins/receiptFE/src/ReceiptHook.php index a81ab5611..1fbfdd33e 100755 --- a/plugins/receiptFE/src/ReceiptHook.php +++ b/plugins/receiptFE/src/ReceiptHook.php @@ -113,7 +113,7 @@ class ReceiptHook extends Manager 'icon' => 'fa fa-ticket text-'.$color, 'message' => $message, 'show' => $notify, - 'link' => base_url().'/controller.php?id_module='.$module->id, + 'link' => base_path().'/controller.php?id_module='.$module->id, ]; } } diff --git a/plugins/revisioni/edit.php b/plugins/revisioni/edit.php index f9ac6e3fb..75341039c 100755 --- a/plugins/revisioni/edit.php +++ b/plugins/revisioni/edit.php @@ -24,7 +24,7 @@ $revisione_principale = $dbo->fetchOne('SELECT master_revision FROM co_preventiv $revisioni = $dbo->fetchArray('SELECT * FROM co_preventivi WHERE master_revision = '.prepare($revisione_principale['master_revision']).' OR id = '.prepare($revisione_principale['master_revision']).' ORDER BY created_at'); echo " - + @@ -90,7 +90,7 @@ echo " '; echo " -
    + diff --git a/plugins/statistiche_anagrafiche/info.php b/plugins/statistiche_anagrafiche/info.php index 0890871b4..1d19b7812 100755 --- a/plugins/statistiche_anagrafiche/info.php +++ b/plugins/statistiche_anagrafiche/info.php @@ -115,7 +115,7 @@ echo '
    '.tr('Preventivi').' - '.($preventivi->count() > 0 ? ''.tr('Visualizza').' ' : '').' + '.($preventivi->count() > 0 ? ''.tr('Visualizza').' ' : '').'
    '.$preventivi->count().'
    @@ -130,7 +130,7 @@ echo '
    '.tr('Contratti').' - '.($contratti->count() > 0 ? ''.tr('Visualizza').' ' : '').' + '.($contratti->count() > 0 ? ''.tr('Visualizza').' ' : '').'
    '.$contratti->count().'
    @@ -145,7 +145,7 @@ echo '
    '.tr('Ordini cliente').' - '.($ordini_cliente->count() > 0 ? ''.tr('Visualizza').' ' : '').' + '.($ordini_cliente->count() > 0 ? ''.tr('Visualizza').' ' : '').'
    '.$ordini_cliente->count().'
    @@ -162,7 +162,7 @@ echo '
    '.tr('Attività').' - '.($interventi->count() > 0 ? ''.tr('Visualizza').' ' : '').' + '.($interventi->count() > 0 ? ''.tr('Visualizza').' ' : '').'
    '.$interventi->count().'
    @@ -177,7 +177,7 @@ echo '
    '.tr('Ddt in uscita').' - '.($ddt_uscita->count() > 0 ? ''.tr('Visualizza').' ' : '').' + '.($ddt_uscita->count() > 0 ? ''.tr('Visualizza').' ' : '').'
    '.$ddt_uscita->count().'
    @@ -192,7 +192,7 @@ echo '
    '.tr('Fatture').' - '.($fatture_vendita->count() + $note_credito->count() > 0 ? ''.tr('Visualizza').' ' : '').' + '.($fatture_vendita->count() + $note_credito->count() > 0 ? ''.tr('Visualizza').' ' : '').'
    '.($fatture_vendita->count() + $note_credito->count()).'
    diff --git a/reset.php b/reset.php index 88a0ec642..2fe1ec66b 100755 --- a/reset.php +++ b/reset.php @@ -59,7 +59,7 @@ switch (post('op')) { flash()->error(tr("Errore durante la gestione della richiesta: si prega di contattare l'amministratore").'.'); } - redirect_legacy(base_url().'/index.php'); + redirect_legacy(base_path().'/index.php'); throw new \LegacyExitException(); break; @@ -76,7 +76,7 @@ switch (post('op')) { flash()->info(tr('Password cambiata!')); - redirect_legacy(base_url().'/index.php'); + redirect_legacy(base_path().'/index.php'); throw new \LegacyExitException(); break; } @@ -121,7 +121,7 @@ if (auth()->isBrute()) { echo '
    - +

    '.$pageTitle.'

    diff --git a/routes.php b/routes.php index 351edca35..bc1299292 100644 --- a/routes.php +++ b/routes.php @@ -15,7 +15,7 @@ use DevCode\CausaliTrasporto\Controllers\CausaliTrasportoController; | */ -Route::middleware('web') +Route::middleware(['web', 'legacy']) ->group(function () { // Route di fallback generale Route::any('/legacy/{path}', [LegacyController::class, 'index']) diff --git a/src/API/Common/Task.php b/src/API/Common/Task.php index ef33474c0..fde134da9 100644 --- a/src/API/Common/Task.php +++ b/src/API/Common/Task.php @@ -81,7 +81,7 @@ class Task extends Resource implements RetrieveInterface, CreateInterface */ protected function request() { - $endpoint = base_url().'/cron.php'; + $endpoint = base_path().'/cron.php'; $postData = json_encode([]); $endpointParts = parse_url($endpoint); diff --git a/src/API/Response.php b/src/API/Response.php index 654ca9280..5480d02f8 100755 --- a/src/API/Response.php +++ b/src/API/Response.php @@ -225,7 +225,7 @@ class Response */ public static function isAPIRequest() { - return getURLPath() == slashes(base_url().'/api/index.php'); + return getURLPath() == slashes(base_path().'/api/index.php'); } /** diff --git a/src/HTMLBuilder/Handler/CKEditorHandler.php b/src/HTMLBuilder/Handler/CKEditorHandler.php index fd86095bc..101b07f40 100755 --- a/src/HTMLBuilder/Handler/CKEditorHandler.php +++ b/src/HTMLBuilder/Handler/CKEditorHandler.php @@ -34,6 +34,6 @@ class CKEditorHandler implements HandlerInterface // Generazione del codice HTML return ' - '; + '; } } diff --git a/src/HTMLBuilder/Handler/DefaultHandler.php b/src/HTMLBuilder/Handler/DefaultHandler.php index 8cc9345a5..4151535d4 100755 --- a/src/HTMLBuilder/Handler/DefaultHandler.php +++ b/src/HTMLBuilder/Handler/DefaultHandler.php @@ -129,7 +129,7 @@ class DefaultHandler implements HandlerInterface $result .= '
    - +