Introduzione procedura di configurazione

This commit is contained in:
Dasc3er 2021-02-19 11:54:03 +01:00
parent 73129be4a7
commit b93ee1a7f6
35 changed files with 1432 additions and 166 deletions

View File

@ -3,6 +3,7 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_LOCALE =
LOG_CHANNEL=stack
LOG_LEVEL=debug

View File

@ -3,6 +3,7 @@
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Intervention\Image\Exception\NotFoundException;
use Throwable;
class Handler extends ExceptionHandler
@ -36,5 +37,9 @@ class Handler extends ExceptionHandler
$this->reportable(function (Throwable $e) {
//
});
$this->renderable(function (NotFoundException $e, $request) {
return response()->view('errors.404', [], 404);
});
}
}

View File

@ -34,7 +34,7 @@ class ConfirmablePasswordController extends Controller
'password' => $request->password,
])) {
throw ValidationException::withMessages([
'password' => __('auth.password'),
'password' => tr('auth.password'),
]);
}

View File

@ -56,8 +56,8 @@ class NewPasswordController extends Controller
// the application's home authenticated view. If there is an error we can
// redirect them back to where they came from with their error message.
return $status == Password::PASSWORD_RESET
? redirect()->route('login')->with('status', __($status))
? redirect()->route('login')->with('status', tr($status))
: back()->withInput($request->only('username'))
->withErrors(['username' => __($status)]);
->withErrors(['username' => tr($status)]);
}
}

View File

@ -40,8 +40,8 @@ class PasswordResetLinkController extends Controller
);
return $status == Password::RESET_LINK_SENT
? back()->with('status', __($status))
? back()->with('status', tr($status))
: back()->withInput($request->only('email'))
->withErrors(['email' => __($status)]);
->withErrors(['email' => tr($status)]);
}
}

View File

@ -0,0 +1,203 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ConfigurationController extends Controller
{
public static function isConfigCompleted()
{
try {
$connection = DB::connection();
$configuration_completed = !empty($connection->getDatabaseName());
$grants = $connection->select($connection->raw('SHOW GRANTS FOR CURRENT_USER'));
} catch (\Exception $e) {
$configuration_completed = false;
}
return $configuration_completed;
}
public function index(Request $request)
{
// Impostazione dinamica della lingua
$lang = $request->get('lang');
if (!empty($lang)) {
app()->setLocale($lang);
}
// Contenuti aggiuntivi
$args = [
'license' => file_get_contents(base_path('LICENSE')),
'languages' => [
'it_IT' => [
'title' => tr('Italiano'),
'flag' => 'IT',
],
'en_GB' => [
'title' => tr('Inglese'),
'flag' => 'GB',
],
],
// Default values
'host' => '',
'username' => '',
'database_name' => '',
];
return view('config.configuration', $args);
}
public function test(Request $request)
{
$requirements = $this->checkConnection($request);
if ($requirements === null) {
$state = 0;
}
// Permessi insufficienti
elseif (!empty($requirements)) {
$state = 1;
}
// Permessi completi
else {
$state = 2;
}
return $state;
}
public function save(Request $request)
{
// Controllo sullo stato della connessione
$result = $this->checkConnection($request);
if ($result === null) {
return redirect(route('configuration'));
}
// Individuazione parametri aggiuntivi
$decimals = $request->input('decimal_separator');
$thousands = $request->input('thousand_separator');
$decimals = $decimals == 'dot' ? '.' : ',';
$thousands = $thousands == 'dot' ? '.' : $thousands;
$thousands = $thousands == 'comma' ? ',' : $thousands;
// Completamento configurazione
$pairs = [
'APP_LOCALE' => $request->input('language'),
'DB_HOST' => $request->input('host'),
'DB_USERNAME' => $request->input('username'),
'DB_PASSWORD' => $request->input('password'),
'DB_DATABASE' => $request->input('database_name'),
/*
'|timestamp|' => post('timestamp_format'),
'|date|' => post('date_format'),
'|time|' => post('time_format'),
'|decimals|' => $decimals,
'|thousands|' => $thousands,
*/
];
foreach ($pairs as $key => $value) {
$this->updateEnv($key, $value);
}
return redirect(route('configuration'));
}
/**
* Verifica la connessione al database secondo i parametri indicati nella richiesta.
* Restituisce un array di permessi mancanti in caso la connessione avvenga con successo, oppure null in caso contrario.
*
* @return array|string[]|null
*/
protected function checkConnection(Request $request)
{
// Configurazione della connessione di test
$database_name = $request->input('database_name');
config(['database.connections.testing' => [
'driver' => 'mysql',
'host' => $request->input('host'),
'port' => '3306',
'password' => $request->input('password'),
'database' => $database_name,
'username' => $request->input('username'),
]]);
try {
$connection = DB::connection('testing');
// Controllo sul nome del database per verificare la connessione
$connection_completed = !empty($connection->getDatabaseName());
// Individuazione permessi garantiti all'utenza
$database_name = str_replace('_', '\_', $database_name);
$grants = $connection->select($connection->raw('SHOW GRANTS FOR CURRENT_USER'));
} catch (\Exception $e) {
return null;
}
$requirements = [
'SELECT',
'INSERT',
'UPDATE',
'CREATE',
'ALTER',
'DROP',
];
foreach ($grants as $result) {
$privileges = current($result);
if (
string_contains($privileges, ' ON `'.$database_name.'`.*') ||
string_contains($privileges, ' ON *.*')
) {
$pieces = explode(', ', explode(' ON ', str_replace('GRANT ', '', $privileges))[0]);
// Permessi generici sul database
if (in_array('ALL', $pieces) || in_array('ALL PRIVILEGES', $pieces)) {
$requirements = [];
break;
}
// Permessi specifici sul database
foreach ($requirements as $key => $value) {
if (in_array($value, $pieces)) {
unset($requirements[$key]);
}
}
}
}
return $requirements;
}
protected function updateEnv($key, $value)
{
$path = base_path('.env');
if (is_bool(env($key))) {
$old = env($key) ? 'true' : 'false';
} elseif (env($key) === null) {
$old = 'null';
} else {
$old = env($key);
}
if (file_exists($path)) {
file_put_contents($path, str_replace(
"$key=".$old,
"$key=".$value,
file_get_contents($path)
));
}
}
}

View File

