2020-12-31 16:16:52 +01:00
|
|
|
<?php
|
|
|
|
|
2021-02-19 11:54:03 +01:00
|
|
|
use App\Http\Controllers\ConfigurationController;
|
2021-02-22 16:17:49 +01:00
|
|
|
use App\Http\Controllers\HookController;
|
2021-01-04 19:04:41 +01:00
|
|
|
use App\Http\Controllers\InfoController;
|
2021-02-19 14:39:39 +01:00
|
|
|
use App\Http\Controllers\InitializationController;
|
2021-02-22 16:17:49 +01:00
|
|
|
use App\Http\Controllers\MessageController;
|
2021-03-13 14:13:19 +01:00
|
|
|
use App\Http\Controllers\RequirementsController;
|
2021-01-04 11:21:16 +01:00
|
|
|
use App\Http\Controllers\Test;
|
2021-07-07 11:35:30 +02:00
|
|
|
use App\Http\Controllers\UpdateController;
|
2021-02-20 17:37:57 +01:00
|
|
|
use App\Http\Controllers\UserController;
|
2021-03-15 10:43:14 +01:00
|
|
|
use App\Http\Controllers\WidgetModalController;
|
2020-12-31 16:16:52 +01:00
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Web Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2021-02-19 11:54:03 +01:00
|
|
|
// Percorsi di autenticazione e gestione utenza
|
|
|
|
require __DIR__.'/auth.php';
|
|
|
|
|
2021-02-19 14:39:39 +01:00
|
|
|
// Redirect predefinito a seguito del login
|
2021-02-20 13:31:52 +01:00
|
|
|
Route::get('/', function () {
|
|
|
|
$module = auth()->user()->getFirstAvailableModule();
|
2021-02-19 14:39:39 +01:00
|
|
|
|
2021-07-07 14:50:55 +02:00
|
|
|
return redirect('legacy/controller.php?id_module='.$module->id);
|
2021-02-19 14:39:39 +01:00
|
|
|
})
|
2021-02-22 14:36:36 +01:00
|
|
|
->middleware(['auth']);
|
2021-02-19 14:39:39 +01:00
|
|
|
|
2021-03-13 14:13:19 +01:00
|
|
|
// Schermata dei requisiti
|
|
|
|
Route::get('/requirements', [RequirementsController::class, 'index'])
|
|
|
|
->name('requirements');
|
|
|
|
|
2021-02-19 11:54:03 +01:00
|
|
|
// Sezione di configurazione
|
2021-07-07 14:50:55 +02:00
|
|
|
Route::prefix('config')
|
|
|
|
->group(function () {
|
|
|
|
Route::get('/', [ConfigurationController::class, 'index'])
|
|
|
|
->name('configuration');
|
|
|
|
|
|
|
|
Route::get('/test', [ConfigurationController::class, 'test'])
|
|
|
|
->name('configuration-test');
|
|
|
|
|
|
|
|
Route::get('/cache', [ConfigurationController::class, 'cache'])
|
|
|
|
->name('configuration-cache');
|
|
|
|
|
|
|
|
Route::get('/write', [ConfigurationController::class, 'write'])
|
|
|
|
->name('configuration-write');
|
|
|
|
|
|
|
|
Route::post('/save', [ConfigurationController::class, 'save'])
|
|
|
|
->name('configuration-save');
|
|
|
|
});
|
2021-01-04 11:21:16 +01:00
|
|
|
|
2021-07-07 11:35:30 +02:00
|
|
|
// Installazione aggiornamenti del gestionale
|
|
|
|
Route::get('/update', [UpdateController::class, 'index'])
|
|
|
|
->name('update');
|
|
|
|
Route::post('/update', [UpdateController::class, 'execute'])
|
|
|
|
->name('update-execute');
|
|
|
|
|
2021-02-19 14:39:39 +01:00
|
|
|
// Inizializzazione del gestionale
|
|
|
|
Route::get('/init', [InitializationController::class, 'index'])
|
|
|
|
->name('initialization');
|
|
|
|
Route::post('/init', [InitializationController::class, 'save'])
|
|
|
|
->name('initialization-save');
|
|
|
|
|
2021-01-04 11:21:16 +01:00
|
|
|
// Messaggi flash
|
2021-02-22 16:17:49 +01:00
|
|
|
Route::get('/messages', [MessageController::class, 'index'])
|
2021-01-04 11:21:16 +01:00
|
|
|
->name('messages');
|
|
|
|
|
2021-01-04 19:04:41 +01:00
|
|
|
// Operazioni Ajax
|
2021-02-22 14:36:36 +01:00
|
|
|
Route::prefix('ajax')
|
|
|
|
->group(function () {
|
|
|
|
Route::get('/select', [Test::class, 'index'])
|
2021-01-04 19:04:41 +01:00
|
|
|
->name('ajax-select');
|
2021-02-22 14:36:36 +01:00
|
|
|
Route::get('/complete', [Test::class, 'index'])
|
2021-01-04 19:04:41 +01:00
|
|
|
->name('ajax-complete');
|
2021-02-22 14:36:36 +01:00
|
|
|
Route::get('/search', [Test::class, 'index'])
|
2021-01-04 19:04:41 +01:00
|
|
|
->name('ajax-search');
|
|
|
|
|
2021-02-22 14:36:36 +01:00
|
|
|
// Sessioni
|
|
|
|
Route::get('/session/', [Test::class, 'index'])
|
2021-01-04 19:04:41 +01:00
|
|
|
->name('ajax-session');
|
2021-02-22 14:36:36 +01:00
|
|
|
Route::get('/session-array/', [Test::class, 'index'])
|
2021-01-04 19:04:41 +01:00
|
|
|
->name('ajax-session-array');
|
|
|
|
|
2021-02-22 14:36:36 +01:00
|
|
|
// Dataload
|
|
|
|
Route::get('/dataload/{module_id}/{reference_id?}', [Test::class, 'index'])
|
2021-01-04 19:04:41 +01:00
|
|
|
->where('module_id', '[0-9]+')
|
|
|
|
->where('reference_id', '[0-9]+')
|
|
|
|
->name('ajax-dataload');
|
2021-02-22 14:36:36 +01:00
|
|
|
});
|
2021-01-04 19:04:41 +01:00
|
|
|
|
2021-01-04 11:21:16 +01:00
|
|
|
// Hooks
|
2021-02-22 14:36:36 +01:00
|
|
|
Route::prefix('hook')
|
|
|
|
->middleware(['auth'])
|
|
|
|
->group(function () {
|
2021-02-22 16:17:49 +01:00
|
|
|
Route::get('/list', [HookController::class, 'list'])
|
2021-02-22 14:36:36 +01:00
|
|
|
->name('hooks');
|
2021-01-04 11:21:16 +01:00
|
|
|
|
2021-02-22 16:17:49 +01:00
|
|
|
Route::get('/lock/{hook_id}', [HookController::class, 'lock'])
|
|
|
|
->whereNumber('hook_id')
|
2021-02-22 14:36:36 +01:00
|
|
|
->name('hook-lock');
|
2021-01-04 11:21:16 +01:00
|
|
|
|
2021-02-22 16:17:49 +01:00
|
|
|
Route::get('/execute/{hook_id}/{token}', [HookController::class, 'execute'])
|
|
|
|
->whereNumber('hook_id')
|
2021-02-22 14:36:36 +01:00
|
|
|
->name('hook-execute');
|
2021-01-04 11:21:16 +01:00
|
|
|
|
2021-02-22 16:17:49 +01:00
|
|
|
Route::get('/response/{hook_id}', [HookController::class, 'response'])
|
|
|
|
->whereNumber('hook_id')
|
2021-02-22 14:36:36 +01:00
|
|
|
->name('hook-response');
|
|
|
|
});
|
2021-01-04 11:21:16 +01:00
|
|
|
|
|
|
|
// Informazioni su OpenSTAManager
|
2021-02-19 11:54:03 +01:00
|
|
|
Route::get('/info', [InfoController::class, 'info'])
|
2021-02-22 14:36:36 +01:00
|
|
|
->middleware(['auth'])
|
2021-01-04 11:21:16 +01:00
|
|
|
->name('info');
|
|
|
|
|
|
|
|
// Segnalazione bug
|
2021-02-22 14:36:36 +01:00
|
|
|
Route::prefix('bug')
|
|
|
|
->middleware(['auth'])
|
|
|
|
->group(function () {
|
|
|
|
Route::get('', [InfoController::class, 'bug'])
|
|
|
|
->name('bug');
|
|
|
|
|
|
|
|
Route::post('', [InfoController::class, 'send'])
|
|
|
|
->name('bug-send');
|
|
|
|
});
|
2021-01-04 11:21:16 +01:00
|
|
|
|
|
|
|
// Log di accesso
|
2021-02-20 17:37:57 +01:00
|
|
|
Route::get('/logs', [UserController::class, 'logs'])
|
2021-02-22 14:36:36 +01:00
|
|
|
->middleware(['auth'])
|
2021-01-04 11:21:16 +01:00
|
|
|
->name('logs');
|
|
|
|
|
2021-03-15 10:43:14 +01:00
|
|
|
// Log di accesso
|
|
|
|
Route::get('/widget/modal/{id}', [WidgetModalController::class, 'modal'])
|
|
|
|
->whereNumber('id')
|
|
|
|
->middleware(['auth'])
|
|
|
|
->name('widget-modal');
|
|
|
|
|
2021-01-04 11:21:16 +01:00
|
|
|
// Informazioni sull'utente
|
2021-02-22 14:36:36 +01:00
|
|
|
Route::prefix('user')
|
|
|
|
->middleware(['auth'])
|
|
|
|
->group(function () {
|
|
|
|
Route::get('/info', [UserController::class, 'index'])
|
|
|
|
->name('user-info');
|
|
|
|
|
|
|
|
Route::get('/password', [UserController::class, 'password'])
|
|
|
|
->name('user-password');
|
|
|
|
|
|
|
|
Route::post('/password', [UserController::class, 'savePassword'])
|
|
|
|
->name('user-password-save');
|
|
|
|
|
|
|
|
Route::get('/photo', [UserController::class, 'photo'])
|
|
|
|
->name('user-photo');
|
2021-01-04 11:21:16 +01:00
|
|
|
|
2021-02-22 14:36:36 +01:00
|
|
|
Route::post('/photo', [UserController::class, 'savePhoto'])
|
|
|
|
->name('user-photo-save');
|
|
|
|
});
|