diff --git a/.editorconfig b/.editorconfig
index 6bb235b83..1671c9b9d 100755
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,11 +1,18 @@
-# editorconfig.org
-
root = true
[*]
charset = utf-8
end_of_line = lf
-indent_size = 4
-indent_style = space
insert_final_newline = true
-trim_trailing_whitespace = true
\ No newline at end of file
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+
+[*.md]
+trim_trailing_whitespace = false
+
+[*.{yml,yaml}]
+indent_size = 2
+
+[docker-compose.yml]
+indent_size = 4
diff --git a/.env.example b/.env.example
new file mode 100644
index 000000000..44853cd59
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,51 @@
+APP_NAME=Laravel
+APP_ENV=local
+APP_KEY=
+APP_DEBUG=true
+APP_URL=http://localhost
+
+LOG_CHANNEL=stack
+LOG_LEVEL=debug
+
+DB_CONNECTION=mysql
+DB_HOST=127.0.0.1
+DB_PORT=3306
+DB_DATABASE=laravel
+DB_USERNAME=root
+DB_PASSWORD=
+
+BROADCAST_DRIVER=log
+CACHE_DRIVER=file
+FILESYSTEM_DRIVER=local
+QUEUE_CONNECTION=sync
+SESSION_DRIVER=file
+SESSION_LIFETIME=120
+
+MEMCACHED_HOST=127.0.0.1
+
+REDIS_HOST=127.0.0.1
+REDIS_PASSWORD=null
+REDIS_PORT=6379
+
+MAIL_MAILER=smtp
+MAIL_HOST=mailhog
+MAIL_PORT=1025
+MAIL_USERNAME=null
+MAIL_PASSWORD=null
+MAIL_ENCRYPTION=null
+MAIL_FROM_ADDRESS=null
+MAIL_FROM_NAME="${APP_NAME}"
+
+AWS_ACCESS_KEY_ID=
+AWS_SECRET_ACCESS_KEY=
+AWS_DEFAULT_REGION=us-east-1
+AWS_BUCKET=
+AWS_USE_PATH_STYLE_ENDPOINT=false
+
+PUSHER_APP_ID=
+PUSHER_APP_KEY=
+PUSHER_APP_SECRET=
+PUSHER_APP_CLUSTER=mt1
+
+MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
+MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100755
index 67483f479..000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,191 +0,0 @@
-## GITATTRIBUTES FOR WEB PROJECTS
-#
-# These settings are for any web project.
-#
-# Details per file setting:
-# text These files should be normalized (i.e. convert CRLF to LF).
-# binary These files are binary and should be left untouched.
-#
-# Note that binary is a macro for -text -diff.
-######################################################################
-
-## AUTO-DETECT
-## Handle line endings automatically for files detected as
-## text and leave all files detected as binary untouched.
-## This will handle all files NOT defined below.
-* text=auto
-
-## SOURCE CODE
-*.bat text eol=crlf
-*.coffee text
-*.css text
-*.htm text
-*.html text
-*.inc text
-*.ini text
-*.js text
-*.json text
-*.jsx text
-*.less text
-*.od text
-*.onlydata text
-*.php text
-*.pl text
-*.py text
-*.rb text
-*.sass text
-*.scm text
-*.scss text
-*.sh text eol=lf
-*.sql text
-*.styl text
-*.tag text
-*.ts text
-*.tsx text
-*.xml text
-*.xhtml text
-
-## DOCKER
-*.dockerignore text
-Dockerfile text
-
-## DOCUMENTATION
-*.markdown text
-*.md text
-*.mdwn text
-*.mdown text
-*.mkd text
-*.mkdn text
-*.mdtxt text
-*.mdtext text
-*.txt text
-AUTHORS text
-CHANGELOG text
-CHANGES text
-CONTRIBUTING text
-COPYING text
-copyright text
-*COPYRIGHT* text
-INSTALL text
-license text
-LICENSE text
-NEWS text
-readme text
-*README* text
-TODO text
-
-## TEMPLATES
-*.dot text
-*.ejs text
-*.haml text
-*.handlebars text
-*.hbs text
-*.hbt text
-*.jade text
-*.latte text
-*.mustache text
-*.njk text
-*.phtml text
-*.tmpl text
-*.tpl text
-*.twig text
-
-## LINTERS
-.csslintrc text
-.eslintrc text
-.htmlhintrc text
-.jscsrc text
-.jshintrc text
-.jshintignore text
-.stylelintrc text
-
-## CONFIGS
-*.bowerrc text
-*.cnf text
-*.conf text
-*.config text
-.browserslistrc text
-.editorconfig text
-.gitattributes text
-.gitconfig text
-.htaccess text
-*.npmignore text
-*.yaml text
-*.yml text
-browserslist text
-Makefile text
-makefile text
-
-## HEROKU
-Procfile text
-.slugignore text
-
-## GRAPHICS
-*.ai binary
-*.bmp binary
-*.eps binary
-*.gif binary
-*.ico binary
-*.jng binary
-*.jp2 binary
-*.jpg binary
-*.jpeg binary
-*.jpx binary
-*.jxr binary
-*.pdf binary
-*.png binary
-*.psb binary
-*.psd binary
-*.svg text
-*.svgz binary
-*.tif binary
-*.tiff binary
-*.wbmp binary
-*.webp binary
-
-## AUDIO
-*.kar binary
-*.m4a binary
-*.mid binary
-*.midi binary
-*.mp3 binary
-*.ogg binary
-*.ra binary
-
-## VIDEO
-*.3gpp binary
-*.3gp binary
-*.as binary
-*.asf binary
-*.asx binary
-*.fla binary
-*.flv binary
-*.m4v binary
-*.mng binary
-*.mov binary
-*.mp4 binary
-*.mpeg binary
-*.mpg binary
-*.ogv binary
-*.swc binary
-*.swf binary
-*.webm binary
-
-## ARCHIVES
-*.7z binary
-*.gz binary
-*.jar binary
-*.rar binary
-*.tar binary
-*.zip binary
-
-## FONTS
-*.ttf binary
-*.eot binary
-*.otf binary
-*.woff binary
-*.woff2 binary
-
-## EXECUTABLES
-*.exe binary
-*.pyc binary
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
deleted file mode 100755
index 46178f820..000000000
--- a/.github/CONTRIBUTING.md
+++ /dev/null
@@ -1,96 +0,0 @@
----
-currentMenu: contribuire
----
-
-# Contribuire
-
-Sei interessato a contribuire allo sviluppo di OpenSTAManger? Ottimo, sei il benvenuto!
-
-Siamo entusiasti di ogni nuova contribuzione che otteniamo dalla nostra community.
-Ci sono molti modi per contribuire: segnalare bug, richiedere miglioramenti, scrivere tutorial, migliorare la documentazione, ...
-
-Non serve essere degli esperti programmatori per aiutarci! :smile_cat:
-
-Leggi le seguenti sezioni per scoprire come ti consigliamo di procedere.
-Se ti serve un aiuto, crea una issue su GitHub.
-
-## Linee guida
-
-Per migliorare il sistema con cui sviluppiamo il codice, abbiamo deciso di adottare alcune linee guida per facilitare la collaborazione tra più persone.
-
-
-### Standard del codice
-
-Per lo standard ufficiale riguardante i nomi e le strutture da utilizzare, visita la sezione [Standard](STANDARD.md).
-
-### Codice di condotta
-
-Per il momento non abbiamo adottato un vero e proprio codice di condotta, ma ti chiediamo di essere il più civile possibile nel comunicare con gli altri per questo progetto.
-
-### Stile del codice
-
-Utilizziamo principalmente due strumenti per mantenere consistente nel tempo lo stile del codice:
-- [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)
-- [EditorConfig](https://editorconfig.org)
-
-PHP CS Fixer viene utilizzato per formattare automaticamente il codice PHP e aumentare la sua comprensibilità.
-La configurazione può essere trovata nel file [.php_cs](https://github.com/devcode-it/openstamanager/blob/master/.php_cs).
-
-EditorConfig viene sfruttato per mantenere la consistenza nella formattazione di base dei diversi altri file utilizzati nel progetto.
-La configurazione può essere trovata nel file [.editorconfig](https://github.com/devcode-it/openstamanager/blob/master/.editorconfig).
-
-Maggiori informazioni sui plugin che permettono di integrare questi strumenti sono disponibili nei relativi siti.
-
-## Prima contribuzione
-
-Sei insicuro su cosa potresti lavorare per contribuire al progetto?
-
-Prova a dare un'occhiata alle issue sotto la label [nuovi contributori](https://github.com/devcode-it/openstamanager/labels/nuovi%20contributori), dove sono indicate le migliorie più semplici da applicare.
-
-## Problemi di sicurezza
-
-Se trovi un problema di sicurezza, NON aprire una issue. Inviaci un'email all'indirizzo `info at openstamanager dot com`.
-
-Per capire se hai individuato un problema di sicurezza, prova a farti queste domande:
-
-* Posso accedere a qualcosa a cui non dovrei avere accesso?
-* Posso disabilitare qualcosa per altre persone?
-
-Se la risposta a una di queste domande è positiva, allora probabilmente hai individuato un problema di sicurezza.
-Considera però che anche in caso negativo potrebbe trattarsi di un problema di questo tipo, quindi se sei insicuro contattaci comunque via email.
-
-## Segnalare un bug
-
-Se hai individuato un bug e desideri segnalarlo, apri una nuova issue provando a mantenerti sulla base del [file di template su GitHub](https://github.com/devcode-it/openstamanager/blob/master/.github/ISSUE_TEMPLATE.md).
-
-Se vuoi suggerire una miglioramento di qualche tipo oppure una nuova funzionalità, sentiti libero di aprire una issue apposita dove spieghi dettagliatamente la modifica che vorresti, la sua utilità e il suo funzionamento generale
-
-## Pull Request
-
-Se sei in grado di risolvere uno dei bug segnalati oppure vuoi completare una nuova funzionalità, apri una nuova Pull Request provando a mantenerti sulla base del [file di template su GitHub](https://github.com/devcode-it/openstamanager/blob/master/.github/PULL_REQUEST_TEMPLATE.md).
-
-## Community
-
-Siamo presenti su [Facebook](https://www.facebook.com/openstamanager), e il nostro forum ufficiale è disponibile all'indirizzo .
-
-Cerchiamo di essere disponibili quanto possibile, ma non sempre riusciamo a rispondere tempestivamente.
-
-## Testing
-
-Il progetto presenta, a partire dalla versione 2.4.2, un insieme di test per facilitare il controllo sul corretto funzionamento del gestionale.
-
-E' innanzitutto necessario configurare correttamente l'ambiente locale per l'esecuzione dei test:
-- Impostare l'URL del web server locale nel file `codeception.yml` per Codeception
-```yml
-modules:
- config:
- WebDriver:
- url: http://localhost/openstamanager
-```
-- Scaricare (ChromeDriver)[https://sites.google.com/a/chromium.org/chromedriver/getting-started], rendendolo eseguibile da riga di comando (su Windows, aggiungerlo al PATH)
-
-E' quindi possibile eseguire i tests avviando dapprima il server ChromeDriver e poi Codeception in shell differenti:
-```bash
-chromedriver --url-base=/wd/hub
-php codecept.phar run --steps
-```
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
deleted file mode 100755
index 1a968ebf7..000000000
--- a/.github/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,38 +0,0 @@
-## Comportamento richiesto
-
-Descrivi il comportamento che ti aspetti dal progetto.
-
-## Comportamento attuale
-
-Qual è il comportamento attuale, e come ti aspetti che venga migliorato?
-
-## Possibile soluzione
-
-[Non obbligatorio] Hai suggerimenti su come risolvere il bug o individuarne le cause?
-
-## Passi per riprodurre il comportamento
-
-[Per i bug] Descrivi dettagliatamente i singoli passi per riprodurre il malfunzionamento.
-
-1.
-2.
-3.
-
-Eventuale codice rilevante:
-```php
-Se serve, aggiungi qui il codice che vuoi farci testare
-```
-
-Eventuali log relativi (cartella **logs/**):
-```
-Se presenti, aggiungi qui i log relativi al malfunzionamento
-```
-
-## Contesto
-
-Inserisci le informazioni riguardanti il tuo ambiente di esecuzione. Può essere utile per individuare problemi riproducibili solo con condizioni specifiche.
-
-* Modulo:
-* Versione del progetto:
-* Versione PHP:
-* Tipo di server:
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100755
index 874e8c2f1..000000000
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,22 +0,0 @@
-## Descrizione
-
-Includi un sommario dei cambiamenti introdotti, con il relativo contesto.
-Elenca anche le eventuali dipendenze aggiuntive richieste per questa modifica.
-
-Risolve: #(issue)
-
-## Tipologia
-
-Rimuovi le opzioni non rilevanti.
-
-- [ ] Bug fix (cambiamenti minori che risolvono una issue)
-- [ ] Nuova funzionalità (cambiamenti minori che aggiungono una nuova funzionalità)
-- [ ] Cambiamento maggiore (fix o funzionalità che richiede una revisione prima di essere pubblicata)
-- [ ] Questo cambiamenti richiede un aggiornamento della documentazione
-
-# Checklist
-
-- [ ] Il codice segue le linee guida del progetto
-- [ ] Ho commentato il codice, in particolare nelle parti più complesse
-- [ ] Ho aggiornato di conseguenza la documentazione (se presente)
-- [ ] Il codice non genera warnings
diff --git a/.github/STANDARD.md b/.github/STANDARD.md
deleted file mode 100755
index b3d475ee9..000000000
--- a/.github/STANDARD.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Standard del codice
-
-Lo standard prevede l'utilizzo di nomi in italiano per la maggior parte dei contenuti, esclusi i sistemi di gestione interna del gestionale (tabelle `zz_*` e codici particolarmente rilevanti).
-
-I nomi delle variabili devono seguire uno standard comune, che prevede la sostituzione degli spazi con `_` (*underscore*) e la rimozione delle lettere accentate a favore di quelle semplici.
-
-Le variabili devono possedere nomi completi e chiari.
-Esempio:
- - Partita IVA -> `partita_iva` nel database, `$partita_iva` in PHP
-
-## Database
-
-Gli identificatori devono iniziare per `id_*` e i flag per `is_*`.
-E' fondamentale ricordarsi di impostare correttamente le **FOREIGN KEYS** delle relative tabelle.
-
-Ci sono inoltre alcuni campi utilizzati in modo riccorrente all'interno del gestionale:
- - `default boolean NOT NULL DEFAULT 0` per i valori di default, non cancellabili e con modificabilità limitata
- - `predefined boolean NOT NULL DEFAULT 0` per i valori predefiniti in selezioni o gruppi
- - `visible boolean NOT NULL DEFAULT 1` per nascondere gli elementi
- - `deleted_at timestamp NULL DEFAULT NULL,` per segnare un elemento come eliminato
-
-Per tabelle non presenti all'interno della lista ufficiale di OpenSTAManager (file **update/tables.php**), è necessario inoltre provvedere all'aggiunta dei seguenti campi:
- - `updated_at timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP`
- - `created_at timestamp NULL DEFAULT CURRENT_TIMESTAMP`
-
-## Note
-
-Malgrado una buona parte del codice ufficiale non segua completamente queste buone pratiche, è consigliato l'implementazione di queste linee guida per nuove funzioni e strutture mentre il sistema di base viene lentamente standardizzato.
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
deleted file mode 100644
index 1d889ccb0..000000000
--- a/.github/workflows/main.yml
+++ /dev/null
@@ -1,129 +0,0 @@
-name: OpenSTAManager CI
-
-on:
- workflow_dispatch
-
-jobs:
- tests:
- runs-on: ubuntu-18.04
-
- strategy:
- matrix:
- python-version: [3.9]
- php-version: ['7.4']
-
- steps:
- - uses: actions/checkout@v2
-
-# - name: Set up PHP ${{ matrix.php-version }}
-# uses: shivammathur/setup-php@v2
-# with:
-# php-version: ${{ matrix.php-version }}
-# extensions: zip, mbstring, pdo_mysql, mysql, dom, xsl, openssl, intl, curl, soap, gd
-
- - name: Setup PHP
- run: |
- sudo apt install libapache2-mod-php7.4
- sudo sed -i 's,^post_max_size =.*$,post_max_size = 32M,' /etc/php/7.4/apache2/php.ini
- sudo sed -i 's,^upload_max_filesize =.*$,upload_max_filesize = 32M,' /etc/php/7.4/apache2/php.ini
-
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Install SeleniumBase
- uses: actions/checkout@v2
- with:
- repository: seleniumbase/SeleniumBase
- path: selenium-base
-
- - name: Configure SeleniumBase
- run: |
- cd selenium-base
- python setup.py install
-
- - name: Install Chrome and Firefox
- run: |
- sudo apt install google-chrome-stable
- sudo apt-get install firefox
-
- - name: Check the console scripts interface
- run: |
- seleniumbase
- sbase
-
- - name: Install chromedriver and geckodriver (Firefox Webdriver)
- run: |
- seleniumbase install chromedriver
- seleniumbase install geckodriver
-
- - name: Make sure pytest is working
- run: |
- echo "def test_1(): pass" > nothing.py
- pytest nothing.py
-
- - name: Make sure nosetests is working
- run: |
- echo "def test_2(): pass" > nothing2.py
- nosetests nothing2.py
-
- - name: Cache Composer packages
- id: composer-cache
- uses: actions/cache@v2
- with:
- path: vendor
- key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
- restore-keys: |
- ${{ runner.os }}-php-
-
- - name: Install Composer dependencies
- run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
-
- - name: Use NPM and Node.js
- uses: actions/setup-node@v2
- with:
- node-version: '14'
- - name: Install NPM and compile assets
- run: |
- yarn install
- npm run build-OSM
-
-
- - name: Copy OSM to www root
- run: |
- sudo cp -R /home/runner/work/openstamanager/openstamanager /var/www/html/
- sudo chmod -R 0777 /var/www/html/openstamanager
- sudo rm /var/www/html/openstamanager/.htaccess
-
- - name: Check out test repository
- uses: actions/checkout@v2
- with:
- repository: devcode-it/openstamanager-tests
- path: python-tests
-
- - name: Install Python dependencies
- run: |
- cd python-tests/
- python -m pip install --upgrade pip
- python -m pip install pytest
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
-
- - name: Restart apache
- run: sudo service apache2 restart
-
- - name: Restart MySQL
- run: sudo service mysql restart
-
- - name: Init test configuration
- run: |
- curl http://localhost/openstamanager/
- sudo cat /var/log/apache2/access.log
- cd python-tests/
- echo -ne "{\n \"login\": {\n \"password\": \"adminadmin\",\n \"username\": \"admin\"\n },\n \"database\": {\n \"host\": \"localhost\",\n \"user\": \"root\",\n \"pass\": \"root\",\n \"name\": \"osm\"\n },\n \"server\": \"http://localhost/openstamanager/\",\n \"browser\": \"firefox\",\n \"headless\": true\n}" > config.json
- pytest Init.py
-
- - name: Execute tests
- run: |
- cd python-tests/
- pytest tests
diff --git a/.gitignore b/.gitignore
index a805acbe6..0d51056de 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,100 +1,163 @@
-# Compiled source #
-###################
-*.com
-*.class
-*.dll
-*.exe
-*.o
-*.so
-*.pyo
-*.pyc
+/.vscode
-# Packages #
-############
-*.7z
-*.dmg
-*.gz
-*.iso
-*.jar
-*.rar
-*.tar
-*.zip
+# Created by https://www.toptal.com/developers/gitignore/api/phpstorm,laravel,composer,yarn
+# Edit at https://www.toptal.com/developers/gitignore?templates=phpstorm,laravel,composer,yarn
-# Logs and databases #
-######################
-*.log
-*.sqlite
+### Composer ###
+composer.phar
+/vendor/
-# Mixed #
-######################
-*~
-._*
-.cache
-.DS_Store
-.DS_Store?
-.idea
-.project
-.settings
-.tmproj
-*.esproj
-*.sublime-project
-*.sublime-workspace
-nbproject
-Thumbs.db
-ehthumbs.db
-ehthumbs_vista.db
-$RECYCLE.BIN
-desktop.ini
-Desktop.ini
-.Spotlight-V100
-.Trashes
-.fuse_hidden*
-.directory
-.Trash-*
-.nfs*
-*.cab
-*.msi
-*.msm
-*.msp
-*.lnk
-.vscode/*
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+# composer.lock
-# Npm, Bower, Composer #
-######################
-bower_components/
+### Laravel ###
node_modules/
-vendor/
-*.phar
-*.lock
-package-lock.json
+npm-debug.log
+yarn-error.log
-# Project #
-######################
-*.new
-*.old
-*.txt
-assets/dist/
-backup/*
-!backup/.htaccess
-custom/
-files/*
-!files/.htaccess
-!files/impianti/
-files/impianti/*
-!files/impianti/componente.ini
-!files/temp/
-files/temp/*
-tmp/
-config.inc.php
-database.sql
-VERSION
-REVISION
-.php_cs.cache
-manifest.json
-checksum.json
-database.json
+# Laravel 4 specific
+bootstrap/compiled.php
+app/storage/
+
+# Laravel 5 & Lumen specific
+public/storage
+public/hot
+
+# Laravel 5 & Lumen specific with changed public path
+public_html/storage
+public_html/hot
+
+storage/*.key
+.env
+.env.backup
+Homestead.yaml
+Homestead.json
+/.vagrant
+.phpunit.result.cache
+docker-compose.override.yml
+
+### PhpStorm ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# AWS User-specific
+.idea/**/aws.xml
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+### PhpStorm Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+# .idea/misc.xml
+# *.ipr
+
+# Sonarlint plugin
+# https://plugins.jetbrains.com/plugin/7973-sonarlint
+.idea/**/sonarlint/
+
+# SonarQube Plugin
+# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
+.idea/**/sonarIssues.xml
+
+# Markdown Navigator plugin
+# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
+.idea/**/markdown-navigator.xml
+.idea/**/markdown-navigator-enh.xml
+.idea/**/markdown-navigator/
+
+# Cache file creation bug
+# See https://youtrack.jetbrains.com/issue/JBR-2257
+.idea/$CACHE_FILE$
+
+# CodeStream plugin
+# https://plugins.jetbrains.com/plugin/12206-codestream
+.idea/codestream.xml
+
+### yarn ###
+# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored
+
+.yarn/*
+!.yarn/releases
+!.yarn/plugins
+!.yarn/sdks
+!.yarn/versions
+
+# if you are NOT using Zero-installs, then:
+# comment the following lines
+!.yarn/cache
+
+# and uncomment the following lines
+# .pnp.*
+
+# End of https://www.toptal.com/developers/gitignore/api/phpstorm,laravel,composer,yarn
-/tests/_log/*
-/tests/_temp/*
-codeception.yml
-!.gitkeep
diff --git a/.styleci.yml b/.styleci.yml
new file mode 100644
index 000000000..9231873a1
--- /dev/null
+++ b/.styleci.yml
@@ -0,0 +1,13 @@
+php:
+ preset: laravel
+ disabled:
+ - no_unused_imports
+ finder:
+ not-name:
+ - index.php
+ - server.php
+js:
+ finder:
+ not-name:
+ - webpack.mix.js
+css: true
diff --git a/actions.php b/actions.php
deleted file mode 100755
index cca727e2a..000000000
--- a/actions.php
+++ /dev/null
@@ -1,429 +0,0 @@
-.
- */
-
-include_once __DIR__.'/core.php';
-
-use Models\Note;
-use Models\OperationLog;
-use Models\Upload;
-use Modules\Checklists\Check;
-use Modules\Checklists\Checklist;
-use Modules\Emails\Template;
-use Notifications\EmailNotification;
-
-if (empty($structure) || empty($structure['enabled'])) {
- exit(tr('Accesso negato'));
-}
-
-$upload_dir = base_dir().'/'.Uploads::getDirectory($id_module, $id_plugin);
-
-$database->beginTransaction();
-
-// Upload allegati e rimozione
-if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
- // Controllo sui permessi di scrittura per il modulo
- if (Modules::getPermission($id_module) != 'rw') {
- flash()->error(tr('Non hai permessi di scrittura per il modulo _MODULE_', [
- '_MODULE_' => '"'.Modules::get($id_module)['name'].'"',
- ]));
- }
-
- // Controllo sui permessi di scrittura per il file system
- elseif (!directory($upload_dir)) {
- flash()->error(tr('Non hai i permessi di scrittura nella cartella _DIR_!', [
- '_DIR_' => '"files"',
- ]));
- }
-
- // Gestione delle operazioni
- else {
- // UPLOAD
- if (filter('op') == 'aggiungi-allegato' && !empty($_FILES) && !empty($_FILES['file']['name'])) {
- $upload = Uploads::upload($_FILES['file'], [
- 'name' => filter('nome_allegato'),
- 'category' => filter('categoria'),
- 'id_module' => $id_module,
- 'id_plugin' => $id_plugin,
- 'id_record' => $id_record,
- ]);
-
- // Creazione file fisico
- if (!empty($upload)) {
- flash()->info(tr('File caricato correttamente!'));
- } else {
- flash()->error(tr('Errore durante il caricamento del file!'));
- }
- }
-
- // DELETE
- elseif (filter('op') == 'rimuovi-allegato' && filter('filename') !== null) {
- $name = Uploads::delete(filter('filename'), [
- 'id_module' => $id_module,
- 'id_plugin' => $id_plugin,
- 'id_record' => $id_record,
- ]);
-
- if (!empty($name)) {
- flash()->info(tr('File _FILE_ eliminato!', [
- '_FILE_' => '"'.$name.'"',
- ]));
- } else {
- flash()->error(tr("Errore durante l'eliminazione del file!"));
- }
- }
-
- redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : ''));
- }
-}
-
-// Download allegati
-elseif (filter('op') == 'download-allegato') {
- $rs = $dbo->fetchArray('SELECT * FROM zz_files WHERE id_module='.prepare($id_module).' AND id='.prepare(filter('id')).' AND filename='.prepare(filter('filename')));
-
- download($upload_dir.'/'.$rs[0]['filename'], $rs[0]['original']);
-} elseif (filter('op') == 'visualizza-modifica-allegato') {
- include_once base_dir().'/include/modifica_allegato.php';
-}
-
-// Modifica dati di un allegato
-elseif (filter('op') == 'modifica-allegato') {
- $id_allegato = filter('id_allegato');
- $allegato = Upload::find($id_allegato);
-
- $allegato->name = post('nome_allegato');
- $allegato->category = post('categoria_allegato');
-
- $allegato->save();
-}
-
-// Modifica nome della categoria degli allegati
-elseif (filter('op') == 'modifica-categoria-allegato') {
- $category = post('category');
- $name = post('name');
-
- $uploads = $structure->uploads($id_record)->where('category', $category);
- foreach ($uploads as $upload) {
- $upload->category = $name;
- $upload->save();
- }
-}
-
-// Validazione dati
-elseif (filter('op') == 'validate') {
- // Lettura informazioni di base
- $init = $structure->filepath('init.php');
- if (!empty($init)) {
- include_once $init;
- }
-
- // Validazione del campo
- $validation = $structure->filepath('validation.php');
- if (!empty($validation)) {
- include_once $validation;
- }
-
- echo json_encode($response);
-
- return;
-}
-
-// Aggiunta nota interna
-elseif (filter('op') == 'aggiungi-nota') {
- $contenuto = post('contenuto');
- $data_notifica = post('data_notifica') ?: null;
-
- $nota = Note::build($user, $structure, $id_record, $contenuto, $data_notifica);
-
- flash()->info(tr('Nota interna aggiunta correttamente!'));
-}
-
-// Rimozione data di notifica dalla nota interna
-elseif (filter('op') == 'rimuovi-notifica-nota') {
- $id_nota = post('id_nota');
- $nota = Note::find($id_nota);
-
- $nota->notification_date = null;
- $nota->save();
-
- flash()->info(tr('Data di notifica rimossa dalla nota interna!'));
-}
-
-// Rimozione nota interna
-elseif (filter('op') == 'rimuovi-nota') {
- $id_nota = post('id_nota');
- $nota = Note::find($id_nota);
-
- $nota->delete();
-
- flash()->info(tr('Nota interna aggiunta correttamente!'));
-}
-
-// Clonazione di una checklist
-elseif (filter('op') == 'copia-checklist') {
- $content = post('content');
- $checklist_id = post('checklist');
-
- $users = post('assigned_users');
- $users = array_clean($users);
-
- $group_id = post('group_id');
-
- $checklist = Checklist::find($checklist_id);
- $checklist->copia($user, $id_record, $users, $group_id);
-}
-
-// Aggiunta check alla checklist
-elseif (filter('op') == 'aggiungi-check') {
- $content = post('content');
- $parent_id = post('parent') ?: null;
-
- $users = post('assigned_users');
- $users = array_clean($users);
-
- $group_id = post('group_id');
-
- $check = Check::build($user, $structure, $id_record, $content, $parent_id);
- $check->setAccess($users, $group_id);
-}
-
-// Rimozione di un check della checklist
-elseif (filter('op') == 'rimuovi-check') {
- $check_id = post('check_id');
- $check = Check::find($check_id);
-
- if (!empty($check) && $check->user->id == $user->id) {
- $check->delete();
- } else {
- flash()->error(tr('Impossibile eliminare il check!'));
- }
-}
-
-// Gestione check per le checklist
-elseif (filter('op') == 'toggle-check') {
- $check_id = post('check_id');
- $check = Check::find($check_id);
-
- if (!empty($check) && $check->assignedUsers->pluck('id')->search($user->id) !== false) {
- $check->toggleCheck($user);
- } else {
- flash()->error(tr('Impossibile cambiare lo stato del check!'));
- }
-}
-
-// Gestione ordine per le checklist
-elseif (filter('op') == 'ordina-checks') {
- $ids = explode(',', $_POST['order']);
- $order = 0;
-
- foreach ($ids as $id) {
- $dbo->query('UPDATE `zz_checks` SET `order` = '.prepare($order).' WHERE id = '.prepare($id));
- ++$order;
- }
-}
-
-// Inizializzazione email
-elseif (post('op') == 'send-email') {
- $template = Template::find(post('template'));
-
- $mail = \Modules\Emails\Mail::build($user, $template, $id_record);
-
- // Rimozione allegati predefiniti
- $mail->resetPrints();
-
- // Destinatari
- $receivers = array_clean(post('destinatari'));
- $types = post('tipo_destinatari');
- foreach ($receivers as $key => $receiver) {
- $mail->addReceiver($receiver, $types[$key]);
- }
-
- // Contenuti
- $mail->subject = post('subject');
- $mail->content = post('body');
-
- // Conferma di lettura
- $mail->read_notify = post('read_notify');
-
- // Stampe da allegare
- $prints = post('prints');
- foreach ($prints as $print) {
- $mail->addPrint($print);
- }
-
- // Allegati originali
- $files = post('uploads');
- foreach ($files as $file) {
- $mail->addUpload($file);
- }
-
- // Salvataggio email nella coda di invio
- $mail->save();
-
- // Invio mail istantaneo
- $email = EmailNotification::build($mail);
- $email_success = $email->send();
-
- if ($email_success) {
- OperationLog::setInfo('id_email', $mail->id);
- flash()->info(tr('Email inviata correttamente!'));
- } else {
- $mail->delete();
- flash()->error(tr('Errore durante l\'invio email! Verifica i parametri dell\'account SMTP utilizzato.'));
- }
-} elseif (filter('op') == 'aggiorna_colonne') {
- include_once base_dir().'/include/colonne.php';
-} elseif (filter('op') == 'toggle_colonna') {
- $visible = filter('visible');
- $id_riga = filter('id_vista');
-
- $dbo->query('UPDATE `zz_views` SET `visible` = '.prepare($visible).' WHERE id = '.prepare($id_riga));
-} elseif (filter('op') == 'ordina_colonne') {
- $order = explode(',', post('order', true));
-
- foreach ($order as $i => $id_riga) {
- $dbo->query('UPDATE `zz_views` SET `order` = '.prepare($i).' WHERE id='.prepare($id_riga));
- }
-} elseif (filter('op') == 'visualizza_righe_riferimenti') {
- include_once base_dir().'/include/riferimenti/riferimenti.php';
-} elseif (filter('op') == 'visualizza_righe_documento') {
- include_once base_dir().'/include/riferimenti/righe_documento.php';
-} elseif (filter('op') == 'salva_riferimento_riga') {
- $database->insert('co_riferimenti_righe', [
- 'source_type' => filter('source_type'),
- 'source_id' => filter('source_id'),
- 'target_type' => filter('target_type'),
- 'target_id' => filter('target_id'),
- ]);
-} elseif (filter('op') == 'rimuovi_riferimento_riga') {
- $database->delete('co_riferimenti_righe', [
- 'id' => filter('idriferimento'),
- ]);
-}
-
-// Inclusione di eventuale plugin personalizzato
-if (!empty($structure['script'])) {
- $path = $structure->getEditFile();
- if (!empty($path)) {
- include $path;
- }
-
- $database->commitTransaction();
-
- return;
-}
-
-// Lettura risultato query del modulo
-$init = $structure->filepath('init.php');
-if (!empty($init)) {
- include_once $init;
-}
-
-// Retrocompatibilità
-if (!isset($record) && isset($records[0])) {
- $record = $records[0];
-} elseif (!isset($records[0]) && isset($record)) {
- $records = [$record];
-} elseif (!isset($record)) {
- $record = [];
- $records = [$record];
-}
-
-// Registrazione del record
-HTMLBuilder\HTMLBuilder::setRecord($record);
-
-if ($structure->permission == 'rw') {
- // Esecuzione delle operazioni di gruppo
- $id_records = post('id_records');
- $id_records = is_array($id_records) ? $id_records : explode(';', $id_records);
- $id_records = array_clean($id_records);
- $id_records = array_unique($id_records);
-
- $bulk = $structure->filepath('bulk.php');
- $bulk = empty($bulk) ? [] : include $bulk;
- $bulk = empty($bulk) ? [] : $bulk;
-
- if (in_array(post('op'), array_keys($bulk))) {
- redirect(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;
-
- // Operazioni generiche per i campi personalizzati
- if (post('op') != null) {
- $custom_where = !empty($id_plugin) ? '`id_plugin` = '.prepare($id_plugin) : '`id_module` = '.prepare($id_module);
-
- $query = 'SELECT `id`, `html_name` AS `name` FROM `zz_fields` WHERE '.$custom_where;
- $customs = $dbo->fetchArray($query);
-
- if (!string_starts_with(post('op'), 'delete')) {
- $values = [];
- foreach ($customs as $custom) {
- if (post($custom['name']) !== null) {
- $values[$custom['id']] = post($custom['name']);
- }
- }
-
- // Inserimento iniziale
- if (string_starts_with(post('op'), 'add')) {
- // Informazioni di log
- Filter::set('get', 'id_record', $id_record);
-
- foreach ($values as $key => $value) {
- $dbo->insert('zz_field_record', [
- 'id_record' => $id_record,
- 'id_field' => $key,
- 'value' => $value,
- ]);
- }
- }
-
- // Aggiornamento
- elseif (string_starts_with(post('op'), 'update')) {
- $query = 'SELECT `zz_field_record`.`id_field` FROM `zz_field_record` JOIN `zz_fields` ON `zz_fields`.`id` = `zz_field_record`.`id_field` WHERE id_record = '.prepare($id_record).' AND '.$custom_where;
- $customs_present = $dbo->fetchArray($query);
- $customs_present = array_column($customs_present, 'id_field');
-
- foreach ($values as $key => $value) {
- if (in_array($key, $customs_present)) {
- $dbo->update('zz_field_record', [
- 'value' => $value,
- ], [
- 'id_record' => $id_record,
- 'id_field' => $key,
- ]);
- } else {
- $dbo->insert('zz_field_record', [
- 'id_record' => $id_record,
- 'id_field' => $key,
- 'value' => $value,
- ]);
- }
- }
- }
- }
-
- // Eliminazione
- elseif (!empty($customs)) {
- $dbo->query('DELETE FROM `zz_field_record` WHERE `id_record` = '.prepare($id_record).' AND `id_field` IN ('.implode(',', array_column($customs, 'id')).')');
- }
- }
- }
-}
-
-$database->commitTransaction();
diff --git a/add.php b/add.php
deleted file mode 100755
index e946ce2ba..000000000
--- a/add.php
+++ /dev/null
@@ -1,105 +0,0 @@
-.
- */
-
-include_once __DIR__.'/core.php';
-
-// Inclusione elementi fondamentali del modulo
-include base_dir().'/actions.php';
-
-// Controllo dei permessi
-if (empty($id_plugin)) {
- Permissions::check('rw');
-}
-
-// Caricamento template
-echo '
-
-';
-
-include !empty(get('edit')) ? $structure->getEditFile() : $structure->getAddFile();
-
-echo '
-
';
-
-// Campi personalizzati
-echo '
-
-
-
-
-
- {( "name": "custom_fields", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "position": "top", "place": "add" )}
-
-
-
- {( "name": "custom_fields", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "position": "bottom", "place": "add" )}
-
-
-';
-
-if (isAjaxRequest()) {
- echo '
-';
-}
-
-echo '
-';
diff --git a/ajax.php b/ajax.php
deleted file mode 100755
index 8b82006f8..000000000
--- a/ajax.php
+++ /dev/null
@@ -1,171 +0,0 @@
-.
- */
-
-include_once __DIR__.'/core.php';
-
-use Models\Hook;
-
-switch (filter('op')) {
- // Imposta un valore ad un array di $_SESSION
- // esempio: push di un valore in $_SESSION['dashboard']['idtecnici']
- // iversed: specifica se rimuovere dall'array il valore trovato e applicare quindi una deselezione (valori 0 o 1, default 1)
- case 'session_set_array':
- $array = explode(',', get('session'));
- $value = "'".get('value')."'";
- $inversed = get('inversed');
-
- $found = false;
-
- // Ricerca valore nell'array
- foreach ($_SESSION[$array[0]][$array[1]] as $idx => $val) {
- // Se il valore esiste lo tolgo
- if ($val == $value) {
- $found = true;
-
- if ((int) $inversed == 1) {
- unset($_SESSION[$array[0]][$array[1]][$idx]);
- }
- }
- }
-
- if (!$found) {
- array_push($_SESSION[$array[0]][$array[1]], $value);
- }
-
- // print_r($_SESSION[$array[0]][$array[1]]);
-
- break;
-
- // Imposta un valore ad una sessione
- case 'session_set':
- $array = explode(',', get('session'));
- $value = get('value');
- $clear = get('clear');
-
- if ($clear == 1 || $value == '') {
- unset($_SESSION[$array[0]][$array[1]]);
- } else {
- $_SESSION[$array[0]][$array[1]] = $value;
- }
-
- break;
-
- case 'list_attachments':
- echo '{( "name": "filelist_and_upload", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "id_plugin": "'.$id_plugin.'" )}';
-
- break;
-
- case 'checklists':
- include base_dir().'/plugins/checks.php';
-
- break;
-
- case 'active_users':
- $posizione = get('id_module');
- if (isset($id_record)) {
- $posizione .= ', '.get('id_record');
- }
-
- $user = Auth::user();
- $interval = setting('Timeout notifica di presenza (minuti)') * 60 * 2;
-
- $dbo->query('UPDATE zz_semaphores SET updated = NOW() WHERE id_utente = :user_id AND posizione = :position', [
- ':user_id' => $user['id'],
- ':position' => $posizione,
- ]);
-
- // Rimozione record scaduti
- $dbo->query('DELETE FROM zz_semaphores WHERE DATE_ADD(updated, INTERVAL :interval SECOND) <= NOW()', [
- ':interval' => $interval,
- ]);
-
- $datas = $dbo->fetchArray('SELECT DISTINCT username FROM zz_semaphores INNER JOIN zz_users ON zz_semaphores.id_utente=zz_users.id WHERE zz_semaphores.id_utente != :user_id AND posizione = :position', [
- ':user_id' => $user['id'],
- ':position' => $posizione,
- ]);
-
- echo json_encode($datas);
-
- break;
-
- case 'hooks':
- $hooks = Hook::all();
-
- $results = [];
- foreach ($hooks as $hook) {
- if ($hook->permission != '-') {
- $results[] = [
- 'id' => $hook->id,
- 'name' => $hook->name,
- ];
- }
- }
-
- echo json_encode($results);
-
- break;
-
- case 'hook-lock':
- $hook_id = filter('id');
- $hook = Hook::find($hook_id);
-
- $token = $hook->lock();
-
- echo json_encode($token);
-
- break;
-
- case 'hook-execute':
- $hook_id = filter('id');
- $token = filter('token');
- $hook = Hook::find($hook_id);
-
- $response = $hook->execute($token);
-
- echo json_encode($response);
-
- break;
-
- case 'hook-response':
- $hook_id = filter('id');
- $hook = Hook::find($hook_id);
-
- $response = $hook->response();
-
- echo json_encode($response);
-
- break;
-
- case 'flash':
- $response = flash()->getMessages();
-
- echo json_encode($response);
-
- break;
-
- case 'summable-results':
- $ids = post('ids') ?: [];
- $results = Util\Query::getSums($structure, [
- 'id' => $ids,
- ]);
-
- echo json_encode($results);
-
- break;
-}
diff --git a/ajax_complete.php b/ajax_complete.php
deleted file mode 100755
index f7eaad063..000000000
--- a/ajax_complete.php
+++ /dev/null
@@ -1,33 +0,0 @@
-.
- */
-
-include_once __DIR__.'/core.php';
-
-if (!isset($resource)) {
- $module = get('module');
- $op = get('op');
-
- $result = AJAX::complete($op);
-
- echo $result;
-}
-
-// Casi particolari
-else {
-}
diff --git a/ajax_dataload.php b/ajax_dataload.php
deleted file mode 100755
index bda5e6f45..000000000
--- a/ajax_dataload.php
+++ /dev/null
@@ -1,204 +0,0 @@
-.
- */
-
-include_once __DIR__.'/core.php';
-
-use Util\Query;
-
-// Informazioni fondamentali
-$columns = (array) filter('columns');
-$order = filter('order') ? filter('order')[0] : [];
-$draw_numer = intval(filter('draw'));
-
-if (!empty(filter('order'))) {
- $order['column'] = $order['column'] - 1;
-}
-array_shift($columns);
-
-$total = Util\Query::readQuery($structure);
-
-// Ricerca
-$search = [];
-for ($i = 0; $i < count($columns); ++$i) {
- if (!empty($columns[$i]['search']['value']) || $columns[$i]['search']['value'] == '0') {
- $search[$total['fields'][$i]] = $columns[$i]['search']['value'];
- }
-}
-
-$limit = [
- 'start' => filter('start'),
- 'length' => filter('length'),
-];
-
-// Predisposizione della risposta
-$results = [
- 'data' => [],
- 'recordsTotal' => 0,
- 'recordsFiltered' => 0,
- 'summable' => [],
- 'draw' => $draw_numer,
-];
-
-$query = Query::getQuery($structure);
-if (!empty($query)) {
- // CONTEGGIO TOTALE
- $results['recordsTotal'] = $dbo->fetchNum($query);
-
- // RISULTATI VISIBILI
- $query = Query::getQuery($structure, $search, $order, $limit);
-
- // Filtri derivanti dai permessi (eventuali)
- if (empty($id_plugin)) {
- $query = Modules::replaceAdditionals($id_module, $query);
- }
-
- // Conteggio dei record filtrati
- $data = Query::executeAndCount($query);
- $rows = $data['results'];
- $results['recordsFiltered'] = $data['count'];
-
- // SOMME
- $results['summable'] = Util\Query::getSums($structure, $search);
-
- // Allineamento delle righe
- $align = [];
- $row = isset($rows[0]) ? $rows[0] : [];
- foreach ($row as $field => $value) {
- $value = trim($value);
-
- // Allineamento a destra se il valore della prima riga risulta numerica
- if (is_numeric($value) && formatter()->isStandardNumber($value)) {
- $align[$field] = 'text-right';
- }
-
- // Allineamento al centro se il valore della prima riga risulta relativo a date o icone
- elseif (formatter()->isStandardDate($value) || preg_match('/^icon_(.+?)$/', $field)) {
- $align[$field] = 'text-center';
- }
- }
-
- // Creazione della tabella
- foreach ($rows as $i => $r) {
- // Evitare risultati con ID a null
- // Codice non applicabile in ogni caso: sulla base dei permessi, ID può non essere impostato
- /*
- if (empty($r['id'])) {
- continue;
- }*/
-
- $result = [
- 'id' => $r['id'],
- ' ', // Colonna ID
- ];
-
- foreach ($total['fields'] as $pos => $field) {
- $column = [];
-
- if (!empty($r['_bg_'])) {
- $column['data-background'] = $r['_bg_'];
- }
-
- // Allineamento
- if (!empty($align[$field])) {
- $column['class'] = $align[$field];
- }
-
- $value = trim($r[$field]);
-
- // Formattazione automatica
- if (!empty($total['format'][$pos]) && !empty($value)) {
- if (formatter()->isStandardTimestamp($value)) {
- $value = Translator::timestampToLocale($value);
- } elseif (formatter()->isStandardDate($value)) {
- $value = Translator::dateToLocale($value);
- } elseif (formatter()->isStandardTime($value)) {
- $value = Translator::timeToLocale($value);
- } elseif (formatter()->isStandardNumber($value)) {
- $value = Translator::numberToLocale($value);
- }
- }
-
- // Icona
- if (preg_match('/^color_(.+?)$/', $field, $m)) {
- $value = isset($r['color_title_'.$m[1]]) ? $r['color_title_'.$m[1]] : '';
-
- $column['class'] = 'text-center small';
- $column['data-background'] = $r[$field];
- }
-
- // Icona di stampa
- elseif ($field == '_print_') {
- $print = $r['_print_'];
-
- $print_url = Prints::getHref($print, $r['id']);
-
- $value = ' ';
- }
-
- // Icona
- elseif (preg_match('/^icon_(.+?)$/', trim($field), $m)) {
- $value = ' '.$r['icon_title_'.$m[1]].' ';
- }
-
- // Colore del testo
- if (!empty($column['data-background'])) {
- $column['data-color'] = isset($column['data-color']) ? $column['data-color'] : color_inverse(trim($column['data-background']));
- }
-
- // Link della colonna
- if ($field != '_print_') {
- $id_record = $r['id'];
- $hash = '';
-
- $id_module = !empty($r['_link_module_']) ? $r['_link_module_'] : $id_module;
- if (!empty($r['_link_record_'])) {
- $id_record = $r['_link_record_'];
- $hash = !empty($r['_link_hash_']) ? '#'.$r['_link_hash_'] : '';
- unset($id_plugin);
- }
-
- // Link per i moduli
- if (empty($id_plugin)) {
- $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_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';
- }
- }
-
- $attributes = [];
- foreach ($column as $key => $val) {
- $val = is_array($val) ? implode(' ', $val) : $val;
- $attributes[] = $key.'="'.$val.'"';
- }
-
- // Replace base_link() per le query
- $value = str_replace('base_link()', base_path(), $value);
- $result[] = str_replace('|attr|', implode(' ', $attributes), ''.$value.'
');
- }
-
- $results['data'][] = $result;
- }
-}
-
-$json = json_encode($results);
-echo $json;
diff --git a/ajax_search.php b/ajax_search.php
deleted file mode 100755
index 2858b8221..000000000
--- a/ajax_search.php
+++ /dev/null
@@ -1,39 +0,0 @@
-.
- */
-
-include_once __DIR__.'/core.php';
-
-if (!isset($term)) {
- /*
- == Super search ==
- Ricerca di un termine su tutti i moduli.
- Il risultato è in json
- */
-
- $term = get('term');
- $term = str_replace('/', '\\/', $term);
-
- $results = AJAX::search($term);
-
- echo json_encode($results);
-}
-
-// Casi particolari
-else {
-}
diff --git a/ajax_select.php b/ajax_select.php
deleted file mode 100755
index 03932f48c..000000000
--- a/ajax_select.php
+++ /dev/null
@@ -1,46 +0,0 @@
-.
- */
-
-include_once __DIR__.'/core.php';
-
-if (!isset($resource)) {
- $op = empty($op) ? filter('op') : $op;
- $search = filter('search');
- $page = filter('page') ?: 0;
- $length = filter('length') ?: 100;
-
- // Opzioni di selezione sugli elementi
- $options = filter('options') ?: [];
- $options_compatibility = session_get('superselect', []);
- $options = array_merge($options_compatibility, $options);
-
- // Preselezione su $elements dichiarato da file precedente
- if (!isset($elements)) {
- $elements = [];
- }
- $elements = (!is_array($elements)) ? explode(',', $elements) : $elements;
-
- $results = AJAX::select($op, $elements, $search, $page, $length, $options);
-
- echo json_encode($results);
-}
-
-// Casi particolari
-else {
-}
diff --git a/api/index.php b/api/index.php
deleted file mode 100755
index fd5ef0b00..000000000
--- a/api/index.php
+++ /dev/null
@@ -1,69 +0,0 @@
-.
- */
-
-use API\Response;
-
-function serverError()
-{
- $error = error_get_last();
- if ($error['type'] == E_ERROR) {
- ob_end_clean();
- echo Response::error('serverError');
- }
-}
-
-// Gestione degli errori
-set_error_handler('serverError');
-register_shutdown_function('serverError');
-
-include_once __DIR__.'/../core.php';
-
-// Disabilita la sessione per l'API
-session_write_close();
-
-// Permesso di accesso all'API da ogni dispositivo
-header('Access-Control-Allow-Origin: *');
-header('Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS');
-
-try {
- $response = Response::manage();
-} catch (Exception $e) {
- // Log dell'errore
- $logger = logger();
- $logger->addRecord(\Monolog\Logger::ERROR, $e);
-
- $response = Response::error('serverError');
-}
-
-// Richiesta OPTIONS (controllo da parte del dispositivo)
-if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
- $response = Response::error('ok');
-}
-
-json_decode($response);
-
-// Impostazioni di Content-Type e Charset Header
-if (json_last_error() == JSON_ERROR_NONE) {
- header('Content-Type: application/json; charset=UTF-8');
-} else {
- header('Content-Type: text/plain; charset=UTF-8');
-}
-
-// Stampa dei risultati
-echo $response;
diff --git a/artisan b/artisan
new file mode 100644
index 000000000..67a3329b1
--- /dev/null
+++ b/artisan
@@ -0,0 +1,53 @@
+#!/usr/bin/env php
+make(Illuminate\Contracts\Console\Kernel::class);
+
+$status = $kernel->handle(
+ $input = new Symfony\Component\Console\Input\ArgvInput,
+ new Symfony\Component\Console\Output\ConsoleOutput
+);
+
+/*
+|--------------------------------------------------------------------------
+| Shutdown The Application
+|--------------------------------------------------------------------------
+|
+| Once Artisan has finished running, we will fire off the shutdown events
+| so that any final work may be done by the application before we shut
+| down the process. This is the last thing to happen to the request.
+|
+*/
+
+$kernel->terminate($input, $status);
+
+exit($status);
diff --git a/assets/src/css/datatables.css b/assets/src/css/datatables.css
deleted file mode 100755
index 277a89911..000000000
--- a/assets/src/css/datatables.css
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/*!
- * DataTables + Font Awesome integration
- * License: MIT - http://datatables.net/license
- */
-
-
-/*
- * Sort styling
- */
-
-table.dataTable thead th {
- position: relative;
- background-image: none !important;
- /* Remove the DataTables bootstrap integration styling */
-}
-
-table.dataTable thead th.sorting:after,
-table.dataTable thead th.sorting_asc:after,
-table.dataTable thead th.sorting_desc:after {
- position: absolute;
- top: 12px;
- right: 8px;
- display: block;
- font-family: FontAwesome;
-}
-
-table.dataTable thead th.sorting:after {
- content: "\f0dc";
- color: #ddd;
- font-size: 0.8em;
- padding-top: 0.12em;
-}
-
-table.dataTable thead th.sorting_asc:after {
- content: "\f0de";
-}
-
-table.dataTable thead th.sorting_desc:after {
- content: "\f0dd";
-}
-
-div.dataTables_scrollBody table.dataTable thead th.sorting:after,
-div.dataTables_scrollBody table.dataTable thead th.sorting_asc:after,
-div.dataTables_scrollBody table.dataTable thead th.sorting_desc:after {
- content: "";
-}
-
-
-/* In Bootstrap and Foundation the padding top is a little different from the DataTables stylesheet */
-
-table.table thead th.sorting:after,
-table.table thead th.sorting_asc:after,
-table.table thead th.sorting_desc:after {
- top: 8px;
-}
-
-
-/*
- * DataTables style pagination controls
- */
-
-div.dataTables_paginate a.paginate_button.first,
-div.dataTables_paginate a.paginate_button.previous {
- position: relative;
- padding-left: 24px;
-}
-
-div.dataTables_paginate a.paginate_button.next,
-div.dataTables_paginate a.paginate_button.last {
- position: relative;
- padding-right: 24px;
-}
-
-div.dataTables_paginate a.first:before,
-div.dataTables_paginate a.previous:before {
- position: absolute;
- top: 8px;
- left: 10px;
- display: block;
- font-family: FontAwesome;
-}
-
-div.dataTables_paginate a.next:after,
-div.dataTables_paginate a.last:after {
- position: absolute;
- top: 8px;
- right: 10px;
- display: block;
- font-family: FontAwesome;
-}
-
-div.dataTables_paginate a.first:before {
- content: "\f100";
-}
-
-div.dataTables_paginate a.previous:before {
- content: "\f104";
-}
-
-div.dataTables_paginate a.next:after {
- content: "\f105";
-}
-
-div.dataTables_paginate a.last:after {
- content: "\f101";
-}
-
-
-/*
- * Bootstrap and foundation style pagination controls
- */
-
-div.dataTables_paginate li.first > a,
-div.dataTables_paginate li.previous > a {
- position: relative;
- padding-left: 24px;
-}
-
-div.dataTables_paginate li.next > a,
-div.dataTables_paginate li.last > a {
- position: relative;
- padding-right: 24px;
-}
-
-div.dataTables_paginate li.first a:before,
-div.dataTables_paginate li.previous a:before {
- position: absolute;
- top: 6px;
- left: 10px;
- display: block;
- font-family: FontAwesome;
-}
-
-div.dataTables_paginate li.next a:after,
-div.dataTables_paginate li.last a:after {
- position: absolute;
- top: 6px;
- right: 10px;
- display: block;
- font-family: FontAwesome;
-}
-
-div.dataTables_paginate li.first a:before {
- content: "\f100";
-}
-
-div.dataTables_paginate li.previous a:before {
- content: "\f104";
-}
-
-div.dataTables_paginate li.next a:after {
- content: "\f105";
-}
-
-div.dataTables_paginate li.last a:after {
- content: "\f101";
-}
-
-
-/* In Foundation we don't want the padding like in bootstrap */
-
-div.columns div.dataTables_paginate li.first a:before,
-div.columns div.dataTables_paginate li.previous a:before,
-div.columns div.dataTables_paginate li.next a:after,
-div.columns div.dataTables_paginate li.last a:after {
- top: 0;
-}
-
-
-/* Fix for Scroller plugin */
-
-div.DTS {
- display: block !important;
-}
-
-div.DTS tbody td {
- white-space: normal;
-}
-
-div.DTS div.DTS_Loading {
- z-index: 1;
-}
-
-div.DTS div.dataTables_scrollBody {
- background: none;
-}
-
-div.DTS div.dataTables_scrollBody table {
- z-index: 2;
-}
-
-div.DTS div.dataTables_paginate,
-div.DTS div.dataTables_length {
- display: none;
-}
-
-
-/* Custom */
-
-div.dataTables_wrapper {
- min-height: 150px;
-}
-
-.dataTables_filter input {
- display: inline-block;
- border-radius: 0px !important;
- box-shadow: none;
- height: 34px;
- padding: 6px 12px;
- font-size: 14px;
- line-height: 1.42857;
- vertical-align: middle;
- background-color: #FFF;
- background-image: none;
- border: 1px solid #CCC;
- transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
-}
-
-.dataTables_info .select-info {
- display: none;
-}
diff --git a/assets/src/css/print/print.css b/assets/src/css/print/print.css
deleted file mode 100755
index aa0b4e68c..000000000
--- a/assets/src/css/print/print.css
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-input,
-button,
-.btn,
-header,
-.main-sidebar,
-.main-footer,
-#widget-controller_top,
-#widget-controller_right,
-.daterangepicker,
-.datepicker,
-#main-records_filter,
-.extra-info,
-.deleteicon,
-.fa.deleteicon::after,
-.fa.deleteicon::before,
-.hide,
-#back-to-top {
- display: none;
-}
-
-td {
- border: 1px solid #ccc;
-}
-
-th {
- background: #333;
- color: #fff;
- text-align: left;
- padding: 4px;
-}
-
-nav {
- float: left;
-}
-
-ul {
- margin: 0;
- padding: 0;
-}
-
-li.header i {
- display: none;
-}
-
-li.header {
- list-style: none;
- margin: 10px 0;
- padding: 0;
-}
-
-li.header > a {
- font-size: 30px;
- text-decoration: none;
- font-weight: bold;
- color: #333;
- text-align: left;
- float: left;
-}
-
-.table {
- width: 100%;
-}
-
-.text-right {
- text-align: right;
-}
-
-.pull-left {
- float: left;
- text-align: left;
-}
-
-#totali_colonne td {
- background: #eee;
-}
-
-#totali_colonne td big {
- font-size: 22px;
-}
-
-.li-widget, .nav-tabs, .dataTables_info, tfoot, #th_selector, td.select-checkbox, th.search.sorting {
- display: none !important;
-}
-
-a[href]:after {
- content: none !important;
-}
diff --git a/assets/src/css/style.css b/assets/src/css/style.css
deleted file mode 100755
index 09ed1aead..000000000
--- a/assets/src/css/style.css
+++ /dev/null
@@ -1,1098 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-*:focus {
- outline: none;
-}
-
-@font-face {
- font-family: 'OpenSansRegular';
- src: url('../fonts/opensans-regular-webfont.eot');
- src: url('../fonts/opensans-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/opensans-regular-webfont.woff') format('woff'), url('../fonts/opensans-regular-webfont.ttf') format('truetype'), url('../fonts/opensans-regular-webfont.svg#OpenSansRegular') format('svg');
- font-weight: normal;
- font-style: normal;
-}
-
-html,
-body {
- font-family: 'Open Sans', sans-serif;
-}
-
-html {
- height: 100%;
-}
-
-textarea {
- resize: vertical;
-}
-
-a.disabled {
- pointer-events: none;
- cursor: default;
- opacity: 0.6;
-}
-
-#progress {
- margin: auto;
- position: relative;
- display: none;
-}
-
-#progress .progress-bar {
- background-image: url(../img/progress.gif);
-}
-
-#progress .progress-bar span {
- position: absolute;
- top: 2px;
- left: 47%;
- color: #a20;
- font-weight: bold;
-}
-
-input[type=file] {
- height: initial;
- margin-bottom: 5px;
-}
-
-#datetime {
- font-size: 11px;
- font-weight: normal;
- color: #aaa;
- margin: 8px 0 0 0;
-}
-
-.ui-menu {
- position: fixed;
-}
-
-.autocomplete, .ui-autocomplete {
- background: white;
- z-index: 10000;
- min-width: 160px;
- padding: 10px;
- margin: 2px;
- list-style: none;
- border-style: solid;
- border-width: 1px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
-}
-
-.autocomplete .group, .ui-autocomplete-category {
- font-size: 1.5em;
- background: inherit;
-}
-
-.autocomplete > div {
- padding: 5px;
-}
-
-.highlight {
- background: #FFFF66;
-}
-
-.autocomplete > div:hover:not(.group),
-.autocomplete > div.selected {
- background: #F5F5F5;
- cursor: pointer;
-}
-
-.ui-autocomplete-scrollable {
- max-height: 80vh;
- width: 600px;
- overflow-y: auto;
- overflow-x: hidden;
-}
-
-.ui-autocomplete a {
- color: inherit;
-}
-
-.square {
- width: 24px;
- height: 24px;
- margin: auto;
-}
-
-.content {
- padding: 20px 15px;
-}
-
-.navbar a:hover,
-.logo:hover {
- text-decoration: none
-}
-
-.no-padding {
- padding: 0 0px;
-}
-
-.box-center {
- width: 600px;
- margin: 7% auto
-}
-
-.box-center-large {
- width: 850px;
- margin: 7% auto
-}
-
-.box-center .box-body,
-.box-center-large .box-body {
- padding: 20px;
- border-top: 0
-}
-
-.li-widget a:hover {
- text-decoration: none;
-}
-
-.clickable {
- cursor: pointer;
-}
-
-#main_loading {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: #555;
- z-index: 9999;
- text-align: center;
- opacity: 0.9;
- -moz-opacity: 0.9;
- filter: alpha(opacity=90);
-}
-
-#main_loading > div {
- position: relative;
- top: 50%;
- color: #333;
-}
-
-#main_loading > div > i {
- font-size: 300px;
- margin-top: -150px;
- color: #e24e1e;
-}
-
-#mini-loader {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 9000;
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, 0.15);
-}
-
-#mini-loader > div {
- position: absolute;
- bottom: 50%;
- left: 50%;
- width: 100px;
- height: 100px;
- margin-top: -50px;
- margin-left: -50px;
- background: transparent url(../img/ajax-loader.gif) top left no-repeat;
-}
-
-#tiny-loader {
- position: fixed;
- z-index: 9000;
- width: 100%;
- height: 100%;
- top: 50%;
- left: 50%;
- background: transparent url(../img/ajax-loader.gif) top left no-repeat;
-}
-
-body .header .logo {
- font-family: inherit;
-}
-
-.btn-github {
- color: #ffffff !important;
- background-color: #444444 !important;
- border-color: rgba(0, 0, 0, 0.2) !important;
-}
-
-.navbar-custom-menu > ul > li > a:hover,
-.navbar-custom-menu > ul > li > a:focus,
-.navbar-custom-menu > ul > li > a:active {
- filter: brightness(75%);
-}
-
-.btn-github:active,
-.btn-github.active,
-.open .dropdown-toggle.btn-github {
- background-image: none;
-}
-
-.btn-github.disabled,
-.btn-github[disabled],
-fieldset[disabled] .btn-github,
-.btn-github.disabled:hover,
-.btn-github[disabled]:hover,
-fieldset[disabled] .btn-github:hover,
-.btn-github.disabled:focus,
-.btn-github[disabled]:focus,
-fieldset[disabled] .btn-github:focus,
-.btn-github.disabled:active,
-.btn-github[disabled]:active,
-fieldset[disabled] .btn-github:active,
-.btn-github.disabled.active,
-.btn-github[disabled].active,
-fieldset[disabled] .btn-github.active {
- background-color: #444444;
- border-color: rgba(0, 0, 0, 0.2);
-}
-
-.btn-github .badge {
- color: #444444;
- background-color: #ffffff;
-}
-
-span.form-control {
- background: transparent;
- border: none;
-}
-
-.panel-heading.mini {
- padding: 5px 8px;
-}
-
-.dropdown.col-md-3 > .dropdown-menu {
- width: 91.5%;
- left: 15px;
- padding: 5px;
-}
-
-.input-group-addon {
- padding: 0px 12px;
-}
-
-.colorpicker {
- margin-top: 0;
-}
-
-#pulsanti.affix {
- top: 0;
- padding: 10px 0;
- width: 100%;
- z-index: 800;
- background: #fff;
- border-bottom: 3px solid #ddd;
-}
-
-
-/* Aggiustamenti per i widget */
-
-.widget li {
- margin-left: 0;
- list-style-type: none;
-}
-
-.widget {
- padding: 0;
- margin-bottom: 0;
-}
-
-.widget.bordered {
- border: 6px dashed #aaa;
- margin: 10px;
- min-height: 200px;
- padding: 4px;
-}
-
-.close {
- padding-right: 5px;
- position: relative;
- z-index: 1;
- opacity: 0.4;
-}
-
-.close:focus,
-.close:hover {
- opacity: 0.8;
-}
-
-.li-widget button.close:hover,
-.li-widget button.close:focus {
- opacity: 0.3;
-}
-
-.li-widget button.close {
- padding-right: 5px;
- opacity: 0.1;
-}
-
-
-/* Tooltip dark */
-
-.ui-tooltip {
- background: #222;
- color: white;
- border: 0;
- font-size: 11px;
-}
-
-.nav-tabs-custom > .nav-tabs.pull-right > li > a.back-btn {
- font-size: 12px;
- color: #FFFFFF;
-}
-
-.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a,
-.navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a,
-.navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a {
- white-space: normal;
-}
-
-.nav-tabs-custom > .nav-tabs.pull-right > li > a.back-btn:hover {
- cursor: pointer;
- color: #72AFD2;
-}
-
-.input-searching {
- background: #FFBF91;
-}
-
-.deleteicon:hover {
- color: black;
-}
-
-.deleteicon {
- color: gray;
- width: 30px;
- height: 30px;
- position: absolute;
- margin-left: -30px;
- bottom: 7px;
- right: 17px;
- float: right;
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.input-group-addon {
- min-width: 40px;
-}
-
-.info-box-icon i {
- color: #fff;
-}
-
-.progress-description,
-.info-box-text {
- white-space: normal;
- overflow: auto;
- font-size: 12px;
-}
-
-.colorpicker,
-.colorpicker * {
- z-index: 9999
-}
-
-.signature-pad {
- width: 100%;
- height: 100%;
- font-size: 10px;
- border: 1px solid #e8e8e8;
- background-color: #fff;
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.08) inset;
- border-radius: 4px;
-}
-
-.signature-pad:before,
-.signature-pad:after {
- content: "";
- width: 40%;
- height: 10px;
- left: 20px;
- bottom: 10px;
- background: transparent;
- -webkit-transform: skew(-3deg) rotate(-3deg);
- -moz-transform: skew(-3deg) rotate(-3deg);
- -ms-transform: skew(-3deg) rotate(-3deg);
- -o-transform: skew(-3deg) rotate(-3deg);
- transform: skew(-3deg) rotate(-3deg);
- box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
-}
-
-.signature-pad:after {
- left: auto;
- right: 20px;
- -webkit-transform: skew(3deg) rotate(3deg);
- -moz-transform: skew(3deg) rotate(3deg);
- -ms-transform: skew(3deg) rotate(3deg);
- -o-transform: skew(3deg) rotate(3deg);
- transform: skew(3deg) rotate(3deg);
-}
-
-#canvas {
- width: 100%;
- height: 100%;
- min-height: 202px;
- border-radius: 4px;
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.02) inset;
-}
-
-.sidebar-menu li > a > .pull-right-container {
- position: absolute;
- padding: 12px;
- right: 10px;
- top: 50%;
- margin-top: -19px;
-}
-
-.sidebar-form {
- border-radius: 3px;
- margin: 10px 10px;
-}
-
-.sidebar-form input[type="text"],
-.sidebar-form .btn {
- border: 1px;
- height: 35px;
- -webkit-transition: all 0.3s ease-in-out;
- -o-transition: all 0.3s ease-in-out;
- transition: all 0.3s ease-in-out;
-}
-
-.sidebar-form input[type="text"] {
- border-top-left-radius: 2px;
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 2px;
-}
-
-.sidebar-form .btn {
- border-top-left-radius: 0;
- border-top-right-radius: 2px;
- border-bottom-right-radius: 2px;
- border-bottom-left-radius: 0;
-}
-
-.swal2-buttonswrapper .btn {
- margin: 5px;
-}
-
-
-/* Personalizzazione del plugin Select2 */
-
-.select2-search,
-.select2-search__field {
- width: 100% !important
-}
-
-.select2-results__option[aria-selected=true] {
- display: none
-}
-
-.select2-container--bootstrap .select2-selection--multiple .select2-selection__choice {
- margin: 2px 0 0 2px;
-}
-
-.select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
- padding: 4px;
-}
-
-.input-group-addon.no-padding {
- border: 0px;
-}
-
-.input-group-addon.no-padding > * {
- border-radius: 0px;
-}
-
-div.DTS tbody td,
-div.DTS tbody th {
- max-width: 500px;
-}
-
-input.min-width {
- min-width: 200px;
-}
-
-input.small-width {
- min-width: 100px;
-}
-
-.pac-container {
- z-index: 1100;
-}
-
-.form-control#blob {
- height: auto;
-}
-
-@media (max-width: 480px) {
- #main_loading > div > i {
- font-size: 160px;
- margin-top: -80px;
- }
-}
-
-@media screen and (max-width: 767px) {
- .navbar-left {
- display: none;
- }
-
- .box-center,
- .box-center-large {
- width: 90%;
- margin-top: 20px
- }
-
- .main-header .logo {
- display: none;
- }
-
- /*
- .content-wrapper,
- .right-side,
- .left-side,
- .main-sidebar {
- padding-top: 50px;
- }*/
-}
-
-@media screen and (min-width: 768px) and (max-width: 1024px) {
- .signature-pad {
- margin: 10%;
- }
-}
-
-@media screen and (max-width: 992px) {
- .table-bordered > thead > tr > th,
- .table-bordered > tbody > tr > th,
- .table-bordered > tfoot > tr > th,
- .table-bordered > thead > tr > td,
- .table-bordered > tbody > tr > td,
- .table-bordered > tfoot > tr > td {
- word-break: break-all;
- }
-}
-
-@media screen and (max-width: 1024px) {
- .push {
- position: static;
- }
-
- .signature-pad {
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- width: auto;
- height: auto;
- min-width: 250px;
- min-height: 140px;
- margin: 5%;
- }
-}
-
-.callout a {
- text-decoration: none;
-}
-
-.dropdown-menu {
- min-width: 130px;
-}
-
-.img-circle.square {
- box-shadow: 0px 0px 1px 1px lightgray;
-}
-
-.select2-dropdown {
- z-index: 2000;
-}
-
-.after.input-group-addon .select2-selection,
-.after.input-group-addon {
- border-radius: 0px 4px 4px 0px;
- border-left: none;
-}
-
-.before.input-group-addon .select2-selection,
-.before.input-group-addon {
- border-radius: 4px 0px 0px 4px;
- border-right: none;
-}
-
-.hide-it-off-screen {
- position: absolute;
- left: -10000px;
- top: -10000px;
-}
-
-.box-info ul > li > :last-child {
- margin-bottom: 5px;
-}
-
-.row {
- overflow-wrap: break-word;
- word-wrap: break-word;
- -ms-word-break: break-all;
- word-break: break-all;
- word-break: break-word;
- -ms-hyphens: auto;
- -moz-hyphens: auto;
- -webkit-hyphens: auto;
- hyphens: auto;
-}
-
-.request .morelink {
- color: #fff;
- font-weight: bold;
-}
-
-.component-loader {
- position: absolute;
- z-index: 20;
- opacity: 0.5;
- width: 100%;
- height: 100%;
- background: #fff;
-}
-
-.component-loader > div {
- position: relative;
- top: 50%;
- color: #333;
-}
-
-.btn-group-flex {
- display: flex;
-}
-
-.btn-group-flex .btn {
- flex: 1
-}
-
-@media (min-width: 1140px) {
- .modal-lg {
- width: 60vw;
- }
-}
-
-
-/* Interventi da pianificare in Dashboard */
-
-#external-events .fc-event {
- margin-top: 10px;
- padding: 10px;
- cursor: pointer;
-}
-
-.fc-event-primary {
- background-color: #3a87ad;
- border: 1px solid #3a87ad;
-}
-
-.fc-event-danger {
- background-color: #dd4b46;
- border: 1px solid #dd4b46;
-}
-
-
-/* Fix per tabs editor */
-
-.nav-tabs-custom > .nav-tabs > li {
- border-top: 3px solid #ddd;
-}
-
-.nav-tabs-custom > .nav-tabs.pull-right > li:first-of-type.active > a {
- border-right-color: #f4f4f4;
- border-right-width: 1px;
- border-left-width: 0px;
-}
-
-.nav-tabs-custom > .nav-tabs > li.header {
- padding: 0px;
-}
-
-.nav-tabs-custom > .nav-tabs > li {
- margin-bottom: -1px;
- margin-right: 0px;
-}
-
-.ui-autocomplete {
- background: #f6f6f6;
- border-color: #ccc;
- border-color: rgba(0, 0, 0, 0.2);
- -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -webkit-background-clip: padding-box;
- -moz-background-clip: padding;
- background-clip: padding-box;
-}
-
-.parsley-errors-list {
- color: red;
-}
-
-
-/** TIMELINE */
-
-.timeline {
- list-style: none;
- padding: 20px 0 20px;
- position: relative;
-}
-
-.timeline:before {
- top: 0;
- bottom: 0;
- position: absolute;
- content: " ";
- width: 3px;
- background-color: #eeeeee;
- left: 50%;
- margin-left: -4.5px;
-}
-
-.timeline > li {
- margin-bottom: 20px;
- position: relative;
-}
-
-.timeline > li:before,
-.timeline > li:after {
- content: " ";
- display: table;
-}
-
-.timeline > li:after {
- clear: both;
-}
-
-.timeline > li:before,
-.timeline > li:after {
- content: " ";
- display: table;
-}
-
-.timeline > li:after {
- clear: both;
-}
-
-.timeline > li > .timeline-panel {
- width: 50%;
- float: left;
- border: 1px solid #d4d4d4;
- border-radius: 2px;
- padding: 20px;
- position: relative;
- -webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
- box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
-}
-
-.timeline > li.timeline-inverted + li:not(.timeline-inverted),
-.timeline > li:not(.timeline-inverted) + li.timeline-inverted {
- margin-top: -60px;
-}
-
-.timeline > li:not(.timeline-inverted) {
- padding-right: 90px;
-}
-
-.timeline > li.timeline-inverted {
- padding-left: 90px;
-}
-
-.timeline > li > .timeline-panel:before {
- position: absolute;
- top: 26px;
- right: -15px;
- display: inline-block;
- border-top: 15px solid transparent;
- border-left: 15px solid #ccc;
- border-right: 0 solid #ccc;
- border-bottom: 15px solid transparent;
- content: " ";
-}
-
-.timeline > li > .timeline-panel:after {
- position: absolute;
- top: 27px;
- right: -14px;
- display: inline-block;
- border-top: 14px solid transparent;
- border-left: 14px solid #fff;
- border-right: 0 solid #fff;
- border-bottom: 14px solid transparent;
- content: " ";
-}
-
-.timeline > li > .timeline-badge {
- color: #fff;
- width: 50px;
- height: 50px;
- line-height: 50px;
- font-size: 1.4em;
- text-align: center;
- position: absolute;
- top: 16px;
- left: 50%;
- margin-left: -25px;
- background-color: #999999;
- z-index: 100;
- border-top-right-radius: 50%;
- border-top-left-radius: 50%;
- border-bottom-right-radius: 50%;
- border-bottom-left-radius: 50%;
-}
-
-.timeline > li.timeline-inverted > .timeline-panel {
- float: right;
-}
-
-.timeline > li.timeline-inverted > .timeline-panel:before {
- border-left-width: 0;
- border-right-width: 15px;
- left: -15px;
- right: auto;
-}
-
-.timeline > li.timeline-inverted > .timeline-panel:after {
- border-left-width: 0;
- border-right-width: 14px;
- left: -14px;
- right: auto;
-}
-
-.timeline-badge.primary {
- background-color: #2e6da4 !important;
-}
-
-.timeline-badge.success {
- background-color: #3f903f !important;
-}
-
-.timeline-badge.warning {
- background-color: #f0ad4e !important;
-}
-
-.timeline-badge.danger {
- background-color: #d9534f !important;
-}
-
-.timeline-badge.info {
- background-color: #5bc0de !important;
-}
-
-.timeline-title {
- margin-top: 0;
- color: inherit;
-}
-
-.timeline-body > p,
-.timeline-body > ul {
- margin-bottom: 0;
-}
-
-.timeline-body > p + p {
- margin-top: 5px;
-}
-
-
-/* Checklist */
-
-.todo-list ul {
- list-style: none;
- margin-left: 11px;
-}
-
-.progress .progress-bar span {
- color: #000;
-}
-
-.attachment-img {
- max-width: 20px;
- max-height: 20px;
-}
-
-.logo-image {
- max-width: 320px;
- max-height: 60px;
-}
-
-.has-feedback .form-control {
- padding-right: 6px;
-}
-
-.direct-chat-text img {
- max-width: 100%;
-}
-
-
-/* Dropzone */
-
-.dropzone {
- border: 2px dashed #337ab7;
- border-radius: 5px;
- background: white;
- margin-top: 10px;
-}
-
-.dropzone .dz-message {
- font-weight: 400;
-}
-
-.dropzone .dz-message .note {
- font-size: 0.8em;
- font-weight: 200;
- display: block;
- margin-top: 1.4rem;
-}
-
-
-/** Fix tooltip per elementi disabilitati. */
-
-div.tip {
- display: inline-block !important;
-}
-
-.disabled {
- pointer-events: none
-}
-
-
-/* Fancy checkbox: https://bootsnipp.com/snippets/M2bda */
-
-.checkbox-group input[type="checkbox"] {
- display: none;
-}
-
-.checkbox-group input[type="checkbox"] + .btn-group > label span {
- width: 20px;
-}
-
-.checkbox-group input[type="checkbox"] + .btn-group {
- width: 100%;
- display: flex;
- overflow: auto;
-}
-
-.checkbox-group input[type="checkbox"] + .btn-group label:last-child {
- flex-grow: 100;
-}
-
-.checkbox-group input[type="checkbox"] + .btn-group > label span:first-child {
- display: none;
-}
-
-.checkbox-group input[type="checkbox"] + .btn-group > label span:last-child {
- display: inline-block;
-}
-
-.checkbox-group input[type="checkbox"]:checked + .btn-group > label span:first-child {
- display: inline-block;
-}
-
-.checkbox-group input[type="checkbox"]:checked + .btn-group > label span:last-child {
- display: none;
-}
-
-
-/* Sidebar destra per i plugin */
-
-.control-sidebar {
- top: 50px;
-}
-
-.control-sidebar {
- padding-top: 10px;
-}
-
-@media screen and (min-width: 1140px) {
- .with-control-sidebar {
- margin-right: 230px;
- }
-
- .control-sidebar-open {
- right: 0;
- display: block !important;
- }
-
- .control-sidebar.control-sidebar-open,
- .control-sidebar.control-sidebar-open + .control-sidebar-bg {
- right: 0;
- }
-
- .control-sidebar-toggle {
- /*display: none !important;*/
- }
-}
-
-/* Fix stile */
-.skin-default .nav.navbar-nav li a {
- color: #FFFFFF;
-}
-
-.skin-default .nav.navbar-nav li a:hover {
- background: #222222;
-}
-
-.number-input {
- text-align: right;
-}
-
-/* Loading specificato per un div */
-.local-loader {
- position: relative;
- width: 100%;
- height: 0
-}
-
-.local-loader > div {
- position: absolute;
- top: 100px;
- z-index: 2;
- opacity: 0.5;
- width: 100%
-}
-
-.div-loading {
- opacity: 0.5;
-}
-
-/* Stile Fullcalendar per weekend */
-.fc-sat, .fc-sun {
- background-color: rgba(255, 99, 71, 0.6) !important;
-}
-
-.login-box .img-responsive {
- padding: 18px 0px 4px;
-}
-
-.no-selection {
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
diff --git a/assets/src/css/themes/default.css b/assets/src/css/themes/default.css
deleted file mode 100755
index 8f074dc2c..000000000
--- a/assets/src/css/themes/default.css
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-.skin-default .wrapper,
-.skin-default .main-sidebar,
-.skin-default .left-side {
- background: #333;
-}
-
-.skin-default.login-page .wrapper {
- background: #d2d6de;
-}
-
-.skin-default .content-wrapper,
-.skin-default .content {
- background: #f6f6f6;
-}
-
-.skin-default #supersearch {
- color: #eee;
-}
-
-.skin-default #supersearch:focus {
- color: #222;
-}
-
-.skin-default .inner {
- color: #eee;
-}
-
-.skin-default .nav-tabs-custom .nav-tabs li a {
- color: #3c8dbc;
-}
-
-.skin-default .nav-tabs-custom .nav-tabs li.active a {
- color: inherit;
-}
-
-.skin-default .nav-tabs-custom .nav-tabs.pull-right li a.back-btn {
- color: #3C8DBC;
-}
-
-.skin-default .nav-tabs-custom .nav-tabs.pull-right li a.back-btn:hover {
- color: #72AFD2;
-}
-
-.skin-default .main-header .navbar > span {
- color: #eee;
- background: #222;
- border: none;
-}
-
-.skin-default .main-header .navbar .nav > li > a
-.skin-default .main-header .navbar .nav > li > a:hover,
-.skin-default .main-header .navbar .nav > li > a:active,
-.skin-default .main-header .navbar .nav > li > a:focus,
-.skin-default .main-header .navbar .nav .open > a,
-.skin-default .main-header .navbar .nav .open > a:hover,
-.skin-default .main-header .navbar .nav .open > a:focus,
-.skin-default .main-header .navbar .nav .active a,
-.skin-default .main-header .navbar .nav .actual a,
-.skin-default .main-header .navbar .nav .menu-open a {
- background: rgba(0, 0, 0, 0.2);
- color: #f6f6f6;
-}
-
-.skin-default .main-header .navbar .sidebar-toggle,
-.skin-default .main-header .navbar .sidebar-toggle .icon-bar {
- color: #f6f6f6;
-}
-
-.skin-default .main-header .navbar .sidebar-toggle:hover {
- color: #f6f6f6;
- background: rgba(0, 0, 0, 0.2);
-}
-
-.skin-default .main-header .navbar .sidebar-toggle {
- color: #f6f6f6;
-}
-
-.skin-default .main-header .navbar .sidebar-toggle:hover {
- background: #222;
-}
-
-@media (max-width: 767px) {
- .skin-default .main-header .navbar .dropdown-menu li.divider {
- background: rgba(255, 255, 255, 0.1);
- }
-
- .skin-default .main-header .navbar .dropdown-menu li a {
- color: #f6f6f6;
- }
-
- .skin-default .main-header .navbar .dropdown-menu li a:hover {
- background: #222;
- }
-}
-
-.skin-default .main-header .navbar .sidebar-toggle .icon-bar {
- background: #f6f6f6;
-}
-
-.skin-default .main-header .logo {
- background: #222;
- color: #f6f6f6;
- border-bottom: 0 solid transparent;
-}
-
-.skin-default .main-header .logo:hover {
- background: #222;
-}
-
-.skin-default .main-header li.user-header {
- background: #222;
-}
-
-.skin-default .main-header a {
- text-decoration: none;
-}
-
-.skin-default .content-header {
- background: transparent;
-}
-
-.skin-default .user-panel .info,
-.skin-default .user-panel .info a {
- color: #f6f6f6;
-}
-
-.skin-default .sidebar-menu li.header {
- color: #4b646f;
- background: #222;
-}
-
-.skin-default .sidebar-menu li a {
- border-left: 3px solid transparent;
-}
-
-.skin-default .sidebar-menu li:hover a,
-.skin-default .sidebar-menu li.active a,
-.skin-default .sidebar-menu li.actual a,
-.skin-default .sidebar-menu li.menu-open a {
- background: #222;
- border-left-color: #222;
-}
-
-.skin-default .sidebar-menu li:hover > a,
-.skin-default .sidebar-menu li.actual > a {
- color: #f6f6f6;
-}
-
-.skin-default .sidebar-menu li .treeview-menu {
- margin: 0 1px;
- background: #222;
-}
-
-.skin-default .sidebar a {
- color: #f6f6f6;
-}
-
-.skin-default .sidebar a:hover {
- text-decoration: none;
-}
-
-.skin-default .treeview-menu li a {
- color: #f6f6f6;
-}
-
-.skin-default .sidebar-form {
- border-color: #222;
-}
-
-.skin-default .sidebar-form input[type="text"],
-.skin-default .sidebar-form .btn {
- box-shadow: none;
- background: #222;
- border-color: transparent;
-}
-
-.skin-default .sidebar-form input[type="text"] {
- color: #666;
-}
-
-.skin-default .sidebar-form input[type="text"]:focus,
-.skin-default .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
- background: #f6f6f6;
- color: #666;
-}
-
-.skin-default .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
- border-left-color: #f6f6f6;
-}
-
-.skin-default .sidebar-form .btn {
- color: #999;
-}
-
-.skin-default .main-sidebar li,
-.skin-default .main-sidebar li a {
- color: #ccc;
-}
-
-.skin-default .panel-primary .panel-heading {
- border-bottom: 2px solid #57a;
-}
-
-.skin-default .nav-button {
- background-color: #333;
-}
diff --git a/assets/src/img/ajax-loader.gif b/assets/src/img/ajax-loader.gif
deleted file mode 100755
index cc70a7a8b..000000000
Binary files a/assets/src/img/ajax-loader.gif and /dev/null differ
diff --git a/assets/src/img/favicon.png b/assets/src/img/favicon.png
deleted file mode 100755
index 63def4f30..000000000
Binary files a/assets/src/img/favicon.png and /dev/null differ
diff --git a/assets/src/img/help.png b/assets/src/img/help.png
deleted file mode 100755
index bb4ce6eac..000000000
Binary files a/assets/src/img/help.png and /dev/null differ
diff --git a/assets/src/img/logo.png b/assets/src/img/logo.png
deleted file mode 100755
index 8ac0d15fb..000000000
Binary files a/assets/src/img/logo.png and /dev/null differ
diff --git a/assets/src/img/progress.gif b/assets/src/img/progress.gif
deleted file mode 100755
index cb59a04f9..000000000
Binary files a/assets/src/img/progress.gif and /dev/null differ
diff --git a/assets/src/js/base/custom.js b/assets/src/js/base/custom.js
deleted file mode 100644
index 7c063fe71..000000000
--- a/assets/src/js/base/custom.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-// Aggiunta dell'ingranaggio all'unload della pagina
-$(window).on("beforeunload", function () {
- $("#main_loading").show();
-});
-
-// Rimozione dell'ingranaggio al caricamento completo della pagina
-$(window).on("load", function () {
- $("#main_loading").fadeOut();
-});
-
-// Fix multi-modal
-$(document).on('hidden.bs.modal', '.modal', function () {
- $(this).remove();
- $('.modal:visible').length && $(document.body).addClass('modal-open');
-});
-
-$(document).ready(function () {
- // Standard per i popup
- toastr.options = {
- "closeButton": true,
- "debug": false,
- "newestOnTop": false,
- "progressBar": true,
- "positionClass": "toast-top-right",
- //"preventDuplicates": true,
- "onclick": null,
- "showDuration": "300",
- "hideDuration": "1000",
- "timeOut": "12000",
- "extendedTimeOut": "8000",
- "showEasing": "swing",
- "hideEasing": "linear",
- "showMethod": "fadeIn",
- "hideMethod": "fadeOut"
- };
-
- // Imposta lo standard per la conversione dei numeri
- if (numeral.locales['current_locale'] === undefined) {
- numeral.register('locale', 'current_locale', {
- delimiters: {
- thousands: globals.thousands,
- decimal: globals.decimals,
- },
- abbreviations: {
- thousand: 'k',
- million: 'm',
- billion: 'b',
- trillion: 't'
- },
- currency: {
- symbol: '€'
- }
- });
- }
- numeral.locale('current_locale');
- numeral.defaultFormat('0,0.' + ('0').repeat(globals.cifre_decimali));
-
- // Richiamo alla generazione di Datatables
- start_datatables();
-
- // Calendario principale
- start_complete_calendar("#daterange", function (start, end) {
- // Esegue il submit del periodo selezionato e ricarica la pagina
- $.get(globals.rootdir + '/core.php?period_start=' + start.format('YYYY-MM-DD') + '&period_end=' + end.format('YYYY-MM-DD'), function (data) {
- location.reload();
- });
- });
-
- // Messaggi automatici di eliminazione
- $(document).on('click', '.ask', function () {
- message(this);
- });
-
- // Forza l'evento "blur" nei campi di testo per formattare i numeri con
- // jquery inputmask prima del submit
- setTimeout(function () {
- $('form').on('submit', function () {
- $('input').trigger('blur');
- });
- }, 1000);
-});
diff --git a/assets/src/js/base/datatables-buttons.js b/assets/src/js/base/datatables-buttons.js
deleted file mode 100644
index 9838dd939..000000000
--- a/assets/src/js/base/datatables-buttons.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-$(document).ready(function () {
- // Pulsanti di Datatables
- $(".btn-csv").off("click").on("click", function (e) {
- var table = $(document).find("#" + $(this).closest("[data-target]").data("target")).DataTable();
-
- table.buttons(0).trigger();
- });
-
- $(".btn-excel").off("click").on("click", function (e) {
- var table = $(document).find("#" + $(this).closest("[data-target]").data("target")).DataTable();
-
- table.buttons(3).trigger();
- });
-
- $(".btn-pdf").off("click").on("click", function (e) {
- var table = $(document).find("#" + $(this).closest("[data-target]").data("target")).DataTable();
-
- table.buttons(4).trigger();
- });
-
- $(".btn-copy").off("click").on("click", function (e) {
- var table = $(document).find("#" + $(this).closest("[data-target]").data("target")).DataTable();
-
- table.buttons(1).trigger();
- });
-
- $(".btn-print").off("click").on("click", function (e) {
- var table = $(document).find("#" + $(this).closest("[data-target]").data("target")).DataTable();
-
- table.buttons(2).trigger();
- });
-
- $(".btn-select-all").click(function () {
- var table_selector = "#" + $(this).closest("[data-target]").data("target");
- var wrapper = getTable(table_selector);
- var table = wrapper.datatable;
-
- // Visualizzazione del caricamento
- $("#main_loading").show();
-
- // Parametri della richiesta
- var params = table.ajax.params();
- params.length = -1;
-
- $.ajax({
- url: table.ajax.url(),
- data: params,
- type: 'GET',
- dataType: "json",
- success: function (response) {
- var row_ids = response.data.map(function (a) {
- return a.id;
- });
-
- // Chiamata di selezione completa
- wrapper.addSelectedRows(row_ids);
- table.clear().draw();
-
- $("#main_loading").hide();
- }
- })
- });
-
- $(".btn-select-none").click(function () {
- var table_selector = "#" + $(this).closest("[data-target]").data("target");
- var wrapper = getTable(table_selector);
- var table = wrapper.datatable;
-
- // Chiamata di deselezione completa
- var row_ids = wrapper.getSelectedRows();
- wrapper.removeSelectedRows(row_ids);
- table.clear().draw();
- });
-
- $(document).on("click", ".select-checkbox", function () {
- var row = $(this).parent();
- var row_id = row.attr("id");
-
- var table_selector = $(this).closest(".dataTable");
- var wrapper = getTable(table_selector);
-
- if (row.hasClass("selected")) {
- //table.datatable.rows("#" + row_id).select();
- wrapper.addSelectedRows(row_id);
- } else {
- //table.datatable.rows("#" + row_id).deselect();
- wrapper.removeSelectedRows(row_id);
- }
- });
-
- $(".bulk-action").click(function () {
- var table = $(document).find("#" + $(this).parent().parent().parent().parent().data("target"));
-
- if (table.data('selected')) {
- $(this).attr("data-id_records", table.data('selected'));
- $(this).data("id_records", table.data('selected'));
-
- if ($(this).data("type") === "modal") {
- var data = JSON.parse(JSON.stringify($(this).data()));
- var href = data.url;
-
- delete data.url;
- delete data.title;
- delete data.op;
- delete data.backto;
- delete data.blank;
-
- var values = [];
- for (var name in data) {
- values.push(name + '=' + data[name]);
- }
-
- var link = href + (href.indexOf('?') !== -1 ? '&' : '?') + values.join('&');
-
- launch_modal($(this).data("title"), link);
- } else {
- message(this);
- }
-
- $(this).attr("data-id_records", "");
- $(this).data("id_records", "");
- } else {
- swal(globals.translations.waiting, globals.translations.waitingMessage, "error");
- }
- });
-});
diff --git a/assets/src/js/base/navigation.js b/assets/src/js/base/navigation.js
deleted file mode 100644
index 82405dde1..000000000
--- a/assets/src/js/base/navigation.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-$(document).ready(function () {
- // Tabs
- $('.nav-tabs').tabs();
-
- // Entra nel tab indicato al caricamento della pagina
- var hash = location.hash ? location.hash : getUrlVars().hash;
- if (hash && hash != '#tab_0') {
- $('ul.nav-tabs a[href="' + hash + '"]').tab('show').trigger('shown.bs.tab');
- } else {
- removeHash();
- }
-
- $(window).bind('beforeunload', function () {
- if (location.hash == '#tab_0') {
- removeHash();
- }
- });
-
- // Nel caso la navigazione sia da mobile, disabilito il ritorno al punto precedente
- if (!globals.is_mobile) {
- // Salvo lo scroll per riportare qui l'utente al reload
- $(window).on('scroll', function () {
- if (sessionStorage != undefined) {
- sessionStorage.setItem('scrollTop_' + globals.id_module + '_' + globals.id_record, $(document).scrollTop());
- }
- });
-
- // Riporto l'utente allo scroll precedente
- if (sessionStorage['scrollTop_' + globals.id_module + '_' + globals.id_record] != undefined) {
- setTimeout(function () {
- scrollToOffset(sessionStorage['scrollTop_' + globals.id_module + '_' + globals.id_record]);
- }, 1);
- }
- }
-
- $('.nav-tabs a').click(function (e) {
- $(this).tab('show');
-
- let scroll = $('body').scrollTop() || $('html').scrollTop();
- window.location.hash = this.hash;
-
- $('html,body').scrollTop(scroll);
- });
-
- // Fix per la visualizzazione di Datatables all'interno dei tab Bootstrap
- $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
- $($.fn.dataTable.tables(true)).DataTable().columns.adjust();
- $($.fn.dataTable.tables(true)).DataTable().scroller.measure();
- });
-});
diff --git a/assets/src/js/base/sidebar.js b/assets/src/js/base/sidebar.js
deleted file mode 100644
index 90c705a08..000000000
--- a/assets/src/js/base/sidebar.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-$(document).ready(function () {
- // Fix per il menu principale
- $('.sidebar-menu').tree({
- followLink: true,
- });
-
- $('.sidebar-menu > li.treeview i.fa-angle-left').click(function (e) {
- e.preventDefault();
- $(this).find('ul').stop().slideDown();
- });
-
- $('.sidebar-menu > li.treeview i.fa-angle-down').click(function (e) {
- e.preventDefault();
- $(this).find('ul').stop().slideUp();
- });
-
- const elenco_menu = $('.treeview-menu > li.active');
- for (i = 0; i < elenco_menu.length; i++) {
- const elemento = $(elenco_menu[i]);
- elemento.parent().show().parent().addClass('active');
- elemento.parent().parent().find('i.fa-angle-left').removeClass('fa-angle-left').addClass('fa-angle-down');
- }
-
- // Menu ordinabile
- if (!globals.is_mobile) {
- sortable(".sidebar-menu", {
- axis: "y",
- cursor: "move",
- dropOnEmpty: true,
- scroll: true,
- })[0].addEventListener("sortupdate", function (e) {
- let order = $(".sidebar-menu > .treeview[data-id]").toArray().map(a => $(a).data("id"))
-
- $.post(globals.rootdir + "/actions.php", {
- id_module: globals.order_manager_id,
- op: "sort_modules",
- order: order.join(","),
- });
- });
- }
-
- // Mostra/nasconde sidebar del menu principale
- $(".sidebar-toggle").on("click", function () {
- if ($("body").hasClass("sidebar-collapse")) {
- session_set("settings,sidebar-collapse", 0, 1, 0);
- } else {
- session_set("settings,sidebar-collapse", 1, 0, 0);
- }
-
- setTimeout(function () {
- window.dispatchEvent(new Event('resize'));
- }, 350);
- });
-
- // Barra plugin laterale
- const pluginToggle = $(".control-sidebar-toggle");
- const largeScreen = screen.width > 1200;
-
- // Gestione click sul pulsante per il toggle
- pluginToggle.on("click", function () {
- $("aside.content-wrapper, .main-footer").toggleClass("with-control-sidebar");
-
- toggleControlSidebar();
- });
-
- // Gestione click sulla sidebar per evitare chiusura
- $(".control-sidebar").on("click", function (e) {
- if (largeScreen && e.target.tagName === 'A' && $(".main-footer").hasClass("with-control-sidebar")) {
- toggleControlSidebar();
- }
- });
-
- // Barra plugin laterale disabilitata per schermi piccoli
- if (largeScreen && !globals.collapse_plugin_sidebar) {
- pluginToggle.click();
- }
-});
-
-/**
- * Funzione dedicata alla gestione del toggle della sidebar.
- */
-function toggleControlSidebar() {
- const sidebar = $(".control-sidebar");
-
- sidebar.toggleClass("control-sidebar-open");
-
- if (sidebar.hasClass("control-sidebar-open")) {
- sidebar.show();
- }
-}
diff --git a/assets/src/js/base/slider.js b/assets/src/js/base/slider.js
deleted file mode 100644
index 7e9784e71..000000000
--- a/assets/src/js/base/slider.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-$(document).ready(function () {
- // Pulsante per il ritorno a inizio pagina
- var slideToTop = $("
");
- slideToTop.html(' ');
- slideToTop.css({
- position: 'fixed',
- bottom: '20px',
- right: '25px',
- width: '40px',
- height: '40px',
- color: '#eee',
- 'font-size': '',
- 'line-height': '40px',
- 'text-align': 'center',
- 'background-color': 'rgba(255, 78, 0)',
- 'box-shadow': '0 0 10px rgba(0, 0, 0, 0.05)',
- cursor: 'pointer',
- 'z-index': '99999',
- opacity: '.7',
- 'display': 'none'
- });
-
- slideToTop.on('mouseenter', function () {
- $(this).css('opacity', '1');
- });
-
- slideToTop.on('mouseout', function () {
- $(this).css('opacity', '.7');
- });
-
- $('.wrapper').append(slideToTop);
- $(window).scroll(function () {
- if ($(window).scrollTop() >= 150) {
- if (!$(slideToTop).is(':visible')) {
- $(slideToTop).fadeIn(500);
- }
- } else {
- $(slideToTop).fadeOut(500);
- }
- });
-
- $(slideToTop).click(function () {
- $("html, body").animate({
- scrollTop: 0
- }, 500);
- });
-});
diff --git a/assets/src/js/base/supersearch.js b/assets/src/js/base/supersearch.js
deleted file mode 100644
index 23212355a..000000000
--- a/assets/src/js/base/supersearch.js
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-$(document).ready(function () {
- const searchInput = $('#supersearch');
- const searchButton = searchInput.parent().find('i');
- const searches = [];
-
- autocomplete({
- minLength: 1,
- input: searchInput[0],
- emptyMsg: globals.translations.noResults,
- debounceWaitMs: 500,
- fetch: function(text, update) {
- text = text.toLowerCase();
-
- // Registrazione ricerca
- searches.push(text);
- searchButton
- .removeClass('fa-search')
- .addClass('fa-spinner fa-spin');
-
- $.ajax({
- url: globals.rootdir + '/ajax_search.php',
- dataType: "JSON",
- data: {
- term: text,
- },
- success: function (data) {
- // Fix per gestione risultati null
- data = data ? data : [];
-
- // Trasformazione risultati in formato leggibile
- const results = data.map(function (result) {
- return {
- label: result.label ? result.label : '' + result.title + ' ' + result.labels
- .join('').split(' ,').join(' '),
- group: result.category,
- link: result.link,
- value: result.title
- }
- });
-
- // Rimozione ricerca in corso
- searches.pop();
- if (searches.length === 0) {
- searchButton
- .removeClass('fa-spinner fa-spin')
- .addClass('fa-search');
- }
-
- update(results);
- },
- error: function (){
- searchButton
- .removeClass('fa-spinner fa-spin')
- .addClass('fa-exclamation-triangle');
- }
- });
- },
- preventSubmit: true,
- disableAutoSelect: true,
- onSelect: function(item) {
- window.location.href = item.link;
- },
- customize: function(input, inputRect, container, maxHeight) {
- container.style.width = '600px';
- },
- render: function(item, currentValue){
- const itemElement = document.createElement("div");
- itemElement.innerHTML = item.label;
- // " + item.value + " " + item.label + "
- return itemElement;
- }
- });
-});
diff --git a/assets/src/js/base/widgets.js b/assets/src/js/base/widgets.js
deleted file mode 100644
index 3aae07b43..000000000
--- a/assets/src/js/base/widgets.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-$(document).ready(function () {
- const widgets = sortable("#widget-top, #widget-right", {
- forcePlaceholderSize: true,
- items: 'li',
- cursor: 'move',
- dropOnEmpty: true,
- acceptFrom: '.widget',
- scroll: true,
- });
-
- for (const sorting of widgets) {
- sorting.addEventListener("sortupdate", function (e) {
- // Rimuovo l'evidenziazione dell'area widget
- $('.widget').removeClass('bordered');
-
- // Salvo la lista su cui ho eseguito il drop
- const location = $(e.detail.destination.container).attr('id').replace('widget-', '');
-
- let order = $(".widget li[data-id]").toArray().map(a => $(a).data("id"))
- $.post(globals.rootdir + "/actions.php", {
- id_module: globals.order_manager_id,
- id_module_widget: globals.id_module,
- op: 'sort_widgets',
- location: location,
- order: order.join(','),
- });
- });
-
- sorting.addEventListener("sortstart", function (e) {
- // Evidenzio le aree dei widget
- $('.widget').addClass('bordered');
- });
- }
-});
diff --git a/assets/src/js/functions/allegati.js b/assets/src/js/functions/allegati.js
deleted file mode 100644
index f15708843..000000000
--- a/assets/src/js/functions/allegati.js
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-// Disabling autoDiscover, otherwise Dropzone will try to attach twice.
-Dropzone.autoDiscover = false;
-
-/**
- * Restituisce filename ed estensione di un file indicato.
- * @param path
- * @returns [string, string]
- */
-function getFilenameAndExtension(path) {
- let filename_extension = path.replace(/^.*[\\\/]/, '');
- let filename = filename_extension.substring(0, filename_extension.lastIndexOf('.'));
- let ext = filename_extension.split('.').pop();
-
- return [filename, ext];
-}
-
-/**
- * Inizializza la gestione degli allegati.
- * @param gestione
- */
-function initGestioneAllegati(gestione) {
- const dropzone_id = '#' + gestione.attr('id') + ' .dropzone';
- const maxFilesize = gestione.data('max_filesize');
- if ($(dropzone_id).length === 0) {
- return;
- }
-
- let params = new URLSearchParams({
- op: "aggiungi-allegato",
- id_module: gestione.data('id_module'),
- id_plugin: gestione.data('id_plugin'),
- id_record: gestione.data('id_record'),
- }).toString();
-
- let dragdrop = new Dropzone(dropzone_id, {
- dictDefaultMessage: globals.translations.allegati.messaggio + ". (" + globals.translations.allegati.maxFilesize.replace('_SIZE_', maxFilesize) + ")",
- paramName: "file",
- maxFilesize: maxFilesize, // MB
- uploadMultiple: false,
- parallelUploads: 2,
- addRemoveLinks: false,
- autoProcessQueue: true,
- autoQueue: true,
- url: globals.rootdir + "/actions.php?" + params,
- init: function (file, xhr, formData) {
- this.on("success", function (file) {
- dragdrop.removeFile(file);
- });
-
- this.on("complete", function (file) {
- // Ricarico solo quando ho finito
- if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
- ricaricaAllegati(gestione);
- }
- });
- }
- });
-}
-
-/**
- * Funzione per l'apertura della schermata di modifica per una categoria di allegati.
- * @param gestione
- * @param pulsanteModifica
- */
-function modificaCategoriaAllegati(gestione, pulsanteModifica) {
- const categoria = $(pulsanteModifica).parent().parent();
- console.log(categoria)
-
- const nome = categoria.find(".box-title");
- nome.addClass('hidden');
- $(pulsanteModifica).addClass('hidden');
-
- const pulsanteSalva = categoria.find(".category-save");
- const pulsanteAnnulla = categoria.find(".category-cancel");
- const inputNome = categoria.find(".category-name");
- pulsanteSalva.removeClass("hidden");
- pulsanteAnnulla.removeClass("hidden");
- inputNome.removeClass("hidden");
-}
-
-/**
- * Funzione per salvare le modifiche effettuate su una categoria di allegati.
- * @param gestione
- * @param pulsanteSalva
- */
-function salvaCategoriaAllegati(gestione, pulsanteSalva) {
- const categoria = $(pulsanteSalva).parent().parent();
-
- const nome = categoria.find(".box-title");
- const inputNome = categoria.find(".category-name");
-
- mostraCaricamentoAllegati(gestione);
-
- $.ajax({
- url: globals.rootdir + "/actions.php",
- cache: false,
- type: "POST",
- data: {
- op: "modifica-categoria-allegato",
- id_module: gestione.data('id_module'),
- id_plugin: gestione.data('id_plugin'),
- id_record: gestione.data('id_record'),
- category: nome.text(),
- name: inputNome.val(),
- },
- success: function (data) {
- ricaricaAllegati(gestione);
- },
- error: function (gestione) {
- ricaricaAllegati(gestione);
- }
- });
-}
-
-/**
- * Funzione per caricare un nuovo allegato.
- * @param gestione
- */
-function aggiungiAllegato(gestione) {
- const id = "#" + gestione.attr('id');
- const form = $(id + " #upload-form");
-
- form.ajaxSubmit({
- url: globals.rootdir + "/actions.php",
- data: data,
- type: "post",
- uploadProgress: function (event, position, total, percentComplete) {
- $(id + " #upload").prop("disabled", true).html(percentComplete + "%").removeClass("btn-success").addClass("btn-info");
- },
- success: function (data) {
- ricaricaAllegati(gestione);
- },
- error: function (data) {
- alert(globals.translations.allegati.errore + ": " + data);
- }
- });
-}
-
-/**
- * Funzione per mostrare il loader di caricamento per gli allegati.
- * @param gestione
- */
-function mostraCaricamentoAllegati(gestione) {
- const id = "#" + gestione.attr('id');
-
- localLoading($(id + " .panel-body"), true);
-}
-
-/**
- * Funzione dedicata al caricamento dinamico degli allegati.
- * @param gestione
- */
-function ricaricaAllegati(gestione) {
- const id = "#" + gestione.attr('id');
-
- let params = new URLSearchParams({
- op: "list_attachments",
- id_module: gestione.data('id_module'),
- id_plugin: gestione.data('id_plugin'),
- id_record: gestione.data('id_record'),
- }).toString();
-
- $(id).load(globals.rootdir + "/ajax.php?" + params, function () {
- localLoading($(id + " .panel-body"), false);
-
- const nuovoAllegato = $(id + " table tr").eq(-1).attr("id");
- if (nuovoAllegato !== undefined) {
- $("#" + nuovoAllegato).effect("highlight", {}, 1500);
- }
- });
-}
-
-/**
- * Funzione per l'apertura della pagina di gestione dei dati dell'allegato.
- * @param button
- */
-function modificaAllegato(button) {
- const gestione = $(button).closest(".gestione-allegati");
- const allegato = $(button).closest("tr").data();
-
- let params = new URLSearchParams({
- op: "visualizza-modifica-allegato",
- id_module: gestione.data('id_module'),
- id_plugin: gestione.data('id_plugin'),
- id_record: gestione.data('id_record'),
- id_allegato: allegato.id,
- }).toString();
-
- openModal(globals.translations.allegati.modifica, globals.rootdir + "/actions.php?" + params);
-}
-
-/**
- * Funzione per gestire il download di un allegato.
- * @param button
- */
-function saggiungiAllegato(button) {
- const gestione = $(button).closest(".gestione-allegati");
- const allegato = $(button).closest("tr").data();
-
- let params = new URLSearchParams({
- op: "download-allegato",
- id_module: gestione.data('id_module'),
- id_plugin: gestione.data('id_plugin'),
- id_record: gestione.data('id_record'),
- id: allegato.id,
- filename: allegato.filename,
- }).toString();
-
- window.open(globals.rootdir + "/actions.php?" + params, "_blank")
-}
-
-/**
- * Funzione per l'apertura dell'anteprima di visualizzazione allegato.
- * @param button
- */
-function visualizzaAllegato(button) {
- const allegato = $(button).closest("tr").data();
-
- let params = new URLSearchParams({
- file_id: allegato.id,
- }).toString();
-
- openModal(allegato.nome + ' (' + allegato.filename + ') ', globals.rootdir + "/view.php?" + params);
-}
-
-/**
- * Funzione per la gestione della rimozione di un allegato specifico.
- *
- * @param button
- */
-function rimuoviAllegato(button) {
- const gestione = $(button).closest(".gestione-allegati");
- const allegato = $(button).closest("tr").data();
-
- swal({
- title: globals.translations.allegati.elimina,
- type: "warning",
- showCancelButton: true,
- confirmButtonText: globals.translations.allegati.procedi,
- }).then(function () {
- mostraCaricamentoAllegati(gestione);
-
- // Parametri della richiesta AJAX
- let params = new URLSearchParams({
- op: "rimuovi-allegato",
- id_module: gestione.data('id_module'),
- id_plugin: gestione.data('id_plugin'),
- id_record: gestione.data('id_record'),
- id_allegato: allegato.id,
- filename: allegato.filename,
- }).toString();
-
- // Richiesta AJAX
- $.ajax(globals.rootdir + "/actions.php?" + params)
- .then(function () {
- ricaricaAllegati(gestione);
- });
- }).catch(swal.noop);
-}
-
-function impostaCategorieAllegatiDisponibili(gestione, categorie) {
- // Disabilitazione per rimozione input in aggiunta
- return;
-
- const id = "#" + gestione.attr('id');
- const input = $("#modifica-allegato #categoria_allegato")[0];
-
- autocomplete({
- minLength: 0,
- input: input,
- emptyMsg: globals.translations.noResults,
- fetch: function (text, update) {
- text = text.toLowerCase();
- const suggestions = categorie.filter(n => n.toLowerCase().startsWith(text));
-
- // Trasformazione risultati in formato leggibile
- const results = suggestions.map(function (result) {
- return {
- label: result,
- value: result
- }
- });
-
- update(results);
- },
- onSelect: function (item) {
- input.value = item.label;
- },
- });
-}
diff --git a/assets/src/js/functions/datatables.js b/assets/src/js/functions/datatables.js
deleted file mode 100755
index 9b1e0a1a6..000000000
--- a/assets/src/js/functions/datatables.js
+++ /dev/null
@@ -1,521 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-function start_local_datatables() {
- $('.datatables').each(function () {
- if (!$.fn.DataTable.isDataTable($(this))) {
- $(this).DataTable({
- language: globals.translations.datatables,
- retrieve: true,
- ordering: true,
- searching: true,
- paging: false,
- order: [],
- lengthChange: false,
- scrollY: "70vh",
- });
- }
- });
-}
-
-// Datatable
-function start_datatables() {
- start_local_datatables();
-
- $('.main-records').each(function () {
- const $this = $(this);
-
- // Controlla che la tabella non sia già inizializzata
- if (!$.fn.DataTable.isDataTable('#' + $this.attr('id'))) {
- const id_module = $this.data('idmodule');
- const id_plugin = $this.data('idplugin');
- const id_parent = $this.data('idparent');
-
- // Parametri di ricerca da url o sessione
- const search = getTableSearch();
-
- const column_search = [];
- $this.find("th").each(function () {
- const id = $(this).attr('id').replace("th_", "");
- const single_value = search["search_" + id] ? search["search_" + id] : "";
-
- column_search.push({
- "sSearch": single_value,
- });
- });
-
- $this.on('preInit.dt', function (ev, settings) {
- $('#mini-loader').show();
- });
-
- const table = $this.DataTable({
- language: globals.translations.datatables,
- autoWidth: true,
- dom: "ti",
- serverSide: true,
- deferRender: true,
- ordering: true,
- searching: true,
- aaSorting: [],
- aoSearchCols: column_search,
- scrollY: "60vh",
- scrollX: '100%',
- retrieve: true,
- stateSave: true,
- rowId: 'id',
- stateSaveCallback: function (settings, data) {
- sessionStorage.setItem('DataTables_' + id_module + '-' + id_plugin + '-' + id_parent, JSON.stringify(data));
- },
- stateLoadCallback: function (settings) {
- return JSON.parse(sessionStorage.getItem('DataTables_' + id_module + '-' + id_plugin + '-' + id_parent));
- },
- columnDefs: [{
- searchable: false,
- orderable: false,
- width: '1%',
- className: 'select-checkbox',
- targets: 0
- }],
- select: {
- style: 'multi',
- selector: 'td:first-child'
- },
- buttons: getDatatablesButtons($this),
- scroller: {
- loadingIndicator: true,
- displayBuffer: globals.dataload_page_buffer,
- },
- ajax: {
- url: "ajax_dataload.php?id_module=" + id_module + "&id_plugin=" + id_plugin + "&id_parent=" + id_parent,
- type: 'GET',
- dataSrc: "data",
- },
- initComplete: initComplete,
- drawCallback: drawCallback,
- footerCallback: footerCallback,
- });
-
- table.on('processing.dt', function (e, settings, processing) {
- if (processing) {
- $('#mini-loader').show();
- } else {
- $('#mini-loader').hide();
- }
- })
- }
- });
-}
-
-/**
- * Funzione per evitare il sorting al click della colonna.
- * Utilizzata per evitare il sorting nelle ricerche.
- * @param {*} e
- */
-function stopTableSorting(e) {
- if (!e) var e = window.event;
- e.cancelBubble = true;
- if (e.stopPropagation) e.stopPropagation();
-}
-
-/**
- * Funzione per resettare il campo di ricerca in una specifica colonna.
- * @param {string} type
- */
-function resetTableSearch(type) {
- if (type == null) $('[id^=th_] input').val('').trigger('keyup');
- else $('[id^=th_' + type + '] input').val('').trigger('keyup');
-}
-
-/**
- * Sostituisce i caratteri speciali per la ricerca attraverso le tabelle Datatables.
- *
- * @param {string} field
- * @return string
- */
-function searchFieldName(field) {
- return field.replace(' ', '-').replace('.', '');
-}
-
-/**
- * Salva nella sessione la ricerca per le tabelle Datatables.
- *
- * @param {int} module_id
- * @param {string} field
- * @param {string} value
- */
-function setTableSearch(module_id, field, value) {
- session_set('module_' + module_id + ',' + 'search_' + searchFieldName(field), value, 0);
-}
-
-/**
- * Restituisce i valori di ricerca impostati nell'URL della pagina.
- * @returns {{}}
- */
-function getTableSearch() {
- // Parametri di ricerca da url o sessione
- const search = getUrlVars();
-
- globals.search.forEach(function (value, index, array) {
- if (search[array[index]] === undefined) {
- search[array[index]] = array[value];
- }
- });
-
- return search;
-}
-
-/**
- * Restituisce i pulsanti da generare per la tabella Datatables.
- * @returns
- */
-function getDatatablesButtons(table) {
- return [
- // Pulsante di esportazione CSV
- {
- extend: 'csv',
- footer: true,
- fieldSeparator: ";",
- exportOptions: {
- modifier: {
- selected: true
- },
- format: {
- body: function (data, row, column, node) {
- data = $('' + data + '
').text();
- data_edit = data.replace('.', ''); // Rimozione punto delle migliaia
-
- return data_edit.match(/^[0-9,]+$/) ? data_edit : data;
- }
- }
- }
- },
- // Pulsante di esportazione tramite copia
- {
- extend: 'copy',
- footer: true,
- exportOptions: {
- modifier: {
- selected: true
- }
- }
- },
- // Pulsante di esportazione via stampa della tabella
- {
- extend: 'print',
- autoPrint: true,
- footer: false, // Non funzionante in Firefox, e saltuarmente in Chrome
- customize: function (win, config, datatable) {
- const footer = datatable.table().footer().children[0];
-
- const body = $(win.document.body);
- body.find('table')
- .addClass('compact')
- .css('font-size', 'inherit')
- .append(footer.cloneNode(true));
-
- body.find('td:first-child, th:first-child')
- .addClass('hide');
-
- },
- exportOptions: {
- modifier: {
- selected: true
- }
- }
- },
- // Pulsante di esportazione in formato Excel
- {
- extend: 'excel',
- footer: true,
- exportOptions: {
- modifier: {
- selected: true
- },
- format: {
- body: function (data, row, column, node) {
- data = $('' + data + '
').text();
- data_edit = data.replace('.', ''); // Fix specifico per i numeri italiani
- data_edit = data_edit.replace(',', '.');
-
- return data_edit.match(/^[0-9\.]+$/) ? data_edit : data;
- }
- }
- }
- },
- // Pulsante di esportazione in formato PDF
- {
- extend: 'pdf',
- footer: true,
- exportOptions: {
- modifier: {
- selected: true
- }
- }
- },
- ];
-}
-
-function initComplete(settings) {
- const api = this.api();
- const $this = $(this);
- const search = getTableSearch();
-
- api.columns('.search').every(function () {
- const column = this;
-
- // Valore predefinito della ricerca
- let tempo;
- const header = $(column.header());
- const name = header.attr('id').replace('th_', '');
-
- const value = search['search_' + name] ? search['search_' + name] : '';
-
- $(' ')
- .appendTo(column.header())
- .on('keyup', function (e) {
- clearInterval(tempo);
-
- // Fix del pulsante di pulizia ricerca e del messaggio sulla ricerca lenta
- if (e.which != 9) {
- if (!$(this).val()) {
- if ($(this).parent().data("slow") != undefined) $("#slow").remove();
- $(this).removeClass('input-searching');
- $(this).next('.deleteicon').addClass('hide');
- } else {
- if ($(this).parent().data("slow") != undefined && $("#slow").length == 0) {
- $("#" + $this.attr('id') + "_info").parent().append(' ' + globals.translations.long + ' ');
- }
- $(this).addClass('input-searching');
- $(this).next('.deleteicon').removeClass('hide');
- }
- }
-
- function start_search(module_id, field, search_value) {
- setTableSearch(module_id, field, search_value);
- column.search(search_value).draw();
- }
-
- // Impostazione delle sessioni per le ricerche del modulo e del campo specificati
- const module_id = $this.data('idmodule'); //+ "-" + $this.data('idplugin');
- const field = $(this).parent().attr('id').replace('th_', '');
- const value = $(this).val();
- if (e.keyCode == 13 || $(this).val() == '') {
- start_search(module_id, field, value);
- } else {
- const tempo_attesa_ricerche = (globals.tempo_attesa_ricerche * 1000);
-
- tempo = window.setTimeout(start_search, tempo_attesa_ricerche, module_id, field, value);
- }
- });
- });
-
- // Disabilito l'ordinamento alla pressione del tasto invio sull'
- $("thead input, .search").on('keypress', function (e) {
- stopTableSorting(e);
- });
-
- // Disabilito l'ordinamento al click sull'
- $("thead input, .deleteicon").click(function (e) {
- stopTableSorting(e);
- });
-
- $('.deleteicon').on("click", function (e) {
- resetTableSearch($(this).parent().attr("id").replace("th_", ""));
- });
-}
-
-function drawCallback(settings) {
- const table = getTable(settings.nTable);
- const datatable = table.datatable;
-
- $(".dataTables_sizing .deleteicon").addClass('hide');
-
- $("[data-background]").each(function () {
- $(this).parent().css("background", $(this).data("background"));
- });
-
- $("[data-color]").each(function () {
- $(this).parent().css("color", $(this).data("color"));
- });
-
- $("[data-link]").each(function () {
- const $link = $(this);
- $(this).parent().not('.bound').addClass('bound').click(function (event) {
- if ($link.data('type') === 'dialog') {
- launch_modal(globals.translations.details, $link.data('link'));
- } else {
- openLink(event, $link.data('link'))
- }
- });
- $(this).parent().addClass("clickable");
- });
-
- // Reimposto il flag sulle righe ricaricate selezionate in precedenza
- const selected = table.getSelectedRows();
- datatable.rows().every(function (rowIdx) {
- if (selected.includes(this.id())) {
- datatable.row(':eq(' + rowIdx + ')', {
- page: 'current'
- }).select();
- }
- });
-}
-
-function footerCallback(row, data, start, end, display) {
- let i = -1;
- const json = this.api().ajax.json();
-
- this.api().columns().every(function () {
- if (json.summable[i] !== undefined) {
- $(this.footer()).addClass("text-right")
- .attr("id", "summable")
- .html(json.summable[i]);
- }
-
- i++;
- });
-}
-
-/**
- * Restituisce un oggetto che permette di gestire le tabelle DataTables.
- *
- * @param selector
- */
-function getTable(selector) {
- const table = $(selector);
-
- const selected = new Map();
- const selected_ids = table.data('selected') ? table.data('selected').split(';') : [];
- selected_ids.forEach(function (item, index) {
- selected.set(item, true);
- });
-
- return {
- table: table,
-
- id_module: table.data('idmodule'),
- id_plugin: table.data('idplugin'),
-
- initDatatable: function () {
- if (table.hasClass('datatables')) {
- start_local_datatables();
- } else {
- start_datatables();
- }
- },
- datatable: table.DataTable(),
-
- // Funzioni per i contenitori relativi alla tabella
- getSelectControllerContainer: function () {
- return $('.row[data-target="' + table.attr('id') + '"]').find('.select-controller-container');
- },
- getExportContainer: function () {
- return $('.row[data-target="' + table.attr('id') + '"]').find('.export-container');
- },
- getActionsContainer: function () {
- return $('.row[data-target="' + table.attr('id') + '"]').find('.actions-container');
- },
-
- // Gestione delle righe selezionate
- selected: selected,
- getSelectedRows: function () {
- return Array.from(selected.keys());
- },
- saveSelectedRows: function () {
- const selected_rows = this.getSelectedRows();
- table.data('selected', selected_rows.join(';'));
-
- // Abilitazione dinamica di azioni di gruppo e esportazione
- const bulk_container = this.getActionsContainer();
- const export_buttons = this.getExportContainer().find('.table-btn');
- if (selected_rows.length > 0) {
- bulk_container.removeClass('disabled').attr('disabled', false);
- export_buttons.removeClass('disabled').attr('disabled', false);
- } else {
- bulk_container.addClass('disabled').attr('disabled', true);
- export_buttons.addClass('disabled').attr('disabled', true);
- }
-
- // Aggiornamento contatore delle selezioni
- this.getSelectControllerContainer()
- .find('.selected-count').html(selected_rows.length);
-
- // Aggiornamento del footer nel caso sia richiesto
- if (globals.restrict_summables_to_selected) {
- this.updateFooterForSelectedRows();
- }
- },
- addSelectedRows: function (row_ids) {
- row_ids = Array.isArray(row_ids) ? row_ids : [row_ids];
- row_ids.forEach(function (item, index) {
- selected.set(item.toString(), true);
- });
-
- this.saveSelectedRows();
- },
- removeSelectedRows: function (row_ids) {
- row_ids = Array.isArray(row_ids) ? row_ids : [row_ids];
- row_ids.forEach(function (item, index) {
- selected.delete(item.toString());
- });
-
- this.saveSelectedRows();
- },
- clearSelectedRows: function () {
- selected.clear();
- this.saveSelectedRows();
- },
-
- /**
- * Nuovi valori dei campi summable
- * @returns
- */
- getSelectedRowsFooter: function () {
- let ids = this.getSelectedRows();
-
- return $.ajax({
- url: globals.rootdir + "/ajax.php",
- type: "POST",
- dataType: "json",
- data: {
- id_module: this.id_module,
- id_plugin: this.id_plugin,
- op: "summable-results",
- ids: ids,
- }
- });
- },
-
- /**
- * Aggiornamento dei campi summable
- */
- updateFooterForSelectedRows: function () {
- let datatable = this.datatable;
-
- this.getSelectedRowsFooter().then(function (response) {
- for (let [column, value] of Object.entries(response)) {
- let index = parseInt(column) + 1;
- let sel = datatable.column(index).footer();
- $(sel).addClass("text-right")
- .attr("id", "summable")
- .html(value);
- }
- });
- },
- };
-}
diff --git a/assets/src/js/functions/dates.js b/assets/src/js/functions/dates.js
deleted file mode 100755
index 56bc0214f..000000000
--- a/assets/src/js/functions/dates.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-function getCalendarIcons() {
- return {
- time: 'fa fa-clock-o',
- date: 'fa fa-calendar',
- up: 'fa fa-chevron-up',
- down: 'fa fa-chevron-down',
- previous: 'fa fa-chevron-left',
- next: 'fa fa-chevron-right',
- today: 'fa fa-street-view',
- clear: 'fa fa-trash',
- close: 'fa fa-times'
- };
-}
-
-function initDateInput(input) {
- let date_format = dateFormatMoment(globals.date_format);
- let calendar_icons = getCalendarIcons();
- let $input = $(input);
-
- $(input).datetimepicker({
- format: date_format,
- locale: globals.locale,
- icons: calendar_icons,
- useCurrent: false,
- minDate: moment($input.attr('min-date')).isValid() ? $input.attr('min-date') : false,
- maxDate: moment($input.attr('max-date')).isValid() ? $input.attr('max-date') : false,
- });
-
- return true;
-}
-
-function initTimestampInput(input) {
- let $input = $(input);
- let timestamp_format = dateFormatMoment(globals.timestamp_format);
- let calendar_icons = getCalendarIcons();
-
- $input.datetimepicker({
- format: timestamp_format,
- locale: globals.locale,
- icons: calendar_icons,
- collapse: false,
- sideBySide: true,
- useCurrent: false,
- stepping: 5,
- widgetPositioning: {
- horizontal: 'left',
- vertical: 'auto'
- },
- minDate: moment($input.attr('min-date')).isValid() ? $input.attr('min-date') : false,
- maxDate: moment($input.attr('max-date')).isValid() ? $input.attr('max-date') : false,
- });
-
- // fix per timestamp-picker non visibile con la classe table-responsive
- $input.on("dp.show", function (e) {
- $('#tecnici > div').removeClass('table-responsive');
- });
-
- $input.on("dp.hide", function (e) {
- $('#tecnici > div').addClass('table-responsive');
- });
-
- return true;
-}
-
-function initTimeInput(input) {
- let $input = $(input);
- let time_format = dateFormatMoment(globals.time_format);
- let calendar_icons = getCalendarIcons();
-
- $input.datetimepicker({
- format: time_format,
- locale: globals.locale,
- icons: calendar_icons,
- useCurrent: false,
- stepping: 5,
- minDate: moment($input.attr('min-date')).isValid() ? $input.attr('min-date') : false,
- maxDate: moment($input.attr('max-date')).isValid() ? $input.attr('max-date') : false,
- });
-
- return true;
-}
-
-/**
- * @deprecated
- */
-function start_datepickers() {
- $('.timestamp-picker').each(function () {
- input(this);
- });
-
- $('.datepicker').each(function () {
- input(this);
- });
-
- $('.timepicker').each(function () {
- input(this);
- });
-}
-
-function start_complete_calendar(id, callback) {
- var ranges = {};
- ranges[globals.translations.today] = [moment(), moment()];
- ranges[globals.translations.firstThreemester] = [moment("01", "MM"), moment("03", "MM").endOf('month')];
- ranges[globals.translations.secondThreemester] = [moment("04", "MM"), moment("06", "MM").endOf('month')];
- ranges[globals.translations.thirdThreemester] = [moment("07", "MM"), moment("09", "MM").endOf('month')];
- ranges[globals.translations.fourthThreemester] = [moment("10", "MM"), moment("12", "MM").endOf('month')];
- ranges[globals.translations.firstSemester] = [moment("01", "MM"), moment("06", "MM").endOf('month')];
- ranges[globals.translations.secondSemester] = [moment("06", "MM"), moment("12", "MM").endOf('month')];
- ranges[globals.translations.thisMonth] = [moment().startOf('month'), moment().endOf('month')];
- ranges[globals.translations.lastMonth] = [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')];
- ranges[globals.translations.thisYear] = [moment().startOf('year'), moment().endOf('year')];
- ranges[globals.translations.lastYear] = [moment().subtract(1, 'year').startOf('year'), moment().subtract(1, 'year').endOf('year')];
-
- var format = dateFormatMoment(globals.date_format);
- $(id).daterangepicker({
- locale: {
- format: format,
- customRangeLabel: globals.translations.custom,
- applyLabel: globals.translations.apply,
- cancelLabel: globals.translations.cancel,
- fromLabel: globals.translations.from,
- toLabel: globals.translations.to,
- },
- ranges: ranges,
- startDate: globals.start_date_formatted,
- endDate: globals.end_date_formatted,
- applyClass: 'btn btn-success btn-sm',
- cancelClass: 'btn btn-danger btn-sm',
- linkedCalendars: false
- },
- callback
- );
-}
diff --git a/assets/src/js/functions/form.js b/assets/src/js/functions/form.js
deleted file mode 100644
index a415454f2..000000000
--- a/assets/src/js/functions/form.js
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * @deprecated
- * @param form
- * @param data
- * @param callback
- * @param errorCallback
- * @returns {*|jQuery}
- */
-function submitAjax(form, data, callback, errorCallback) {
- let valid = $(form).parsley().validate();
- if (!valid) {
- return valid;
- }
-
- if (!data) data = {};
-
- // Lettura dei contenuti degli input
- data = {...getInputsData(form), ...data};
-
- $("#main_loading").show();
- content_was_modified = false;
-
- // Fix per gli id di default
- data.id_module = data.id_module ? data.id_module : globals.id_module;
- data.id_record = data.id_record ? data.id_record : globals.id_record;
- data.id_plugin = data.id_plugin ? data.id_plugin : globals.id_plugin;
- data.ajax = 1;
-
- prepareForm(form);
-
- // Invio dei dati
- $(form).ajaxSubmit({
- url: globals.rootdir + "/actions.php",
- data: data,
- type: "post",
- success: function (data) {
- let response = data.trim();
-
- // Tentativo di conversione da JSON
- try {
- response = JSON.parse(response);
- } catch (e) {
- }
-
- callback(response);
-
- $("#main_loading").fadeOut();
-
- renderMessages();
- },
- error: function (data) {
- $("#main_loading").fadeOut();
-
- toastr["error"](data);
-
- if (errorCallback) errorCallback(data);
- }
- });
-
- return valid;
-}
-
-/**
- *
- * @param form
- */
-function prepareForm(form) {
- $(form).find('input:disabled, select:disabled').prop('disabled', false);
-
- let hash = window.location.hash;
- if (hash) {
- var input = $(' ', {
- type: 'hidden',
- name: 'hash',
- value: hash,
- });
-
- $(form).append(input);
- }
-}
-
-/**
- * Funzione per la gestione delle animazioni di caricamento sui pulsanti cliccati e appositamente predisposti,
- *
- * @param button
- * @returns {[*, *]}
- */
-function buttonLoading(button) {
- let $this = $(button);
-
- let result = [
- $this.html(),
- $this.attr("class")
- ];
-
- $this.html(' Attendere...');
- $this.addClass("btn-warning");
- $this.prop("disabled", true);
-
- return result;
-}
-
-/**
- * Funzione per ripristinare un pulsante con animazioni allo stato precedente.
- *
- * @param button
- * @param loadingResult
- */
-function buttonRestore(button, loadingResult) {
- let $this = $(button);
-
- $this.html(loadingResult[0]);
-
- $this.attr("class", "");
- $this.addClass(loadingResult[1]);
- $this.prop("disabled", false);
-}
-
-/**
- * Funzione per salvare i contenuti di un form via AJAX, utilizzando una struttura più recente fondata sull'utilizzo di Promise.
- *
- * @param button
- * @param form
- * @param data
- * @returns {Promise}
- */
-function salvaForm(form, data = {}, button = null) {
- return new Promise(function (resolve, reject) {
- // Caricamento visibile nel pulsante
- let restore = buttonLoading(button);
-
- // Messaggio in caso di eventuali errori
- let valid = $(form).parsley().validate();
- if (!valid) {
- swal({
- type: "error",
- title: globals.translations.ajax.missing.title,
- text: globals.translations.ajax.missing.text,
- });
- buttonRestore(button, restore);
-
- reject();
- return;
- }
-
- // Gestione grafica di salvataggio
- $("#main_loading").show();
- content_was_modified = false;
-
- // Lettura dei contenuti degli input
- data = {...getInputsData(form), ...data};
- data.ajax = 1;
-
- // Fix per gli id di default
- data.id_module = data.id_module ? data.id_module : globals.id_module;
- data.id_record = data.id_record ? data.id_record : globals.id_record;
- data.id_plugin = data.id_plugin ? data.id_plugin : globals.id_plugin;
-
- // Invio dei dati
- $.ajax({
- url: globals.rootdir + "/actions.php",
- data: data,
- type: "POST",
- success: function (data) {
- let response = data.trim();
-
- // Tentativo di conversione da JSON
- try {
- response = JSON.parse(response);
- } catch (e) {
- }
-
- // Gestione grafica del successo
- $("#main_loading").fadeOut();
- renderMessages();
- buttonRestore(button, restore);
-
- resolve(response);
- },
- error: function (data) {
- toastr["error"](data);
-
- // Gestione grafica dell'errore
- $("#main_loading").fadeOut();
- swal({
- type: "error",
- title: globals.translations.ajax.error.title,
- text: globals.translations.ajax.error.text,
- });
- buttonRestore(button, restore);
-
- reject(data);
- }
- });
- });
-}
-
-/**
- * Funzione per recuperare come oggetto i contenuti degli input interni a un tag HTML.
- *
- * @param {HTMLElement|string|jQuery} form
- * @returns {{}}
- */
-function getInputsData(form) {
- let place = $(form);
- let data = {};
-
- // Gestione input previsti con sistema JS integrato
- let inputs = place.find('.openstamanager-input');
- for (const x of inputs) {
- const i = input(x);
- const name = i.getElement().attr('name');
- const value = i.get();
-
- data[name] = value === undefined || value === null ? undefined : value;
- }
-
- // Gestione input HTML standard
- let standardInputs = place.find(':input').not('.openstamanager-input').serializeArray();
- for (const x of standardInputs) {
- data[x.name] = x.value;
- }
-
- // Gestione hash dell'URL
- let hash = window.location.hash;
- if (hash) {
- data['hash'] = hash;
- }
-
- return data;
-}
diff --git a/assets/src/js/functions/functions.js b/assets/src/js/functions/functions.js
deleted file mode 100755
index e77147816..000000000
--- a/assets/src/js/functions/functions.js
+++ /dev/null
@@ -1,608 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * Modal gestito da versioni precedenti.
- * @param title
- * @param href
- * @param init_modal
- */
-function launch_modal(title, href, init_modal) {
- openModal(title, href);
-}
-
-/**
- * Modal.
- * @param title
- * @param href
- */
-function openModal(title, href) {
- // Fix - Select2 does not function properly when I use it inside a Bootstrap modal.
- $.fn.modal.Constructor.prototype.enforceFocus = function () {
- };
-
- // Generazione dinamica modal
- do {
- id = '#bs-popup-' + Math.floor(Math.random() * 100);
- } while ($(id).length !== 0);
-
- if ($(id).length === 0) {
- $('#modals').append('
');
- }
-
- $(id).on('hidden.bs.modal', function () {
- if ($('.modal-backdrop').length < 1) {
- $(this).html('');
- $(this).data('modal', null);
- }
- });
-
- // Promise per la gestione degli eventi
- const d = $.Deferred();
- $(id).one('shown.bs.modal', d.resolve);
-
- const content = '';
-
- // Lettura contenuto div
- if (href.substr(0, 1) === '#') {
- const data = $(href).html();
-
- $(id).html(content.replace("|data|", data));
- $(id).modal('show');
- } else {
- $.get(href, function (data, response) {
- if (response === 'success') {
- $(id).html(content.replace("|data|", data));
- $(id).modal('show');
- }
- });
- }
-
- return d.promise();
-}
-
-/**
- *
- * @param event
- * @param link
- */
-function openLink(event, link) {
- if (event.ctrlKey) {
- window.open(link);
- } else {
- location.href = link;
- }
-}
-
-/**
- * Funzione per far scrollare la pagina fino a un offset
- * @param offset
- */
-function scrollToOffset(offset) {
- $('html,body').animate({
- scrollTop: offset
- }, 'slow');
-}
-
-/**
- * Ritorna un array associativo con i parametri passati via GET
- */
-function getUrlVars() {
- let params = {};
-
- let query = window.location.search.substring(1);
- let parameterArray = query.split('&');
- if (parameterArray && parameterArray.length) {
- parameterArray.map(param => {
- let keyValuePair = param.split('=')
- let key = keyValuePair[0];
- params[key] = keyValuePair[1] ? decodeURIComponent(keyValuePair[1]) : null;
- })
- }
-
- return params;
-}
-
-/**
- * Data e ora (orologio)
- */
-function clock() {
- $('#datetime').html(moment().formatPHP(globals.timestamp_format));
- setTimeout('clock()', 1000);
-}
-
-/**
- * Funzione per impostare un valore ad un array in $_SESSION
- */
-function session_set_array(session_array, value, inversed) {
- if (inversed == undefined) {
- inversed = 1;
- }
-
- return $.get(globals.rootdir + "/ajax.php?op=session_set_array&session=" + session_array + "&value=" + value + "&inversed=" + inversed);
-}
-
-/**
- * Funzione per impostare un valore ad una sessione
- */
-function session_set(session_array, value, clear, reload) {
- if (clear === undefined) {
- clear = 1;
- }
-
- if (reload === undefined) {
- reload = 0;
- }
-
- return $.get(globals.rootdir + "/ajax.php?op=session_set&session=" + session_array + "&value=" + value + "&clear=" + clear, function (data, status) {
- if (reload === 1) {
- location.reload();
- }
- });
-}
-
-function session_keep_alive() {
- $.get(globals.rootdir + '/core.php');
-}
-
-function setContrast(backgroundcolor) {
- var rgb = [];
- var bg = String(backgroundcolor);
-
- // ex. backgroundcolor = #ffc400
- rgb[0] = bg.substr(1, 2);
- rgb[1] = bg.substr(2, 2);
- rgb[2] = bg.substr(5, 2);
-
- var R1 = parseInt(rgb[0], 16);
- var G1 = parseInt(rgb[1], 16);
- var B1 = parseInt(rgb[2], 16);
-
- var R2 = 255;
- var G2 = 255;
- var B2 = 255;
-
- var L1 = 0.2126 * Math.pow(R1 / 255, 2.2) + 0.7152 * Math.pow(G1 / 255, 2.2) + 0.0722 * Math.pow(B1 / 255, 2.2);
- var L2 = 0.2126 * Math.pow(R2 / 255, 2.2) + 0.7152 * Math.pow(G2 / 255, 2.2) + 0.0722 * Math.pow(B2 / 255, 2.2);
-
- if (L1 > L2) {
- var lum = (L1 + 0.05) / (L2 + 0.05);
- } else {
- var lum = (L2 + 0.05) / (L1 + 0.05);
- }
-
- if (lum >= 9) {
- return "#ffffff";
- } else {
- return "#000000";
- }
-}
-
-function message(element) {
- data = $.extend({}, $(element).data());
-
- var title = globals.translations.deleteTitle;
- if (data["title"] != undefined) title = data["title"];
-
- var msg = globals.translations.deleteMessage;
- if (data["msg"] != undefined) msg = data["msg"];
-
- var button = globals.translations.delete;
- if (data["button"] != undefined) button = data["button"];
-
- var btn_class = "btn btn-lg btn-danger";
- if (data["class"] != undefined) btn_class = data["class"];
-
- swal({
- title: title,
- html: '' + msg + '
',
- type: "warning",
- showCancelButton: true,
- confirmButtonText: button,
- confirmButtonClass: btn_class,
- onOpen: function () {
- restart_inputs();
- },
- preConfirm: function () {
- $form = $('#swal-form');
- $form.find(':input').each(function () {
- data[$(this).attr('name')] = $(this).val();
- });
-
- if ($form.parsley().validate()) {
- return new Promise(function (resolve) {
- resolve();
- });
- } else {
- $('.swal2-buttonswrapper button').each(function () {
- $(this).prop('disabled', false);
- });
- }
- }
- }).then(
- function () {
- if (data["op"] == undefined) data["op"] = "delete";
-
- var href = window.location.href.split("#")[0];
- if (data["href"] != undefined) {
- href = data["href"];
- delete data.href;
- }
-
- var hash = window.location.href.split("#")[1];
- if (hash) {
- data["hash"] = hash;
- }
-
- method = "post";
- if (data["method"] != undefined) {
- if (data["method"] == "post" || data["method"] == "get") {
- method = data["method"];
- }
- delete data.method;
- }
-
- blank = data.blank != undefined && data.blank;
- delete data.blank;
-
- if (data.callback) {
- $.ajax({
- type: method,
- crossDomain: true,
- url: href,
- data: data,
- beforeSend: function (response) {
- var before = window[data.before];
-
- if (typeof before === 'function') {
- before(response);
- }
- },
- success: function (response) {
- var callback = window[data.callback];
-
- if (typeof callback === 'function') {
- callback(response);
- }
- },
- error: function (xhr, ajaxOptions, error) {
- swal({
- title: globals.translations.errorTitle,
- html: globals.translations.errorMessage,
- type: "error",
- })
- },
- });
- } else {
- redirect(href, data, method, blank);
- }
- },
- function (dismiss) {
- }
- );
-}
-
-function redirect(href, data, method, blank) {
- method = method ? method : "get";
- blank = blank ? blank : false;
-
- if (method == "post") {
- var text = '';
-
- var form = $(text);
- $('body').append(form);
-
- form.submit();
- } else {
- var values = [];
-
- for (var name in data) {
- values.push(name + '=' + data[name]);
- }
-
- var link = href + (href.indexOf('?') !== -1 ? '&' : '?') + values.join('&') + window.location.hash;
-
- if (!blank) {
- location.href = link;
- } else {
- window.open(link);
- }
- }
-}
-
-function setCookie(cname, cvalue, exdays) {
- var d = new Date();
- d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
- var expires = "expires=" + d.toUTCString();
- document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
-}
-
-function getCookie(cname) {
- var name = cname + "=";
- var decodedCookie = decodeURIComponent(document.cookie);
- var ca = decodedCookie.split(';');
- for (var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == ' ') {
- c = c.substring(1);
- }
- if (c.indexOf(name) == 0) {
- return c.substring(name.length, c.length);
- }
- }
- return "";
-}
-
-/**
- * Visualizzazione dei messaggi attivi tramite toastr.
- */
-function renderMessages() {
- $.ajax({
- url: globals.rootdir + '/ajax.php',
- type: 'get',
- dataType: 'JSON',
- data: {
- op: 'flash',
- },
- success: function (messages) {
- let info = messages.info ? messages.info : [];
- info.forEach(function (element) {
- if (element) toastr["success"](element);
- });
-
- let warning = messages.warning ? messages.warning : [];
- warning.forEach(function (element) {
- if (element) toastr["warning"](element);
- });
-
- let error = messages.error ? messages.error : [];
- error.forEach(function (element) {
- if (element) toastr["error"](element);
- });
-
- }
- });
-}
-
-/**
- * Rimuove l'hash dall'URL corrente.
- */
-function removeHash() {
- history.replaceState(null, null, ' ');
-}
-
-/**
- *
- * @param str
- * @param find
- * @param replace
- * @returns {*}
- */
-function replaceAll(str, find, replace) {
- return str.replace(new RegExp(find, "g"), replace);
-}
-
-/**
- * @deprecated
- */
-function cleanup_inputs() {
- $('.bound').removeClass("bound");
-
- $('.superselect, .superselectajax').each(function () {
- let $this = $(this);
-
- if ($this.data('select2')) {
- input(this).destroy();
- }
- });
-}
-
-/**
- * @deprecated
- */
-function restart_inputs() {
- // Generazione degli input
- $('.openstamanager-input').each(function () {
- input(this);
- });
-}
-
-/**
- * Messaggio di avviso salvataggio a comparsa sulla destra solo nella versione a desktop intero
- */
-function alertPush() {
- if ($(window).width() > 1023) {
- let i = 0;
-
- $('.alert-success.push').each(function () {
- i++;
- tops = 60 * i + 95;
-
- $(this).css({
- 'position': 'fixed',
- 'z-index': 3000,
- 'right': '10px',
- 'top': -100,
- }).delay(1000).animate({
- 'top': tops,
- }).delay(3000).animate({
- 'top': -100,
- });
- });
- }
-
- // Nascondo la notifica se passo sopra col mouse
- $('.alert-success.push').on('mouseover', function () {
- $(this).stop().animate({
- 'top': -100,
- 'opacity': 0
- });
- });
-}
-
-/**
- * Funzione per l'apertura del messaggi di rimozione elemento standard.
- *
- * @param button
- * @param title
- * @param message
- * @returns {*}
- */
-function confirmDelete(button, title, message) {
- return swal({
- title: title ? title : globals.translations.deleteTitle,
- html: message ? message : globals.translations.deleteMessage,
- type: "warning",
- showCancelButton: true,
- confirmButtonText: globals.translations.delete,
- confirmButtonClass: "btn btn-lg btn-danger",
- })
-}
-
-
-/**
- * Nasconde una specifica colonna di una tabella indicata.
- *
- * @param table
- * @param column
- */
-function hideTableColumn(table, column) {
- column = "" + column; // Cast a stringa
-
- // Verifica sulle colonne nascoste in precedenza
- let hiddenColumns = table.getAttribute("hidden-columns");
- hiddenColumns = hiddenColumns ? hiddenColumns.split(",") : [];
- if (hiddenColumns.includes(column)) {
- return;
- }
-
- // Salvataggio delle colonne nascoste
- hiddenColumns.push(column);
- table.setAttribute("hidden-columns", hiddenColumns.join(","));
-
- let rows = table.rows;
- for (let row of rows) {
- let currentColumn = 1;
- for (let i = 0; i < row.cells.length; i++) {
- let cell = row.cells[i];
-
- // Individuazione del colspan
- let colspan = parseInt(cell.getAttribute("colspan"));
- let hiddenColspan = cell.getAttribute("colspan-hidden");
- hiddenColspan = parseInt(hiddenColspan ? hiddenColspan : 0);
- let totalColspan = colspan + hiddenColspan;
-
- // Gestione dell'operazione nel caso di cella multipla
- if (totalColspan && totalColspan > 1) {
- if (column >= currentColumn && column <= currentColumn + totalColspan - 1) {
- cell.setAttribute("colspan", colspan - 1);
- cell.setAttribute("colspan-hidden", hiddenColspan + 1);
-
- // Cella nascosta nel caso colspan sia nullo
- if (colspan - 1 === 0) {
- cell.classList.add("hidden");
- }
- }
-
- currentColumn += totalColspan;
- }
- // Gestione di una cella normale
- else {
- if (column === "" + currentColumn) {
- cell.classList.add("hidden");
- }
- currentColumn++;
- }
- }
- }
-}
-
-/**
- * Funzione per aggiungere in un *endpoint* il contenuto di uno specifico *template*, effettuando delle sostituzioni di base e inizializzando i campi aggiunti.
- *
- * @param {string|jQuery|HTMLElement} endpoint_selector
- * @param {string|jQuery|HTMLElement} template_selector
- * @param {object} replaces
- * @param {boolean} prepend
- * @returns {*|jQuery|HTMLElement}
- */
-function aggiungiContenuto(endpoint_selector, template_selector, replaces = {}, prepend = false) {
- let template = $(template_selector);
- let endpoint = $(endpoint_selector);
-
- // Distruzione degli input interni
- template.find('.openstamanager-input').each(function () {
- input(this).destroy();
- });
-
- // Contenuto da sostituire
- let content = template.html();
- for ([key, value] of Object.entries(replaces)) {
- content = replaceAll(content, key, value);
- }
-
- // Aggiunta del contenuto
- let element = $(content);
- if (prepend) {
- endpoint.prepend(element);
- } else {
- endpoint.append(element);
- }
-
- // Rigenerazione degli input interni
- element.find('.openstamanager-input').each(function () {
- input(this).trigger("change");
- });
-
- return element;
-}
-
-/**
- * Funzione per forzare l'apertura di uno specifico tab senza un relativo cambiamento di URL.
- *
- * @param {HTMLElement} link
- */
-function apriTab(link) {
- let element = $(link).closest("li");
- let parent = element.closest(".nav-tabs-custom");
-
- parent.find("ul > li").removeClass("active");
- element.addClass("active");
-
- let tab = $(link).data("tab");
- parent.find(".tab-pane").removeClass("active");
- parent.find(".tab-pane#" + tab).addClass("active");
-}
diff --git a/assets/src/js/functions/hooks.js b/assets/src/js/functions/hooks.js
deleted file mode 100755
index df3fa0902..000000000
--- a/assets/src/js/functions/hooks.js
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- *
- */
-function startHooks() {
- $.ajax({
- url: globals.rootdir + "/ajax.php",
- type: "get",
- data: {
- op: "hooks",
- },
- success: function (data) {
- hooks = JSON.parse(data);
-
- $("#hooks-header").text(globals.translations.hooksExecuting);
- $("#hooks-number").text(hooks.length);
-
- if (hooks.length == 0) {
- $("#hooks-loading").hide();
- $("#hooks-number").text(0);
- $("#hooks-header").text(globals.translations.hookNone);
- }
-
- hooks.forEach(function (item, index) {
- renderHook(item, {
- show: true,
- message: globals.translations.hookExecuting.replace('_NAME_', item.name)
- });
-
- startHook(item, true);
- });
- },
- });
-}
-
-/**
- * Richiama l'hook per l'esecuzione.
- *
- * @param hook
- */
-function startHook(hook, init) {
- $.ajax({
- url: globals.rootdir + "/ajax.php",
- type: "get",
- data: {
- op: "hook-lock",
- id: hook.id,
- },
- success: function (data) {
- var token = JSON.parse(data);
-
- if (init) {
- hookCount("#hooks-counter");
-
- updateHook(hook);
- }
-
- if (token) {
- executeHook(hook, token);
- } else {
- var timeout = 10;
-
- setTimeout(function () {
- startHook(hook);
- }, timeout * 1000);
- }
- },
- });
-}
-
-/**
- * Richiama l'hook per l'esecuzione.
- *
- * @param hook
- * @param token
- */
-function executeHook(hook, token) {
- $.ajax({
- url: globals.rootdir + "/ajax.php",
- type: "get",
- data: {
- op: "hook-execute",
- id: hook.id,
- token: token,
- },
- success: function (data) {
- var result = JSON.parse(data);
- updateHook(hook);
-
- var timeout;
- if (result.execute) {
- startHook(hook);
- } else {
- timeout = 30;
-
- setTimeout(function () {
- startHook(hook);
- }, timeout * 1000);
- }
- },
- });
-}
-
-/**
- * Aggiorna le informazioni dell'hook.
- *
- * @param hook
- * @param init
- */
-function updateHook(hook) {
- $.ajax({
- url: globals.rootdir + "/ajax.php",
- type: "get",
- data: {
- op: "hook-response",
- id: hook.id,
- },
- success: function (data) {
- var result = JSON.parse(data);
- renderHook(hook, result);
-
- // Rimozione eventuale della rotella di caricamento
- var counter = $("#hooks-counter").text();
- var number = $("#hooks > li").length;
-
- if (number == 0) {
- $("#hooks-notified").html(' ');
- $("#hooks-label").removeClass();
- $("#hooks-label").addClass('label').addClass('label-success');
- } else {
- $("#hooks-notified").text(number);
- $("#hooks-label").removeClass();
- $("#hooks-label").addClass('label').addClass('label-danger');
- }
-
- if (counter == $("#hooks-number").text()) {
- $("#hooks-loading").hide();
-
- var hookMessage;
- if (number > 1) {
- hookMessage = globals.translations.hookMultiple.replace('_NUM_', number);
- } else if (number == 1) {
- hookMessage = globals.translations.hookSingle;
- } else {
- hookMessage = globals.translations.hookNone;
- }
-
- $("#hooks-header").text(hookMessage);
- }
- },
- });
-}
-
-/**
- * Aggiunta dell'hook al numero totale.
- */
-function hookCount(id, value) {
- value = value ? value : 1;
-
- var element = $(id);
- var number = parseInt(element.text());
- number = isNaN(number) ? 0 : number;
-
- number += value;
- element.text(number);
-
- return number;
-}
-
-/**
- * Genera l'HTML per la visualizzazione degli hook.
- *
- * @param element_id
- * @param result
- */
-function renderHook(hook, result) {
- if (result.length == 0) return;
-
- var element_id = "hook-" + hook.id;
-
- // Inizializzazione
- var element = $("#" + element_id);
- if (element.length == 0) {
- $("#hooks").append(' ');
-
- element = $("#" + element_id);
- }
-
- // Rimozione
- if (!result.show) {
- element.remove();
-
- return;
- }
-
- // Contenuto
- var content = ' ' + result.message + ' ';
-
- if (result.progress) {
- var current = result.progress.current;
- var total = result.progress.total;
- var percentage = current / total * 100;
- percentage = isNaN(percentage) ? 100 : percentage;
-
- percentage = Math.round(percentage * 100) / 100;
-
- content += '' + percentage + '% (' + current + '/' + total + ')
';
- }
-
- content += ' ';
-
- element.html(content);
-}
diff --git a/assets/src/js/functions/init.js b/assets/src/js/functions/init.js
deleted file mode 100755
index 8080438e8..000000000
--- a/assets/src/js/functions/init.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-function init() {
- // Inizializzazzione dei box AdminLTE
- $('.box').boxWidget();
-
- // Modal di default
- $('[data-href]').not('.ask, .bound').click(function () {
- launch_modal($(this).data('title'), $(this).data('href'), 1);
- });
- $('[data-href]').not('.ask, .bound').addClass('bound clickable');
-
- // Tooltip
- $('.tip').not('.tooltipstered').each(function () {
- $this = $(this);
- $this.tooltipster({
- animation: 'grow',
- contentAsHTML: true,
- hideOnClick: true,
- onlyOne: true,
- maxWidth: 350,
- touchDevices: true,
- trigger: 'hover',
- position: $this.data('position') ? $this.data('position') : 'top',
- });
- });
-
- if ($('form').length) {
- $('form').not('.no-check').parsley();
- }
-
- // Aggiunta nell'URL del nome tab su cui tornare dopo il submit
- // Blocco del pulsante di submit dopo il primo submit
- $('form').on("submit", function (e) {
- if ($(this).parsley().validate() && (e.result == undefined || e.result)) {
- $(this).submit(function () {
- return false;
- });
-
- $(this).find('[type=submit]').prop("disabled", true).addClass("disabled");
-
- prepareForm(this);
-
- return true;
- }
-
- return false;
- });
-
- window.Parsley.on('field:success', function () {
- this.$element.removeClass('parsley-success');
- });
-
- restart_inputs();
-}
diff --git a/assets/src/js/functions/input.js b/assets/src/js/functions/input.js
deleted file mode 100644
index a45a555f4..000000000
--- a/assets/src/js/functions/input.js
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * Funzione semplificata per accedere ad uno specifico input.
- * Accetta un oggetto jQuery, oppure un elemento JS HTMLElement, oppure il nome dell'input di interesse.
- *
- * Attenzione: in caso di molteplici input individuati, viene restituito l'ultimo individuato.
- *
- * @param {string|jQuery|HTMLElement} name
- * @returns {Input|*}
- */
-function input(name) {
- let element;
-
- // Selezione tramite jQuery
- if (name instanceof jQuery) {
- element = name.last();
- }
-
- // Selezione tramite JS diretto
- else if (isElement(name)) {
- element = $(name);
- }
-
- // Selezione per nome
- else {
- element = $("[name='" + name + "']").last();
-
- // Fix per select multipli
- if (element.length === 0) {
- element = $("[name='" + name + "[]']").last();
- }
- }
-
- if (!element.data("input-controller")) {
- return new Input(element);
- } else {
- const controller = element.data("input-controller");
-
- if (!element.data("input-init")) {
- controller.init();
- }
-
- return controller;
- }
-}
-
-/**
- *
- * @constructor
- * @param {jQuery} element
- */
-function Input(element) {
- this.element = element;
-
- this.element.data("input-controller", this);
- this.element.data("required", this.element.attr("required"));
-
- this.init();
-}
-
-/**
- * Effettua le operazioni di inizializzazione sull'input in base alla relativa tipologia.
- */
-Input.prototype.init = function () {
- let initCompleted = false;
- let htmlElement = this.element[0];
-
- // Operazioni di inizializzazione per input specifici
- // Inizializzazione per date
- if (this.element.hasClass('timestamp-picker')) {
- initCompleted = initTimestampInput(htmlElement);
- } else if (this.element.hasClass('datepicker')) {
- initCompleted = initDateInput(htmlElement);
- } else if (this.element.hasClass('timepicker')) {
- initCompleted = initTimeInput(htmlElement);
- }
-
- // Inizializzazione per campi numerici
- else if (this.element.hasClass('number-input')) {
- initCompleted = initNumberInput(htmlElement);
- }
-
- // Inizializzazione per textarea
- else if (this.element.hasClass('editor-input')) {
- initCompleted = initEditorInput(htmlElement);
- }
-
- // Inizializzazione per textarea
- else if (this.element.hasClass('autosize') || this.element.attr('maxlength')) {
- if (this.element.hasClass('autosize'))
- initCompleted = initTextareaInput(htmlElement);
-
- if (htmlElement.hasAttribute('charcounter'))
- initCompleted = initCharCounter(htmlElement);
- }
-
- // Inizializzazione per select
- else if (this.element.hasClass('select-input')) {
- initCompleted = initSelectInput(htmlElement);
- }
-
- // Inizializzazione alternativa per maschere
- else {
- initCompleted = initMaskInput(htmlElement);
- }
-
- this.element.data("input-init", !!initCompleted);
-}
-
-/**
- * Restituisce l'elemento jQuery che rappresenta l'input.
- *
- * @returns {jQuery}
- */
-Input.prototype.getElement = function () {
- return this.element;
-}
-
-/**
- * Gestisce l'abilitazione e la disibilitazione dell'input sulla base del valore indicato.
- *
- * @param {boolean} value
- * @returns {Input}
- */
-Input.prototype.setDisabled = function (value) {
- if (value) {
- return this.disable();
- } else {
- return this.enable();
- }
-}
-
-/**
- * Disabilita l'input all'utilizzo grafico.
- *
- * @returns {Input}
- */
-Input.prototype.disable = function () {
- this.element.addClass("disabled")
- .attr("disabled", true)
- .attr("readonly", false)
- .attr("required", false);
-
- let group = this.element.closest(".form-group");
-
- // Disabilitazione eventuali pulsanti relativi
- group.find("button")
- .addClass("disabled");
-
- // Disabilitazione per checkbox
- group.find(".btn-group label")
- .addClass("disabled");
- group.find("input[type=checkbox]")
- .attr("disabled", true)
- .attr("readonly", false)
- .addClass("disabled");
-
- // Gestione dell'editor
- if (this.element.hasClass("editor-input")) {
- const name = this.element.attr("id");
- CKEDITOR.instances[name].setReadOnly(true);
- }
-
- return this;
-}
-
-/**
- * Abilita l'input all'utilizzo grafico.
- *
- * @returns {Input}
- */
-Input.prototype.enable = function () {
- this.element.removeClass("disabled")
- .attr("disabled", false)
- .attr("readonly", false)
- .attr("required", this.element.data("required"));
-
- let group = this.element.closest(".form-group");
-
- // Abilitazione eventuali pulsanti relativi
- group.find("button")
- .removeClass("disabled");
-
- // Abilitazione per checkbox
- group.find(".btn-group label")
- .removeClass("disabled");
- group.find("input[type=checkbox]")
- .attr("disabled", false)
- .attr("readonly", false)
- .removeClass("disabled");
-
- // Gestione dell'editor
- if (this.element.hasClass("editor-input")) {
- const name = this.element.attr("id");
- CKEDITOR.instances[name].setReadOnly(false);
- }
-
- return this;
-}
-
-/**
- * Controlla se l'input è disabilitato.
- *
- * @returns {boolean}
- */
-Input.prototype.isDisabled = function () {
- return this.element.hasClass("disabled")
-}
-
-/**
- * Restituisce un oggetto cotentente le caratteristiche dell'input.
- *
- * @returns {{value: (string|number)}|jQuery|any}
- */
-Input.prototype.getData = function () {
- if (this.element.is('select')) {
- return this.element.selectData();
- }
-
- return {
- value: this.get()
- };
-}
-
-/**
- * Restituisce il valore corrente dell'input.
- *
- * @returns {string|number}
- */
-Input.prototype.get = function () {
- let value = this.element.val();
-
- // Gestione dei valori per select
- if (this.element.hasClass("select-input")) {
- value = value ? value : null;
- }
-
- // Gestione dei valori per l'editor
- if (this.element.hasClass("editor-input")) {
- const name = this.element.attr("id");
- value = typeof CKEDITOR !== 'undefined' ? CKEDITOR.instances[name].getData() : value;
- }
-
- // Conversione del valore per le checkbox
- let group = this.element.closest(".form-group");
- if (group.find("input[type=checkbox]").length) {
- return parseInt(value) ? 1 : 0;
- }
-
- // Gestione dei valori numerici
- if (this.element.hasClass("number-input")) {
- const autonumeric = this.element.data("autonumeric");
-
- if (autonumeric) {
- return parseFloat(autonumeric.rawValue);
- }
- // In attesa dell'inizializzazione per autonumeric, il valore registrato è interpretabile
- else {
- return parseFloat(value);
- }
- }
-
- return value;
-}
-
-/**
- * Imposta il valore per l'input.
- *
- * @param value
- * @returns {Input}
- */
-Input.prototype.set = function (value) {
- // Gestione dei valori per l'editor
- if (this.element.hasClass("editor-input") && typeof CKEDITOR !== 'undefined') {
- const name = this.element.attr("id");
- CKEDITOR.instances[name].setData(value);
- } else {
- this.element.val(value).trigger("change");
- }
-
- return this;
-}
-
-/**
- * Imposta l'input per essere obbligatorio o meno.
- * @param {bool} value
- * @returns {Input}
- */
-Input.prototype.setRequired = function (value) {
- this.element.attr("required", value)
- .data("required", value);
-
- return this;
-}
-
-// Eventi permessi
-/**
- * Gestisce gli eventi di tipologia "change".
- *
- * @param callable
- * @returns {Input}
- */
-Input.prototype.change = function (callable) {
- this.on("change", callable)
-
- return this;
-}
-
-/**
- * Gestisce l'ascolto a uno specifico evento sulla base dell'oggetto jQuery.
- *
- * @param {string} event
- * @param callable
- *
- * @returns {Input}
- */
-Input.prototype.on = function (event, callable) {
- this.element.on(event, callable);
-
- return this;
-}
-
-/**
- * Gestisce la rimozione degli ascoltatori attivi per uno specifico evento sulla base dell'oggetto jQuery.
- *
- * @param {string} event
- *
- * @returns {Input}
- */
-Input.prototype.off = function (event) {
- this.element.off(event);
-
- return this;
-}
-
-/**
- * Effettua il trigger di uno specifico evento sull'input.
- * @param {string} event
- * @param callable
- * @returns {Input}
- */
-Input.prototype.trigger = function (event, callable) {
- this.element.trigger(event, callable);
-
- return this;
-}
-
-/**
- * Distrugge il gestore attuale per l'input e ne disabilita le funzionalità previste.
- */
-Input.prototype.destroy = function () {
- if (this.element.data('select2')) {
- this.element.select2().select2("destroy")
- }
-
- // Gestione della distruzione per l'editor
- if (this.element.hasClass("editor-input")) {
- const name = this.element.attr("id");
- CKEDITOR.instances[name].destroy();
- }
-
- this.element.data("input-controller", null);
- this.element.data("input-init", false);
-}
-
-/**
- * Returns true if it is a DOM node.
- *
- * @param o
- * @returns boolean
- *
- * @source https://stackoverflow.com/a/384380
- */
-function isNode(o) {
- return (
- typeof Node === "object" ? o instanceof Node :
- o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string"
- );
-}
-
-/**
- * Returns true if it is a DOM element.
- *
- * @param o
- * @returns boolean
- *
- * @source https://stackoverflow.com/a/384380
- */
-function isElement(o) {
- return (
- typeof HTMLElement === "object" ? o instanceof HTMLElement : // DOM2
- o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName === "string"
- );
-}
diff --git a/assets/src/js/functions/inputmask.js b/assets/src/js/functions/inputmask.js
deleted file mode 100644
index 5b7ad9cc1..000000000
--- a/assets/src/js/functions/inputmask.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * Funzione per l'inizializzazione delle maschere sui campi impostati.
- * @param input
- */
-function initMaskInput(input) {
- let $input = $(input);
-
- if ($input.hasClass('email-mask')) {
- $input.inputmask('Regex', {
- regex: "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^-]+(?:\\.[a-zA-Z0-9_!#$%&'*+/=?`{|}~^-]+)*@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$",
- });
- } else if ($input.hasClass('rea-mask')) {
- $input.inputmask({
- mask: "AA-999999{1,15}",
- casing: "upper",
- });
- } else if ($input.hasClass('provincia-mask')) {
- $input.inputmask({
- mask: "AA",
- casing: "upper",
- });
- } else if ($input.hasClass('alphanumeric-mask')) {
- $input.inputmask('Regex', {
- regex: "[A-Za-z0-9#_|\/\\-.]*",
- });
- } else if ($input.hasClass('math-mask')) {
- $input.inputmask('Regex', {
- regex: "[0-9,.+\-]*",
- });
- }
-
- return true;
-}
-
-/**
- * Inputmask.
- *
- * @param element
- */
-function start_inputmask(element) {
- if (element === undefined) {
- element = '';
- } else {
- element = element + ' ';
- }
-
- let masks = ['math-mask', 'alphanumeric-mask', 'provincia-mask', 'rea-mask', 'email-mask'];
-
- let selector = element + '.' + masks.join(', ' + element + '.')
- $(selector).each(function () {
- input(this);
- });
-}
diff --git a/assets/src/js/functions/loaders.js b/assets/src/js/functions/loaders.js
deleted file mode 100644
index 9f985c670..000000000
--- a/assets/src/js/functions/loaders.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * Funzione per gestire il loader locale per uno specifico DIV.
- *
- * @param div Identificatore JS dell'elemento
- * @param show
- */
-function localLoading(div, show) {
- let container = $(div);
-
- // Ricerca del loader esistente
- let loader = container.find(".panel-loading");
-
- // Aggiunta del loader in caso di assenza
- if (!loader.length) {
- let html = `
-
-
-
- ` + globals.translations.loading + `
-
-
-
`;
-
- container.prepend(html);
- loader = container.find(".local-loader");
- }
-
- // Visualizzazione del loader
- if (show) {
- loader.removeClass("hidden");
- container.addClass("div-loading");
- }
- // Rimozione del loader
- else {
- loader.addClass("hidden");
- container.removeClass("div-loading");
- }
-}
-
-/**
- * Funzione per gestire la visualizzazione del loader generale del gestionale.
- * @param show
- */
-function mainLoader(show) {
- let loader = $("#main_loading");
-
- if (show) {
- loader.show();
- } else {
- loader.fadeOut();
- }
-}
diff --git a/assets/src/js/functions/moment.js b/assets/src/js/functions/moment.js
deleted file mode 100755
index 87fe6e0c6..000000000
--- a/assets/src/js/functions/moment.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-function dateFormatMoment(format) {
- /*
- * PHP => moment.js
- * Will take a php date format and convert it into a JS format for moment
- * http://www.php.net/manual/en/function.date.php
- * http://momentjs.com/docs/#/displaying/format/
- */
- var formatMap = {
- d: 'DD',
- D: 'ddd',
- j: 'D',
- l: 'dddd',
- N: 'E',
- S: function () {
- return '[' + moment().format('Do').replace(/\d*/g, '') + ']';
- },
- w: 'd',
- z: function () {
- return moment().format('DDD') - 1;
- },
- W: 'W',
- F: 'MMMM',
- m: 'MM',
- M: 'MMM',
- n: 'M',
- t: function () {
- return moment().daysInMonth();
- },
- L: function () {
- return moment().isLeapYear() ? 1 : 0;
- },
- o: 'GGGG',
- Y: 'YYYY',
- y: 'YY',
- a: 'a',
- A: 'A',
- B: function () {
- var thisUTC = moment().clone().utc(),
- // Shamelessly stolen from http://javascript.about.com/library/blswatch.htm
- swatch = ((thisUTC.hours() + 1) % 24) + (thisUTC.minutes() / 60) + (thisUTC.seconds() / 3600);
- return Math.floor(swatch * 1000 / 24);
- },
- g: 'h',
- G: 'H',
- h: 'hh',
- H: 'HH',
- i: 'mm',
- s: 'ss',
- u: '[u]', // not sure if moment has this
- e: '[e]', // moment does not have this
- I: function () {
- return moment().isDST() ? 1 : 0;
- },
- O: 'ZZ',
- P: 'Z',
- T: '[T]', // deprecated in moment
- Z: function () {
- return parseInt(moment().format('ZZ'), 10) * 36;
- },
- c: 'YYYY-MM-DD[T]HH:mm:ssZ',
- r: 'ddd, DD MMM YYYY HH:mm:ss ZZ',
- U: 'X'
- };
- var formatEx = /[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g;
-
- return format.replace(formatEx, function (phpStr) {
- return typeof formatMap[phpStr] === 'function' ? formatMap[phpStr].call(that) : formatMap[phpStr];
- })
-}
-
-(function (m) {
- moment.fn.formatPHP = function (format) {
- return this.format(dateFormatMoment(format));
- };
-}(moment));
diff --git a/assets/src/js/functions/numbers.js b/assets/src/js/functions/numbers.js
deleted file mode 100644
index 4ad9bce88..000000000
--- a/assets/src/js/functions/numbers.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * Funzione per inizializzare i campi di input numerici per la gestione integrata del formato impostato per il gestionale.
- *
- * @deprecated
- */
-function initNumbers() {
- $('.number-input').each(function () {
- input(this);
- });
-}
-
-/**
- * Funzione per l'inizializzazione dei campi numerici.
- * @param input
- */
-function initNumberInput(input) {
- let $input = $(input);
- if (AutoNumeric.isManagedByAutoNumeric(input)) {
- return true;
- }
-
- let min = $input.attr('min-value') && $input.attr('min-value') !== "undefined" ? $input.attr('min-value') : null;
- let max = $input.attr('max-value') && $input.attr('max-value') !== "undefined" ? $input.attr('max-value') : null;
-
- let decimals = $input.attr('decimals') ? $input.attr('decimals') : globals.cifre_decimali;
-
- let autonumeric = new AutoNumeric(input, {
- caretPositionOnFocus: "decimalLeft",
- allowDecimalPadding: true,
- currencySymbolPlacement: "s",
- negativePositiveSignPlacement: "p",
- decimalCharacter: globals.decimals,
- decimalCharacterAlternative: ".",
- digitGroupSeparator: globals.thousands,
- emptyInputBehavior: min ? min : "zero",
- overrideMinMaxLimits: "ignore",
- modifyValueOnWheel: false,
- outputFormat: "string",
- unformatOnSubmit: true,
- watchExternalChanges: true,
- minimumValue: min ? min : "-10000000000000",
- maximumValue: max ? max : "10000000000000",
- decimalPlaces: decimals,
- });
-
- $input.data("autonumeric", autonumeric);
-
- return true;
-}
diff --git a/assets/src/js/functions/prototypes.js b/assets/src/js/functions/prototypes.js
deleted file mode 100755
index 279e53b49..000000000
--- a/assets/src/js/functions/prototypes.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-String.prototype.toEnglish = function () {
- return numeral(this.toString()).value();
-};
-
-Number.prototype.toLocale = function () {
- return numeral(this).format();
-};
diff --git a/assets/src/js/functions/select.js b/assets/src/js/functions/select.js
deleted file mode 100755
index a8756c410..000000000
--- a/assets/src/js/functions/select.js
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * Select.
- *
- * @deprecated
- */
-function start_superselect() {
- $('.superselect, .superselectajax').each(function () {
- input(this);
- });
-}
-
-/**
- * Gestisce le operazioni di rendering per una singola opzione del select.
- *
- * @param data
- * @param container
- * @returns {*}
- */
-function optionRendering(data, container) {
- // Aggiunta degli attributi impostati staticamente
- selectOptionAttributes(data);
-
- // Impostazione del colore dell'opzione
- let bg;
- if (data._bgcolor_) {
- bg = data._bgcolor_;
- } else if ($(data.element).attr("_bgcolor_")) {
- bg = $(data.element).attr("_bgcolor_");
- } else if ($(data.element).data("_bgcolor_")) {
- bg = $(data.element).data("_bgcolor_");
- }
-
- if (bg && !$("head").find('#' + data._resultId + '_style').length) {
- $(container).css("background-color", bg);
- $(container).css("color", setContrast(bg));
- }
-
- return data.text;
-}
-
-/**
- * Gestisce le operazioni di rendering per le opzioni selezionate del select.
- *
- * @param data
- * @returns {*}
- */
-function selectionRendering(data) {
- // Aggiunta degli attributi impostati staticamente
- selectOptionAttributes(data);
-
- return data.text;
-}
-
-/**
- * Gestisce le operazioni per l'impostazione dinamica degli attributi per una singola opzione del select.
- *
- * @param data
- * @returns {void}
- */
-function selectOptionAttributes(data) {
- // Aggiunta degli attributi impostati staticamente
- let attributes = $(data.element).data("select-attributes");
- if (attributes) {
- for ([key, value] of Object.entries(attributes)) {
- data[key] = value;
- }
- }
-}
-
-/**
- * Reimposta i contenuti di un creato con select2.
- */
-jQuery.fn.selectClear = function () {
- this.val([]).trigger("change");
-
- return this;
-};
-
-/**
- * Resetta i contenuti di un creato con select2.
- */
-jQuery.fn.selectReset = function (placeholder) {
- this.selectClear();
- this.empty();
-
- if (placeholder !== undefined) {
- this.next().find('.select2-selection__placeholder').text(placeholder);
- this.next().find('input.select2-search__field').attr('placeholder', placeholder);
- }
-
- return this;
-};
-
-/**
- * Aggiorna un creato con select2 impostando un valore di default.
- * Da utilizzare per l'impostazione dei select basati su richieste AJAX.
- */
-jQuery.fn.selectSetNew = function (value, label, data) {
- // Fix selezione per valori multipli
- let values = this.val();
- if (this.prop("multiple")) {
- values.push(value);
- } else {
- this.selectReset();
- values = value;
- }
-
- this.selectAdd([{
- 'value': value,
- 'text': label,
- 'data': data,
- }]);
-
- this.selectSet(values);
-
- return this;
-};
-
-/**
- * Aggiorna un creato con select2 impostando un valore di default.
- * Da utilizzare per l'impostazione dei select statici.
- */
-jQuery.fn.selectSet = function (value) {
- this.val(value).trigger("change");
-
- return this;
-};
-
-/**
- * Aggiorna un creato con select2 impostando un valore di default
- */
-jQuery.fn.selectAdd = function (values) {
- let $this = this;
-
- values.forEach(function (item) {
- if (item.data) {
- item['data-select-attributes'] = JSON.stringify(item.data);
-
- // Retrocompatibilità per l'uso del attributo data su selectData
- Object.keys(item.data).forEach(function (element) {
- item['data-' + element] = item.data[element];
- });
- }
-
- delete item.data;
-
- const option = $(' ', item);
- $this.append(option);
- });
-
- return this;
-};
-
-/**
- * Restituisce l'oggetto contenente gli attributi di una generata da select2.
- */
-jQuery.fn.selectData = function () {
- let selectData = this.select2('data');
-
- if (this.prop('multiple')) {
- return selectData;
- } else if (selectData.length !== 0 && selectData[0].id) {
- return selectData[0];
- }
-
- return undefined;
-};
-
-/**
- * Imposta il valore di un'opzione di un creato con select2.
- */
-jQuery.fn.setSelectOption = function (name, value) {
- this.data('select-options')[name] = value;
-
- return this;
-};
-
-/**
- * Restituisce il valore impostato per un'opzione di un creato con select2.
- */
-jQuery.fn.getSelectOption = function (name) {
- return this.data('select-options')[name];
-};
-
-/**
- * Imposta il valore di un opzioni per tutti i select attivi della pagina.
- *
- * @param name
- * @param value
- */
-function updateSelectOption(name, value) {
- $(".superselectajax").each(function () {
- $(this).setSelectOption(name, value);
- })
-}
-
-/**
- * Funzione per l'inizializzazione automatica del select.
- *
- * @param input
- */
-function initSelectInput(input) {
- let $input = $(input);
-
- if ($input.hasClass('superselect')) {
- initStaticSelectInput(input);
- } else {
- initDynamicSelectInput(input);
- }
-
- return $input.data('select2');
-}
-
-/**
- * Funzione per l'inizializzazione del select statico.
- *
- * @param input
- */
-function initStaticSelectInput(input) {
- let $input = $(input);
-
- $input.select2({
- theme: "bootstrap",
- language: "it",
- width: '100%',
- maximumSelectionLength: $input.data('maximum') ? $input.data('maximum') : -1,
- minimumResultsForSearch: $input.hasClass('no-search') ? -1 : 0,
- allowClear: !$input.hasClass('no-search'),
- escapeMarkup: function (text) {
- return text;
- },
- templateResult: optionRendering,
- templateSelection: selectionRendering,
- });
-}
-
-/**
- * Funzione per l'inizializzazione del select dinamico.
- *
- * @param input
- */
-function initDynamicSelectInput(input) {
- let $input = $(input);
-
- $input.select2({
- theme: "bootstrap",
- language: "it",
- maximumSelectionLength: $input.data('maximum') ? $input.data('maximum') : -1,
- minimumInputLength: $input.data('heavy') ? 3 : 0,
- allowClear: true,
- escapeMarkup: function (text) {
- return text;
- },
- templateResult: optionRendering,
- templateSelection: selectionRendering,
- ajax: {
- url: globals.rootdir + "/ajax_select.php?op=" + $input.data('source'),
- dataType: 'json',
- delay: 250,
- data: function (params) {
- return {
- search: params.term,
- page: params.page || 0,
- length: params.length || 100,
- options: this.data('select-options'), // Dati aggiuntivi
- };
- },
- processResults: function (data, params) {
- params.page = params.page || 0;
- params.length = params.length || 100;
-
- let results = data.results;
-
- // Interpretazione forzata per campi optgroup
- if (results && results[0] && results[0]['optgroup']) {
- let groups = results.reduce(function (r, a) {
- r[a.optgroup] = r[a.optgroup] || [];
- r[a.optgroup].push(a);
- return r;
- }, {});
-
- let results_groups = [];
- for ([key, results] of Object.entries(groups)) {
- results_groups.push({
- text: key,
- children: groups[key],
- });
- }
- results = results_groups;
- }
-
- return {
- results: results,
- pagination: {
- more: (params.page + 1) * params.length < data.recordsFiltered,
- }
- };
- },
- cache: false
- },
- width: '100%'
- });
-
- // Rimozione delle option presenti nell'HTML per permettere l'aggiornamento dei dati via AJAX
- // Rimozione per select multipli
- if ($input.prop("multiple")) {
- $input.on('select2:unselecting', function (e) {
- let data = e.params ? e.params.data : null;
- if (data) {
- let option = $input.find('option[value="' + data.id + '"]');
- option.remove();
- }
- });
- }
- // Rimozione per select singoli
- else {
- $input.on('select2:selecting', function (e) {
- let data = $input.selectData();
- if (data) {
- let option = $input.find('option[value="' + data.id + '"]');
- option.remove();
- }
- });
- }
-}
-
diff --git a/assets/src/js/functions/textarea.js b/assets/src/js/functions/textarea.js
deleted file mode 100644
index 1681e0fb2..000000000
--- a/assets/src/js/functions/textarea.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
- * Copyright (C) DevCode s.r.l.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * Funzione per l'inizializzazione dei campi textarea.
- * @param input
- */
-function initTextareaInput(input) {
- autosize($(input));
-
- return true;
-}
-
-function initCharCounter(input) {
- let $input = $(input);
-
- if (input.hasAttribute('maxlength')) {
- $input.maxlength({
- warningClass: "help-block",
- limitReachedClass: "help-block text-danger",
- preText: '',
- separator: ' / ',
- postText: '',
- showMaxLength: true,
- placement: 'bottom-right-inside',
- utf8: true,
- appendToParent: true,
- alwaysShow: false,
- threshold: 150
- });
-
- } else {
- $input.attr('maxlength', '65535');
-
- $input.maxlength({
- warningClass: "help-block",
- limitReachedClass: "help-block text-danger",
- showMaxLength: false,
- placement: 'bottom-right-inside',
- utf8: true,
- appendToParent: true,
- alwaysShow: true
- });
- }
-
- return true;
-}
-
-function waitCKEditor(input) {
- setTimeout(function () {
- initEditorInput(input);
- }, 100);
-}
-
-/**
- * Funzione per l'inizializzazione dei campi editor.
- * @param input
- */
-function initEditorInput(input) {
- if (window.CKEDITOR && CKEDITOR.status === "loaded") {
- initCKEditor(input);
- } else {
- waitCKEditor(input);
- }
-
- return true;
-}
-
-function initCKEditor(input) {
- let $input = $(input);
- let name = input.getAttribute("id");
-
- // Controllo su istanza già esistente
- let instance = CKEDITOR.instances[name];
- if (instance) {
- instance.destroy();
- }
-
- // Avvio di CKEditor
- CKEDITOR.replace(name, {
- toolbar: (input.hasAttribute('use_full_ckeditor')) ? globals.ckeditorToolbar_Full : globals.ckeditorToolbar,
- language: globals.locale,
- scayt_autoStartup: true,
- scayt_sLang: globals.full_locale,
- disableNativeSpellChecker: false,
- fullPage: (input.hasAttribute('use_full_ckeditor')) ? true : false,
- allowedContent: (input.hasAttribute('use_full_ckeditor')) ? true : false,
- extraPlugins: 'scayt',
- skin: 'moono-lisa',
- });
-
- // Gestione di eventi noti
- CKEDITOR.instances[name].on("key", function (event) {
- $input.trigger("keydown", event.data);
- $input.trigger("keyup", event.data);
- });
-
- CKEDITOR.instances[name].on("change", function (event) {
- $input.trigger("change", event);
- });
-
- CKEDITOR.instances[name].on("focus", function (event) {
- $input.trigger("focus", event);
- });
-}
diff --git a/backup/.htaccess b/backup/.htaccess
deleted file mode 100755
index 3a4288278..000000000
--- a/backup/.htaccess
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/bootstrap/app.php b/bootstrap/app.php
new file mode 100644
index 000000000..037e17df0
--- /dev/null
+++ b/bootstrap/app.php
@@ -0,0 +1,55 @@
+singleton(
+ Illuminate\Contracts\Http\Kernel::class,
+ App\Http\Kernel::class
+);
+
+$app->singleton(
+ Illuminate\Contracts\Console\Kernel::class,
+ App\Console\Kernel::class
+);
+
+$app->singleton(
+ Illuminate\Contracts\Debug\ExceptionHandler::class,
+ App\Exceptions\Handler::class
+);
+
+/*
+|--------------------------------------------------------------------------
+| Return The Application
+|--------------------------------------------------------------------------
+|
+| This script returns the application instance. The instance is given to
+| the calling script so we can separate the building of the instances
+| from the actual running of the application and sending responses.
+|
+*/
+
+return $app;
diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore
new file mode 100644
index 000000000..d6b7ef32c
--- /dev/null
+++ b/bootstrap/cache/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/bug.php b/bug.php
deleted file mode 100755
index 4d50c6d68..000000000
--- a/bug.php
+++ /dev/null
@@ -1,203 +0,0 @@
-.
- */
-
-use Modules\Emails\Account;
-use Notifications\EmailNotification;
-
-include_once __DIR__.'/core.php';
-
-$account = Account::where('predefined', true)->first();
-$bug_email = 'info@openstamanager.com';
-
-$user = Auth::user();
-
-if (filter('op') == 'send') {
- // Preparazione email
- $mail = new EmailNotification();
-
- // Destinatario
- $mail->AddAddress($bug_email);
-
- // Oggetto
- $mail->Subject = 'Segnalazione bug OSM '.$version;
-
- // Aggiunta dei file di log (facoltativo)
- if (!empty(post('log')) && file_exists(base_dir().'/logs/error.log')) {
- $mail->AddAttachment(base_dir().'/logs/error.log');
- }
-
- // Aggiunta della copia del database (facoltativo)
- if (!empty(post('sql'))) {
- $backup_file = base_dir().'/Backup OSM '.date('Y-m-d').' '.date('H_i_s').'.sql';
- Backup::database($backup_file);
-
- $mail->AddAttachment($backup_file);
-
- flash()->info(tr('Backup del database eseguito ed allegato correttamente!'));
- }
-
- // Aggiunta delle informazioni di base sull'installazione
- $infos = [
- 'Utente' => $user['username'],
- 'IP' => get_client_ip(),
- 'Versione OSM' => $version.' ('.(!empty($revision) ? $revision : 'In sviluppo').')',
- 'PHP' => phpversion(),
- ];
-
- // Aggiunta delle informazioni sul sistema (facoltativo)
- if (!empty(post('info'))) {
- $infos['Sistema'] = $_SERVER['HTTP_USER_AGENT'].' - '.getOS();
- }
-
- // Completamento del body
- $body = post('body').' ';
- foreach ($infos as $key => $value) {
- $body .= ''.$key.': '.$value.'
';
- }
-
- $mail->Body = $body;
-
- $mail->AltBody = 'Questa email arriva dal modulo bug di segnalazione bug di OSM';
-
- // Invio mail
- if (!$mail->send()) {
- flash()->error(tr("Errore durante l'invio della segnalazione").': '.$mail->ErrorInfo);
- } else {
- flash()->info(tr('Email inviata correttamente!'));
- }
-
- // Rimozione del dump del database
- if (!empty(post('sql'))) {
- delete($backup_file);
- }
-
- redirect(base_path().'/bug.php');
- exit();
-}
-
-$pageTitle = tr('Bug');
-
-include_once App::filepath('include|custom|', 'top.php');
-
-if (empty($account['from_address']) || empty($account['server'])) {
- echo '
-
-
-
'.tr('Attenzione!').' '.tr('Per utilizzare correttamente il modulo di segnalazione bug devi configurare alcuni parametri riguardanti le impostazione delle email').'.
-
- '.Modules::link('Account email', $account['id'], tr('Correggi account'), null, 'class="btn btn-warning pull-right"').'
-
-
';
-}
-
-echo '
-
-
-
-
-';
-
-include_once App::filepath('include|custom|', 'bottom.php');
diff --git a/composer.json b/composer.json
deleted file mode 100755
index e55c44494..000000000
--- a/composer.json
+++ /dev/null
@@ -1,130 +0,0 @@
-{
- "name": "devcode-it/openstamanager",
- "description": "Gestionale open-source per assistenza tecnica e fatturazione elettronica",
- "license": "GPL-3.0",
- "keywords": [
- "gestionale",
- "assistenza tecnica",
- "fatturazione elettronica",
- "open-source"
- ],
- "homepage": "https://www.openstamanager.com/",
- "authors": [{
- "name": "DevCode s.r.l.",
- "email": "info@openstamanager.com"
- }],
- "type": "project",
- "require": {
- "php": ">=5.6.4",
- "ext-curl": "*",
- "ext-dom": "*",
- "ext-fileinfo": "*",
- "ext-intl": "*",
- "ext-json": "*",
- "ext-libxml": "*",
- "ext-mbstring": "*",
- "ext-openssl": "*",
- "ext-pdo": "*",
- "ext-simplexml": "*",
- "ext-xsl": "*",
- "ext-zip": "*",
- "aluguest/ical-easy-reader": "^1.5",
- "danielstjules/stringy": "^3.1",
- "davidepastore/codice-fiscale": "^0.6.0",
- "dragonmantank/cron-expression": "^1.0",
- "ezyang/htmlpurifier": "^4.8",
- "filp/whoops": "^2.1",
- "guzzlehttp/guzzle": "^6.3",
- "ifsnop/mysqldump-php": "^2.3",
- "illuminate/database": "~5.4.0",
- "intervention/image": "^2.3",
- "league/csv": "^8.2",
- "league/oauth2-client": "^2.6",
- "league/oauth2-google": "^3.0",
- "maximebf/debugbar": "^1.15",
- "monolog/monolog": "^1.22",
- "mpdf/mpdf": "^v8.0.7",
- "mpociot/vat-calculator": "^2.3",
- "owasp/csrf-protector-php": "^1.0",
- "phpmailer/phpmailer": "^6.0",
- "respect/validation": "^1.1",
- "servo/fluidxml": "^1.21",
- "slim/flash": "^0.4.0",
- "spipu/html2pdf": "^5.0",
- "symfony/filesystem": "^3.3",
- "symfony/finder": "^3.3",
- "symfony/polyfill-ctype": "^1.8",
- "symfony/polyfill-php70": "^1.8",
- "symfony/translation": "^3.3",
- "symfony/var-dumper": "^3.3",
- "thenetworg/oauth2-azure": "^2.0",
- "willdurand/geocoder": "^3.3"
- },
- "require-dev": {
- "codeception/codeception": "^3.0",
- "friendsofphp/php-cs-fixer": "^2.10"
- },
- "autoload": {
- "psr-4": {
- "": "src/",
- "Update\\": "update/",
- "Modules\\Aggiornamenti\\": ["modules/aggiornamenti/custom/src/", "modules/aggiornamenti/src/"],
- "Modules\\Anagrafiche\\": ["modules/anagrafiche/custom/src/", "modules/anagrafiche/src/"],
- "Modules\\Backups\\": ["modules/backups/custom/src/", "modules/backups/src/"],
- "Modules\\Emails\\": ["modules/emails/custom/src/", "modules/emails/src/"],
- "Modules\\Articoli\\": ["modules/articoli/custom/src/", "modules/articoli/src/"],
- "Modules\\Checklists\\": ["modules/checklists/custom/src/", "modules/checklists/src/"],
- "Modules\\Ritenute\\": ["modules/ritenute/custom/src/", "modules/ritenute/src/"],
- "Modules\\RitenuteContributi\\": ["modules/ritenute_contributi/custom/src/", "modules/ritenute_contributi/src/"],
- "Modules\\Rivalse\\": ["modules/rivalse/custom/src/", "modules/rivalse/src/"],
- "Modules\\Newsletter\\": ["modules/newsletter/custom/src/", "modules/newsletter/src/"],
- "Modules\\Iva\\": ["modules/iva/custom/src/", "modules/iva/src/"],
- "Modules\\DDT\\": ["modules/ddt/custom/src/", "modules/ddt/src/"],
- "Modules\\Fatture\\": ["modules/fatture/custom/src/", "modules/fatture/src/"],
- "Modules\\Ordini\\": ["modules/ordini/custom/src/", "modules/ordini/src/"],
- "Modules\\Preventivi\\": ["modules/preventivi/custom/src/", "modules/preventivi/src/"],
- "Modules\\Contratti\\": ["modules/contratti/custom/src/", "modules/contratti/src/"],
- "Modules\\Interventi\\": ["modules/interventi/custom/src/", "modules/interventi/src/"],
- "Modules\\Pagamenti\\": ["modules/pagamenti/custom/src/", "modules/pagamenti/src/"],
- "Modules\\Statistiche\\": ["modules/statistiche/custom/src/", "modules/statistiche/src/"],
- "Modules\\Scadenzario\\": ["modules/scadenzario/custom/src/", "modules/scadenzario/src/"],
- "Modules\\PrimaNota\\": ["modules/primanota/custom/src/", "modules/primanota/src/"],
- "Modules\\Utenti\\": ["modules/utenti/custom/src/", "modules/utenti/src/"],
- "Modules\\StatoServizi\\": ["modules/stato_servizi/custom/src/", "modules/stato_servizi/src/"],
- "Modules\\StatiIntervento\\": ["modules/stati_intervento/custom/src/", "modules/stati_intervento/src/"],
- "Modules\\StatiPreventivo\\": ["modules/stati_preventivo/custom/src/", "modules/stati_preventivo/src/"],
- "Modules\\StatiContratto\\": ["modules/stati_contratto/custom/src/", "modules/stati_contratto/src/"],
- "Modules\\TipiIntervento\\": ["modules/tipi_intervento/custom/src/", "modules/tipi_intervento/src/"],
- "Modules\\CategorieDocumentali\\": ["modules/categorie_documenti/custom/src/", "modules/categorie_documenti/src/"],
- "Modules\\PianiSconto\\": ["modules/piano_sconto/custom/src/", "modules/piano_sconto/src/"],
- "Modules\\Impianti\\": ["modules/impianti/custom/src/", "modules/impianti/src/"],
- "Modules\\Importazione\\": ["modules/import/custom/src/", "modules/import/src/"],
- "Modules\\Impostazioni\\": ["modules/impostazioni/custom/src/", "modules/impostazioni/src/"],
- "Plugins\\ExportFE\\": ["plugins/exportFE/custom/src/", "plugins/exportFE/src/"],
- "Plugins\\ImportFE\\": ["plugins/importFE/custom/src/", "plugins/importFE/src/"],
- "Plugins\\ReceiptFE\\": ["plugins/receiptFE/custom/src/", "plugins/receiptFE/src/"],
- "Plugins\\DichiarazioniIntento\\": ["plugins/dichiarazioni_intento/custom/src/", "plugins/dichiarazioni_intento/src/"],
- "Plugins\\PianificazioneInterventi\\": ["plugins/pianificazione_interventi/custom/src/", "plugins/pianificazione_interventi/src/"],
- "Plugins\\PianificazioneFatturazione\\": ["plugins/pianificazione_fatturazione/custom/src/", "plugins/pianificazione_fatturazione/src/"],
- "Plugins\\StatisticheArticoli\\": ["plugins/statistiche_articoli/custom/src/", "plugins/statistiche_articoli/src/"],
- "Plugins\\ListinoClienti\\": ["plugins/listino_clienti/custom/src/", "plugins/listino_clienti/src/"],
- "Plugins\\ListinoFornitori\\": ["plugins/listino_fornitori/custom/src/", "plugins/listino_fornitori/src/"]
- },
- "files": [
- "lib/functions.php",
- "lib/common.php",
- "lib/helpers.php",
- "lib/util.php",
- "lib/deprecated.php"
- ]
- },
- "config": {
- "sort-packages": true,
- "optimize-autoloader": false,
- "apcu-autoloader": true,
- "prefer-stable": true,
- "platform": {
- "php": "5.6.4"
- }
- }
-}
diff --git a/config.example.php b/config.example.php
deleted file mode 100755
index 3f982f57d..000000000
--- a/config.example.php
+++ /dev/null
@@ -1,63 +0,0 @@
-.
- */
-
-// Impostazioni di base per l'accesso al database
-$db_host = '|host|';
-$db_username = '|username|';
-$db_password = '|password|';
-$db_name = '|database|';
-//$port = '|port|';
-
-// Percorso della cartella di backup
-$backup_dir = __DIR__.'/backup/';
-
-// Tema selezionato per il front-end
-$theme = 'default';
-
-// Impostazioni di sicurezza
-$redirectHTTPS = false; // Redirect automatico delle richieste da HTTP a HTTPS
-$disableCSRF = true; // Protezione contro CSRF
-
-// Impostazioni di debug
-$debug = false;
-
-// Personalizzazione dei gestori dei tag personalizzati
-$HTMLWrapper = null;
-$HTMLHandlers = [];
-$HTMLManagers = [];
-
-// Lingua del progetto (per la traduzione e la conversione numerica)
-$lang = '|lang|';
-// Personalizzazione della formattazione di timestamp, date e orari
-$formatter = [
- 'timestamp' => '|timestamp|',
- 'date' => '|date|',
- 'time' => '|time|',
- 'number' => [
- 'decimals' => '|decimals|',
- 'thousands' => '|thousands|',
- ],
-];
-
-// Ulteriori file CSS e JS da includere
-$assets = [
- 'css' => [],
- 'print' => [],
- 'js' => [],
-];
diff --git a/config/app.php b/config/app.php
new file mode 100644
index 000000000..c9b8f5ae1
--- /dev/null
+++ b/config/app.php
@@ -0,0 +1,234 @@
+ env('APP_NAME', 'Laravel'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Application Environment
+ |--------------------------------------------------------------------------
+ |
+ | This value determines the "environment" your application is currently
+ | running in. This may determine how you prefer to configure various
+ | services the application utilizes. Set this in your ".env" file.
+ |
+ */
+
+ 'env' => env('APP_ENV', 'production'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Application Debug Mode
+ |--------------------------------------------------------------------------
+ |
+ | When your application is in debug mode, detailed error messages with
+ | stack traces will be shown on every error that occurs within your
+ | application. If disabled, a simple generic error page is shown.
+ |
+ */
+
+ 'debug' => (bool) env('APP_DEBUG', false),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Application URL
+ |--------------------------------------------------------------------------
+ |
+ | This URL is used by the console to properly generate URLs when using
+ | the Artisan command line tool. You should set this to the root of
+ | your application so that it is used when running Artisan tasks.
+ |
+ */
+
+ 'url' => env('APP_URL', 'http://localhost'),
+
+ 'asset_url' => env('ASSET_URL', null),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Application Timezone
+ |--------------------------------------------------------------------------
+ |
+ | Here you may specify the default timezone for your application, which
+ | will be used by the PHP date and date-time functions. We have gone
+ | ahead and set this to a sensible default for you out of the box.
+ |
+ */
+
+ 'timezone' => 'UTC',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Application Locale Configuration
+ |--------------------------------------------------------------------------
+ |
+ | The application locale determines the default locale that will be used
+ | by the translation service provider. You are free to set this value
+ | to any of the locales which will be supported by the application.
+ |
+ */
+
+ 'locale' => 'en',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Application Fallback Locale
+ |--------------------------------------------------------------------------
+ |
+ | The fallback locale determines the locale to use when the current one
+ | is not available. You may change the value to correspond to any of
+ | the language folders that are provided through your application.
+ |
+ */
+
+ 'fallback_locale' => 'en',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Faker Locale
+ |--------------------------------------------------------------------------
+ |
+ | This locale will be used by the Faker PHP library when generating fake
+ | data for your database seeds. For example, this will be used to get
+ | localized telephone numbers, street address information and more.
+ |
+ */
+
+ 'faker_locale' => 'en_US',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Encryption Key
+ |--------------------------------------------------------------------------
+ |
+ | This key is used by the Illuminate encrypter service and should be set
+ | to a random, 32 character string, otherwise these encrypted strings
+ | will not be safe. Please do this before deploying an application!
+ |
+ */
+
+ 'key' => env('APP_KEY'),
+
+ 'cipher' => 'AES-256-CBC',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Autoloaded Service Providers
+ |--------------------------------------------------------------------------
+ |
+ | The service providers listed here will be automatically loaded on the
+ | request to your application. Feel free to add your own services to
+ | this array to grant expanded functionality to your applications.
+ |
+ */
+
+ 'providers' => [
+
+ /*
+ * Laravel Framework Service Providers...
+ */
+ Illuminate\Auth\AuthServiceProvider::class,
+ Illuminate\Broadcasting\BroadcastServiceProvider::class,
+ Illuminate\Bus\BusServiceProvider::class,
+ Illuminate\Cache\CacheServiceProvider::class,
+ Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
+ Illuminate\Cookie\CookieServiceProvider::class,
+ Illuminate\Database\DatabaseServiceProvider::class,
+ Illuminate\Encryption\EncryptionServiceProvider::class,
+ Illuminate\Filesystem\FilesystemServiceProvider::class,
+ Illuminate\Foundation\Providers\FoundationServiceProvider::class,
+ Illuminate\Hashing\HashServiceProvider::class,
+ Illuminate\Mail\MailServiceProvider::class,
+ Illuminate\Notifications\NotificationServiceProvider::class,
+ Illuminate\Pagination\PaginationServiceProvider::class,
+ Illuminate\Pipeline\PipelineServiceProvider::class,
+ Illuminate\Queue\QueueServiceProvider::class,
+ Illuminate\Redis\RedisServiceProvider::class,
+ Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
+ Illuminate\Session\SessionServiceProvider::class,
+ Illuminate\Translation\TranslationServiceProvider::class,
+ Illuminate\Validation\ValidationServiceProvider::class,
+ Illuminate\View\ViewServiceProvider::class,
+
+ /*
+ * Package Service Providers...
+ */
+
+ /*
+ * Application Service Providers...
+ */
+ App\Providers\AppServiceProvider::class,
+ App\Providers\AuthServiceProvider::class,
+ // App\Providers\BroadcastServiceProvider::class,
+ App\Providers\EventServiceProvider::class,
+ App\Providers\RouteServiceProvider::class,
+
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Class Aliases
+ |--------------------------------------------------------------------------
+ |
+ | This array of class aliases will be registered when this application
+ | is started. However, feel free to register as many as you wish as
+ | the aliases are "lazy" loaded so they don't hinder performance.
+ |
+ */
+
+ 'aliases' => [
+
+ 'App' => Illuminate\Support\Facades\App::class,
+ 'Arr' => Illuminate\Support\Arr::class,
+ 'Artisan' => Illuminate\Support\Facades\Artisan::class,
+ 'Auth' => Illuminate\Support\Facades\Auth::class,
+ 'Blade' => Illuminate\Support\Facades\Blade::class,
+ 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
+ 'Bus' => Illuminate\Support\Facades\Bus::class,
+ 'Cache' => Illuminate\Support\Facades\Cache::class,
+ 'Config' => Illuminate\Support\Facades\Config::class,
+ 'Cookie' => Illuminate\Support\Facades\Cookie::class,
+ 'Crypt' => Illuminate\Support\Facades\Crypt::class,
+ 'Date' => Illuminate\Support\Facades\Date::class,
+ 'DB' => Illuminate\Support\Facades\DB::class,
+ 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
+ 'Event' => Illuminate\Support\Facades\Event::class,
+ 'File' => Illuminate\Support\Facades\File::class,
+ 'Gate' => Illuminate\Support\Facades\Gate::class,
+ 'Hash' => Illuminate\Support\Facades\Hash::class,
+ 'Http' => Illuminate\Support\Facades\Http::class,
+ 'Lang' => Illuminate\Support\Facades\Lang::class,
+ 'Log' => Illuminate\Support\Facades\Log::class,
+ 'Mail' => Illuminate\Support\Facades\Mail::class,
+ 'Notification' => Illuminate\Support\Facades\Notification::class,
+ 'Password' => Illuminate\Support\Facades\Password::class,
+ 'Queue' => Illuminate\Support\Facades\Queue::class,
+ 'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
+ 'Redirect' => Illuminate\Support\Facades\Redirect::class,
+ // 'Redis' => Illuminate\Support\Facades\Redis::class,
+ 'Request' => Illuminate\Support\Facades\Request::class,
+ 'Response' => Illuminate\Support\Facades\Response::class,
+ 'Route' => Illuminate\Support\Facades\Route::class,
+ 'Schema' => Illuminate\Support\Facades\Schema::class,
+ 'Session' => Illuminate\Support\Facades\Session::class,
+ 'Storage' => Illuminate\Support\Facades\Storage::class,
+ 'Str' => Illuminate\Support\Str::class,
+ 'URL' => Illuminate\Support\Facades\URL::class,
+ 'Validator' => Illuminate\Support\Facades\Validator::class,
+ 'View' => Illuminate\Support\Facades\View::class,
+
+ ],
+
+];
diff --git a/config/auth.php b/config/auth.php
new file mode 100644
index 000000000..ba1a4d8cb
--- /dev/null
+++ b/config/auth.php
@@ -0,0 +1,117 @@
+ [
+ 'guard' => 'web',
+ 'passwords' => 'users',
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Authentication Guards
+ |--------------------------------------------------------------------------
+ |
+ | Next, you may define every authentication guard for your application.
+ | Of course, a great default configuration has been defined for you
+ | here which uses session storage and the Eloquent user provider.
+ |
+ | All authentication drivers have a user provider. This defines how the
+ | users are actually retrieved out of your database or other storage
+ | mechanisms used by this application to persist your user's data.
+ |
+ | Supported: "session", "token"
+ |
+ */
+
+ 'guards' => [
+ 'web' => [
+ 'driver' => 'session',
+ 'provider' => 'users',
+ ],
+
+ 'api' => [
+ 'driver' => 'token',
+ 'provider' => 'users',
+ 'hash' => false,
+ ],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | User Providers
+ |--------------------------------------------------------------------------
+ |
+ | All authentication drivers have a user provider. This defines how the
+ | users are actually retrieved out of your database or other storage
+ | mechanisms used by this application to persist your user's data.
+ |
+ | If you have multiple user tables or models you may configure multiple
+ | sources which represent each model / table. These sources may then
+ | be assigned to any extra authentication guards you have defined.
+ |
+ | Supported: "database", "eloquent"
+ |
+ */
+
+ 'providers' => [
+ 'users' => [
+ 'driver' => 'eloquent',
+ 'model' => App\Models\User::class,
+ ],
+
+ // 'users' => [
+ // 'driver' => 'database',
+ // 'table' => 'users',
+ // ],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Resetting Passwords
+ |--------------------------------------------------------------------------
+ |
+ | You may specify multiple password reset configurations if you have more
+ | than one user table or model in the application and you want to have
+ | separate password reset settings based on the specific user types.
+ |
+ | The expire time is the number of minutes that the reset token should be
+ | considered valid. This security feature keeps tokens short-lived so
+ | they have less time to be guessed. You may change this as needed.
+ |
+ */
+
+ 'passwords' => [
+ 'users' => [
+ 'provider' => 'users',
+ 'table' => 'password_resets',
+ 'expire' => 60,
+ 'throttle' => 60,
+ ],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Password Confirmation Timeout
+ |--------------------------------------------------------------------------
+ |
+ | Here you may define the amount of seconds before a password confirmation
+ | times out and the user is prompted to re-enter their password via the
+ | confirmation screen. By default, the timeout lasts for three hours.
+ |
+ */
+
+ 'password_timeout' => 10800,
+
+];
diff --git a/config/broadcasting.php b/config/broadcasting.php
new file mode 100644
index 000000000..2d529820c
--- /dev/null
+++ b/config/broadcasting.php
@@ -0,0 +1,64 @@
+ env('BROADCAST_DRIVER', 'null'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Broadcast Connections
+ |--------------------------------------------------------------------------
+ |
+ | Here you may define all of the broadcast connections that will be used
+ | to broadcast events to other systems or over websockets. Samples of
+ | each available type of connection are provided inside this array.
+ |
+ */
+
+ 'connections' => [
+
+ 'pusher' => [
+ 'driver' => 'pusher',
+ 'key' => env('PUSHER_APP_KEY'),
+ 'secret' => env('PUSHER_APP_SECRET'),
+ 'app_id' => env('PUSHER_APP_ID'),
+ 'options' => [
+ 'cluster' => env('PUSHER_APP_CLUSTER'),
+ 'useTLS' => true,
+ ],
+ ],
+
+ 'ably' => [
+ 'driver' => 'ably',
+ 'key' => env('ABLY_KEY'),
+ ],
+
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ ],
+
+ 'log' => [
+ 'driver' => 'log',
+ ],
+
+ 'null' => [
+ 'driver' => 'null',
+ ],
+
+ ],
+
+];
diff --git a/config/cache.php b/config/cache.php
new file mode 100644
index 000000000..8736c7a7a
--- /dev/null
+++ b/config/cache.php
@@ -0,0 +1,110 @@
+ env('CACHE_DRIVER', 'file'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Cache Stores
+ |--------------------------------------------------------------------------
+ |
+ | Here you may define all of the cache "stores" for your application as
+ | well as their drivers. You may even define multiple stores for the
+ | same cache driver to group types of items stored in your caches.
+ |
+ | Supported drivers: "apc", "array", "database", "file",
+ | "memcached", "redis", "dynamodb", "octane", "null"
+ |
+ */
+
+ 'stores' => [
+
+ 'apc' => [
+ 'driver' => 'apc',
+ ],
+
+ 'array' => [
+ 'driver' => 'array',
+ 'serialize' => false,
+ ],
+
+ 'database' => [
+ 'driver' => 'database',
+ 'table' => 'cache',
+ 'connection' => null,
+ 'lock_connection' => null,
+ ],
+
+ 'file' => [
+ 'driver' => 'file',
+ 'path' => storage_path('framework/cache/data'),
+ ],
+
+ 'memcached' => [
+ 'driver' => 'memcached',
+ 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
+ 'sasl' => [
+ env('MEMCACHED_USERNAME'),
+ env('MEMCACHED_PASSWORD'),
+ ],
+ 'options' => [
+ // Memcached::OPT_CONNECT_TIMEOUT => 2000,
+ ],
+ 'servers' => [
+ [
+ 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
+ 'port' => env('MEMCACHED_PORT', 11211),
+ 'weight' => 100,
+ ],
+ ],
+ ],
+
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'cache',
+ 'lock_connection' => 'default',
+ ],
+
+ 'dynamodb' => [
+ 'driver' => 'dynamodb',
+ 'key' => env('AWS_ACCESS_KEY_ID'),
+ 'secret' => env('AWS_SECRET_ACCESS_KEY'),
+ 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
+ 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
+ 'endpoint' => env('DYNAMODB_ENDPOINT'),
+ ],
+
+ 'octane' => [
+ 'driver' => 'octane',
+ ],
+
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Cache Key Prefix
+ |--------------------------------------------------------------------------
+ |
+ | When utilizing a RAM based store such as APC or Memcached, there might
+ | be other applications utilizing the same cache. So, we'll specify a
+ | value to get prefixed to all our keys so we can avoid collisions.
+ |
+ */
+
+ 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
+
+];
diff --git a/config/cors.php b/config/cors.php
new file mode 100644
index 000000000..8a39e6daa
--- /dev/null
+++ b/config/cors.php
@@ -0,0 +1,34 @@
+ ['api/*', 'sanctum/csrf-cookie'],
+
+ 'allowed_methods' => ['*'],
+
+ 'allowed_origins' => ['*'],
+
+ 'allowed_origins_patterns' => [],
+
+ 'allowed_headers' => ['*'],
+
+ 'exposed_headers' => [],
+
+ 'max_age' => 0,
+
+ 'supports_credentials' => false,
+
+];
diff --git a/config/csrf_config.php b/config/csrf_config.php
deleted file mode 100755
index 61b740868..000000000
--- a/config/csrf_config.php
+++ /dev/null
@@ -1,38 +0,0 @@
-.
- */
-
-/*
- * Configuration file for CSRF Protector.
- */
-return [
- 'logDirectory' => base_dir().'/logs',
- 'failedAuthAction' => [
- 'GET' => 0,
- 'POST' => 0,
- ],
- 'jsUrl' => base_path().'/assets/dist/js/csrf/csrfprotector.js',
- 'tokenLength' => 10,
- 'cookieConfig' => [
- 'path' => base_path(),
- 'secure' => isHTTPS(true),
- ],
- 'verifyGetFor' => [],
- 'CSRFP_TOKEN' => '',
- 'disabledJavascriptMessage' => '',
-];
diff --git a/config/database.php b/config/database.php
new file mode 100644
index 000000000..b42d9b30a
--- /dev/null
+++ b/config/database.php
@@ -0,0 +1,147 @@
+ env('DB_CONNECTION', 'mysql'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Database Connections
+ |--------------------------------------------------------------------------
+ |
+ | Here are each of the database connections setup for your application.
+ | Of course, examples of configuring each database platform that is
+ | supported by Laravel is shown below to make development simple.
+ |
+ |
+ | All database work in Laravel is done through the PHP PDO facilities
+ | so make sure you have the driver for your particular database of
+ | choice installed on your machine before you begin development.
+ |
+ */
+
+ 'connections' => [
+
+ 'sqlite' => [
+ 'driver' => 'sqlite',
+ 'url' => env('DATABASE_URL'),
+ 'database' => env('DB_DATABASE', database_path('database.sqlite')),
+ 'prefix' => '',
+ 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
+ ],
+
+ 'mysql' => [
+ 'driver' => 'mysql',
+ 'url' => env('DATABASE_URL'),
+ 'host' => env('DB_HOST', '127.0.0.1'),
+ 'port' => env('DB_PORT', '3306'),
+ 'database' => env('DB_DATABASE', 'forge'),
+ 'username' => env('DB_USERNAME', 'forge'),
+ 'password' => env('DB_PASSWORD', ''),
+ 'unix_socket' => env('DB_SOCKET', ''),
+ 'charset' => 'utf8mb4',
+ 'collation' => 'utf8mb4_unicode_ci',
+ 'prefix' => '',
+ 'prefix_indexes' => true,
+ 'strict' => true,
+ 'engine' => null,
+ 'options' => extension_loaded('pdo_mysql') ? array_filter([
+ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
+ ]) : [],
+ ],
+
+ 'pgsql' => [
+ 'driver' => 'pgsql',
+ 'url' => env('DATABASE_URL'),
+ 'host' => env('DB_HOST', '127.0.0.1'),
+ 'port' => env('DB_PORT', '5432'),
+ 'database' => env('DB_DATABASE', 'forge'),
+ 'username' => env('DB_USERNAME', 'forge'),
+ 'password' => env('DB_PASSWORD', ''),
+ 'charset' => 'utf8',
+ 'prefix' => '',
+ 'prefix_indexes' => true,
+ 'schema' => 'public',
+ 'sslmode' => 'prefer',
+ ],
+
+ 'sqlsrv' => [
+ 'driver' => 'sqlsrv',
+ 'url' => env('DATABASE_URL'),
+ 'host' => env('DB_HOST', 'localhost'),
+ 'port' => env('DB_PORT', '1433'),
+ 'database' => env('DB_DATABASE', 'forge'),
+ 'username' => env('DB_USERNAME', 'forge'),
+ 'password' => env('DB_PASSWORD', ''),
+ 'charset' => 'utf8',
+ 'prefix' => '',
+ 'prefix_indexes' => true,
+ ],
+
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Migration Repository Table
+ |--------------------------------------------------------------------------
+ |
+ | This table keeps track of all the migrations that have already run for
+ | your application. Using this information, we can determine which of
+ | the migrations on disk haven't actually been run in the database.
+ |
+ */
+
+ 'migrations' => 'migrations',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Redis Databases
+ |--------------------------------------------------------------------------
+ |
+ | Redis is an open source, fast, and advanced key-value store that also
+ | provides a richer body of commands than a typical key-value system
+ | such as APC or Memcached. Laravel makes it easy to dig right in.
+ |
+ */
+
+ 'redis' => [
+
+ 'client' => env('REDIS_CLIENT', 'phpredis'),
+
+ 'options' => [
+ 'cluster' => env('REDIS_CLUSTER', 'redis'),
+ 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
+ ],
+
+ 'default' => [
+ 'url' => env('REDIS_URL'),
+ 'host' => env('REDIS_HOST', '127.0.0.1'),
+ 'password' => env('REDIS_PASSWORD', null),
+ 'port' => env('REDIS_PORT', '6379'),
+ 'database' => env('REDIS_DB', '0'),
+ ],
+
+ 'cache' => [
+ 'url' => env('REDIS_URL'),
+ 'host' => env('REDIS_HOST', '127.0.0.1'),
+ 'password' => env('REDIS_PASSWORD', null),
+ 'port' => env('REDIS_PORT', '6379'),
+ 'database' => env('REDIS_CACHE_DB', '1'),
+ ],
+
+ ],
+
+];
diff --git a/config/filesystems.php b/config/filesystems.php
new file mode 100644
index 000000000..760ef9728
--- /dev/null
+++ b/config/filesystems.php
@@ -0,0 +1,73 @@
+ env('FILESYSTEM_DRIVER', 'local'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Filesystem Disks
+ |--------------------------------------------------------------------------
+ |
+ | Here you may configure as many filesystem "disks" as you wish, and you
+ | may even configure multiple disks of the same driver. Defaults have
+ | been setup for each driver as an example of the required options.
+ |
+ | Supported Drivers: "local", "ftp", "sftp", "s3"
+ |
+ */
+
+ 'disks' => [
+
+ 'local' => [
+ 'driver' => 'local',
+ 'root' => storage_path('app'),
+ ],
+
+ 'public' => [
+ 'driver' => 'local',
+ 'root' => storage_path('app/public'),
+ 'url' => env('APP_URL').'/storage',
+ 'visibility' => 'public',
+ ],
+
+ 's3' => [
+ 'driver' => 's3',
+ 'key' => env('AWS_ACCESS_KEY_ID'),
+ 'secret' => env('AWS_SECRET_ACCESS_KEY'),
+ 'region' => env('AWS_DEFAULT_REGION'),
+ 'bucket' => env('AWS_BUCKET'),
+ 'url' => env('AWS_URL'),
+ 'endpoint' => env('AWS_ENDPOINT'),
+ 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
+ ],
+
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Symbolic Links
+ |--------------------------------------------------------------------------
+ |
+ | Here you may configure the symbolic links that will be created when the
+ | `storage:link` Artisan command is executed. The array keys should be
+ | the locations of the links and the values should be their targets.
+ |
+ */
+
+ 'links' => [
+ public_path('storage') => storage_path('app/public'),
+ ],
+
+];
diff --git a/config/hashing.php b/config/hashing.php
new file mode 100644
index 000000000..842577087
--- /dev/null
+++ b/config/hashing.php
@@ -0,0 +1,52 @@
+ 'bcrypt',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Bcrypt Options
+ |--------------------------------------------------------------------------
+ |
+ | Here you may specify the configuration options that should be used when
+ | passwords are hashed using the Bcrypt algorithm. This will allow you
+ | to control the amount of time it takes to hash the given password.
+ |
+ */
+
+ 'bcrypt' => [
+ 'rounds' => env('BCRYPT_ROUNDS', 10),
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Argon Options
+ |--------------------------------------------------------------------------
+ |
+ | Here you may specify the configuration options that should be used when
+ | passwords are hashed using the Argon algorithm. These will allow you
+ | to control the amount of time it takes to hash the given password.
+ |
+ */
+
+ 'argon' => [
+ 'memory' => 1024,
+ 'threads' => 2,
+ 'time' => 2,
+ ],
+
+];
diff --git a/config/logging.php b/config/logging.php
new file mode 100644
index 000000000..1aa06aa30
--- /dev/null
+++ b/config/logging.php
@@ -0,0 +1,105 @@
+ env('LOG_CHANNEL', 'stack'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Log Channels
+ |--------------------------------------------------------------------------
+ |
+ | Here you may configure the log channels for your application. Out of
+ | the box, Laravel uses the Monolog PHP logging library. This gives
+ | you a variety of powerful log handlers / formatters to utilize.
+ |
+ | Available Drivers: "single", "daily", "slack", "syslog",
+ | "errorlog", "monolog",
+ | "custom", "stack"
+ |
+ */
+
+ 'channels' => [
+ 'stack' => [
+ 'driver' => 'stack',
+ 'channels' => ['single'],
+ 'ignore_exceptions' => false,
+ ],
+
+ 'single' => [
+ 'driver' => 'single',
+ 'path' => storage_path('logs/laravel.log'),
+ 'level' => env('LOG_LEVEL', 'debug'),
+ ],
+
+ 'daily' => [
+ 'driver' => 'daily',
+ 'path' => storage_path('logs/laravel.log'),
+ 'level' => env('LOG_LEVEL', 'debug'),
+ 'days' => 14,
+ ],
+
+ 'slack' => [
+ 'driver' => 'slack',
+ 'url' => env('LOG_SLACK_WEBHOOK_URL'),
+ 'username' => 'Laravel Log',
+ 'emoji' => ':boom:',
+ 'level' => env('LOG_LEVEL', 'critical'),
+ ],
+
+ 'papertrail' => [
+ 'driver' => 'monolog',
+ 'level' => env('LOG_LEVEL', 'debug'),
+ 'handler' => SyslogUdpHandler::class,
+ 'handler_with' => [
+ 'host' => env('PAPERTRAIL_URL'),
+ 'port' => env('PAPERTRAIL_PORT'),
+ ],
+ ],
+
+ 'stderr' => [
+ 'driver' => 'monolog',
+ 'level' => env('LOG_LEVEL', 'debug'),
+ 'handler' => StreamHandler::class,
+ 'formatter' => env('LOG_STDERR_FORMATTER'),
+ 'with' => [
+ 'stream' => 'php://stderr',
+ ],
+ ],
+
+ 'syslog' => [
+ 'driver' => 'syslog',
+ 'level' => env('LOG_LEVEL', 'debug'),
+ ],
+
+ 'errorlog' => [
+ 'driver' => 'errorlog',
+ 'level' => env('LOG_LEVEL', 'debug'),
+ ],
+
+ 'null' => [
+ 'driver' => 'monolog',
+ 'handler' => NullHandler::class,
+ ],
+
+ 'emergency' => [
+ 'path' => storage_path('logs/laravel.log'),
+ ],
+ ],
+
+];
diff --git a/config/mail.php b/config/mail.php
new file mode 100644
index 000000000..54299aabf
--- /dev/null
+++ b/config/mail.php
@@ -0,0 +1,110 @@
+ env('MAIL_MAILER', 'smtp'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Mailer Configurations
+ |--------------------------------------------------------------------------
+ |
+ | Here you may configure all of the mailers used by your application plus
+ | their respective settings. Several examples have been configured for
+ | you and you are free to add your own as your application requires.
+ |
+ | Laravel supports a variety of mail "transport" drivers to be used while
+ | sending an e-mail. You will specify which one you are using for your
+ | mailers below. You are free to add additional mailers as required.
+ |
+ | Supported: "smtp", "sendmail", "mailgun", "ses",
+ | "postmark", "log", "array"
+ |
+ */
+
+ 'mailers' => [
+ 'smtp' => [
+ 'transport' => 'smtp',
+ 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
+ 'port' => env('MAIL_PORT', 587),
+ 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
+ 'username' => env('MAIL_USERNAME'),
+ 'password' => env('MAIL_PASSWORD'),
+ 'timeout' => null,
+ 'auth_mode' => null,
+ ],
+
+ 'ses' => [
+ 'transport' => 'ses',
+ ],
+
+ 'mailgun' => [
+ 'transport' => 'mailgun',
+ ],
+
+ 'postmark' => [
+ 'transport' => 'postmark',
+ ],
+
+ 'sendmail' => [
+ 'transport' => 'sendmail',
+ 'path' => '/usr/sbin/sendmail -bs',
+ ],
+
+ 'log' => [
+ 'transport' => 'log',
+ 'channel' => env('MAIL_LOG_CHANNEL'),
+ ],
+
+ 'array' => [
+ 'transport' => 'array',
+ ],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Global "From" Address
+ |--------------------------------------------------------------------------
+ |
+ | You may wish for all e-mails sent by your application to be sent from
+ | the same address. Here, you may specify a name and address that is
+ | used globally for all e-mails that are sent by your application.
+ |
+ */
+
+ 'from' => [
+ 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
+ 'name' => env('MAIL_FROM_NAME', 'Example'),
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Markdown Mail Settings
+ |--------------------------------------------------------------------------
+ |
+ | If you are using Markdown based email rendering, you may configure your
+ | theme and component paths here, allowing you to customize the design
+ | of the emails. Or, you may simply stick with the Laravel defaults!
+ |
+ */
+
+ 'markdown' => [
+ 'theme' => 'default',
+
+ 'paths' => [
+ resource_path('views/vendor/mail'),
+ ],
+ ],
+
+];
diff --git a/config/namespaces.php b/config/namespaces.php
deleted file mode 100755
index ce6f78f32..000000000
--- a/config/namespaces.php
+++ /dev/null
@@ -1,64 +0,0 @@
-.
- */
-
-return [
- 'modules/banche' => 'Modules\Banche',
-];
-
-/*
-'modules/aggiornamenti' => 'Modules\Aggiornamenti',
-'modules/anagrafiche' => 'Modules\Anagrafiche',
-'modules/backups' => 'Modules\Backups',
-'modules/emails' => 'Modules\Emails',
-'modules/articoli' => 'Modules\Articoli',
-'modules/checklists' => 'Modules\Checklists',
-'modules/ritenute' => 'Modules\Ritenute',
-'modules/ritenute_contributi' => 'Modules\RitenuteContributi',
-'modules/rivalse' => 'Modules\Rivalse',
-'modules/newsletter' => 'Modules\Newsletter',
-'modules/iva' => 'Modules\Iva',
-'modules/ddt' => 'Modules\DDT',
-'modules/fatture' => 'Modules\Fatture',
-'modules/ordini' => 'Modules\Ordini',
-'modules/preventivi' => 'Modules\Preventivi',
-'modules/contratti' => 'Modules\Contratti',
-'modules/interventi' => 'Modules\Interventi',
-'modules/pagamenti' => 'Modules\Pagamenti',
-'modules/statistiche' => 'Modules\Statistiche',
-'modules/scadenzario' => 'Modules\Scadenzario',
-'modules/primanota' => 'Modules\PrimaNota',
-'modules/utenti' => 'Modules\Utenti',
-'modules/stato_servizi' => 'Modules\StatoServizi',
-'modules/stati_intervento' => 'Modules\StatiIntervento',
-'modules/stati_preventivo' => 'Modules\StatiPreventivo',
-'modules/stati_contratto' => 'Modules\StatiContratto',
-'modules/tipi_intervento' => 'Modules\TipiIntervento',
-'modules/categorie_documenti' => 'Modules\CategorieDocumentali',
-'modules/listini' => 'Modules\Listini',
-'modules/impianti' => 'Modules\Impianti',
-'modules/impostazioni' => 'Modules\Impostazioni',
-'plugins/exportFE' => 'Plugins\ExportFE',
-'plugins/importFE' => 'Plugins\ImportFE',
-'plugins/receiptFE' => 'Plugins\ReceiptFE',
-'plugins/dichiarazioni_intento' => 'Plugins\DichiarazioniIntento',
-'plugins/pianificazione_interventi' => 'Plugins\PianificazioneInterventi',
-'plugins/pianificazione_fatturazione' => 'Plugins\PianificazioneFatturazione',
-'plugins/statistiche_articoli' => 'Plugins\StatisticheArticoli',
-'plugins/dettagli_articolo' => 'Plugins\DettagliArticolo',
-*/
diff --git a/config/queue.php b/config/queue.php
new file mode 100644
index 000000000..25ea5a819
--- /dev/null
+++ b/config/queue.php
@@ -0,0 +1,93 @@
+ env('QUEUE_CONNECTION', 'sync'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Queue Connections
+ |--------------------------------------------------------------------------
+ |
+ | Here you may configure the connection information for each server that
+ | is used by your application. A default configuration has been added
+ | for each back-end shipped with Laravel. You are free to add more.
+ |
+ | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
+ |
+ */
+
+ 'connections' => [
+
+ 'sync' => [
+ 'driver' => 'sync',
+ ],
+
+ 'database' => [
+ 'driver' => 'database',
+ 'table' => 'jobs',
+ 'queue' => 'default',
+ 'retry_after' => 90,
+ 'after_commit' => false,
+ ],
+
+ 'beanstalkd' => [
+ 'driver' => 'beanstalkd',
+ 'host' => 'localhost',
+ 'queue' => 'default',
+ 'retry_after' => 90,
+ 'block_for' => 0,
+ 'after_commit' => false,
+ ],
+
+ 'sqs' => [
+ 'driver' => 'sqs',
+ 'key' => env('AWS_ACCESS_KEY_ID'),
+ 'secret' => env('AWS_SECRET_ACCESS_KEY'),
+ 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
+ 'queue' => env('SQS_QUEUE', 'default'),
+ 'suffix' => env('SQS_SUFFIX'),
+ 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
+ 'after_commit' => false,
+ ],
+
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ 'queue' => env('REDIS_QUEUE', 'default'),
+ 'retry_after' => 90,
+ 'block_for' => null,
+ 'after_commit' => false,
+ ],
+
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Failed Queue Jobs
+ |--------------------------------------------------------------------------
+ |
+ | These options configure the behavior of failed queue job logging so you
+ | can control which database and table are used to store the jobs that
+ | have failed. You may change them to any database / table you wish.
+ |
+ */
+
+ 'failed' => [
+ 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
+ 'database' => env('DB_CONNECTION', 'mysql'),
+ 'table' => 'failed_jobs',
+ ],
+
+];
diff --git a/config/services.php b/config/services.php
new file mode 100644
index 000000000..2a1d616c7
--- /dev/null
+++ b/config/services.php
@@ -0,0 +1,33 @@
+ [
+ 'domain' => env('MAILGUN_DOMAIN'),
+ 'secret' => env('MAILGUN_SECRET'),
+ 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
+ ],
+
+ 'postmark' => [
+ 'token' => env('POSTMARK_TOKEN'),
+ ],
+
+ 'ses' => [
+ 'key' => env('AWS_ACCESS_KEY_ID'),
+ 'secret' => env('AWS_SECRET_ACCESS_KEY'),
+ 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
+ ],
+
+];
diff --git a/config/session.php b/config/session.php
new file mode 100644
index 000000000..ac0802b19
--- /dev/null
+++ b/config/session.php
@@ -0,0 +1,201 @@
+ env('SESSION_DRIVER', 'file'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Lifetime
+ |--------------------------------------------------------------------------
+ |
+ | Here you may specify the number of minutes that you wish the session
+ | to be allowed to remain idle before it expires. If you want them
+ | to immediately expire on the browser closing, set that option.
+ |
+ */
+
+ 'lifetime' => env('SESSION_LIFETIME', 120),
+
+ 'expire_on_close' => false,
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Encryption
+ |--------------------------------------------------------------------------
+ |
+ | This option allows you to easily specify that all of your session data
+ | should be encrypted before it is stored. All encryption will be run
+ | automatically by Laravel and you can use the Session like normal.
+ |
+ */
+
+ 'encrypt' => false,
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session File Location
+ |--------------------------------------------------------------------------
+ |
+ | When using the native session driver, we need a location where session
+ | files may be stored. A default has been set for you but a different
+ | location may be specified. This is only needed for file sessions.
+ |
+ */
+
+ 'files' => storage_path('framework/sessions'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Database Connection
+ |--------------------------------------------------------------------------
+ |
+ | When using the "database" or "redis" session drivers, you may specify a
+ | connection that should be used to manage these sessions. This should
+ | correspond to a connection in your database configuration options.
+ |
+ */
+
+ 'connection' => env('SESSION_CONNECTION', null),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Database Table
+ |--------------------------------------------------------------------------
+ |
+ | When using the "database" session driver, you may specify the table we
+ | should use to manage the sessions. Of course, a sensible default is
+ | provided for you; however, you are free to change this as needed.
+ |
+ */
+
+ 'table' => 'sessions',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Cache Store
+ |--------------------------------------------------------------------------
+ |
+ | While using one of the framework's cache driven session backends you may
+ | list a cache store that should be used for these sessions. This value
+ | must match with one of the application's configured cache "stores".
+ |
+ | Affects: "apc", "dynamodb", "memcached", "redis"
+ |
+ */
+
+ 'store' => env('SESSION_STORE', null),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Sweeping Lottery
+ |--------------------------------------------------------------------------
+ |
+ | Some session drivers must manually sweep their storage location to get
+ | rid of old sessions from storage. Here are the chances that it will
+ | happen on a given request. By default, the odds are 2 out of 100.
+ |
+ */
+
+ 'lottery' => [2, 100],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Cookie Name
+ |--------------------------------------------------------------------------
+ |
+ | Here you may change the name of the cookie used to identify a session
+ | instance by ID. The name specified here will get used every time a
+ | new session cookie is created by the framework for every driver.
+ |
+ */
+
+ 'cookie' => env(
+ 'SESSION_COOKIE',
+ Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
+ ),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Cookie Path
+ |--------------------------------------------------------------------------
+ |
+ | The session cookie path determines the path for which the cookie will
+ | be regarded as available. Typically, this will be the root path of
+ | your application but you are free to change this when necessary.
+ |
+ */
+
+ 'path' => '/',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Session Cookie Domain
+ |--------------------------------------------------------------------------
+ |
+ | Here you may change the domain of the cookie used to identify a session
+ | in your application. This will determine which domains the cookie is
+ | available to in your application. A sensible default has been set.
+ |
+ */
+
+ 'domain' => env('SESSION_DOMAIN', null),
+
+ /*
+ |--------------------------------------------------------------------------
+ | HTTPS Only Cookies
+ |--------------------------------------------------------------------------
+ |
+ | By setting this option to true, session cookies will only be sent back
+ | to the server if the browser has a HTTPS connection. This will keep
+ | the cookie from being sent to you when it can't be done securely.
+ |
+ */
+
+ 'secure' => env('SESSION_SECURE_COOKIE'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | HTTP Access Only
+ |--------------------------------------------------------------------------
+ |
+ | Setting this value to true will prevent JavaScript from accessing the
+ | value of the cookie and the cookie will only be accessible through
+ | the HTTP protocol. You are free to modify this option if needed.
+ |
+ */
+
+ 'http_only' => true,
+
+ /*
+ |--------------------------------------------------------------------------
+ | Same-Site Cookies
+ |--------------------------------------------------------------------------
+ |
+ | This option determines how your cookies behave when cross-site requests
+ | take place, and can be used to mitigate CSRF attacks. By default, we
+ | will set this value to "lax" since this is a secure default value.
+ |
+ | Supported: "lax", "strict", "none", null
+ |
+ */
+
+ 'same_site' => 'lax',
+
+];
diff --git a/config/view.php b/config/view.php
new file mode 100644
index 000000000..22b8a18d3
--- /dev/null
+++ b/config/view.php
@@ -0,0 +1,36 @@
+ [
+ resource_path('views'),
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Compiled View Path
+ |--------------------------------------------------------------------------
+ |
+ | This option determines where all the compiled Blade templates will be
+ | stored for your application. Typically, this is within the storage
+ | directory. However, as usual, you are free to change this value.
+ |
+ */
+
+ 'compiled' => env(
+ 'VIEW_COMPILED_PATH',
+ realpath(storage_path('framework/views'))
+ ),
+
+];
diff --git a/controller.php b/controller.php
deleted file mode 100755
index d5ef0265f..000000000
--- a/controller.php
+++ /dev/null
@@ -1,115 +0,0 @@
-.
- */
-
-include_once __DIR__.'/core.php';
-
-if (!empty($id_record) && !empty($id_module)) {
- redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record);
-} elseif (empty($id_module)) {
- redirect(base_path().'/index.php');
-}
-
-include_once App::filepath('include|custom|', 'top.php');
-
-// Inclusione gli elementi fondamentali
-include_once base_dir().'/actions.php';
-
-// Widget in alto
-echo '{( "name": "widgets", "id_module": "'.$id_module.'", "position": "top", "place": "controller" )}';
-
-// Lettura eventuali plugins modulo da inserire come tab
-echo '
-
-
- ';
-
-$plugins = $dbo->fetchArray('SELECT id, title FROM zz_plugins WHERE idmodule_to='.prepare($id_module)." AND position='tab_main' AND enabled = 1");
-
-// Tab dei plugin
-foreach ($plugins as $plugin) {
- echo '
-
- '.$plugin['title'].'
- ';
-}
-
-echo '
-
-
-
';
-
-include base_dir().'/include/manager.php';
-
-echo '
-
';
-
-// Plugin
-$module_record = $record;
-foreach ($plugins as $plugin) {
- $record = $module_record;
-
- echo '
-
';
-
- $id_plugin = $plugin['id'];
-
- include base_dir().'/include/manager.php';
-
- echo '
-
';
-}
-
-$record = $module_record;
-
-echo '
-
-
';
-
-redirectOperation($id_module, isset($id_parent) ? $id_parent : $id_record);
-
-// Interfaccia per la modifica dell'ordine e della visibilità delle colonne (Amministratore)
-if ($user->is_admin && string_contains($module['option'], '|select|')) {
- echo '
-
- '.tr('Modifica colonne').'
-
-
-';
-}
-
-// Widget in basso
-echo '{( "name": "widgets", "id_module": "'.$id_module.'", "position": "right", "place": "controller" )}';
-
-include_once App::filepath('include|custom|', 'bottom.php');
diff --git a/core.php b/core.php
deleted file mode 100755
index d9306f0ad..000000000
--- a/core.php
+++ /dev/null
@@ -1,302 +0,0 @@
-.
- */
-
-// Rimozione header X-Powered-By
-header_remove('X-Powered-By');
-
-// Impostazioni di configurazione PHP
-date_default_timezone_set('Europe/Rome');
-
-// Controllo sulla versione PHP
-$minimum = '5.6.0';
-if (version_compare(phpversion(), $minimum) < 0) {
- echo '
-Stai utilizzando la versione PHP '.phpversion().', non compatibile con OpenSTAManager.
-
-Aggiorna PHP alla versione >= '.$minimum.'.
';
- exit();
-}
-
-// Caricamento delle impostazioni personalizzabili
-if (file_exists(__DIR__.'/config.inc.php')) {
- include_once __DIR__.'/config.inc.php';
-}
-
-// Caricamento delle dipendenze e delle librerie del progetto
-$loader = require_once __DIR__.'/vendor/autoload.php';
-
-$namespaces = require_once __DIR__.'/config/namespaces.php';
-foreach ($namespaces as $path => $namespace) {
- $loader->addPsr4($namespace.'\\', __DIR__.'/'.$path.'/custom/src');
- $loader->addPsr4($namespace.'\\', __DIR__.'/'.$path.'/src');
-}
-
-// Individuazione dei percorsi di base
-App::definePaths(__DIR__);
-
-$docroot = DOCROOT;
-$rootdir = ROOTDIR;
-$baseurl = BASEURL;
-
-// Sicurezza della sessioni
-//ini_set('session.cookie_samesite', 'strict');
-ini_set('session.use_trans_sid', '0');
-ini_set('session.use_only_cookies', '1');
-
-session_set_cookie_params(0, base_path(), null, isHTTPS(true));
-session_start();
-
-// Lettura della configurazione
-$config = App::getConfig();
-
-// Redirect al percorso HTTPS se impostato nella configurazione
-if (!empty($config['redirectHTTPS']) && !isHTTPS(true)) {
- header('HTTP/1.1 301 Moved Permanently');
- header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
- exit();
-}
-
-/* GESTIONE DEGLI ERRORI */
-// Logger per la segnalazione degli errori
-$logger = new Monolog\Logger('Logs');
-$logger->pushProcessor(new Monolog\Processor\UidProcessor());
-$logger->pushProcessor(new Monolog\Processor\WebProcessor());
-
-// Registrazione globale del logger
-Monolog\Registry::addLogger($logger, 'logs');
-
-use Monolog\Handler\FilterHandler;
-use Monolog\Handler\RotatingFileHandler;
-use Monolog\Handler\StreamHandler;
-
-$handlers = [];
-if (!API\Response::isAPIRequest()) {
- // File di log di base (logs/error.log, logs/setup.log)
- $handlers[] = new StreamHandler(base_dir().'/logs/error.log', Monolog\Logger::ERROR);
- $handlers[] = new StreamHandler(base_dir().'/logs/setup.log', Monolog\Logger::EMERGENCY);
-
- // Messaggi grafici per l'utente
- $handlers[] = new Extensions\MessageHandler(Monolog\Logger::ERROR);
-
- // File di log ordinati in base alla data
- if (App::debug()) {
- $handlers[] = new RotatingFileHandler(base_dir().'/logs/error.log', 0, Monolog\Logger::ERROR);
- $handlers[] = new RotatingFileHandler(base_dir().'/logs/setup.log', 0, Monolog\Logger::EMERGENCY);
- }
-
- // Inizializzazione Whoops
- $whoops = new Whoops\Run();
-
- if (App::debug()) {
- $whoops->pushHandler(new Whoops\Handler\PrettyPageHandler());
- }
-
- // Abilita la gestione degli errori nel caso la richiesta sia di tipo AJAX
- if (Whoops\Util\Misc::isAjaxRequest()) {
- $whoops->pushHandler(new Whoops\Handler\JsonResponseHandler());
- }
-
- $whoops->register();
-
- // Aggiunta di Monolog a Whoops
- $whoops->pushHandler(function ($exception, $inspector, $run) use ($logger) {
- $logger->addError($exception->getMessage(), [
- 'code' => $exception->getCode(),
- 'message' => $exception->getMessage(),
- 'file' => $exception->getFile(),
- 'line' => $exception->getLine(),
- 'trace' => $exception->getTraceAsString(),
- ]);
- });
-} else {
- $handlers[] = new StreamHandler(base_dir().'/logs/api.log', Monolog\Logger::ERROR);
-}
-
-// Disabilita i messaggi nativi di PHP
-ini_set('display_errors', 0);
-// Ignora gli avvertimenti e le informazioni relative alla deprecazione di componenti
-error_reporting(E_ALL & ~E_WARNING & ~E_CORE_WARNING & ~E_NOTICE & ~E_USER_DEPRECATED & ~E_STRICT);
-
-$pattern = '[%datetime%] %channel%.%level_name%: %message% %context%'.PHP_EOL.'%extra% '.PHP_EOL;
-$monologFormatter = new Monolog\Formatter\LineFormatter($pattern);
-$monologFormatter->includeStacktraces(App::debug());
-
-// Filtra gli errori per livello preciso del gestore dedicato
-foreach ($handlers as $handler) {
- $handler->setFormatter($monologFormatter);
- $logger->pushHandler(new FilterHandler($handler, [$handler->getLevel()]));
-}
-
-// Imposta Monolog come gestore degli errori
-$handler = new Monolog\ErrorHandler($logger);
-if (!API\Response::isAPIRequest()) {
- $handler->registerErrorHandler([]);
- $handler->registerExceptionHandler(Monolog\Logger::ERROR);
-}
-$handler->registerFatalHandler(Monolog\Logger::ERROR);
-
-// Database
-$dbo = $database = database();
-
-/* INTERNAZIONALIZZAZIONE */
-// Istanziamento del gestore delle traduzioni del progetto
-$lang = !empty($config['lang']) ? $config['lang'] : (isset($_GET['lang']) ? $_GET['lang'] : null);
-$formatter = !empty($config['formatter']) ? $config['formatter'] : [];
-$translator = trans();
-$translator->addLocalePath(base_dir().'/locale');
-$translator->addLocalePath(base_dir().'/modules/*/locale');
-$translator->setLocale($lang, $formatter);
-
-// Individuazione di versione e revisione del progetto
-$version = Update::getVersion();
-$revision = Update::getRevision();
-
-/* ACCESSO E INSTALLAZIONE */
-// Controllo sulla presenza dei permessi di accesso basilari
-$continue = $dbo->isInstalled() && !Update::isUpdateAvailable() && (Auth::check() || API\Response::isAPIRequest());
-
-if (!empty($skip_permissions)) {
- Permissions::skip();
-}
-
-if (!$continue && getURLPath() != slashes(base_path().'/index.php') && !Permissions::getSkip()) {
- if (Auth::check()) {
- Auth::logout();
- }
-
- redirect(base_path().'/index.php');
- exit();
-}
-
-/* INIZIALIZZAZIONE GENERALE */
-// Operazione aggiuntive (richieste non API)
-if (!API\Response::isAPIRequest()) {
- // Impostazioni di Content-Type e Charset Header
- header('Content-Type: text/html; charset=UTF-8');
-
- // Controllo CSRF
- if (empty($config['disableCSRF'])) {
- csrfProtector::init();
- }
-
- // Aggiunta del wrapper personalizzato per la generazione degli input
- if (!empty($config['HTMLWrapper'])) {
- HTMLBuilder\HTMLBuilder::setWrapper($config['HTMLWrapper']);
- }
-
- // Aggiunta dei gestori personalizzati per la generazione degli input
- foreach ((array) $config['HTMLHandlers'] as $key => $value) {
- HTMLBuilder\HTMLBuilder::setHandler($key, $value);
- }
-
- // Aggiunta dei gestori per componenti personalizzate
- foreach ((array) $config['HTMLManagers'] as $key => $value) {
- HTMLBuilder\HTMLBuilder::setManager($key, $value);
- }
-
- // Registrazione globale del template per gli input HTML
- register_shutdown_function('translateTemplate');
- ob_start();
-
- // Retrocompatibilità
- $_SESSION['infos'] = isset($_SESSION['infos']) ? array_unique($_SESSION['infos']) : [];
- $_SESSION['warnings'] = isset($_SESSION['warnings']) ? array_unique($_SESSION['warnings']) : [];
- $_SESSION['errors'] = isset($_SESSION['errors']) ? array_unique($_SESSION['errors']) : [];
-
- // Impostazione del tema grafico di default
- $theme = !empty($config['theme']) ? $config['theme'] : 'default';
-
- if ($continue) {
- // Periodo di visualizzazione dei record
- // Personalizzato
- if (!empty($_GET['period_start'])) {
- $_SESSION['period_start'] = $_GET['period_start'];
- $_SESSION['period_end'] = $_GET['period_end'];
- }
- // Dal 01-01-yyy al 31-12-yyyy
- elseif (!isset($_SESSION['period_start'])) {
- $_SESSION['period_start'] = date('Y').'-01-01';
- $_SESSION['period_end'] = date('Y').'-12-31';
- }
-
- $id_record = filter('id_record');
- $id_parent = filter('id_parent');
-
- Modules::setCurrent(filter('id_module'));
- Plugins::setCurrent(filter('id_plugin'));
-
- // Variabili fondamentali
- $module = Modules::getCurrent();
- $plugin = Plugins::getCurrent();
- $structure = isset($plugin) ? $plugin : $module;
-
- $id_module = $module ? $module['id'] : null;
- $id_plugin = $plugin ? $plugin['id'] : null;
-
- $user = Auth::user();
-
- if (!empty($id_module)) {
- // Segmenti
- if (!isset($_SESSION['module_'.$id_module]['id_segment'])) {
- $segments = Modules::getSegments($id_module);
- $_SESSION['module_'.$id_module]['id_segment'] = isset($segments[0]['id']) ? $segments[0]['id'] : null;
- }
-
- Permissions::addModule($id_module);
- }
-
- Permissions::check();
- }
-
- // Retrocompatibilità
- $post = Filter::getPOST();
- $get = Filter::getGET();
-}
-
-// Inclusione dei file modutil.php
-// TODO: sostituire * con lista module dir {aggiornamenti,anagrafiche,articoli}
-// TODO: sostituire tutte le funzioni dei moduli con classi Eloquent relative
-$files = glob(__DIR__.'/{modules,plugins}/*/modutil.php', GLOB_BRACE);
-$custom_files = glob(__DIR__.'/{modules,plugins}/*/custom/modutil.php', GLOB_BRACE);
-foreach ($custom_files as $key => $value) {
- $index = array_search(str_replace('custom/', '', $value), $files);
- if ($index !== false) {
- unset($files[$index]);
- }
-}
-
-$list = array_merge($files, $custom_files);
-foreach ($list as $file) {
- include_once $file;
-}
-
-// Inclusione dei file vendor/autoload.php di Composer
-$files = glob(__DIR__.'/{modules,plugins}/*/vendor/autoload.php', GLOB_BRACE);
-$custom_files = glob(__DIR__.'/{modules,plugins}/*/custom/vendor/autoload.php', GLOB_BRACE);
-foreach ($custom_files as $key => $value) {
- $index = array_search(str_replace('custom/', '', $value), $files);
- if ($index !== false) {
- unset($files[$index]);
- }
-}
-
-$list = array_merge($files, $custom_files);
-foreach ($list as $file) {
- include_once $file;
-}
diff --git a/cron.php b/cron.php
deleted file mode 100644
index e841d1e5b..000000000
--- a/cron.php
+++ /dev/null
@@ -1,190 +0,0 @@
-.
- */
-
-/*
- * Script dedicato alla gestione delle operazioni di cron ricorrenti del gestionale.
- * Una volta attivato, questo script rimane attivo in background per gestire l'esecuzione delle diverse operazioni come pianificate nella tabella zz_tasks.
- *
- * Il file viene richiamato in automatico al login di un utente.
- * Per garantire che lo script resti attivo in ogni situazione, si consiglia di introdurre una chiamata nel relativo crontab di sistema secondo il seguente schema:
- */
-// Schema crontab: "*/5 * * * * php /cron.php"
-
-use Carbon\Carbon;
-use Models\Cache;
-use Monolog\Handler\RotatingFileHandler;
-use Monolog\Logger;
-use Tasks\Task;
-
-// Rimozione delle limitazioni sull'esecuzione
-set_time_limit(0);
-ignore_user_abort(true);
-
-// Chiusura della richiesta alla pagina
-flush();
-
-$skip_permissions = true;
-include_once __DIR__.'/core.php';
-
-// Controllo su possibili aggiornamenti per bloccare il sistema
-$database_online = $database->isInstalled() && !Update::isUpdateAvailable();
-if (!$database_online) {
- return;
-}
-
-// Disabilita della sessione
-session_write_close();
-
-// Aggiunta di un logger specifico
-$pattern = '[%datetime%] %level_name%: %message% %context%'.PHP_EOL;
-$formatter = new Monolog\Formatter\LineFormatter($pattern);
-
-$logger = new Logger('Tasks');
-$handler = new RotatingFileHandler(base_dir().'/logs/cron.log', 7);
-$handler->setFormatter($formatter);
-$logger->pushHandler($handler);
-
-// Lettura della cache
-$ultima_esecuzione = Cache::pool('Ultima esecuzione del cron');
-$data = $ultima_esecuzione->content;
-
-$in_esecuzione = Cache::pool('Cron in esecuzione');
-$cron_id = Cache::pool('ID del cron');
-
-$disattiva = Cache::pool('Disabilita cron');
-if (!empty($disattiva->content)) {
- return;
-}
-
-// Impostazioni sugli slot di esecuzione
-$slot_duration = 5;
-
-// Controllo sull'ultima esecuzione
-$data = $data ? new Carbon($data) : null;
-$minimo_esecuzione = (new Carbon())->subMinutes($slot_duration * 5);
-if (!empty($data) && $minimo_esecuzione->lessThan($data)) {
- return;
-}
-
-// Generazione e registrazione del cron
-$current_id = random_string();
-$cron_id->set($current_id);
-
-// Registrazione dell'esecuzione
-$adesso = new Carbon();
-$ultima_esecuzione->set($adesso->__toString());
-
-// Prima esecuzione immediata
-$slot_minimo = $adesso->copy();
-
-// Esecuzione ricorrente
-$number = 1;
-while (true) {
- $disattiva->refresh();
- $cron_id->refresh();
- $in_esecuzione->refresh();
-
- // Controllo su possibili aggiornamenti per bloccare il sistema
- $database_online = $database->isInstalled() && !Update::isUpdateAvailable();
- if (!$database_online || !empty($disattiva->content) || $cron_id->content != $current_id) {
- return;
- }
-
- // Rimozione dei log più vecchi
- $database->query('DELETE FROM zz_tasks_logs WHERE DATE_ADD(created_at, INTERVAL :interval DAY) <= NOW()', [
- ':interval' => 7,
- ]);
-
- // Risveglio programmato tramite slot
- $timestamp = $slot_minimo->getTimestamp();
- time_sleep_until($timestamp);
- $in_esecuzione->set(true);
-
- // Registrazione dell'iterazione nei log
- $logger->info('Cron #'.$number.' iniziato', [
- 'slot' => $slot_minimo->toDateTimeString(),
- 'slot-unix' => $timestamp,
- ]);
-
- // Calcolo del primo slot disponibile per l'esecuzione successiva
- $inizio_iterazione = $slot_minimo->copy();
- $slot_minimo = $inizio_iterazione->copy()->startOfHour();
- while ($inizio_iterazione->greaterThanOrEqualTo($slot_minimo)) {
- $slot_minimo->addMinutes($slot_duration);
- }
-
- // Aggiornamento dei cron disponibili
- $tasks = Task::all();
- foreach ($tasks as $task) {
- $adesso = new Carbon();
-
- // Registrazione della data per l'esecuzione se non indicata
- if (empty($task->next_execution_at)) {
- $task->registerNextExecution($inizio_iterazione);
- $task->save();
-
- $logger->info($task->name.': data mancante', [
- 'timestamp' => $task->next_execution_at->toDateTimeString(),
- ]);
- }
-
- // Esecuzione diretta solo nel caso in cui sia prevista
- if ($task->next_execution_at->copy()->addSeconds(20)->greaterThanOrEqualTo($inizio_iterazione) && $task->next_execution_at->lessThanOrEqualTo($adesso->copy()->addseconds(20))) {
- // Registrazione dell'esecuzione nei log
- $logger->info($task->name.': '.$task->expression);
- try {
- $task->execute();
- } catch (Exception $e) {
- // Registrazione del completamento nei log
- $task->log('error', 'Errore di esecuzione', [
- 'code' => $e->getCode(),
- 'message' => $e->getMessage(),
- 'trace' => $e->getTraceAsString(),
- ]);
-
- $logger->error($task->name.': errore');
- }
- }
- // Esecuzione mancata
- elseif ($task->next_execution_at->lessThan($inizio_iterazione)) {
- $logger->warning($task->name.': mancata', [
- 'timestamp' => $task->next_execution_at->toDateTimeString(),
- ]);
-
- $task->registerMissedExecution($inizio_iterazione);
- }
-
- // Calcolo dello successivo slot
- if ($task->next_execution_at->lessThan($slot_minimo)) {
- $slot_minimo = $task->next_execution_at;
- }
- }
-
- // Registrazione dello slot successivo nei log
- $logger->info('Cron #'.$number.' concluso', [
- 'next-slot' => $slot_minimo->toDateTimeString(),
- 'next-slot-unix' => $timestamp,
- ]);
- $in_esecuzione->set(false);
-
- // Registrazione dell'esecuzione
- $adesso = new Carbon();
- $ultima_esecuzione->set($adesso->__toString());
- ++$number;
-}
diff --git a/editor.php b/editor.php
deleted file mode 100755
index f5da27b4f..000000000
--- a/editor.php
+++ /dev/null
@@ -1,540 +0,0 @@
-.
- */
-
-include_once __DIR__.'/core.php';
-
-use Carbon\Carbon;
-
-// Disabilitazione dei campi
-$read_only = $structure->permission == 'r';
-
-if (empty($id_record) && !empty($id_module) && empty($id_plugin)) {
- redirect(base_path().'/controller.php?id_module='.$id_module);
-} elseif (empty($id_record) && empty($id_module) && empty($id_plugin)) {
- redirect(base_path().'/index.php');
-}
-
-include_once App::filepath('include|custom|', 'top.php');
-
-if (!empty($id_record)) {
- Util\Query::setSegments(false);
- $query = Util\Query::getQuery($structure, [
- 'id' => $id_record,
- ]);
- Util\Query::setSegments(true);
-}
-// Rimozione della condizione deleted_at IS NULL per visualizzare anche i record eliminati
-if (preg_match('/[`]*([a-z0-9_]*)[`]*[\.]*([`]*deleted_at[`]* IS NULL)/i', $query, $m)) {
- $conditions_to_remove = [];
-
- $condition = trim($m[0]);
-
- if (!empty($table_name)) {
- $condition = $table_name.'.'.$condition;
- }
-
- $conditions_to_remove[] = ' AND '.$condition;
- $conditions_to_remove[] = $condition.' AND ';
-
- $query = str_replace($conditions_to_remove, '', $query);
- $query = str_replace($condition, '', $query);
-}
-
-$has_access = !empty($query) ? $dbo->fetchNum($query) !== 0 : true;
-
-if ($has_access) {
- // Inclusione gli elementi fondamentali
- include_once base_dir().'/actions.php';
-}
-
-if (empty($record) || !$has_access) {
- echo '
-
-
'.
- ' '.tr('Record non trovato').'
-
- '.tr('Stai cercando di accedere ad un record eliminato o non presente').'.
-
-
-
-
- '.tr('Indietro').'
-
-
';
-} else {
- // Widget in alto
- echo '{( "name": "widgets", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "position": "top", "place": "editor" )}';
-
- $advanced_sessions = setting('Attiva notifica di presenza utenti sul record');
- if (!empty($advanced_sessions)) {
- $dbo->query('DELETE FROM zz_semaphores WHERE id_utente='.prepare(Auth::user()['id']).' AND posizione='.prepare($id_module.', '.$id_record));
-
- $dbo->query('INSERT INTO zz_semaphores (id_utente, posizione, updated) VALUES ('.prepare(Auth::user()['id']).', '.prepare($id_module.', '.$id_record).', NOW())');
-
- echo '
-
-
-
-
'.tr('I seguenti utenti stanno visualizzando questa pagina').':
-
-
'.tr('Prestare attenzione prima di effettuare modifiche, poichè queste potrebbero essere perse a causa di multipli salvataggi contemporanei').'.
-
-
';
- }
-
- echo '
-
-
-
-
-
-
';
-
- if (!empty($record['deleted_at'])) {
- $operation = $dbo->fetchOne("SELECT zz_operations.created_at, username FROM zz_operations INNER JOIN zz_users ON zz_operations.id_utente = zz_users.id WHERE op='delete' AND id_module=".prepare($id_module).' AND id_record='.prepare($id_record).' ORDER BY zz_operations.created_at DESC');
-
- $info = tr('Il record è stato eliminato il
_DATE_ da
_USER_ ', [
- '_DATE_' => (($operation['created_at']) ? Translator::timestampToLocale($operation['created_at']) : Translator::timestampToLocale($record['deleted_at'])),
- '_USER_' => ((!empty($operation['username'])) ? $operation['username'] : 'N.D.'),
- ]).'. ';
-
- echo '
-
-
- ';
- }
-
- // Pulsanti di default
- echo '
-
-
- '.tr("Torna all'elenco").'
-
-
-
- {( "name": "button", "type": "print", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}
-
- {( "name": "button", "type": "email", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}
-
-
-
-
-
-
-
-
-
';
-
- // Pulsanti personalizzati
- $buttons = $structure->filepath('buttons.php');
- if (!empty($buttons)) {
- ob_start();
- include $buttons;
- $buttons = ob_get_clean();
-
- echo '
-
- '.$buttons.'
-
-
-
-
';
- }
-
- // Contenuti del modulo
- echo '
-
-
';
-
- $path = $structure->getEditFile();
- if (!empty($path)) {
- include $path;
- }
-
- echo '
-
-
';
-
- // Campi personalizzati
- echo '
-
-
- {( "name": "custom_fields", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "position": "top" )}
-
-
-
- {( "name": "custom_fields", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'" )}
-
-
- ';
-
- if ($structure->permission != '-' && $structure->use_notes && $user->gruppo != 'Clienti') {
- echo '
-
';
-
- include base_dir().'/plugins/notes.php';
-
- echo '
-
';
- }
-
- if ($structure->permission != '-' && $structure->use_checklists) {
- echo '
-
';
-
- include base_dir().'/plugins/checks.php';
-
- echo '
-
';
- }
-
- // Informazioni sulle operazioni
- if (Auth::admin()) {
- echo '
-
';
-
- $operations = $dbo->fetchArray('SELECT `zz_operations`.*, `zz_users`.`username` FROM `zz_operations` JOIN `zz_users` ON `zz_operations`.`id_utente` = `zz_users`.`id` WHERE id_module = '.prepare($id_module).' AND id_record = '.prepare($id_record).' ORDER BY `created_at` DESC LIMIT 200');
-
- if (!empty($operations)) {
- echo '
-
';
-
- foreach ($operations as $operation) {
- $description = $operation['op'];
- $icon = 'pencil-square-o';
- $color = null;
- $timeline_class = null;
-
- switch ($operation['op']) {
- case 'add':
- $description = tr('Creazione');
- $icon = 'plus';
- $color = 'success';
- break;
-
- case 'update':
- $description = tr('Modifica');
- $icon = 'pencil';
- $color = 'info';
- break;
-
- case 'delete':
- $description = tr('Eliminazione');
- $icon = 'times';
- $color = 'danger';
- break;
-
- case 'copy':
- $description = tr('Duplicato');
- $icon = 'clone';
- $color = 'info';
- break;
-
- default:
- $timeline_class = ' class="timeline-inverted"';
- break;
- }
-
- echo '
-
-
-
-
-
-
-
'.$description.'
-
-
-
'.Carbon::parse($operation['created_at'])->diffForHumans().'
-
'.$operation['username'].'
-
-
-
-
-
-
-
-
- ';
- }
-
- echo '
- ';
- } else {
- echo '
-
-
- '.tr('Informazione:').' '.tr('Nessun log disponibile per questa scheda').'.
-
';
- }
-
- echo '
-
';
- }
-
- // Plugin
- $module_record = $record;
- foreach ($plugins as $plugin) {
- $record = $module_record;
-
- echo '
-
';
-
- $id_plugin = $plugin['id'];
-
- include base_dir().'/include/manager.php';
-
- echo '
-
';
- }
-
- $record = $module_record;
-
- echo '
-
-
';
-}
-
-redirectOperation($id_module, isset($id_parent) ? $id_parent : $id_record);
-
-// Widget in basso
-echo '{( "name": "widgets", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "position": "right", "place": "editor" )}';
-
-if (!empty($record)) {
- echo '
-
-
- '.tr('Indietro').'
- ';
-}
-
-echo '
-
-
- php_flag engine off
-
-
- php_flag engine off
-
diff --git a/files/impianti/componente.ini b/files/impianti/componente.ini
deleted file mode 100755
index 666004e58..000000000
--- a/files/impianti/componente.ini
+++ /dev/null
@@ -1,20 +0,0 @@
-[Nome]
-tipo = span
-valore = "Componente di esempio"
-
-[Marca]
-tipo = input
-valore =
-
-[Tipo]
-tipo = select
-valore =
-opzioni = "Tipo 1", "Tipo 2"
-
-[Data di installazione]
-tipo = date
-valore =
-
-[Note]
-tipo = textarea
-valore =
diff --git a/include/.htaccess b/include/.htaccess
deleted file mode 100755
index 3a4288278..000000000
--- a/include/.htaccess
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/include/bottom.php b/include/bottom.php
deleted file mode 100755
index 918715b39..000000000
--- a/include/bottom.php
+++ /dev/null
@@ -1,97 +0,0 @@
-.
- */
-
-include_once __DIR__.'/../core.php';
-
-if (Auth::check()) {
- echo '
-
-
-
-
-
-
- '.tr('OpenSTAManager').'
-
- '.tr('Versione').' '.$version.'
- ('.(!empty($revision) ? $revision : tr('In sviluppo')).')
-
-
-
-
-
';
-}
-echo '
- ';
-
-if (Auth::check()) {
- if (!empty($_SESSION['keep_alive'])) {
- echo '
- ';
- }
-
- if (App::debug()) {
- echo '
-
-
-
-
- ';
- }
-
- $custom_css = html_entity_decode(setting('CSS Personalizzato'));
- if (!empty($custom_css)) {
- echo '
- ';
- }
-
- // Hooks
- echo '
- ';
-}
-
-echo '
-
-