@ -12,17 +12,17 @@ class LegacyController extends Controller
{
public function index($path = 'index.php')
{
$base_path = realpath(__DIR__.'/../../../legacy/');
$base_path = base_path('legacy/');
$file = realpath($base_path.'/'.$path);
if (strpos($file, $base_path) === false){
if (strpos($file, $base_path) === false) {
throw new NotFoundHttpException();
}
ob_start();
try {
require $file;
} catch (LegacyExitException $e) {
}catch (LegacyRedirectException $e){
} catch (LegacyExitException $e) {
} catch (LegacyRedirectException $e) {
return Redirect::to($e->getMessage());
}

View File

@ -2,6 +2,9 @@
namespace App\Http;
use App\Http\Middleware\EnsureCalendarPeriod;
use App\Http\Middleware\EnsureConfiguration;
use App\Http\Middleware\EnsureEnvFile;
use App\Http\Middleware\HTMLBuilder;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
@ -22,7 +25,6 @@ class Kernel extends HttpKernel
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
HTMLBuilder::class
];
/**
@ -32,6 +34,7 @@ class Kernel extends HttpKernel
*/
protected $middlewareGroups = [
'web' => [
EnsureEnvFile::class,
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
@ -40,6 +43,10 @@ class Kernel extends HttpKernel
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Xinax\LaravelGettext\Middleware\GettextMiddleware::class,
EnsureCalendarPeriod::class,
EnsureConfiguration::class,
HTMLBuilder::class,
],
'api' => [
@ -48,6 +55,7 @@ class Kernel extends HttpKernel
],
'legacy' => [
EnsureEnvFile::class,
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
@ -56,6 +64,10 @@ class Kernel extends HttpKernel
// \App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Xinax\LaravelGettext\Middleware\GettextMiddleware::class,
EnsureCalendarPeriod::class,
EnsureConfiguration::class,
HTMLBuilder::class,
],
];

View File

@ -9,12 +9,13 @@ class Authenticate extends Middleware
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Request $request
*
* @return string|null
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
if (!$request->expectsJson()) {
return route('login');
}
}

View File

@ -0,0 +1,45 @@
<?php
namespace App\Http\Middleware;
use App\Http\Controllers\ConfigurationController;
use Closure;
use Illuminate\Http\Request;
class EnsureConfiguration
{
/**
* Handle an incoming request.
*
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
$route = $request->route();
if (starts_with($route->parameter('path'), 'assets')) {
return $next($request);
}
// Test della connessione al database
$configuration_paths = ['configuration', 'configuration-save', 'configuration-test'];
$configuration_completed = ConfigurationController::isConfigCompleted();
if ($configuration_completed) {
// Redirect nel caso in cui la configurazione sia correttamente funzionante
if (in_array($route->getName(), $configuration_paths)) {
return redirect(route('initialization'));
}
} else {
// Redirect per configurazione mancante
if (!in_array($route->getName(), $configuration_paths)) {
return redirect(route('configuration'));
}
}
// Verifiche sullo stato delle migrazioni
// Verifiche sullo stato delle impostazioni obbligatorie
return $next($request);
}
}

View File

@ -0,0 +1,38 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
class EnsureEnvFile
{
/**
* Handle an incoming request.
*
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
// Copia del file .env dal formato standard
$env_file = base_path('.env');
if (!file_exists($env_file)) {
copy(base_path('.env.example'), $env_file);
if (!file_exists($env_file)) {
return response('Missing .env file');
}
}
// Generazione automatica delle key Laravel
if (empty(env('APP_KEY'))) {
Artisan::call('key:generate');
header('Refresh: 0;');
return response('Missing app key');
}
return $next($request);
}
}

View File

@ -10,8 +10,6 @@ class HTMLBuilder
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)

View File

@ -49,7 +49,7 @@ class LoginRequest extends FormRequest
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'username' => __('auth.failed'),
'username' => tr('auth.failed'),
]);
}

View File

@ -3,7 +3,6 @@
namespace App\Models;
use Common\SimpleModelTrait;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
@ -16,7 +15,8 @@ use Modules\Anagrafiche\Anagrafica;
class User extends Authenticatable
{
use HasFactory, Notifiable;
use HasFactory;
use Notifiable;
use SimpleModelTrait;
protected $table = 'zz_users';
@ -60,7 +60,6 @@ class User extends Authenticatable
'email_verified_at' => 'datetime',
];
/**
* Crea un nuovo utente.
*

View File

@ -1,7 +1,6 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
@ -80,7 +79,7 @@ return [
|
*/
'locale' => 'en',
'locale' => env('APP_LOCALE', 'it_IT'),
/*
|--------------------------------------------------------------------------
@ -93,7 +92,7 @@ return [
|
*/
'fallback_locale' => 'en',
'fallback_locale' => 'it_IT',
/*
|--------------------------------------------------------------------------
@ -106,7 +105,7 @@ return [
|
*/
'faker_locale' => 'en_US',
'faker_locale' => 'it_IT',
/*
|--------------------------------------------------------------------------
@ -135,7 +134,6 @@ return [
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
@ -174,7 +172,6 @@ return [
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
/*
@ -189,7 +186,6 @@ return [
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
@ -226,7 +222,5 @@ return [
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
];

218
config/debugbar.php Normal file
View File

@ -0,0 +1,218 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Debugbar Settings
|--------------------------------------------------------------------------
|
| Debugbar is enabled by default, when debug is set to true in app.php.
| You can override the value by setting enable to true or false instead of null.
|
| You can provide an array of URI's that must be ignored (eg. 'api/*')
|
*/
'enabled' => env('DEBUGBAR_ENABLED', null),
'except' => [
'telescope*',
'horizon*',
],
/*
|--------------------------------------------------------------------------
| Storage settings
|--------------------------------------------------------------------------
|
| DebugBar stores data for session/ajax requests.
| You can disable this, so the debugbar stores data in headers/session,
| but this can cause problems with large data collectors.
| By default, file storage (in the storage folder) is used. Redis and PDO
| can also be used. For PDO, run the package migrations first.
|
*/
'storage' => [
'enabled' => true,
'driver' => 'file', // redis, file, pdo, socket, custom
'path' => storage_path('debugbar'), // For file driver
'connection' => null, // Leave null for default connection (Redis/PDO)
'provider' => '', // Instance of StorageInterface for custom driver
'hostname' => '127.0.0.1', // Hostname to use with the "socket" driver
'port' => 2304, // Port to use with the "socket" driver
],
/*
|--------------------------------------------------------------------------
| Vendors
|--------------------------------------------------------------------------
|
| Vendor files are included by default, but can be set to false.
| This can also be set to 'js' or 'css', to only include javascript or css vendor files.
| Vendor files are for css: font-awesome (including fonts) and highlight.js (css files)
| and for js: jquery and and highlight.js
| So if you want syntax highlighting, set it to true.
| jQuery is set to not conflict with existing jQuery scripts.
|
*/
'include_vendors' => true,
/*
|--------------------------------------------------------------------------
| Capture Ajax Requests
|--------------------------------------------------------------------------
|
| The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
| you can use this option to disable sending the data through the headers.
|
| Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools.
*/
'capture_ajax' => true,
'add_ajax_timing' => false,
/*
|--------------------------------------------------------------------------
| Custom Error Handler for Deprecated warnings
|--------------------------------------------------------------------------
|
| When enabled, the Debugbar shows deprecated warnings for Symfony components
| in the Messages tab.
|
*/
'error_handler' => false,
/*
|--------------------------------------------------------------------------
| Clockwork integration
|--------------------------------------------------------------------------
|
| The Debugbar can emulate the Clockwork headers, so you can use the Chrome
| Extension, without the server-side code. It uses Debugbar collectors instead.
|
*/
'clockwork' => false,
/*
|--------------------------------------------------------------------------
| DataCollectors
|--------------------------------------------------------------------------
|
| Enable/disable DataCollectors
|
*/
'collectors' => [
'phpinfo' => true, // Php version
'messages' => true, // Messages
'time' => true, // Time Datalogger
'memory' => true, // Memory usage
'exceptions' => true, // Exception displayer
'log' => true, // Logs from Monolog (merged in messages if enabled)
'db' => true, // Show database (PDO) queries and bindings
'views' => true, // Views with their data
'route' => true, // Current route information
'auth' => false, // Display Laravel authentication status
'gate' => true, // Display Laravel Gate checks
'session' => true, // Display session data
'symfony_request' => true, // Only one can be enabled..
'mail' => true, // Catch mail messages
'laravel' => false, // Laravel version and environment
'events' => false, // All events fired
'default_request' => false, // Regular or special Symfony request logger
'logs' => false, // Add the latest log messages
'files' => false, // Show the included files
'config' => false, // Display config settings
'cache' => false, // Display cache events
'models' => true, // Display models
'livewire' => true, // Display Livewire (when available)
],
/*
|--------------------------------------------------------------------------
| Extra options
|--------------------------------------------------------------------------
|
| Configure some DataCollectors
|
*/
'options' => [
'auth' => [
'show_name' => true, // Also show the users name/email in the debugbar
],
'db' => [
'with_params' => true, // Render SQL with the parameters substituted
'backtrace' => true, // Use a backtrace to find the origin of the query in your files.
'backtrace_exclude_paths' => [], // Paths to exclude from backtrace. (in addition to defaults)
'timeline' => false, // Add the queries to the timeline
'explain' => [ // Show EXPLAIN output on queries
'enabled' => false,
'types' => ['SELECT'], // Deprecated setting, is always only SELECT
],
'hints' => false, // Show hints for common mistakes
'show_copy' => false, // Show copy button next to the query
],
'mail' => [
'full_log' => false,
],
'views' => [
'data' => false, //Note: Can slow down the application, because the data can be quite large..
],
'route' => [
'label' => true, // show complete route on bar
],
'logs' => [
'file' => null,
],
'cache' => [
'values' => true, // collect cache values
],
],
/*
|--------------------------------------------------------------------------
| Inject Debugbar in Response
|--------------------------------------------------------------------------
|
| Usually, the debugbar is added just before </body>, by listening to the
| Response after the App is done. If you disable this, you have to add them
| in your template yourself. See http://phpdebugbar.com/docs/rendering.html
|
*/
'inject' => true,
/*
|--------------------------------------------------------------------------
| DebugBar route prefix
|--------------------------------------------------------------------------
|
| Sometimes you want to set route prefix to be used by DebugBar to load
| its resources from. Usually the need comes from misconfigured web server or
| from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97
|
*/
'route_prefix' => '_debugbar',
/*
|--------------------------------------------------------------------------
| DebugBar route domain
|--------------------------------------------------------------------------
|
| By default DebugBar route served from the same domain that request served.
| To override default domain, specify it as a non-empty value.
*/
'route_domain' => null,
/*
|--------------------------------------------------------------------------
| DebugBar theme
|--------------------------------------------------------------------------
|
| Switches between light and dark theme. If set to auto it will respect system preferences
| Possible values: auto, light, dark
*/
'theme' => 'auto',
];

20
config/image.php Normal file
View File

@ -0,0 +1,20 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Image Driver
|--------------------------------------------------------------------------
|
| Intervention Image supports "GD Library" and "Imagick" to process images
| internally. You may choose one of them according to your PHP
| configuration. By default PHP's "GD Library" implementation is used.
|
| Supported: "gd", "imagick"
|
*/
'driver' => 'gd'
];

View File

@ -1,9 +1,7 @@
<?php
return [
/**
/*
* Translation handlers, options are:
*
* - symfony: (recommended) uses the symfony translations component. Incompatible with php-gettext
@ -13,76 +11,76 @@ return [
*/
'handler' => 'symfony',
/**
/*
* Session identifier: Key under which the current locale will be stored.
*/
'session-identifier' => 'laravel-gettext-locale',
/**
/*
* Default locale: this will be the default for your application.
* Is to be supposed that all strings are written in this language.
*/
'locale' => 'it_IT',
'locale' => env('APP_LOCALE', 'it_IT'),
/**
/*
* Supported locales: An array containing all allowed languages
*/
'supported-locales' => [
'it_IT',
'ne_GB',
'en_GB',
'de_DE',
],
/**
/*
* Default charset encoding.
*/
'encoding' => 'UTF-8',
/**
/*
* -----------------------------------------------------------------------
* All standard configuration ends here. The following values
* are only for special cases.
* -----------------------------------------------------------------------
**/
/**
/*
* Locale categories to set
*/
'categories' => [
'LC_ALL',
],
/**
/*
* Base translation directory path (don't use trailing slash)
*/
'translations-path' => '../resources/lang',
/**
/*
* Relative path to the app folder: is used on .po header files
*/
'relative-path' => '../../../../../app',
/**
/*
* Fallback locale: When default locale is not available
*/
'fallback-locale' => 'it_IT',
/**
/*
* Default domain used for translations: It is the file name for .po and .mo files
*/
'domain' => 'messages',
/**
/*
* Project name: is used on .po header files
*/
'project' => 'OpenSTAManager',
/**
/*
* Translator contact data (used on .po headers too)
*/
'translator' => 'James Translator <james@translations.colm>',
/**
/*
* Paths where Poedit will search recursively for strings to translate.
* All paths are relative to app/ (don't use trailing slash).
*
@ -95,7 +93,7 @@ return [
'Console',
],
/**
/*
* Multi-domain directory paths. If you want the translations in
* different files, just wrap your paths into a domain name.
* for example:
@ -105,32 +103,32 @@ return [
// 'frontend' domain
'frontend' => [
'controllers',
'views/frontend',
],
'controllers',
'views/frontend',
],
// 'backend' domain
'backend' => [
'views/backend',
],
'backend' => [
'views/backend',
],
// 'messages' domain (matches default domain)
'storage/views',
],
'storage/views',
],
*/
/**
/*
* Sync laravel: A flag that determines if the laravel built-in locale must
* be changed when you call LaravelGettext::setLocale.
*/
'sync-laravel' => true,
/**
/*
* The adapter used to sync the laravel built-in locale
*/
'adapter' => \Xinax\LaravelGettext\Adapters\LaravelAdapter::class,
/**
/*
* Where to store the current locale/domain
*
* By default, in the session.
@ -140,12 +138,12 @@ return [
*/
'storage' => \Xinax\LaravelGettext\Storages\SessionStorage::class,
/**
/*
* Use custom locale that is not supported by the system
*/
'custom-locale' => false,
/**
/*
* The keywords list used by poedit to search the strings to be translated
*
* The "_", "__" and "gettext" are singular translation functions

273
config/modules.php Normal file
View File

@ -0,0 +1,273 @@
<?php
use Nwidart\Modules\Activators\FileActivator;
return [
/*
|--------------------------------------------------------------------------
| Module Namespace
|--------------------------------------------------------------------------
|
| Default module namespace.
|
*/
'namespace' => 'Modules',
/*
|--------------------------------------------------------------------------
| Module Stubs
|--------------------------------------------------------------------------
|
| Default module stubs.
|
*/
'stubs' => [
'enabled' => false,
'path' => base_path() . '/vendor/nwidart/laravel-modules/src/Commands/stubs',
'files' => [
'routes/web' => 'Routes/web.php',
'routes/api' => 'Routes/api.php',
'views/index' => 'Resources/views/index.blade.php',
'views/master' => 'Resources/views/layouts/master.blade.php',
'scaffold/config' => 'Config/config.php',
'composer' => 'composer.json',
'assets/js/app' => 'Resources/assets/js/app.js',
'assets/sass/app' => 'Resources/assets/sass/app.scss',
'webpack' => 'webpack.mix.js',
'package' => 'package.json',
],
'replacements' => [
'routes/web' => ['LOWER_NAME', 'STUDLY_NAME'],
'routes/api' => ['LOWER_NAME'],
'webpack' => ['LOWER_NAME'],
'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'PROVIDER_NAMESPACE'],
'views/index' => ['LOWER_NAME'],
'views/master' => ['LOWER_NAME', 'STUDLY_NAME'],
'scaffold/config' => ['STUDLY_NAME'],
'composer' => [
'LOWER_NAME',
'STUDLY_NAME',
'VENDOR',
'AUTHOR_NAME',
'AUTHOR_EMAIL',
'MODULE_NAMESPACE',
'PROVIDER_NAMESPACE',
],
],
'gitkeep' => true,
],
'paths' => [
/*
|--------------------------------------------------------------------------
| Modules path
|--------------------------------------------------------------------------
|
| This path used for save the generated module. This path also will be added
| automatically to list of scanned folders.
|
*/
'modules' => base_path('Modules'),
/*
|--------------------------------------------------------------------------
| Modules assets path
|--------------------------------------------------------------------------
|
| Here you may update the modules assets path.
|
*/
'assets' => public_path('modules'),
/*
|--------------------------------------------------------------------------
| The migrations path
|--------------------------------------------------------------------------
|
| Where you run 'module:publish-migration' command, where do you publish the
| the migration files?
|
*/
'migration' => base_path('database/migrations'),
/*
|--------------------------------------------------------------------------
| Generator path
|--------------------------------------------------------------------------
| Customise the paths where the folders will be generated.
| Set the generate key to false to not generate that folder
*/
'generator' => [
'config' => ['path' => 'Config', 'generate' => true],
'command' => ['path' => 'Console', 'generate' => true],
'migration' => ['path' => 'Database/Migrations', 'generate' => true],
'seeder' => ['path' => 'Database/Seeders', 'generate' => true],
'factory' => ['path' => 'Database/factories', 'generate' => true],
'model' => ['path' => 'Entities', 'generate' => true],
'routes' => ['path' => 'Routes', 'generate' => true],
'controller' => ['path' => 'Http/Controllers', 'generate' => true],
'filter' => ['path' => 'Http/Middleware', 'generate' => true],
'request' => ['path' => 'Http/Requests', 'generate' => true],
'provider' => ['path' => 'Providers', 'generate' => true],
'assets' => ['path' => 'Resources/assets', 'generate' => true],
'lang' => ['path' => 'Resources/lang', 'generate' => true],
'views' => ['path' => 'Resources/views', 'generate' => true],
'test' => ['path' => 'Tests/Unit', 'generate' => true],
'test-feature' => ['path' => 'Tests/Feature', 'generate' => true],
'repository' => ['path' => 'Repositories', 'generate' => false],
'event' => ['path' => 'Events', 'generate' => false],
'listener' => ['path' => 'Listeners', 'generate' => false],
'policies' => ['path' => 'Policies', 'generate' => false],
'rules' => ['path' => 'Rules', 'generate' => false],
'jobs' => ['path' => 'Jobs', 'generate' => false],
'emails' => ['path' => 'Emails', 'generate' => false],
'notifications' => ['path' => 'Notifications', 'generate' => false],
'resource' => ['path' => 'Transformers', 'generate' => false],
'component-view' => ['path' => 'Resources/views/components', 'generate' => false],
'component-class' => ['path' => 'View/Component', 'generate' => false],
],
],
/*
|--------------------------------------------------------------------------
| Package commands
|--------------------------------------------------------------------------
|
| Here you can define which commands will be visible and used in your
| application. If for example you don't use some of the commands provided
| you can simply comment them out.
|
*/
'commands' => [
CommandMakeCommand::class,
ControllerMakeCommand::class,
DisableCommand::class,
DumpCommand::class,
EnableCommand::class,
EventMakeCommand::class,
JobMakeCommand::class,
ListenerMakeCommand::class,
MailMakeCommand::class,
MiddlewareMakeCommand::class,
NotificationMakeCommand::class,
ProviderMakeCommand::class,
RouteProviderMakeCommand::class,
InstallCommand::class,
ListCommand::class,
ModuleDeleteCommand::class,
ModuleMakeCommand::class,
FactoryMakeCommand::class,
PolicyMakeCommand::class,
RequestMakeCommand::class,
RuleMakeCommand::class,
MigrateCommand::class,
MigrateRefreshCommand::class,
MigrateResetCommand::class,
MigrateRollbackCommand::class,
MigrateStatusCommand::class,
MigrationMakeCommand::class,
ModelMakeCommand::class,
PublishCommand::class,
PublishConfigurationCommand::class,
PublishMigrationCommand::class,
PublishTranslationCommand::class,
SeedCommand::class,
SeedMakeCommand::class,
SetupCommand::class,
UnUseCommand::class,
UpdateCommand::class,
UseCommand::class,
ResourceMakeCommand::class,
TestMakeCommand::class,
LaravelModulesV6Migrator::class,
],
/*
|--------------------------------------------------------------------------
| Scan Path
|--------------------------------------------------------------------------
|
| Here you define which folder will be scanned. By default will scan vendor
| directory. This is useful if you host the package in packagist website.
|
*/
'scan' => [
'enabled' => false,
'paths' => [
base_path('vendor/*/*'),
],
],
/*
|--------------------------------------------------------------------------
| Composer File Template
|--------------------------------------------------------------------------
|
| Here is the config for composer.json file, generated by this package
|
*/
'composer' => [
'vendor' => 'nwidart',
'author' => [
'name' => 'Nicolas Widart',
'email' => 'n.widart@gmail.com',
],
],
'composer-output' => false,
/*
|--------------------------------------------------------------------------
| Caching
|--------------------------------------------------------------------------
|
| Here is the config for setting up caching feature.
|
*/
'cache' => [
'enabled' => false,
'key' => 'laravel-modules',
'lifetime' => 60,
],
/*
|--------------------------------------------------------------------------
| Choose what laravel-modules will register as custom namespaces.
| Setting one to false will require you to register that part
| in your own Service Provider class.
|--------------------------------------------------------------------------
*/
'register' => [
'translations' => true,
/**
* load files on boot or register method
*
* Note: boot not compatible with asgardcms
*
* @example boot|register
*/
'files' => 'register',
],
/*
|--------------------------------------------------------------------------
| Activators
|--------------------------------------------------------------------------
|
| You can define new types of activators here, file, database etc. The only
| required parameter is 'class'.
| The file activator will store the activation status in storage/installed_modules
*/
'activators' => [
'file' => [
'class' => FileActivator::class,
'statuses-file' => base_path('modules_statuses.json'),
'cache-key' => 'activator.installed',
'cache-lifetime' => 604800,
],
],
'activator' => 'file',
];

50
config/tinker.php Normal file
View File

@ -0,0 +1,50 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Console Commands
|--------------------------------------------------------------------------
|
| This option allows you to add additional Artisan commands that should
| be available within the Tinker environment. Once the command is in
| this array you may execute the command in Tinker using its name.
|
*/
'commands' => [
// App\Console\Commands\ExampleCommand::class,
],
/*
|--------------------------------------------------------------------------
| Auto Aliased Classes
|--------------------------------------------------------------------------
|
| Tinker will not automatically alias classes in your vendor namespaces
| but you may explicitly allow a subset of classes to get aliased by
| adding the names of each of those classes to the following list.
|
*/
'alias' => [
//
],
/*
|--------------------------------------------------------------------------
| Classes That Should Not Be Aliased
|--------------------------------------------------------------------------
|
| Typically, Tinker automatically aliases classes as you require them in
| Tinker. However, you may wish to never alias certain classes, which
| you may accomplish by listing the classes in the following array.
|
*/
'dont_alias' => [
'App\Nova',
],
];

50
config/trustedproxy.php Normal file
View File

@ -0,0 +1,50 @@
<?php
return [
/*
* Set trusted proxy IP addresses.
*
* Both IPv4 and IPv6 addresses are
* supported, along with CIDR notation.
*
* The "*" character is syntactic sugar
* within TrustedProxy to trust any proxy
* that connects directly to your server,
* a requirement when you cannot know the address
* of your proxy (e.g. if using ELB or similar).
*
*/
'proxies' => null, // [<ip addresses>,], '*', '<ip addresses>,'
/*
* To trust one or more specific proxies that connect
* directly to your server, use an array or a string separated by comma of IP addresses:
*/
// 'proxies' => ['192.168.1.1'],
// 'proxies' => '192.168.1.1, 192.168.1.2',
/*
* Or, to trust all proxies that connect
* directly to your server, use a "*"
*/
// 'proxies' => '*',
/*
* Which headers to use to detect proxy related data (For, Host, Proto, Port)
*
* Options include:
*
* - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust)
* - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust)
* - Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB (If you are using AWS Elastic Load Balancer)
*
* - 'HEADER_X_FORWARDED_ALL' (use all x-forwarded-* headers to establish trust)
* - 'HEADER_FORWARDED' (use the FORWARDED header to establish trust)
* - 'HEADER_X_FORWARDED_AWS_ELB' (If you are using AWS Elastic Load Balancer)
*
* @link https://symfony.com/doc/current/deployment/proxies.html
*/
'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
];

52
config/vat_calculator.php Normal file
View File

@ -0,0 +1,52 @@
<?php
/**
* This file is part of VatCalculator.
*
* @license MIT
*/
return [
/*
|--------------------------------------------------------------------------
| VAT rules
|--------------------------------------------------------------------------
|
| If you need to apply custom VAT rules for a specific country code,
| use this array to define the rules that fit your needs. All EU
| VAT rules are preconfigured inside but can be overwritten
| at this point
|
*/
'rules' => [
// 'XX' => 0.17,
],
/*
|--------------------------------------------------------------------------
| Predefined routes
|--------------------------------------------------------------------------
|
| The VAT calculator comes with a number of useful predefined routes
| that allow you to use the VAT calculator JS toolkit. If you
| don't want the routes to be registered, set this variable
| to false.
|
*/
'use_routes' => true,
/*
|--------------------------------------------------------------------------
| Business country code
|--------------------------------------------------------------------------
|
| This should be the country code where your business is located.
| The business country code is used to calculate the correct VAT rate
| when charging a B2B (company) customer inside your business country.
|
*/
'business_country_code' => '',
'forward_soap_faults' => false,
];

2
legacy

@ -1 +1 @@
Subproject commit 6ab76231f148c8da0671f9460e3be558066fff43
Subproject commit 84282dae393004728a5c6281f498a2946b3b39a5

View File

@ -0,0 +1,240 @@
@extends('layouts.base')
@section('body_class', 'bg-light')
@section('title', tr("Configurazione"))
@section('body')
<div class="container bg-light pb-5">
<form action="" method="post" id="config-form">
<input type="hidden" name="lang" value="{{ app()->getLocale() }}">
<div class="py-5 text-center">
<img class="d-block mx-auto mb-4" src="{{ base_url() }}/assets/img/full_logo.png" alt="{{ tr('Logo OpenSTAManager') }}">
<h2>{!! tr('Benvenuto in _NAME_!', ['_NAME_' => '<strong>'.tr('OpenSTAManager').'</strong>']) !!}</h2>
<p class="lead">{!! tr('Puoi procedere alla configurazione tecnica del software attraverso i parametri seguenti, che potranno essere corretti secondo necessità tramite il file _FILE_', ['_FILE_' => '<i>.env</i>']) !!}. </p>
<p>{!! tr("Se necessiti supporto puoi contattarci tramite l'assistenza ufficiale: _LINK_", ['_LINK_' => '<a href="https://www.openstamanager.com/contattaci/?subject=Assistenza%20installazione%20OSM" target="_blank">https://www.openstamanager.com/contattaci/</a>' ]) !!}</p>
</div>
<div class="row">
<div class="col-md-4 col-md-push-8 mb-4">
<h4 class="d-flex justify-content-between align-items-center mb-3 text-muted">{{ tr('Lingua') }}</h4>
<select class="form-control hidden" id="language" required="1">
@foreach($languages as $code => $language)
<option data-country="{{ $language['flag'] }}" value="{{ $code }}">{{ $language['title'] }}</option>
@endforeach
</select>
<p id="language-info">{{ tr('Caricamento lingue in corso') }}...</p>
<hr class="mb-4">
<h4 class="d-flex justify-content-between align-items-center mb-3 text-muted">{{ tr('Licenza') }}</h4>
<p>{{ tr('OpenSTAManager è tutelato dalla licenza _LICENSE_, da accettare obbligatoriamente per poter utilizzare il gestionale', ['_LICENSE_' => 'GPL 3.0']) }}.</p>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="agree" name="agree" required>
<label class="custom-control-label" for="agree">{{ tr('Ho visionato e accetto la licenza') }}</label>
</div>
<textarea class="form-control" rows="15" readonly>{{ $license }}</textarea><br>
<a class="float-left" href="https://www.gnu.org/licenses/translations.en.html#GPL" target="_blank">[ {{ tr('Versioni tradotte') }} ]</a><br><br>
</div>
<div class="col-md-8 col-md-pull-4">
<h4 class="mb-3">{{ tr('Formato date') }}</h4>
<div class="row">
<div class="col-md-4">
{[ "type": "text", "label": "{{ tr('Formato data lunga') }}", "name": "timestamp_format", "value": "d/m/Y H:i", "required": 1 ]}
</div>
<div class="col-md-4">
{[ "type": "text", "label": "{{ tr('Formato data corta') }}", "name": "date_format", "value": "d/m/Y", "required": 1 ]}
</div>
<div class="col-md-4">
{[ "type": "text", "label": "{{ tr('Formato orario') }}", "name": "time_format", "value": "H:i", "required": 1 ]}
</div>
</div>
<small>{{ tr('I formati sono impostabili attraverso lo standard previsto da PHP: _LINK_', ['_LINK_' => '<a href="https://www.php.net/manual/en/function.date.php#refsect1-function.date-parameters">https://www.php.net/manual/en/function.date.php#refsect1-function.date-parameters</a>']) }}.</small>
<hr class="mb-4">
<h4 class="mb-3">{{ tr('Database') }}</h4>
<!-- db_host -->
<div class="row">
<div class="col-md-12">
{[ "type": "text", "label": "{{ tr('Host del database') }}", "name": "host", "placeholder": "{{ tr("Indirizzo dell'host del database") }}", "value": "{{ $host }}", "help": "{{ tr('Esempio') }}: localhost", "show-help": 0, "required": 1 ]}
</div>
</div>
<!-- db_username -->
<div class="row">
<div class="col-md-12">
{[ "type": "text", "label": "{{ tr("Username dell'utente MySQL") }}", "name": "username", "placeholder": "{{ tr("Username") }}", "value": "{{ $username }}", "help": "{{ tr('Esempio') }}: root", "show-help": 0, "required": 1 ]}
</div>
</div>
<!-- db_password -->
<div class="row">
<div class="col-md-12">
{[ "type": "password", "label": "{{ tr("Password dell'utente MySQL") }}", "name": "password", "placeholder": "{{ tr("Password") }}", "help": "{{ tr('Esempio') }}: mysql", "show-help": 0 ]}
</div>
</div>
<!-- db_name -->
<div class="row">
<div class="col-md-12">
{[ "type": "text", "label": "{{ tr('Nome del database') }}", "name": "database_name", "placeholder": "{{ tr('Database') }}", "value": "{{ $database_name }}", "help": "{{ tr('Esempio') }}: openstamanager", "show-help": 0, "required": 1 ]}
</div>
</div>
<hr class="mb-4">
<!-- PULSANTI -->
<div class="row">
<div class="col-md-4">
<span>*<small><small>{{ tr('Campi obbligatori') }}</small></small></span>
</div>
<div class="col-md-4 text-right">
<button type="button" id="test" class="btn btn-warning btn-block">
<i class="fa fa-file-text"></i> {{ tr('Testa il database') }}
</button>
</div>
<div class="col-md-4 text-right">
<button type="submit" id="install" class="btn btn-success btn-block">
<i class="fa fa-check"></i> {{ tr('Installa') }}
</button>
</div>
</div>
</div>
</div>
</form>
</div>
@endsection
@section('js')
<script>
globals.configuration = {
test_url: "{{ route('configuration-test') }}",
translations: {
error: "{{ tr('Errore della configurazione') }}",
errorMessage: "{{ tr('La configurazione non è corretta') }}.",
permissions: "{{ tr('Permessi insufficienti') }}",
permissionsMessage: "{{ tr("L'utente non possiede permessi sufficienti per il testing della connessione. Potresti rilevare problemi in fae di installazione.") }}",
success: "{{ tr('Configurazione corretta') }}",
successMessage: "{{ tr('Ti sei connesso con successo al database') }}. {{ tr("Clicca su 'Installa' per proseguire") }}.",
}
};
</script>
<script type="text/javascript">
var flag_link = "https://lipis.github.io/flag-icon-css/flags/4x3/|flag|.svg";
$(document).ready(function() {
init();
$("#install").on("click", function() {
if ($(this).closest("form").parsley().validate()) {
let restore = buttonLoading("#install");
$("#config-form").submit();
//buttonRestore("#install", restore);
}
});
$("#test").on("click", function() {
if ($(this).closest("form").parsley().validate()) {
let restore = buttonLoading("#test");
$("#install").prop('disabled', true);
$(this).closest("form").ajaxSubmit({
url: globals.configuration.test_url,
data: {
test: 1,
},
type: "post",
success: function (data) {
data = parseFloat(data.trim());
buttonRestore("#test", restore);
$("#install").prop('disabled', false);
if (data === 0) {
swal(globals.configuration.translations.error, globals.configuration.translations.errorMessage, "error");
} else if (data === 1) {
swal(globals.configuration.translations.permissions, globals.configuration.translations.permissionsMessage, "error");
} else {
swal(globals.configuration.translations.success, globals.configuration.translations.successMessage, "success");
}
},
error: function (xhr, error, thrown) {
ajaxError(xhr, error, thrown);
}
});
}
});
$.ajax({
url: flag_link.replace("|flag|", "it"),
success: function(){
initLanguage(true);
},
error: function(){
initLanguage(false);
},
timeout: 500
});
});
function languageFlag(item) {
if (!item.id) {
return item.text;
}
let element = $(item.element);
let img = $("<img>", {
class: "img-flag",
width: 26,
src: flag_link.replace("|flag|", element.data("country").toLowerCase()),
});
let span = $("<span>", {
text: " " + item.text,
});
span.prepend(img);
return span;
}
function initLanguage() {
$("#language").removeClass("hidden");
$("#language-info").addClass("hidden");
$("#language").select2({
theme: "bootstrap",
templateResult: languageFlag,
templateSelection:languageFlag,
});
// Preselezione lingua
if (globals.full_locale) {
$("#language").selectSet(globals.full_locale);
}
$("#language").on("change", function(){
if ($(this).val()) {
var location = window.location;
var url = location.protocol + "//" + location.host + "" + location.pathname;
var parameters = getUrlVars();
parameters.lang = $(this).val();
redirect(url, parameters);
}
});
}
</script>
@endsection

View File

@ -0,0 +1,9 @@
@extends('errors.base')
@section('title', tr("Accesso negato!"))
@section('error_color', 'info')
@section('error_header', '403')
@section('error_message', tr('Oops! Accesso negato'))
@section('error_info', tr('Non possiedi permessi sufficienti per accedere alla pagina da te richiesta'))

View File

@ -0,0 +1,17 @@
@extends('errors.base')
@section('title', tr("Pagina non trovata!"))
@section('error_color', 'warning')
@section('error_header', '404')
@section('error_message', tr('Oops! Pagina non trovata'))
@section('error_info', tr('Non siamo riusciti a trovare la pagina che stavi cercando'))
@section('js')
@if(!auth()->check())
<script>
location.href = "{{ route('login') }}";
</script>
@endif
@endsection

View File

@ -0,0 +1,9 @@
@extends('errors.base')
@section('title', tr("Accesso negato!"))
@section('error_color', 'info')
@section('error_header', '405')
@section('error_message', tr('Oops! Accesso negato'))
@section('error_info', tr('Il metodo di accesso utilizzato non è permesso per accedere alla pagina da te richiesta'))

View File

@ -0,0 +1,9 @@
@extends('errors.base')
@section('title', tr("Errore del server!"))
@section('error_color', 'danger')
@section('error_header', '500')
@section('error_message', tr('Oops! Qualcosa è andato storto'))
@section('error_info', tr('Cercheremo di risolvere il problema il presto possibile'))

View File

@ -0,0 +1,21 @@
@extends('layouts.base')
@section('body_class', 'hold-transition login-page')
@section('error_return')
{!! tr('Nel frattempo, puoi tornare alla _PAGE_', ['_PAGE_' => '<a href="'.route('login').'">'.tr('pagina principale').'</a>']) !!}
@stop
@section('body')
<section style="position: absolute; left: 35%; top: 40%;">
<div class="error-page">
<h2 class="headline text-@yield('error_color')">@yield('error_header')</h2>
<div class="error-content">
<h3><i class="fa fa-exclamation-triangle text-@yield('error_color')"></i> @yield('error_message').</h3>
<p>@yield('error_info'). @yield('error_return').</p>
</div>
</div>
</section>
@endsection

View File

@ -35,85 +35,85 @@
search: search,
translations: {
"day": "{{ __('Giorno') }}",
"week": "{{ __('Settimana') }}",
"month": "{{ __('Mese') }}",
"today": "{{ __('Oggi') }}",
"firstThreemester": "{{ __('I trimestre') }}",
"secondThreemester": "{{ __('II trimestre') }}",
"thirdThreemester": "{{ __('III trimestre') }}",
"fourthThreemester": "{{ __('IV trimestre') }}",
"firstSemester": "{{ __('I semestre') }}",
"secondSemester": "{{ __('II semestre') }}",
"thisMonth": "{{ __('Questo mese') }}",
"lastMonth": "{{ __('Mese scorso') }}",
"thisYear": "{{ __("Quest'anno") }}",
"lastYear": "{{ __('Anno scorso') }}",
"apply": "{{ __('Applica') }}",
"cancel": "{{ __('Annulla') }}",
"from": "{{ __('Da') }}",
"to": "{{ __('A') }}",
"custom": "{{ __('Personalizzato') }}",
"delete": "{{ __('Elimina') }}",
"deleteTitle": "{{ __('Sei sicuro?') }}",
"deleteMessage": "{{ __('Eliminare questo elemento?') }}",
"errorTitle": "{{ __('Errore') }}",
"errorMessage": "{{ __("Si è verificato un errore nell'esecuzione dell'operazione richiesta") }}",
"close": "{{ __('Chiudi') }}",
"filter": "{{ __('Filtra') }}",
"long": "{{ __('La ricerca potrebbe richiedere del tempo') }}",
"details": "{{ __('Dettagli') }}",
"waiting": "{{ __('Impossibile procedere') }}",
"waiting_msg": "{{ __('Prima di proseguire devi selezionare alcuni elementi!') }}",
'hooksExecuting': "{{ __('Hooks in esecuzione') }}",
'hookExecuting': '{{ __('Hook "_NAME_" in esecuzione') }}',
'hookMultiple': "{{ __('Hai _NUM_ notifiche') }}",
'hookSingle': "{{ __('Hai 1 notifica') }}",
'hookNone': "{{ __('Nessuna notifica') }}",
'singleCalendar': {{ __("E' presente un solo periodo!") }}",
"day": "{{ tr('Giorno') }}",
"week": "{{ tr('Settimana') }}",
"month": "{{ tr('Mese') }}",
"today": "{{ tr('Oggi') }}",
"firstThreemester": "{{ tr('I trimestre') }}",
"secondThreemester": "{{ tr('II trimestre') }}",
"thirdThreemester": "{{ tr('III trimestre') }}",
"fourthThreemester": "{{ tr('IV trimestre') }}",
"firstSemester": "{{ tr('I semestre') }}",
"secondSemester": "{{ tr('II semestre') }}",
"thisMonth": "{{ tr('Questo mese') }}",
"lastMonth": "{{ tr('Mese scorso') }}",
"thisYear": "{{ tr("Quest'anno") }}",
"lastYear": "{{ tr('Anno scorso') }}",
"apply": "{{ tr('Applica') }}",
"cancel": "{{ tr('Annulla') }}",
"from": "{{ tr('Da') }}",
"to": "{{ tr('A') }}",
"custom": "{{ tr('Personalizzato') }}",
"delete": "{{ tr('Elimina') }}",
"deleteTitle": "{{ tr('Sei sicuro?') }}",
"deleteMessage": "{{ tr('Eliminare questo elemento?') }}",
"errorTitle": "{{ tr('Errore') }}",
"errorMessage": "{{ tr("Si è verificato un errore nell'esecuzione dell'operazione richiesta") }}",
"close": "{{ tr('Chiudi') }}",
"filter": "{{ tr('Filtra') }}",
"long": "{{ tr('La ricerca potrebbe richiedere del tempo') }}",
"details": "{{ tr('Dettagli') }}",
"waiting": "{{ tr('Impossibile procedere') }}",
"waiting_msg": "{{ tr('Prima di proseguire devi selezionare alcuni elementi!') }}",
'hooksExecuting': "{{ tr('Hooks in esecuzione') }}",
'hookExecuting': '{{ tr('Hook "_NAME_" in esecuzione') }}',
'hookMultiple': "{{ tr('Hai _NUM_ notifiche') }}",
'hookSingle': "{{ tr('Hai 1 notifica') }}",
'hookNone': "{{ tr('Nessuna notifica') }}",
'singleCalendar': {{ tr("E' presente un solo periodo!") }}",
ajax: {
"missing": {
"title": "{{ __('Errore') }}",
"text": "{{ __('Alcuni campi obbligatori non sono stati compilati correttamente') }}",
"title": "{{ tr('Errore') }}",
"text": "{{ tr('Alcuni campi obbligatori non sono stati compilati correttamente') }}",
},
"error": {
"title": "{{ __('Errore') }}",
"text": "{{ __('Errore durante il salvataggio del record') }}",
"title": "{{ tr('Errore') }}",
"text": "{{ tr('Errore durante il salvataggio del record') }}",
}
},
password: {
"wordMinLength": "{{ __('La password è troppo corta') }}",
"wordMaxLength": "{{ __('La password è troppo lunga') }}",
"wordInvalidChar": "{{ __('La password contiene un carattere non valido') }}",
"wordNotEmail": "{{ __('Non usare la tua e-mail come password') }}",
"wordSimilarToUsername": "{{ __('La password non può contenere il tuo nome') }}",
"wordTwoCharacterClasses": "{{ __('Usa classi di caratteri diversi') }}",
"wordRepetitions": "{{ __('La password contiene ripetizioni') }}",
"wordSequences": "{{ __('La password contiene sequenze') }}",
"errorList": "{{ __('Attenzione') }}:",
"veryWeak": "{{ __('Molto debole') }}",
"weak": "{{ __('Debole') }}",
"normal": "{{ __('Normale') }}",
"medium": "{{ __('Media') }}",
"strong": "{{ __('Forte') }}",
"veryStrong": "{{ __('Molto forte') }}",
"wordMinLength": "{{ tr('La password è troppo corta') }}",
"wordMaxLength": "{{ tr('La password è troppo lunga') }}",
"wordInvalidChar": "{{ tr('La password contiene un carattere non valido') }}",
"wordNotEmail": "{{ tr('Non usare la tua e-mail come password') }}",
"wordSimilarToUsername": "{{ tr('La password non può contenere il tuo nome') }}",
"wordTwoCharacterClasses": "{{ tr('Usa classi di caratteri diversi') }}",
"wordRepetitions": "{{ tr('La password contiene ripetizioni') }}",
"wordSequences": "{{ tr('La password contiene sequenze') }}",
"errorList": "{{ tr('Attenzione') }}:",
"veryWeak": "{{ tr('Molto debole') }}",
"weak": "{{ tr('Debole') }}",
"normal": "{{ tr('Normale') }}",
"medium": "{{ tr('Media') }}",
"strong": "{{ tr('Forte') }}",
"veryStrong": "{{ tr('Molto forte') }}",
},
datatables: {
"emptyTable": "{{ __('Nessun dato presente nella tabella') }}",
"info": "{{ __('Vista da _START_ a _END_ di _TOTAL_ elementi') }}",
"infoEmpty": "{{ __('Vista da 0 a 0 di 0 elementi') }}",
"infoFiltered": "({{ __('filtrati da _MAX_ elementi totali') }})",
"emptyTable": "{{ tr('Nessun dato presente nella tabella') }}",
"info": "{{ tr('Vista da _START_ a _END_ di _TOTAL_ elementi') }}",
"infoEmpty": "{{ tr('Vista da 0 a 0 di 0 elementi') }}",
"infoFiltered": "({{ tr('filtrati da _MAX_ elementi totali') }})",
"infoPostFix": "",
"lengthMenu": "{{ __('Visualizza _MENU_ elementi') }}",
"lengthMenu": "{{ tr('Visualizza _MENU_ elementi') }}",
"loadingRecords": " ",
"processing": "{{ __('Elaborazione') }}...",
"search": "{{ __('Cerca') }}:",
"zeroRecords": "{{ __('La ricerca non ha portato alcun risultato') }}.",
"processing": "{{ tr('Elaborazione') }}...",
"search": "{{ tr('Cerca') }}:",
"zeroRecords": "{{ tr('La ricerca non ha portato alcun risultato') }}.",
"paginate": {
"first": "{{ __('Inizio') }}",
"previous": "{{ __('Precedente') }}",
"next": "{{ __('Successivo') }}",
"last": "{{ __('Fine') }}"
"first": "{{ tr('Inizio') }}",
"previous": "{{ tr('Precedente') }}",
"next": "{{ tr('Successivo') }}",
"last": "{{ tr('Fine') }}"
},
},
},
@ -158,19 +158,19 @@
@section('body')
<div class="wrapper">
<header class="main-header">
<a href="https://www.openstamanager.com" class="logo" title="{{ __("Il gestionale open source per l'assistenza tecnica e la fatturazione") }}" target="_blank">
<a href="https://www.openstamanager.com" class="logo" title="{{ tr("Il gestionale open source per l'assistenza tecnica e la fatturazione") }}" target="_blank">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini">{{ __("OSM") }}</span>
<span class="logo-mini">{{ tr("OSM") }}</span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg">
{{ __('OpenSTAManager') }}
{{ tr('OpenSTAManager') }}
</span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top" role="navigation">
<!-- Sidebar toggle button-->
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">{{ __('Mostra/nascondi menu') }}</span>
<span class="sr-only">{{ tr('Mostra/nascondi menu') }}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
@ -211,23 +211,23 @@
</ul>
</li>
<li><a href="#" onclick="window.print()" class="tip" title="{{ __('Stampa') }}">
<li><a href="#" onclick="window.print()" class="tip" title="{{ tr('Stampa') }}">
<i class="fa fa-print"></i>
</a></li>
<li><a href="{{ route('bug') }}" class="tip" title="{{ __('Segnalazione bug') }}">
<li><a href="{{ route('bug') }}" class="tip" title="{{ tr('Segnalazione bug') }}">
<i class="fa fa-bug"></i>
</a></li>
<li><a href="{{ route('logs') }}" class="tip" title="{{ __('Log accessi') }}">
<li><a href="{{ route('logs') }}" class="tip" title="{{ tr('Log accessi') }}">
<i class="fa fa-book"></i>
</a></li>
<li><a href="{{ route('info') }}" class="tip" title="{{ __('Informazioni') }}">
<li><a href="{{ route('info') }}" class="tip" title="{{ tr('Informazioni') }}">
<i class="fa fa-info"></i>
</a></li>
<li><a href="{{ route('logout') }}" onclick="sessionStorage.clear()" class="bg-red tip" title="{{ __('Esci') }}">
<li><a href="{{ route('logout') }}" onclick="sessionStorage.clear()" class="bg-red tip" title="{{ tr('Esci') }}">
<i class="fa fa-power-off"></i>
</a></li>
</ul>
@ -257,7 +257,7 @@
<!-- Form di ricerca generale -->
<div class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" id="supersearch" placeholder="{{ __('Cerca') }}..."/>
<input type="text" name="q" class="form-control" id="supersearch" placeholder="{{ tr('Cerca') }}..."/>
<span class="input-group-btn">
<button class="btn btn-flat" id="search-btn" name="search" type="submit" ><i class="fa fa-search"></i>
</button>
@ -283,10 +283,10 @@
</div>
<footer class="main-footer">
<a class="hidden-xs" href="https://www.openstamanager.com" title="{{ __("Il gestionale open source per l'assistenza tecnica e la fatturazione") }}" target="_blank"><strong>{{ __('OpenSTAManager') }}</strong></a>
<a class="hidden-xs" href="https://www.openstamanager.com" title="{{ tr("Il gestionale open source per l'assistenza tecnica e la fatturazione") }}" target="_blank"><strong>{{ tr('OpenSTAManager') }}</strong></a>
<span class="pull-right hidden-xs">
<strong>{{ __('Versione') }}:</strong> {{ Update::getVersion() }}
<small class="text-muted">({{ Update::getRevision() ?: __('In sviluppo') }})</small>
<strong>{{ tr('Versione') }}:</strong> {{ Update::getVersion() }}
<small class="text-muted">({{ Update::getRevision() ?: tr('In sviluppo') }})</small>
</span>
</footer>

View File

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<title>@yield('title') - {{ __('OpenSTAManager') }}</title>
<title>@yield('title') - {{ tr('OpenSTAManager') }}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
@ -50,21 +50,21 @@
translations: {
password: {
"wordMinLength": "{{ __('La password è troppo corta') }}",
"wordMaxLength": "{{ __('La password è troppo lunga') }}",
"wordInvalidChar": "{{ __('La password contiene un carattere non valido') }}",
"wordNotEmail": "{{ __('Non usare la tua e-mail come password') }}",
"wordSimilarToUsername": "{{ __('La password non può contenere il tuo nome') }}",
"wordTwoCharacterClasses": "{{ __('Usa classi di caratteri diversi') }}",
"wordRepetitions": "{{ __('La password contiene ripetizioni') }}",
"wordSequences": "{{ __('La password contiene sequenze') }}",
"errorList": "{{ __('Attenzione') }}:",
"veryWeak": "{{ __('Molto debole') }}",
"weak": "{{ __('Debole') }}",
"normal": "{{ __('Normale') }}",
"medium": "{{ __('Media') }}",
"strong": "{{ __('Forte') }}",
"veryStrong": "{{ __('Molto forte') }}",
"wordMinLength": "{{ tr('La password è troppo corta') }}",
"wordMaxLength": "{{ tr('La password è troppo lunga') }}",
"wordInvalidChar": "{{ tr('La password contiene un carattere non valido') }}",
"wordNotEmail": "{{ tr('Non usare la tua e-mail come password') }}",
"wordSimilarToUsername": "{{ tr('La password non può contenere il tuo nome') }}",
"wordTwoCharacterClasses": "{{ tr('Usa classi di caratteri diversi') }}",
"wordRepetitions": "{{ tr('La password contiene ripetizioni') }}",
"wordSequences": "{{ tr('La password contiene sequenze') }}",
"errorList": "{{ tr('Attenzione') }}:",
"veryWeak": "{{ tr('Molto debole') }}",
"weak": "{{ tr('Debole') }}",
"normal": "{{ tr('Normale') }}",
"medium": "{{ tr('Media') }}",
"strong": "{{ tr('Forte') }}",
"veryStrong": "{{ tr('Molto forte') }}",
},
},

View File

@ -5,7 +5,7 @@
@section('body')
@yield('before_content')
<div class="box box-outline box-center-large @yield('box_class')">
<div class="box box-outline box-center-large @yield('box_class')">
<div class="box-header text-center">
@yield('box_header')
</div>

View File

@ -6,7 +6,6 @@ use App\Http\Controllers\Auth\EmailVerificationNotificationController;
use App\Http\Controllers\Auth\EmailVerificationPromptController;
use App\Http\Controllers\Auth\NewPasswordController;
use App\Http\Controllers\Auth\PasswordResetLinkController;
use App\Http\Controllers\Auth\RegisteredUserController;
use App\Http\Controllers\Auth\VerifyEmailController;
use Illuminate\Support\Facades\Route;

View File

@ -3,7 +3,7 @@
use App\Http\Controllers\LegacyController;
use Illuminate\Support\Facades\Route;
Route::any('/', [LegacyController::class, 'index']);
//Route::any('/', [LegacyController::class, 'index']);
Route::any('/{path}', [LegacyController::class, 'index'])
->name('legacy')

View File

@ -1,7 +1,7 @@
<?php
use App\Http\Controllers\ConfigurationController;
use App\Http\Controllers\InfoController;
use App\Http\Controllers\LegacyController;
use App\Http\Controllers\Test;
use Illuminate\Support\Facades\Route;
@ -16,9 +16,16 @@ use Illuminate\Support\Facades\Route;
|
*/
Route::get('/test', function () {
return view('welcome');
});
// Percorsi di autenticazione e gestione utenza
require __DIR__.'/auth.php';
// Sezione di configurazione
Route::get('/config', [ConfigurationController::class, 'index'])
->name('configuration');
Route::get('/config-test', [ConfigurationController::class, 'test'])
->name('configuration-test');
Route::post('/config', [ConfigurationController::class, 'save'])
->name('configuration-save');
// Messaggi flash
Route::get('/messages', [Test::class, 'index'])
@ -65,7 +72,7 @@ Route::prefix('hook')->group(function () {
});
// Informazioni su OpenSTAManager
Route::get('/info', [InfoController::class, 'info'])
Route::get('/info', [InfoController::class, 'info'])
->name('info');
// Segnalazione bug
@ -88,5 +95,3 @@ Route::post('/password', [Test::class, 'index']);
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth'])->name('dashboard');
require __DIR__ . '/auth.php';