Introduzione modifiche per compatibilità con Laravel
This commit is contained in:
parent
475a194234
commit
09a94daaff
|
@ -1,11 +0,0 @@
|
|||
# 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
|
33
.php_cs
33
.php_cs
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->files()
|
||||
->exclude('.couscous')
|
||||
->exclude('node_modules')
|
||||
->exclude('vendor')
|
||||
->exclude('tests')
|
||||
->ignoreDotFiles(true)
|
||||
->ignoreVCS(true)
|
||||
->in(__DIR__);
|
||||
|
||||
$config = PhpCsFixer\Config::create()
|
||||
->setRules([
|
||||
'@Symfony' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'yoda_style' => false,
|
||||
'no_short_echo_tag' => true,
|
||||
'ordered_imports' => true,
|
||||
'no_alternative_syntax' => true,
|
||||
'ordered_class_elements' => true,
|
||||
'phpdoc_order' => true,
|
||||
//'no_superfluous_phpdoc_tags' => [
|
||||
// 'allow_mixed' => true,
|
||||
// 'allow_unused_params' => true,
|
||||
//],
|
||||
//'phpdoc_add_missing_param_annotation' => [
|
||||
// 'only_untyped' => false,
|
||||
//],
|
||||
])
|
||||
->setFinder($finder);
|
||||
|
||||
return $config;
|
17
actions.php
17
actions.php
|
@ -88,7 +88,7 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
|
|||
}
|
||||
}
|
||||
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : ''));
|
||||
redirect_legacy(base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : ''));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -288,17 +288,8 @@ elseif (post('op') == 'send-email') {
|
|||
}
|
||||
} 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_riferimenti') {
|
||||
include_once base_dir().'/include/riferimenti/riferimenti.php';
|
||||
} elseif (filter('op') == 'visualizza_righe_riferimenti') {
|
||||
include_once base_dir().'/include/riferimenti/riferimenti.php';
|
||||
} elseif (filter('op') == 'visualizza_righe_documento') {
|
||||
|
@ -359,7 +350,7 @@ if ($structure->permission == 'rw') {
|
|||
$bulk = empty($bulk) ? [] : $bulk;
|
||||
|
||||
if (in_array(post('op'), array_keys($bulk))) {
|
||||
redirect(base_path().'/controller.php?id_module='.$id_module, 'js');
|
||||
redirect_legacy(base_url().'/controller.php?id_module='.$id_module, 'js');
|
||||
} else {
|
||||
// Esecuzione delle operazioni del modulo
|
||||
($include_file = $structure->filepath('actions.php')) ? include $include_file : null;
|
||||
|
|
4
ajax.php
4
ajax.php
|
@ -45,7 +45,7 @@ switch (filter('op')) {
|
|||
}
|
||||
|
||||
if (!$found) {
|
||||
array_push($_SESSION[$array[0]][$array[1]], $value);
|
||||
$_SESSION[$array[0]][$array[1]][] = $value;
|
||||
}
|
||||
|
||||
// print_r($_SESSION[$array[0]][$array[1]]);
|
||||
|
@ -82,7 +82,7 @@ switch (filter('op')) {
|
|||
$posizione .= ', '.get('id_record');
|
||||
}
|
||||
|
||||
$user = Auth::user();
|
||||
$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', [
|
||||
|
|
|
@ -180,11 +180,11 @@ if (!empty($query)) {
|
|||
|
||||
// Link per i moduli
|
||||
if (empty($id_plugin)) {
|
||||
$column['data-link'] = base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.$hash;
|
||||
$column['data-link'] = base_url().'/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-link'] = base_url().'/add.php?id_module='.$id_module.'&id_record='.$id_record.'&id_plugin='.$id_plugin.'&id_parent='.$id_parent.'&edit=1'.$hash;
|
||||
|
||||
$column['data-type'] = 'dialog';
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ if (!empty($query)) {
|
|||
}
|
||||
|
||||
// Replace base_link() per le query
|
||||
$value = str_replace('base_link()', base_path(), $value);
|
||||
$value = str_replace('base_link()', base_url(), $value);
|
||||
$result[] = str_replace('|attr|', implode(' ', $attributes), '<div |attr|>'.$value.'</div>');
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ if (!isset($resource)) {
|
|||
|
||||
// Opzioni di selezione sugli elementi
|
||||
$options = filter('options') ?: [];
|
||||
$options_compatibility = session_get('superselect', []);
|
||||
$options_compatibility = session('superselect', []);
|
||||
$options = array_merge($options_compatibility, $options);
|
||||
|
||||
// Preselezione su $elements dichiarato da file precedente
|
||||
|
|
|
@ -301,7 +301,7 @@ function message(element) {
|
|||
},
|
||||
});
|
||||
} else {
|
||||
redirect(href, data, method, blank);
|
||||
redirect_legacy(href, data, method, blank);
|
||||
}
|
||||
},
|
||||
function (dismiss) {
|
||||
|
@ -309,7 +309,7 @@ function message(element) {
|
|||
);
|
||||
}
|
||||
|
||||
function redirect(href, data, method, blank) {
|
||||
function redirect_legacy(href, data, method, blank) {
|
||||
method = method ? method : "get";
|
||||
blank = blank ? blank : false;
|
||||
|
||||
|
|
|
@ -34,12 +34,9 @@ function start_superselect() {
|
|||
* @param container
|
||||
* @returns {*}
|
||||
*/
|
||||
function optionRendering(data, container) {
|
||||
// Aggiunta degli attributi impostati staticamente
|
||||
selectOptionAttributes(data);
|
||||
|
||||
// Impostazione del colore dell'opzione
|
||||
function selectOptionRender(data, container) {
|
||||
let bg;
|
||||
|
||||
if (data._bgcolor_) {
|
||||
bg = data._bgcolor_;
|
||||
} else if ($(data.element).attr("_bgcolor_")) {
|
||||
|
@ -53,29 +50,6 @@ function optionRendering(data, container) {
|
|||
$(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) {
|
||||
|
@ -83,6 +57,8 @@ function selectOptionAttributes(data) {
|
|||
data[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return data.text;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -152,9 +128,6 @@ jQuery.fn.selectAdd = function (values) {
|
|||
|
||||
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];
|
||||
});
|
||||
|
@ -247,8 +220,7 @@ function initStaticSelectInput(input) {
|
|||
escapeMarkup: function (text) {
|
||||
return text;
|
||||
},
|
||||
templateResult: optionRendering,
|
||||
templateSelection: selectionRendering,
|
||||
templateResult: selectOptionRender,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -269,8 +241,7 @@ function initDynamicSelectInput(input) {
|
|||
escapeMarkup: function (text) {
|
||||
return text;
|
||||
},
|
||||
templateResult: optionRendering,
|
||||
templateSelection: selectionRendering,
|
||||
templateResult: selectOptionRender,
|
||||
ajax: {
|
||||
url: globals.rootdir + "/ajax_select.php?op=" + $input.data('source'),
|
||||
dataType: 'json',
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Deny from all
|
13
bug.php
13
bug.php
|
@ -25,7 +25,7 @@ include_once __DIR__.'/core.php';
|
|||
$account = Account::where('predefined', true)->first();
|
||||
$bug_email = 'info@openstamanager.com';
|
||||
|
||||
$user = Auth::user();
|
||||
$user = auth()->user();
|
||||
|
||||
if (filter('op') == 'send') {
|
||||
// Preparazione email
|
||||
|
@ -87,13 +87,14 @@ if (filter('op') == 'send') {
|
|||
delete($backup_file);
|
||||
}
|
||||
|
||||
redirect(base_path().'/bug.php');
|
||||
exit();
|
||||
redirect_legacy(base_url().'/bug.php');
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
}
|
||||
|
||||
$pageTitle = tr('Bug');
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'top.php');
|
||||
|
||||
if (empty($account['from_address']) || empty($account['server'])) {
|
||||
echo '
|
||||
|
@ -198,6 +199,6 @@ echo '
|
|||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="'.App::getPaths()['js'].'/ckeditor/ckeditor.js'.'"></script>';
|
||||
<script type="text/javascript" charset="utf-8" src="'.AppLegacy::getPaths()['js'].'/ckeditor/ckeditor.js'.'"></script>';
|
||||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'bottom.php');
|
||||
|
|
|
@ -15,7 +15,12 @@
|
|||
}],
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"php": "^7.3|^8.0",
|
||||
"fideloper/proxy": "^4.4",
|
||||
"fruitcake/laravel-cors": "^2.0",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"laravel/framework": "^8.12",
|
||||
"laravel/tinker": "^2.5",
|
||||
"ext-curl": "*",
|
||||
"ext-dom": "*",
|
||||
"ext-fileinfo": "*",
|
||||
|
@ -34,7 +39,6 @@
|
|||
"dragonmantank/cron-expression": "^1.0",
|
||||
"ezyang/htmlpurifier": "^4.8",
|
||||
"filp/whoops": "^2.1",
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"ifsnop/mysqldump-php": "^2.3",
|
||||
"illuminate/database": "^6.0",
|
||||
"intervention/image": "^2.3",
|
||||
|
@ -64,7 +68,12 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"codeception/codeception": "^3.0",
|
||||
"friendsofphp/php-cs-fixer": "^2.10"
|
||||
"friendsofphp/php-cs-fixer": "^2.10",
|
||||
"facade/ignition": "^2.5",
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
"mockery/mockery": "^1.4.2",
|
||||
"nunomaduro/collision": "^5.0",
|
||||
"phpunit/phpunit": "^9.3.3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// 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' => [],
|
||||
];
|
|
@ -26,10 +26,10 @@ return [
|
|||
'GET' => 0,
|
||||
'POST' => 0,
|
||||
],
|
||||
'jsUrl' => base_path().'/assets/dist/js/csrf/csrfprotector.js',
|
||||
'jsUrl' => base_url().'/assets/dist/js/csrf/csrfprotector.js',
|
||||
'tokenLength' => 10,
|
||||
'cookieConfig' => [
|
||||
'path' => base_path(),
|
||||
'path' => base_url(),
|
||||
'secure' => isHTTPS(true),
|
||||
],
|
||||
'verifyGetFor' => [],
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
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);
|
||||
redirect_legacy(base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record);
|
||||
} elseif (empty($id_module)) {
|
||||
redirect(base_path().'/index.php');
|
||||
redirect_legacy(base_url().'/index.php');
|
||||
}
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'top.php');
|
||||
|
||||
// Inclusione gli elementi fondamentali
|
||||
include_once base_dir().'/actions.php';
|
||||
|
@ -112,4 +112,4 @@ function modificaColonne(button) {
|
|||
// Widget in basso
|
||||
echo '{( "name": "widgets", "id_module": "'.$id_module.'", "position": "right", "place": "controller" )}';
|
||||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'bottom.php');
|
||||
|
|
74
core.php
74
core.php
|
@ -30,7 +30,8 @@ if (version_compare(phpversion(), $minimum) < 0) {
|
|||
<p>Stai utilizzando la versione PHP '.phpversion().', non compatibile con OpenSTAManager.</p>
|
||||
|
||||
<p>Aggiorna PHP alla versione >= '.$minimum.'.</p>';
|
||||
exit();
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
}
|
||||
|
||||
// Caricamento delle impostazioni personalizzabili
|
||||
|
@ -38,38 +39,30 @@ 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__);
|
||||
AppLegacy::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();
|
||||
session_set_cookie_params(0, base_url(), null, isHTTPS(true));
|
||||
session_start();*/
|
||||
|
||||
// Lettura della configurazione
|
||||
$config = App::getConfig();
|
||||
$config = AppLegacy::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();
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
}
|
||||
|
||||
/* GESTIONE DEGLI ERRORI */
|
||||
|
@ -95,7 +88,7 @@ if (!API\Response::isAPIRequest()) {
|
|||
$handlers[] = new Extensions\MessageHandler(Monolog\Logger::ERROR);
|
||||
|
||||
// File di log ordinati in base alla data
|
||||
if (App::debug()) {
|
||||
if (AppLegacy::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);
|
||||
}
|
||||
|
@ -103,7 +96,7 @@ if (!API\Response::isAPIRequest()) {
|
|||
// Inizializzazione Whoops
|
||||
$whoops = new Whoops\Run();
|
||||
|
||||
if (App::debug()) {
|
||||
if (AppLegacy::debug()) {
|
||||
$whoops->pushHandler(new Whoops\Handler\PrettyPageHandler());
|
||||
}
|
||||
|
||||
|
@ -135,7 +128,7 @@ error_reporting(E_ALL & ~E_WARNING & ~E_CORE_WARNING & ~E_NOTICE & ~E_USER_DEPRE
|
|||
|
||||
$pattern = '[%datetime%] %channel%.%level_name%: %message% %context%'.PHP_EOL.'%extra% '.PHP_EOL;
|
||||
$monologFormatter = new Monolog\Formatter\LineFormatter($pattern);
|
||||
$monologFormatter->includeStacktraces(App::debug());
|
||||
$monologFormatter->includeStacktraces(AppLegacy::debug());
|
||||
|
||||
// Filtra gli errori per livello preciso del gestore dedicato
|
||||
foreach ($handlers as $handler) {
|
||||
|
@ -158,10 +151,10 @@ $dbo = $database = database();
|
|||
// 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);
|
||||
AppLegacy::setFormatter($lang, $formatter);
|
||||
//$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();
|
||||
|
@ -169,19 +162,19 @@ $revision = Update::getRevision();
|
|||
|
||||
/* ACCESSO E INSTALLAZIONE */
|
||||
// Controllo sulla presenza dei permessi di accesso basilari
|
||||
$continue = $dbo->isInstalled() && !Update::isUpdateAvailable() && (Auth::check() || API\Response::isAPIRequest());
|
||||
$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();
|
||||
if (!$continue && getURLPath() != slashes(base_url().'/index.php') && !Permissions::getSkip()) {
|
||||
if (auth()->check()) {
|
||||
auth()->logout();
|
||||
}
|
||||
|
||||
redirect(base_path().'/index.php');
|
||||
exit();
|
||||
redirect_legacy(base_url().'/index.php');
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
}
|
||||
|
||||
/* INIZIALIZZAZIONE GENERALE */
|
||||
|
@ -192,7 +185,7 @@ if (!API\Response::isAPIRequest()) {
|
|||
|
||||
// Controllo CSRF
|
||||
if (empty($config['disableCSRF'])) {
|
||||
csrfProtector::init();
|
||||
//csrfProtector::init();
|
||||
}
|
||||
|
||||
// Aggiunta del wrapper personalizzato per la generazione degli input
|
||||
|
@ -211,13 +204,12 @@ if (!API\Response::isAPIRequest()) {
|
|||
}
|
||||
|
||||
// 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']) : [];
|
||||
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';
|
||||
|
@ -226,13 +218,13 @@ if (!API\Response::isAPIRequest()) {
|
|||
// Periodo di visualizzazione dei record
|
||||
// Personalizzato
|
||||
if (!empty($_GET['period_start'])) {
|
||||
$_SESSION['period_start'] = $_GET['period_start'];
|
||||
$_SESSION['period_end'] = $_GET['period_end'];
|
||||
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';
|
||||
elseif (session('period_start') == null) {
|
||||
session(['period_start' => date('Y').'-01-01']);
|
||||
session(['period_end' => date('Y').'-12-31']);
|
||||
}
|
||||
|
||||
$id_record = filter('id_record');
|
||||
|
@ -249,13 +241,13 @@ if (!API\Response::isAPIRequest()) {
|
|||
$id_module = $module ? $module['id'] : null;
|
||||
$id_plugin = $plugin ? $plugin['id'] : null;
|
||||
|
||||
$user = Auth::user();
|
||||
$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;
|
||||
session(['module_'.$id_module.'.id_segment' => isset($segments[0]['id']) ? $segments[0]['id'] : null]);
|
||||
}
|
||||
|
||||
Permissions::addModule($id_module);
|
||||
|
|
22
editor.php
22
editor.php
|
@ -25,12 +25,12 @@ use Carbon\Carbon;
|
|||
$read_only = $structure->permission == 'r';
|
||||
|
||||
if (empty($id_record) && !empty($id_module) && empty($id_plugin)) {
|
||||
redirect(base_path().'/controller.php?id_module='.$id_module);
|
||||
redirect_legacy(base_url().'/controller.php?id_module='.$id_module);
|
||||
} elseif (empty($id_record) && empty($id_module) && empty($id_plugin)) {
|
||||
redirect(base_path().'/index.php');
|
||||
redirect_legacy(base_url().'/index.php');
|
||||
}
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'top.php');
|
||||
|
||||
if (!empty($id_record)) {
|
||||
Util\Query::setSegments(false);
|
||||
|
@ -73,7 +73,7 @@ if (empty($record) || !$has_access) {
|
|||
</h3>
|
||||
<br>
|
||||
|
||||
<a class="btn btn-default" href="'.base_path().'/controller.php?id_module='.$id_module.'">
|
||||
<a class="btn btn-default" href="'.base_url().'/controller.php?id_module='.$id_module.'">
|
||||
<i class="fa fa-chevron-left"></i> '.tr('Indietro').'
|
||||
</a>
|
||||
</div>';
|
||||
|
@ -83,9 +83,9 @@ if (empty($record) || !$has_access) {
|
|||
|
||||
$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('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())');
|
||||
$dbo->query('INSERT INTO zz_semaphores (id_utente, posizione, updated) VALUES ('.prepare(auth()->user()['id']).', '.prepare($id_module.', '.$id_record).', NOW())');
|
||||
|
||||
echo '
|
||||
<div class="box box-warning box-solid text-center info-active hide">
|
||||
|
@ -159,7 +159,7 @@ if (empty($record) || !$has_access) {
|
|||
// Pulsanti di default
|
||||
echo '
|
||||
<div id="pulsanti">
|
||||
<a class="btn btn-warning" id="back" href="'.base_path().'/controller.php?id_module='.$id_module.'">
|
||||
<a class="btn btn-warning" id="back" href="'.base_url().'/controller.php?id_module='.$id_module.'">
|
||||
<i class="fa fa-chevron-left"></i> '.tr("Torna all'elenco").'
|
||||
</a>
|
||||
|
||||
|
@ -325,7 +325,7 @@ if (empty($record) || !$has_access) {
|
|||
}
|
||||
|
||||
// Informazioni sulle operazioni
|
||||
if (Auth::admin()) {
|
||||
if (auth()->user()->isAdmin()) {
|
||||
echo '
|
||||
<div id="tab_info" class="tab-pane">';
|
||||
|
||||
|
@ -441,7 +441,7 @@ echo '{( "name": "widgets", "id_module": "'.$id_module.'", "id_record": "'.$id_r
|
|||
if (!empty($record)) {
|
||||
echo '
|
||||
<hr>
|
||||
<a class="btn btn-default" href="'.base_path().'/controller.php?id_module='.$id_module.'">
|
||||
<a class="btn btn-default" href="'.base_url().'/controller.php?id_module='.$id_module.'">
|
||||
<i class="fa fa-chevron-left"></i> '.tr('Indietro').'
|
||||
</a>';
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ if (!empty($advanced_sessions)) {
|
|||
?>
|
||||
|
||||
function getActiveUsers(){
|
||||
$.getJSON('<?php echo base_path(); ?>/ajax.php?op=active_users', {
|
||||
$.getJSON('<?php echo base_url(); ?>/ajax.php?op=active_users', {
|
||||
id_module: <?php echo $id_module; ?>,
|
||||
id_record: <?php echo $id_record; ?>
|
||||
},
|
||||
|
@ -544,4 +544,4 @@ if (!empty($advanced_sessions)) {
|
|||
</script>
|
||||
<?php
|
||||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'bottom.php');
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
# Disable PHP rendering
|
||||
<IfModule mod_php5.c>
|
||||
php_flag engine off
|
||||
</IfModule>
|
||||
<IfModule mod_php7.c>
|
||||
php_flag engine off
|
||||
</IfModule>
|
|
@ -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 =
|
515
gulpfile.js
515
gulpfile.js
|
@ -1,515 +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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Librerie NPM richieste per l'esecuzione
|
||||
const gulp = require('gulp');
|
||||
const merge = require('merge-stream');
|
||||
const del = require('del');
|
||||
const gulpIf = require('gulp-if');
|
||||
const babel = require('gulp-babel');
|
||||
|
||||
// Minificatori
|
||||
const minifyJS = require('gulp-uglify');
|
||||
const minifyCSS = require('gulp-clean-css');
|
||||
const minifyJSON = require('gulp-json-minify');
|
||||
|
||||
// Interpretatori CSS
|
||||
const sass = require('gulp-sass');
|
||||
const less = require('gulp-less');
|
||||
const stylus = require('gulp-stylus');
|
||||
const autoprefixer = require('gulp-autoprefixer');
|
||||
|
||||
// Concatenatore
|
||||
const concat = require('gulp-concat');
|
||||
|
||||
// Altro
|
||||
const flatten = require('gulp-flatten');
|
||||
const rename = require('gulp-rename');
|
||||
|
||||
// Release
|
||||
const glob = require('globby');
|
||||
const md5File = require('md5-file')
|
||||
const fs = require('fs');
|
||||
const archiver = require('archiver');
|
||||
const shell = require('shelljs');
|
||||
const inquirer = require('inquirer');
|
||||
|
||||
// Configurazione
|
||||
const config = {
|
||||
production: 'assets/dist', // Cartella di destinazione
|
||||
development: 'assets/src', // Cartella dei file di personalizzazione
|
||||
debug: false,
|
||||
nodeDirectory: './node_modules', // Percorso per node_modules
|
||||
paths: {
|
||||
js: 'js',
|
||||
css: 'css',
|
||||
images: 'img',
|
||||
fonts: 'fonts'
|
||||
},
|
||||
babelOptions: {
|
||||
compact: true,
|
||||
presets: [
|
||||
['@babel/env', {
|
||||
modules: false
|
||||
}],
|
||||
],
|
||||
},
|
||||
minifiers: {
|
||||
css: {
|
||||
rebase: false,
|
||||
}
|
||||
}
|
||||
};
|
||||
config.babelOptions.compact = !config.debug;
|
||||
|
||||
// Elaborazione e minificazione di JS
|
||||
const JS = gulp.parallel(() => {
|
||||
const vendor = [
|
||||
'jquery/dist/jquery.js',
|
||||
'autosize/dist/autosize.js',
|
||||
'autocompleter/autocomplete.js',
|
||||
'html5sortable/dist/html5sortable.js',
|
||||
'bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js',
|
||||
'moment/moment.js',
|
||||
'components-jqueryui/jquery-ui.js',
|
||||
'datatables.net/js/jquery.dataTables.js',
|
||||
'datatables.net-buttons/js/dataTables.buttons.js',
|
||||
'datatables.net-buttons/js/buttons.colVis.js',
|
||||
'datatables.net-buttons/js/buttons.flash.js',
|
||||
'datatables.net-buttons/js/buttons.html5.js',
|
||||
'datatables.net-buttons/js/buttons.print.js',
|
||||
'datatables.net-scroller/js/dataTables.scroller.js',
|
||||
'datatables.net-select/js/dataTables.select.js',
|
||||
'dropzone/dist/dropzone.js',
|
||||
'autonumeric/dist/autoNumeric.min.js',
|
||||
'eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',
|
||||
'fullcalendar/dist/fullcalendar.js',
|
||||
'geocomplete/jquery.geocomplete.js',
|
||||
'inputmask/dist/min/jquery.inputmask.bundle.min.js',
|
||||
'jquery-form/src/jquery.form.js',
|
||||
'jquery-ui-touch-punch/jquery.ui.touch-punch.js',
|
||||
'jquery.shorten/src/jquery.shorten.js',
|
||||
'numeral/numeral.js',
|
||||
'parsleyjs/dist/parsley.js',
|
||||
'select2/dist/js/select2.min.js',
|
||||
'signature_pad/dist/signature_pad.js',
|
||||
'sweetalert2/dist/sweetalert2.js',
|
||||
'toastr/build/toastr.min.js',
|
||||
'tooltipster/dist/js/tooltipster.bundle.js',
|
||||
'admin-lte/dist/js/adminlte.js',
|
||||
'bootstrap/dist/js/bootstrap.min.js',
|
||||
'bootstrap-daterangepicker/daterangepicker.js',
|
||||
'datatables.net-bs/js/dataTables.bootstrap.js',
|
||||
'datatables.net-buttons-bs/js/buttons.bootstrap.js',
|
||||
'smartwizard/dist/js/jquery.smartWizard.min.js',
|
||||
'bootstrap-maxlength/dist/bootstrap-maxlength.js',
|
||||
];
|
||||
|
||||
for (const i in vendor) {
|
||||
vendor[i] = config.nodeDirectory + '/' + vendor[i];
|
||||
}
|
||||
|
||||
return gulp.src(vendor)
|
||||
.pipe(babel(config.babelOptions))
|
||||
.pipe(concat('app.min.js'))
|
||||
.pipe(minifyJS())
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js));
|
||||
}, srcJS);
|
||||
|
||||
// Elaborazione e minificazione di JS personalizzati
|
||||
function srcJS() {
|
||||
const js = gulp.src([
|
||||
config.development + '/' + config.paths.js + '/base/*.js',
|
||||
])
|
||||
.pipe(babel(config.babelOptions))
|
||||
.pipe(concat('custom.min.js'))
|
||||
.pipe(gulpIf(!config.debug, minifyJS()))
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js));
|
||||
|
||||
const functions = gulp.src([
|
||||
config.development + '/' + config.paths.js + '/functions/*.js',
|
||||
])
|
||||
.pipe(babel(config.babelOptions))
|
||||
.pipe(concat('functions.min.js'))
|
||||
.pipe(gulpIf(!config.debug, minifyJS()))
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js));
|
||||
|
||||
return merge(js, functions);
|
||||
}
|
||||
|
||||
// Elaborazione e minificazione di CSS
|
||||
const CSS = gulp.parallel(() => {
|
||||
const vendor = [
|
||||
'bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css',
|
||||
'dropzone/dist/dropzone.css',
|
||||
'eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
|
||||
'font-awesome/css/font-awesome.min.css',
|
||||
'fullcalendar/dist/fullcalendar.css',
|
||||
'parsleyjs/src/parsley.css',
|
||||
'select2/dist/css/select2.min.css',
|
||||
'sweetalert2/dist/sweetalert2.css',
|
||||
'toastr/build/toastr.min.css',
|
||||
'tooltipster/dist/css/tooltipster.bundle.css',
|
||||
'admin-lte/dist/css/AdminLTE.css',
|
||||
'bootstrap/dist/css/bootstrap.min.css',
|
||||
'bootstrap-daterangepicker/daterangepicker.css',
|
||||
'datatables.net-bs/css/dataTables.bootstrap.css',
|
||||
'datatables.net-buttons-bs/css/buttons.bootstrap.css',
|
||||
'datatables.net-scroller-bs/css/scroller.bootstrap.css',
|
||||
'datatables.net-select-bs/css/select.bootstrap.css',
|
||||
'select2-bootstrap-theme/dist/select2-bootstrap.css',
|
||||
'smartwizard/dist/css/smart_wizard.min.css',
|
||||
'smartwizard/dist/css/smart_wizard_theme_arrows.min.css',
|
||||
];
|
||||
|
||||
for (const i in vendor) {
|
||||
vendor[i] = config.nodeDirectory + '/' + vendor[i];
|
||||
}
|
||||
|
||||
return gulp.src(vendor)
|
||||
.pipe(gulpIf('*.scss', sass(), gulpIf('*.less', less(), gulpIf('*.styl', stylus()))))
|
||||
.pipe(autoprefixer())
|
||||
.pipe(minifyCSS({
|
||||
rebase: false,
|
||||
}))
|
||||
.pipe(concat('app.min.css'))
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.css));
|
||||
}, srcCSS);
|
||||
|
||||
// Elaborazione e minificazione di CSS personalizzati
|
||||
function srcCSS() {
|
||||
const css = gulp.src([
|
||||
config.development + '/' + config.paths.css + '/*.{css,scss,less,styl}',
|
||||
])
|
||||
.pipe(gulpIf('*.scss', sass(), gulpIf('*.less', less(), gulpIf('*.styl', stylus()))))
|
||||
.pipe(autoprefixer())
|
||||
.pipe(gulpIf(!config.debug, minifyCSS(config.minifiers.css)))
|
||||
.pipe(concat('style.min.css'))
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.css));
|
||||
|
||||
const print = gulp.src([
|
||||
config.development + '/' + config.paths.css + '/print/*.{css,scss,less,styl}',
|
||||
config.nodeDirectory + '/fullcalendar/fullcalendar.print.css',
|
||||
], {
|
||||
allowEmpty: true
|
||||
})
|
||||
.pipe(gulpIf('*.scss', sass(), gulpIf('*.less', less(), gulpIf('*.styl', stylus()))))
|
||||
.pipe(autoprefixer())
|
||||
.pipe(gulpIf(!config.debug, minifyCSS(config.minifiers.css)))
|
||||
.pipe(concat('print.min.css'))
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.css));
|
||||
|
||||
const themes = gulp.src([
|
||||
config.development + '/' + config.paths.css + '/themes/*.{css,scss,less,styl}',
|
||||
config.nodeDirectory + '/admin-lte/dist/css/skins/_all-skins.min.css',
|
||||
])
|
||||
.pipe(gulpIf('*.scss', sass(), gulpIf('*.less', less(), gulpIf('*.styl', stylus()))))
|
||||
.pipe(autoprefixer())
|
||||
.pipe(gulpIf(!config.debug, minifyCSS(config.minifiers.css)))
|
||||
.pipe(concat('themes.min.css'))
|
||||
.pipe(flatten())
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.css));
|
||||
|
||||
return merge(css, print, themes);
|
||||
}
|
||||
|
||||
|
||||
// Elaborazione delle immagini
|
||||
const images = srcImages;
|
||||
|
||||
// Elaborazione delle immagini personalizzate
|
||||
function srcImages() {
|
||||
return gulp.src([
|
||||
config.development + '/' + config.paths.images + '/**/*.{jpg,png,jpeg,gif}',
|
||||
])
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.images));
|
||||
}
|
||||
|
||||
|
||||
// Elaborazione dei fonts
|
||||
const fonts = gulp.parallel(() => {
|
||||
const vendor = [
|
||||
'font-awesome/fonts/fontawesome-webfont.eot',
|
||||
'font-awesome/fonts/fontawesome-webfont.svg',
|
||||
'font-awesome/fonts/fontawesome-webfont.ttf',
|
||||
'font-awesome/fonts/fontawesome-webfont.woff',
|
||||
'font-awesome/fonts/fontawesome-webfont.woff2',
|
||||
'font-awesome/fonts/FontAwesome.otf',
|
||||
'bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
|
||||
'bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
|
||||
'bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
|
||||
'bootstrap/dist/fonts/glyphicons-halflings-regular.woff',
|
||||
'bootstrap/dist/fonts/glyphicons-halflings-regular.woff2',
|
||||
];
|
||||
|
||||
for (const i in vendor) {
|
||||
vendor[i] = config.nodeDirectory + '/' + vendor[i];
|
||||
}
|
||||
|
||||
return gulp.src(vendor)
|
||||
.pipe(flatten())
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.fonts));
|
||||
}, srcFonts);
|
||||
|
||||
// Elaborazione dei fonts personalizzati
|
||||
function srcFonts() {
|
||||
return gulp.src([
|
||||
config.development + '/' + config.paths.fonts + '/**/*.{otf,eot,svg,ttf,woff,woff2}',
|
||||
])
|
||||
.pipe(flatten())
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.fonts));
|
||||
}
|
||||
|
||||
function ckeditor() {
|
||||
return gulp.src([
|
||||
config.nodeDirectory + '/ckeditor4/{adapters,lang,skins,plugins,core}/**/*.{js,json,css,png,gif,html}',
|
||||
config.nodeDirectory + '/ckeditor4/*.{js,css}',
|
||||
])
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js + '/ckeditor'));
|
||||
}
|
||||
|
||||
function colorpicker() {
|
||||
return gulp.src([
|
||||
config.nodeDirectory + '/bootstrap-colorpicker/dist/**/*.{jpg,png,jpeg}',
|
||||
])
|
||||
.pipe(flatten())
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.images + '/bootstrap-colorpicker'));
|
||||
}
|
||||
|
||||
function password_strength() {
|
||||
return gulp.src([
|
||||
config.nodeDirectory + '/pwstrength-bootstrap/dist/*.js',
|
||||
])
|
||||
.pipe(concat('password.min.js'))
|
||||
.pipe(minifyJS())
|
||||
.pipe(gulp.dest(config.production + '/password-strength'));
|
||||
}
|
||||
|
||||
function hotkeys() {
|
||||
return gulp.src([
|
||||
config.nodeDirectory + '/hotkeys-js/dist/hotkeys.min.js',
|
||||
])
|
||||
.pipe(flatten())
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js + '/hotkeys-js'));
|
||||
}
|
||||
|
||||
function chartjs() {
|
||||
return gulp.src([
|
||||
config.nodeDirectory + '/chart.js/dist/Chart.min.js',
|
||||
])
|
||||
.pipe(flatten())
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js + '/chartjs'));
|
||||
}
|
||||
|
||||
function csrf() {
|
||||
return gulp.src([
|
||||
'./vendor/owasp/csrf-protector-php/js/csrfprotector.js',
|
||||
])
|
||||
.pipe(flatten())
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js + '/csrf'));
|
||||
}
|
||||
|
||||
function pdfjs() {
|
||||
const web = gulp.src([
|
||||
config.nodeDirectory + '/pdf.js/web/**/*',
|
||||
'!' + config.nodeDirectory + '/pdf.js/web/cmaps/*',
|
||||
'!' + config.nodeDirectory + '/pdf.js/web/*.map',
|
||||
'!' + config.nodeDirectory + '/pdf.js/web/*.pdf',
|
||||
])
|
||||
.pipe(gulp.dest(config.production + '/pdfjs/web'));
|
||||
|
||||
const build = gulp.src([
|
||||
config.nodeDirectory + '/pdf.js/build/*',
|
||||
'!' + config.nodeDirectory + '/pdf.js/build/*.map',
|
||||
])
|
||||
.pipe(gulp.dest(config.production + '/pdfjs/build'));
|
||||
|
||||
return merge(web, build);
|
||||
}
|
||||
|
||||
// Elaborazione e minificazione delle informazioni sull'internazionalizzazione
|
||||
function i18n() {
|
||||
return gulp.src([
|
||||
config.nodeDirectory + '/**/{i18n,lang,locale,locales}/*.{js,json}',
|
||||
config.development + '/' + config.paths.js + '/i18n/**/*.{js,json}',
|
||||
'!' + config.nodeDirectory + '/**/{src,plugins}/**',
|
||||
'!' + config.nodeDirectory + '/ckeditor4/**',
|
||||
'!' + config.nodeDirectory + '/summernote/**',
|
||||
'!' + config.nodeDirectory + '/jquery-ui/**',
|
||||
])
|
||||
//.pipe(gulpIf('*.js', minifyJS(), gulpIf('*.json', minifyJSON())))
|
||||
.pipe(gulpIf('!*.min.*', rename({
|
||||
suffix: '.min'
|
||||
})))
|
||||
.pipe(flatten({
|
||||
includeParents: 1
|
||||
}))
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js + '/i18n'));
|
||||
}
|
||||
|
||||
// PHP DebugBar assets
|
||||
function phpDebugBar() {
|
||||
return gulp.src([
|
||||
'./vendor/maximebf/debugbar/src/DebugBar/Resources/**/*',
|
||||
'!./vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/**/*',
|
||||
])
|
||||
.pipe(gulpIf('*.css', minifyCSS(), gulpIf('*.js', minifyJS())))
|
||||
.pipe(gulp.dest(config.production + '/php-debugbar'));
|
||||
}
|
||||
|
||||
// Operazioni per la release
|
||||
function release(done) {
|
||||
// Impostazione dello zip
|
||||
let output = fs.createWriteStream('./release.zip', {flags: 'w'});
|
||||
let archive = archiver('zip');
|
||||
|
||||
output.on('close', function () {
|
||||
console.log('ZIP completato!');
|
||||
});
|
||||
|
||||
archive.on('error', function (err) {
|
||||
throw err;
|
||||
});
|
||||
|
||||
archive.pipe(output);
|
||||
|
||||
// Individuazione dei file da aggiungere
|
||||
glob([
|
||||
'**/*',
|
||||
'!checksum.json',
|
||||
'!database.json',
|
||||
'!.idea/**',
|
||||
'!.git/**',
|
||||
'!node_modules/**',
|
||||
'!include/custom/**',
|
||||
'!backup/**',
|
||||
'!files/**',
|
||||
'files/temp/.gitkeep',
|
||||
'!logs/**',
|
||||
'!config.inc.php',
|
||||
'!update/structure.php',
|
||||
'!**/*.(lock|phar|log|zip|bak|jar|txt)',
|
||||
'!**/~*',
|
||||
'!vendor/tecnickcom/tcpdf/examples/**',
|
||||
'!vendor/tecnickcom/tcpdf/fonts/*',
|
||||
'vendor/tecnickcom/tcpdf/fonts/*helvetica*',
|
||||
'!vendor/mpdf/mpdf/tmp/*',
|
||||
'!vendor/mpdf/mpdf/ttfonts/*',
|
||||
'vendor/mpdf/mpdf/ttfonts/DejaVuinfo.txt',
|
||||
'vendor/mpdf/mpdf/ttfonts/DejaVu*Condensed*',
|
||||
'!vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/**',
|
||||
'!vendor/respect/validation/tests/**',
|
||||
'!vendor/willdurand/geocoder/tests/**',
|
||||
], {
|
||||
dot: true,
|
||||
}).then(function (files) {
|
||||
// Aggiunta dei file con i relativi checksum
|
||||
let checksum = {};
|
||||
for (const file of files) {
|
||||
if (fs.lstatSync(file).isDirectory()) {
|
||||
archive.directory(file, file);
|
||||
} else {
|
||||
archive.file(file);
|
||||
|
||||
if (!file.startsWith('vendor')) {
|
||||
checksum[file] = md5File.sync(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Eccezioni
|
||||
archive.file('backup/.htaccess', {});
|
||||
archive.file('files/.htaccess', {});
|
||||
archive.file('files/my_impianti/componente.ini', {});
|
||||
archive.file('logs/.htaccess', {});
|
||||
|
||||
// Aggiunta del file dei checksum
|
||||
let checksumFile = fs.createWriteStream('./checksum.json', {flags: 'w'});
|
||||
checksumFile.write(JSON.stringify(checksum));
|
||||
checksumFile.close();
|
||||
archive.file('checksum.json', {});
|
||||
|
||||
// Aggiunta del file per il controllo di integrità del database
|
||||
archive.append(shell.exec('php update/structure.php', {
|
||||
silent: true
|
||||
}).stdout, {
|
||||
name: 'database.json'
|
||||
});
|
||||
|
||||
// Aggiunta del commit corrente nel file REVISION
|
||||
archive.append(shell.exec('git rev-parse --short HEAD', {
|
||||
silent: true
|
||||
}).stdout, {
|
||||
name: 'REVISION'
|
||||
});
|
||||
|
||||
// Opzioni sulla release
|
||||
inquirer.prompt([{
|
||||
type: 'input',
|
||||
name: 'version',
|
||||
message: 'Numero di versione:',
|
||||
}, {
|
||||
type: 'confirm',
|
||||
name: 'beta',
|
||||
message: 'Versione beta?',
|
||||
default: false,
|
||||
}]).then(function (result) {
|
||||
let version = result.version;
|
||||
|
||||
if (result.beta) {
|
||||
version += 'beta';
|
||||
}
|
||||
|
||||
archive.append(version, {
|
||||
name: 'VERSION'
|
||||
});
|
||||
|
||||
// Completamento dello zip
|
||||
archive.finalize();
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Pulizia
|
||||
function clean() {
|
||||
return del([config.production]);
|
||||
}
|
||||
|
||||
// Operazioni di default per la generazione degli assets
|
||||
const bower = gulp.series(clean, gulp.parallel(JS, CSS, images, fonts, phpDebugBar, ckeditor, colorpicker, i18n, pdfjs, hotkeys, chartjs, password_strength, csrf));
|
||||
|
||||
// Debug su CSS e JS
|
||||
exports.srcJS = srcJS;
|
||||
exports.srcCSS = srcCSS;
|
||||
|
||||
exports.bower = bower;
|
||||
exports.release = release;
|
||||
exports.default = bower;
|
||||
|
||||
// Watch task - lanciato con `gulp watch`, resta in attesa e ogni volta che viene modificato un asset in src
|
||||
// viene aggiornata la dist
|
||||
gulp.task('watch', function () {
|
||||
gulp.watch('assets/src/css/*.css', gulp.series(srcCSS, CSS));
|
||||
gulp.watch('assets/src/css/print/*.css', gulp.series(srcCSS, CSS));
|
||||
gulp.watch('assets/src/css/themes/*.css', gulp.series(srcCSS, CSS));
|
||||
gulp.watch('assets/src/js/base/*.js', gulp.series(srcJS, JS));
|
||||
gulp.watch('assets/src/js/functions/*.js', gulp.series(srcJS, JS));
|
||||
gulp.watch('assets/src/img/*', gulp.series(images));
|
||||
});
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
include_once __DIR__.'/../core.php';
|
||||
|
||||
if (Auth::check()) {
|
||||
if (auth()->check()) {
|
||||
echo '
|
||||
</div>
|
||||
</div><!-- /.row -->
|
||||
|
@ -40,13 +40,13 @@ if (Auth::check()) {
|
|||
echo '
|
||||
</div><!-- ./wrapper -->';
|
||||
|
||||
if (Auth::check()) {
|
||||
if (auth()->check()) {
|
||||
if (!empty($_SESSION['keep_alive'])) {
|
||||
echo '
|
||||
<script> setInterval("session_keep_alive()", 5*60*1000); </script>';
|
||||
}
|
||||
|
||||
if (App::debug()) {
|
||||
if (AppLegacy::debug()) {
|
||||
echo '
|
||||
<!-- Fix per le icone di debug -->
|
||||
<style>div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard:before, div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-database:before, div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration:before, div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory:before, div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count:before, div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before {
|
||||
|
|
|
@ -21,6 +21,7 @@ include_once __DIR__.'/../core.php';
|
|||
|
||||
// Compatibilità per controller ed editor
|
||||
$structure = Modules::get($id_module);
|
||||
$modulo_viste = Modules::get('Viste');
|
||||
|
||||
echo '
|
||||
<p>'.tr('Trascina le colonne per ordinare la struttura della tabella principale, seleziona e deseleziona le colonne per renderle visibili o meno').'.</p>
|
||||
|
@ -52,8 +53,9 @@ echo '
|
|||
|
||||
// Aggiornamento effettivo
|
||||
$.post(globals.rootdir + "/actions.php", {
|
||||
id_module: "'.$id_module.'",
|
||||
op: "toggle_colonna",
|
||||
id_module: "'.$modulo_viste->id.'",
|
||||
id_record: "'.$id_module.'",
|
||||
op: "update_visible",
|
||||
id_vista: id,
|
||||
visible: $(this).is(":checked") ? 1 : 0,
|
||||
});
|
||||
|
|
|
@ -78,7 +78,7 @@ if ($module['name'] == 'Interventi') {
|
|||
</div>';
|
||||
}
|
||||
|
||||
echo App::internalLoad('riga.php', $result, $options);
|
||||
echo AppLegacy::internalLoad('riga.php', $result, $options);
|
||||
|
||||
// Informazioni aggiuntive
|
||||
$disabled = empty($result['idarticolo']);
|
||||
|
@ -86,7 +86,7 @@ $disabled = empty($result['idarticolo']);
|
|||
echo '
|
||||
<div class="row '.(!empty($options['nascondi_prezzi']) ? 'hidden' : '').'" id="prezzi_articolo">
|
||||
<div class="col-md-4 text-center">
|
||||
<button type="button" class="btn btn-sm btn-info btn-block '.($disabled ? 'disabled' : '').'" '.($disabled ? 'disabled' : '').' onclick="$(\'#prezziacquisto\').toggleClass(\'hide\'); $(\'#prezziacquisto\').load(\''.base_path()."/ajax_complete.php?module=Articoli&op=getprezziacquisto&idarticolo=' + ( $('#idarticolo option:selected').val() || $('#idarticolo').val()) + '&limit=5".'\');">
|
||||
<button type="button" class="btn btn-sm btn-info btn-block '.($disabled ? 'disabled' : '').'" '.($disabled ? 'disabled' : '').' onclick="$(\'#prezziacquisto\').toggleClass(\'hide\'); $(\'#prezziacquisto\').load(\''.base_url()."/ajax_complete.php?module=Articoli&op=getprezziacquisto&idarticolo=' + ( $('#idarticolo option:selected').val() || $('#idarticolo').val()) + '&limit=5".'\');">
|
||||
<i class="fa fa-shopping-cart"></i> '.tr('Ultimi prezzi di acquisto').'
|
||||
</button>
|
||||
<br>
|
||||
|
@ -94,14 +94,14 @@ echo '
|
|||
</div>
|
||||
|
||||
<div class="col-md-4 text-center">
|
||||
<button type="button" class="btn btn-sm btn-info btn-block '.($disabled ? 'disabled' : '').'" '.($disabled ? 'disabled' : '').' onclick="$(\'#prezzi\').toggleClass(\'hide\'); $(\'#prezzi\').load(\''.base_path()."/ajax_complete.php?module=Articoli&op=getprezzi&idarticolo=' + ( $('#idarticolo option:selected').val() || $('#idarticolo').val()) + '&idanagrafica=".$options['idanagrafica'].'\');">
|
||||
<button type="button" class="btn btn-sm btn-info btn-block '.($disabled ? 'disabled' : '').'" '.($disabled ? 'disabled' : '').' onclick="$(\'#prezzi\').toggleClass(\'hide\'); $(\'#prezzi\').load(\''.base_url()."/ajax_complete.php?module=Articoli&op=getprezzi&idarticolo=' + ( $('#idarticolo option:selected').val() || $('#idarticolo').val()) + '&idanagrafica=".$options['idanagrafica'].'\');">
|
||||
<i class="fa fa-handshake-o"></i> '.($options['dir'] == 'entrata' ? tr('Ultimi prezzi al cliente') : tr('Ultimi prezzi dal fornitore')).'
|
||||
</button>
|
||||
<div id="prezzi" class="hide"></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 text-center">
|
||||
<button type="button" class="btn btn-sm btn-info btn-block '.($disabled ? 'disabled' : '').'" '.($disabled ? 'disabled' : '').' onclick="$(\'#prezzivendita\').toggleClass(\'hide\'); $(\'#prezzivendita\').load(\''.base_path()."/ajax_complete.php?module=Articoli&op=getprezzivendita&idarticolo=' + ( $('#idarticolo option:selected').val() || $('#idarticolo').val()) + '&limit=5".'\');">
|
||||
<button type="button" class="btn btn-sm btn-info btn-block '.($disabled ? 'disabled' : '').'" '.($disabled ? 'disabled' : '').' onclick="$(\'#prezzivendita\').toggleClass(\'hide\'); $(\'#prezzivendita\').load(\''.base_url()."/ajax_complete.php?module=Articoli&op=getprezzivendita&idarticolo=' + ( $('#idarticolo option:selected').val() || $('#idarticolo').val()) + '&limit=5".'\');">
|
||||
<i class="fa fa-money"></i> '.tr('Ultimi prezzi di vendita').'
|
||||
</button>
|
||||
<br>
|
||||
|
|
|
@ -21,7 +21,7 @@ $result['id'] = isset($result['id']) ? $result['id'] : null;
|
|||
|
||||
// Form di inserimento riga documento
|
||||
echo '
|
||||
<form action="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post">
|
||||
<form action="'.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post">
|
||||
<input type="hidden" name="id_plugin" value="'.$id_plugin.'">
|
||||
<input type="hidden" name="hash" value="tab_'.$id_plugin.'">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
|
|
|
@ -55,7 +55,7 @@ if ($righe->isEmpty()) {
|
|||
return;
|
||||
}
|
||||
|
||||
$link = !empty($documento_finale) ? base_path().'/editor.php?id_module='.$final_module['id'].'&id_record='.$documento_finale->id : base_path().'/controller.php?id_module='.$final_module['id'];
|
||||
$link = !empty($documento_finale) ? base_url().'/editor.php?id_module='.$final_module['id'].'&id_record='.$documento_finale->id : base_url().'/controller.php?id_module='.$final_module['id'];
|
||||
|
||||
echo '
|
||||
<form action="'.$link.'" method="post">
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
*/
|
||||
|
||||
// Descrizione
|
||||
echo App::internalLoad('descrizione.php', $result, $options);
|
||||
echo AppLegacy::internalLoad('descrizione.php', $result, $options);
|
||||
|
||||
// Conti, rivalsa INPS e ritenuta d'acconto
|
||||
echo App::internalLoad('conti.php', $result, $options);
|
||||
echo AppLegacy::internalLoad('conti.php', $result, $options);
|
||||
|
||||
// Iva
|
||||
echo '
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
*/
|
||||
|
||||
// Descrizione
|
||||
echo App::internalLoad('descrizione.php', $result, $options);
|
||||
echo AppLegacy::internalLoad('descrizione.php', $result, $options);
|
||||
|
||||
// Conti, rivalsa INPS e ritenuta d'acconto
|
||||
echo App::internalLoad('conti.php', $result, $options);
|
||||
echo AppLegacy::internalLoad('conti.php', $result, $options);
|
||||
|
||||
$incorpora_iva = $options['dir'] == 'entrata' && setting('Utilizza prezzi di vendita comprensivi di IVA');
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ if (file_exists('config.inc.php') && $valid_config && $dbo->isConnected()) {
|
|||
|
||||
$pageTitle = tr('Configurazione');
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'top.php');
|
||||
|
||||
// Controllo sull'esistenza di nuovi parametri di configurazione
|
||||
if (post('db_host') !== null) {
|
||||
|
@ -110,7 +110,8 @@ if (post('db_host') !== null) {
|
|||
}
|
||||
|
||||
echo $state;
|
||||
exit();
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
}
|
||||
|
||||
// Creazione della configurazione
|
||||
|
@ -149,14 +150,14 @@ if (post('db_host') !== null) {
|
|||
<p>'.tr('Sembra che non ci siano i permessi di scrittura sul file _FILE_', [
|
||||
'_FILE_' => '<b>config.inc.php</b>',
|
||||
]).'</p>
|
||||
<form action="'.base_path().'/index.php?action=updateconfig&firstuse=true" method="post">
|
||||
<form action="'.base_url().'/index.php?action=updateconfig&firstuse=true" method="post">
|
||||
<div class="hide">
|
||||
<input type="hidden" name="db_name" value="'.$db_name.'">
|
||||
<input type="hidden" name="db_password" value="'.$db_password.'">
|
||||
<input type="hidden" name="db_username" value="'.$db_username.'">;
|
||||
<input type="hidden" name="db_host" value="'.$db_host.'">
|
||||
</div>
|
||||
<a class="btn btn-warning" href="'.base_path().'/index.php"><i class="fa fa-arrow-left"></i> '.tr('Torna indietro').'</a>
|
||||
<a class="btn btn-warning" href="'.base_url().'/index.php"><i class="fa fa-arrow-left"></i> '.tr('Torna indietro').'</a>
|
||||
<button class="btn btn-info"><i class="fa fa-repeat"></i> '.tr('Riprova').'</button>
|
||||
</form>
|
||||
<hr>
|
||||
|
@ -184,9 +185,9 @@ if (post('db_host') !== null) {
|
|||
"dir" : "ltr",
|
||||
"lang" : "it-IT",
|
||||
"name" : "OpenSTAManager",
|
||||
"scope" : "'.base_path().'",
|
||||
"scope" : "'.base_url().'",
|
||||
"display" : "fullscreen",
|
||||
"start_url" : "'.base_path().'",
|
||||
"start_url" : "'.base_url().'",
|
||||
"short_name" : "OSM",
|
||||
"theme_color" : "transparent",
|
||||
"description" : "OpenSTAManager",
|
||||
|
@ -203,8 +204,9 @@ if (post('db_host') !== null) {
|
|||
}';
|
||||
file_put_contents('manifest.json', $manifest);
|
||||
|
||||
redirect(base_path().'/index.php');
|
||||
exit();
|
||||
redirect_legacy(base_url().'/index.php');
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -219,12 +221,12 @@ if ((file_exists('config.inc.php') || $valid_config) && !$dbo->isConnected()) {
|
|||
<div class="box-body">
|
||||
<p>'.tr("Si è verificato un'errore durante la connessione al database").'.</p>
|
||||
<p>'.tr('Controllare di aver inserito correttamente i dati di accesso, e che il database atto ad ospitare i dati del gestionale sia esistente').'.</p>
|
||||
<a class="btn btn-info" href="'.base_path().'/index.php"><i class="fa fa-repeat"></i> '.tr('Riprova').'</a>
|
||||
<a class="btn btn-info" href="'.base_url().'/index.php"><i class="fa fa-repeat"></i> '.tr('Riprova').'</a>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
$img = App::getPaths()['img'];
|
||||
$img = AppLegacy::getPaths()['img'];
|
||||
|
||||
// Visualizzazione dell'interfaccia di impostazione iniziale, nel caso il file di configurazione sia mancante oppure i paramentri non siano sufficienti
|
||||
if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
|
||||
|
@ -240,7 +242,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
|
|||
'_FILE_' => '<b>config.inc.php</b>',
|
||||
]).'.</p>
|
||||
<p>'.tr("Nel caso il problema persista, rivolgersi all'assistenza ufficiale").'.</p>
|
||||
<a class="btn btn-info" href="'.base_path().'/index.php"><i class="fa fa-repeat"></i> '.tr('Riprova').'</a>
|
||||
<a class="btn btn-info" href="'.base_url().'/index.php"><i class="fa fa-repeat"></i> '.tr('Riprova').'</a>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
@ -295,7 +297,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
|
|||
$("#test").prop("disabled", true);
|
||||
$("#install").prop("disabled", true);
|
||||
$(this).closest("form").ajaxSubmit({
|
||||
url: "'.base_path().'/index.php",
|
||||
url: "'.base_url().'/index.php",
|
||||
data: {
|
||||
test: 1,
|
||||
},
|
||||
|
@ -347,7 +349,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
|
|||
],
|
||||
];
|
||||
|
||||
$current = trans()->getCurrentLocale();
|
||||
$current = trans()->getLocale();
|
||||
foreach ($languages as $code => $language) {
|
||||
echo '
|
||||
<option data-country="'.$language['flag'].'" value="'.$code.'" '.($code == $current ? 'selected' : '').'>'.$language['title'].'</option>';
|
||||
|
@ -406,7 +408,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
|
|||
var parameters = getUrlVars();
|
||||
parameters.lang = $(this).val();
|
||||
|
||||
redirect(url, parameters);
|
||||
redirect_legacy(url, parameters);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -493,7 +495,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
|
|||
// Form dei parametri
|
||||
echo '
|
||||
<form action="?action=updateconfig&firstuse=true" method="post" id="config-form">
|
||||
<input type="hidden" name="lang" value="'.trans()->getCurrentLocale().'">
|
||||
<input type="hidden" name="lang" value="'.trans()->getLocale().'">
|
||||
|
||||
<h4>'.tr('Formato date').'</h4>
|
||||
<div class="row">
|
||||
|
@ -607,6 +609,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
|
|||
</div>';
|
||||
}
|
||||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'bottom.php');
|
||||
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
exit();
|
||||
|
|
|
@ -58,7 +58,7 @@ if ($has_azienda && $has_user && $has_settings) {
|
|||
|
||||
$pageTitle = tr('Inizializzazione');
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'top.php');
|
||||
|
||||
// Controllo sull'esistenza di nuovi parametri di configurazione
|
||||
if (post('action') == 'init') {
|
||||
|
@ -89,7 +89,7 @@ if (post('action') == 'init') {
|
|||
// Creazione utente Amministratore
|
||||
$dbo->insert('zz_users', [
|
||||
'username' => post('admin_username'),
|
||||
'password' => Auth::hashPassword(post('admin_password')),
|
||||
'password' => auth()->hashPassword(post('admin_password')),
|
||||
'email' => post('admin_email'),
|
||||
'idgruppo' => $admin['id'],
|
||||
'idanagrafica' => isset($id_record) ? $id_record : 0,
|
||||
|
@ -114,11 +114,12 @@ if (post('action') == 'init') {
|
|||
}
|
||||
}
|
||||
|
||||
redirect(base_path(), 'js');
|
||||
exit();
|
||||
redirect_legacy(base_url(), 'js');
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
}
|
||||
|
||||
$img = App::getPaths()['img'];
|
||||
$img = AppLegacy::getPaths()['img'];
|
||||
|
||||
// Visualizzazione dell'interfaccia di impostazione iniziale, nel caso il file di configurazione sia mancante oppure i paramentri non siano sufficienti
|
||||
echo '
|
||||
|
@ -260,6 +261,7 @@ echo '
|
|||
|
||||
<script>$(document).ready(init)</script>';
|
||||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'bottom.php');
|
||||
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
exit();
|
||||
|
|
|
@ -104,18 +104,19 @@ if (filter('action') == 'do_update') {
|
|||
}
|
||||
|
||||
echo '
|
||||
<a class="btn btn-success btn-block" href="'.base_path().'">
|
||||
<a class="btn btn-success btn-block" href="'.base_url().'">
|
||||
<i class="fa fa-check"></i> '.tr('Continua').'
|
||||
</a>';
|
||||
}
|
||||
|
||||
exit();
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
} elseif (Update::isUpdateAvailable()) {
|
||||
// Controllo se l'aggiornamento è in esecuzione
|
||||
if (Update::isUpdateLocked() && filter('force') === null) {
|
||||
$pageTitle = tr('Aggiornamento in corso!');
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'top.php');
|
||||
|
||||
echo '
|
||||
<div class="box box-center box-danger box-solid text-center">
|
||||
|
@ -125,13 +126,14 @@ if (filter('action') == 'do_update') {
|
|||
<div class="box-body">
|
||||
<p>'.tr("E' attualmente in corso la procedura di aggiornamento del software, e pertanto siete pregati di attendere fino alla sua conclusione").'.</p>
|
||||
<p>'.tr("Nel caso il problema persista, rivolgersi all'amministratore o all'assistenza ufficiale").'.</p>
|
||||
<a class="btn btn-info" href="'.base_path().'/index.php"><i class="fa fa-repeat"></i> '.tr('Riprova').'</a>
|
||||
<a class="btn btn-info" href="'.base_url().'/index.php"><i class="fa fa-repeat"></i> '.tr('Riprova').'</a>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'bottom.php');
|
||||
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
$firstuse = !$dbo->isInstalled() ? 'true' : 'false';
|
||||
|
@ -139,7 +141,7 @@ if (filter('action') == 'do_update') {
|
|||
$button = !$dbo->isInstalled() ? tr('Installa!') : tr('Aggiorna!');
|
||||
$pageTitle = !$dbo->isInstalled() ? tr('Installazione') : tr('Aggiornamento');
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'top.php');
|
||||
|
||||
echo '
|
||||
<div class="box box-center-large box-warning text-center">
|
||||
|
|
|
@ -94,8 +94,8 @@ if (!empty($type) && $type != 'menu' && $type != 'custom') {
|
|||
}
|
||||
|
||||
// Reset della selezione precedente
|
||||
$_SESSION['module_'.$id_module]['selected'] = [];
|
||||
$selezione = array_keys($_SESSION['module_'.$id_module]['selected']);
|
||||
session(['module_'.$id_module.'.selected' => []]);
|
||||
$selezione = array_keys(session('module_'.$id_module.'.selected'));
|
||||
|
||||
$table_id = 'main_'.rand(0, 99);
|
||||
echo '
|
||||
|
|
|
@ -21,8 +21,8 @@ use Util\FileSystem;
|
|||
$lang = '';
|
||||
include_once __DIR__.'/../core.php';
|
||||
|
||||
$paths = App::getPaths();
|
||||
$user = Auth::user();
|
||||
$paths = AppLegacy::getPaths();
|
||||
$user = auth()->user();
|
||||
|
||||
$pageTitle = !empty($pageTitle) ? $pageTitle : $structure->title;
|
||||
|
||||
|
@ -42,22 +42,22 @@ echo '<!DOCTYPE html>
|
|||
|
||||
if (file_exists(base_dir().'/manifest.json')) {
|
||||
echo '
|
||||
<link rel="manifest" href="'.base_path().'/manifest.json">';
|
||||
<link rel="manifest" href="'.base_url().'/manifest.json">';
|
||||
}
|
||||
|
||||
// CSS
|
||||
foreach (App::getAssets()['css'] as $style) {
|
||||
foreach (AppLegacy::getAssets()['css'] as $style) {
|
||||
echo '
|
||||
<link rel="stylesheet" type="text/css" media="all" href="'.$style.'"/>';
|
||||
}
|
||||
|
||||
// Print CSS
|
||||
foreach (App::getAssets()['print'] as $style) {
|
||||
foreach (AppLegacy::getAssets()['print'] as $style) {
|
||||
echo '
|
||||
<link rel="stylesheet" type="text/css" media="print" href="'.$style.'"/>';
|
||||
}
|
||||
|
||||
if (Auth::check()) {
|
||||
if (auth()->check()) {
|
||||
echo '
|
||||
<script>
|
||||
search = []';
|
||||
|
@ -179,7 +179,7 @@ if (Auth::check()) {
|
|||
},
|
||||
};
|
||||
globals = {
|
||||
rootdir: "'.base_path().'",
|
||||
rootdir: "'.base_url().'",
|
||||
js: "'.$paths['js'].'",
|
||||
css: "'.$paths['css'].'",
|
||||
img: "'.$paths['img'].'",
|
||||
|
@ -203,10 +203,10 @@ if (Auth::check()) {
|
|||
locale: "'.(explode('_', $lang)[0]).'",
|
||||
full_locale: "'.$lang.'",
|
||||
|
||||
start_date: "'.$_SESSION['period_start'].'",
|
||||
start_date_formatted: "'.Translator::dateToLocale($_SESSION['period_start']).'",
|
||||
end_date: "'.$_SESSION['period_end'].'",
|
||||
end_date_formatted: "'.Translator::dateToLocale($_SESSION['period_end']).'",
|
||||
start_date: "'.session('period_start').'",
|
||||
start_date_formatted: "'.Translator::dateToLocale(session('period_start')).'",
|
||||
end_date: "'.session('period_end').'",
|
||||
end_date_formatted: "'.Translator::dateToLocale(session('period_end')).'",
|
||||
|
||||
collapse_plugin_sidebar: '.intval(setting('Nascondere la barra dei plugin di default')).',
|
||||
|
||||
|
@ -241,7 +241,7 @@ if (Auth::check()) {
|
|||
echo '
|
||||
<script>
|
||||
globals = {
|
||||
rootdir: "'.base_path().'",
|
||||
rootdir: "'.base_url().'",
|
||||
|
||||
search: {},
|
||||
translations: {
|
||||
|
@ -275,7 +275,7 @@ if (Auth::check()) {
|
|||
}
|
||||
|
||||
// JS
|
||||
foreach (App::getAssets()['js'] as $js) {
|
||||
foreach (AppLegacy::getAssets()['js'] as $js) {
|
||||
echo '
|
||||
<script type="text/javascript" charset="utf-8" src="'.$js.'"></script>';
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ echo '
|
|||
});
|
||||
</script>';
|
||||
|
||||
if (Auth::check()) {
|
||||
if (auth()->check()) {
|
||||
if (setting('Abilita esportazione Excel e PDF')) {
|
||||
echo '
|
||||
<script type="text/javascript" charset="utf-8" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
|
@ -300,7 +300,7 @@ if (Auth::check()) {
|
|||
}
|
||||
|
||||
if (setting('Attiva scorciatoie da tastiera')) {
|
||||
echo '<script type="text/javascript" charset="utf-8" src="'.App::getPaths()['js'].'/hotkeys-js/hotkeys.min.js"></script>';
|
||||
echo '<script type="text/javascript" charset="utf-8" src="'.url('/').'/assets/js/hotkeys-js/hotkeys.min.js"></script>';
|
||||
echo '
|
||||
<script>
|
||||
|
||||
|
@ -330,17 +330,17 @@ if (Auth::check()) {
|
|||
}
|
||||
}
|
||||
|
||||
$settings_collapse = session_get('settings.sidebar-collapse') ? 1 : 0;
|
||||
$hide_sidebar = Auth::check() && (setting('Nascondere la barra sinistra di default') || $settings_collapse);
|
||||
$settings_collapse = session('settings.sidebar-collapse') ? 1 : 0;
|
||||
$hide_sidebar = auth()->check() && (setting('Nascondere la barra sinistra di default') || $settings_collapse);
|
||||
echo '
|
||||
|
||||
</head>
|
||||
|
||||
<body class="skin-'.$theme.(!empty($hide_sidebar) ? ' sidebar-collapse' : '').(!Auth::check() ? ' hold-transition login-page' : '').'">
|
||||
<div class="'.(!Auth::check() ? '' : 'wrapper').'">';
|
||||
<body class="skin-'.$theme.(!empty($hide_sidebar) ? ' sidebar-collapse' : '').(!auth()->check() ? ' hold-transition login-page' : '').'">
|
||||
<div class="'.(!auth()->check() ? '' : 'wrapper').'">';
|
||||
|
||||
if (Auth::check()) {
|
||||
$calendar_color_label = ($_SESSION['period_start'] != date('Y').'-01-01' || $_SESSION['period_end'] != date('Y').'-12-31') ? 'danger' : 'default';
|
||||
if (auth()->check()) {
|
||||
$calendar_color_label = (session('period_start') != date('Y').'-01-01' || session('period_end') != date('Y').'-12-31') ? 'danger' : 'default';
|
||||
|
||||
echo '
|
||||
<!-- Loader principale -->
|
||||
|
@ -384,7 +384,7 @@ if (Auth::check()) {
|
|||
</a></li>
|
||||
|
||||
<li><a style="cursor:default;padding:0px;padding-right:5px;padding-left:5px;margin-top:15px;" class="label label-'.$calendar_color_label.'">
|
||||
'.Translator::dateToLocale($_SESSION['period_start']).' - '.Translator::dateToLocale($_SESSION['period_end']).'
|
||||
'.Translator::dateToLocale(session('period_start')).' - '.Translator::dateToLocale(session('period_end')).'
|
||||
</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -393,7 +393,7 @@ if (Auth::check()) {
|
|||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="nav-button hide"><a href="'.base_path().'/bug.php" class="tip nav-button" title="'.tr('Segnalazione bug').'">
|
||||
<li class="nav-button hide"><a href="'.base_url().'/bug.php" class="tip nav-button" title="'.tr('Segnalazione bug').'">
|
||||
<i class="fa fa-bug"></i>
|
||||
</a></li>
|
||||
|
||||
|
@ -423,15 +423,19 @@ if (Auth::check()) {
|
|||
<i class="fa fa-print"></i>
|
||||
</a></li>
|
||||
|
||||
<li class="nav-button"><a href="'.base_path().'/log.php" class="tip nav-button" title="'.tr('Log accessi').'">
|
||||
<!---li class="nav-button"><a href="'.base_url().'/bug.php" class="tip nav-button" title="'.tr('Segnalazione bug').'">
|
||||
<i class="fa fa-bug"></i>
|
||||
</a></li--->
|
||||
|
||||
<li class="nav-button"><a href="'.base_url().'/log.php" class="tip nav-button" title="'.tr('Log accessi').'">
|
||||
<i class="fa fa-book"></i>
|
||||
</a></li>
|
||||
|
||||
<li class="nav-button"><a href="'.base_path().'/info.php" class="tip nav-button" title="'.tr('Informazioni').'">
|
||||
<li class="nav-button"><a href="'.base_url().'/info.php" class="tip nav-button" title="'.tr('Informazioni').'">
|
||||
<i class="fa fa-info"></i>
|
||||
</a></li>
|
||||
|
||||
<li class="nav-button"><a href="'.base_path().'/index.php?op=logout" onclick="sessionStorage.clear()" class="bg-red tip" title="'.tr('Esci').'">
|
||||
<li class="nav-button"><a href="'.base_url().'/index.php?op=logout" onclick="sessionStorage.clear()" class="bg-red tip" title="'.tr('Esci').'">
|
||||
<i class="fa fa-power-off"></i>
|
||||
</a></li>
|
||||
</ul>
|
||||
|
@ -446,13 +450,13 @@ if (Auth::check()) {
|
|||
<!-- Sidebar user panel -->
|
||||
<div class="user-panel text-center info" style="height: 60px">
|
||||
<div class="info">
|
||||
<p><a href="'.base_path().'/modules/utenti/info.php">
|
||||
<p><a href="'.base_url().'/modules/utenti/info.php">
|
||||
'.$user['username'].'
|
||||
</a></p>
|
||||
<p id="datetime"></p>
|
||||
</div>
|
||||
|
||||
<a class="image" href="'.base_path().'/modules/utenti/info.php">';
|
||||
<a class="image" href="'.base_url().'/modules/utenti/info.php">';
|
||||
|
||||
$user_photo = $user->photo;
|
||||
if ($user_photo) {
|
||||
|
@ -534,7 +538,7 @@ if (Auth::check()) {
|
|||
}
|
||||
|
||||
// Tab per le informazioni sulle operazioni
|
||||
if (Auth::admin()) {
|
||||
if (auth()->user()->isAdmin()) {
|
||||
echo '
|
||||
<li data-toggle="control-sidebar" class="bg-warning">
|
||||
<a data-toggle="tab" href="#tab_info" id="link-tab_info">
|
||||
|
@ -568,13 +572,13 @@ if (Auth::check()) {
|
|||
<div class="col-md-12">';
|
||||
|
||||
// Eventuale messaggio personalizzato per l'installazione corrente
|
||||
$extra_file = App::filepath('include/custom/extra', 'extra.php');
|
||||
$extra_file = AppLegacy::filepath('include/custom/extra', 'extra.php');
|
||||
if ($extra_file) {
|
||||
include_once $extra_file;
|
||||
}
|
||||
} else {
|
||||
// Eventuale messaggio personalizzato per l'installazione corrente
|
||||
$extra_file = App::filepath('include/custom/extra', 'login.php');
|
||||
$extra_file = AppLegacy::filepath('include/custom/extra', 'login.php');
|
||||
if ($extra_file) {
|
||||
include_once $extra_file;
|
||||
}
|
||||
|
@ -621,7 +625,7 @@ if (!empty($messages['warning'])) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!Auth::check() && (!empty($messages['info']) || !empty($messages['warning']) || !empty($messages['error']))) {
|
||||
if (!auth()->check() && (!empty($messages['info']) || !empty($messages['warning']) || !empty($messages['error']))) {
|
||||
echo '
|
||||
</div>
|
||||
</div>';
|
||||
|
|
59
index.php
59
index.php
|
@ -17,6 +17,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
$skip_permissions = true;
|
||||
include_once __DIR__.'/core.php';
|
||||
|
||||
|
@ -28,52 +31,44 @@ switch ($op) {
|
|||
$username = post('username');
|
||||
$password = post('password');
|
||||
|
||||
if ($dbo->isConnected() && $dbo->isInstalled() && auth()->attempt($username, $password)) {
|
||||
$_SESSION['keep_alive'] = true;
|
||||
|
||||
if (intval(setting('Inizio periodo calendario'))) {
|
||||
$_SESSION['period_start'] = setting('Inizio periodo calendario');
|
||||
} else {
|
||||
$_SESSION['period_start'] = date('Y').'-01-01';
|
||||
}
|
||||
|
||||
if (intval(setting('Fine periodo calendario'))) {
|
||||
$_SESSION['period_end'] = setting('Fine periodo calendario');
|
||||
} else {
|
||||
$_SESSION['period_end'] = date('Y').'-12-31';
|
||||
}
|
||||
$user = User::where('username', $username)->first();
|
||||
if (!empty($user) && Hash::check($password, $user->getAuthPassword())){
|
||||
auth()->loginUsingId($user->id, true);
|
||||
|
||||
// Rimozione log vecchi
|
||||
//$dbo->query('DELETE FROM `zz_operations` WHERE DATE_ADD(`created_at`, INTERVAL 30*24*60*60 SECOND) <= NOW()');
|
||||
} else {
|
||||
$status = auth()->getCurrentStatus();
|
||||
$status = auth()->user();
|
||||
|
||||
flash()->error(Auth::getStatus()[$status]['message']);
|
||||
//flash()->error(auth()->getStatus()[$status]['message']);
|
||||
|
||||
redirect_legacy(base_url().'/index.php');
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
redirect(base_path().'/index.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'logout':
|
||||
Auth::logout();
|
||||
auth()->logout();
|
||||
|
||||
redirect_legacy(base_url().'/index.php');
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
redirect(base_path().'/index.php');
|
||||
exit();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (Auth::check() && isset($dbo) && $dbo->isConnected() && $dbo->isInstalled()) {
|
||||
$module = Auth::firstModule();
|
||||
if (auth()->check() && isset($dbo) && $dbo->isConnected() && $dbo->isInstalled()) {
|
||||
$module = 1;
|
||||
|
||||
if (!empty($module)) {
|
||||
redirect(base_path().'/controller.php?id_module='.$module);
|
||||
redirect_legacy(base_url().'/controller.php?id_module='.$module);
|
||||
} else {
|
||||
redirect(base_path().'/index.php?op=logout');
|
||||
redirect_legacy(base_url().'/index.php?op=logout');
|
||||
}
|
||||
exit();
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
}
|
||||
|
||||
// Procedura di installazione
|
||||
|
@ -87,7 +82,7 @@ include_once base_dir().'/include/init/init.php';
|
|||
|
||||
$pageTitle = tr('Login');
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'top.php');
|
||||
|
||||
// Controllo se è una beta e in caso mostro un warning
|
||||
if (Update::isBeta()) {
|
||||
|
@ -101,7 +96,7 @@ if (Update::isBeta()) {
|
|||
}
|
||||
|
||||
// Controllo se è una beta e in caso mostro un warning
|
||||
if (Auth::isBrute()) {
|
||||
if (false) {
|
||||
echo '
|
||||
<div class="box box-danger box-center" id="brute">
|
||||
<div class="box-header with-border text-center">
|
||||
|
@ -110,7 +105,7 @@ if (Auth::isBrute()) {
|
|||
|
||||
<div class="box-body text-center">
|
||||
<p>'.tr('Sono stati effettuati troppi tentativi di accesso consecutivi!').'</p>
|
||||
<p>'.tr('Tempo rimanente (in secondi)').': <span id="brute-timeout">'.(Auth::getBruteTimeout() + 1).'</span></p>
|
||||
<p>'.tr('Tempo rimanente (in secondi)').': <span id="brute-timeout">'.(auth()->getBruteTimeout() + 1).'</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
@ -145,7 +140,7 @@ if (!empty(flash()->getMessage('error'))) {
|
|||
echo '
|
||||
<form action="?op=login" method="post" class="login-box box" autocomplete="off" >
|
||||
<div class="box-header with-border text-center">
|
||||
<img src="'.App::getPaths()['img'].'/logo_completo.png" class="img-responsive" alt="'.tr('OSM Logo').'">
|
||||
<img src="'.AppLegacy::getPaths()['img'].'/logo_completo.png" class="img-responsive" alt="'.tr('OSM Logo').'">
|
||||
</div>
|
||||
|
||||
<div class="login-box-body box-body">
|
||||
|
@ -161,7 +156,7 @@ echo ' required>
|
|||
{[ "type": "password", "name": "password", "autocomplete": "current-password", "placeholder": "'.tr('Password').'", "icon-before": "<i class=\"fa fa-lock\"></i>" ]}
|
||||
|
||||
<div class="text-right">
|
||||
<small><a href="'.base_path().'/reset.php">'.tr('Password dimenticata?').'</a></small>
|
||||
<small><a href="'.base_url().'/reset.php">'.tr('Password dimenticata?').'</a></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -188,4 +183,4 @@ echo ' required>
|
|||
});
|
||||
</script>';
|
||||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'bottom.php');
|
||||
|
|
6
info.php
6
info.php
|
@ -21,9 +21,9 @@ include_once __DIR__.'/core.php';
|
|||
|
||||
$pageTitle = tr('Informazioni');
|
||||
|
||||
$paths = App::getPaths();
|
||||
$paths = AppLegacy::getPaths();
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'top.php');
|
||||
|
||||
echo '
|
||||
<div class="box">
|
||||
|
@ -164,4 +164,4 @@ echo '
|
|||
</div>
|
||||
</div>';
|
||||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'bottom.php');
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
* @since 2.3
|
||||
*/
|
||||
|
||||
use App\Exceptions\LegacyRedirectException;
|
||||
use HTMLBuilder\HTMLBuilder;
|
||||
use Models\OperationLog;
|
||||
use Symfony\Component\Filesystem\Exception\IOException;
|
||||
|
@ -35,14 +36,12 @@ use Util\FileSystem;
|
|||
*
|
||||
* @param string $url
|
||||
* @param string $type
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function redirect($url, $type = 'php')
|
||||
function redirect_legacy($url, $type = 'php')
|
||||
{
|
||||
switch ($type) {
|
||||
case 'php':
|
||||
header('Location: '.$url);
|
||||
throw new LegacyRedirectException($url);
|
||||
break;
|
||||
case 'js':
|
||||
echo '<script type="text/javascript">location.href="'.$url.'";</script>';
|
||||
|
@ -219,7 +218,7 @@ function get_client_ip()
|
|||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
function translateTemplate()
|
||||
function translateTemplate($template)
|
||||
{
|
||||
$id_record = filter('id_record');
|
||||
$id_parent = filter('id_parent');
|
||||
|
@ -229,8 +228,6 @@ function translateTemplate()
|
|||
$id_module = $module ? $module['id'] : null;
|
||||
$id_plugin = $plugin ? $plugin['id'] : null;
|
||||
|
||||
$template = ob_get_clean();
|
||||
|
||||
$replaces = [
|
||||
'$id_module$' => $id_module,
|
||||
'$id_plugin$' => $id_plugin,
|
||||
|
@ -273,7 +270,7 @@ function translateTemplate()
|
|||
//flash()->clearMessage('info');
|
||||
}
|
||||
|
||||
echo $template;
|
||||
return $template;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -321,12 +318,13 @@ function redirectOperation($id_module, $id_record)
|
|||
$hash = $hash == '#tab_0' ? '' : $hash;
|
||||
|
||||
if ($backto == 'record-edit') {
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.$hash);
|
||||
redirect_legacy(base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.$hash);
|
||||
} elseif ($backto == 'record-list') {
|
||||
redirect(base_path().'/controller.php?id_module='.$id_module.$hash);
|
||||
redirect_legacy(base_url().'/controller.php?id_module='.$id_module.$hash);
|
||||
}
|
||||
|
||||
exit();
|
||||
throw new \App\Exceptions\LegacyExitException;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -371,7 +369,7 @@ function getURLPath()
|
|||
if (substr($path, 0, strlen($prefix)) == $prefix) {
|
||||
$path = substr($path, strlen($prefix));
|
||||
} else {
|
||||
$path = str_replace(base_dir(), base_path(), $path);
|
||||
$path = str_replace(base_dir(), base_url(), $path);
|
||||
}
|
||||
|
||||
return slashes($path);
|
||||
|
@ -420,59 +418,6 @@ function check_query($query)
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il valore corrente di un parametro della sessione.
|
||||
*
|
||||
* @param string $name Nome del parametro in dot-notation
|
||||
* @param mixed|null $default
|
||||
*
|
||||
* @return array|mixed|null
|
||||
*/
|
||||
function session_get($name, $default = null)
|
||||
{
|
||||
$session = &$_SESSION;
|
||||
if (empty($name)) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
$pieces = explode('.', $name);
|
||||
foreach ($pieces as $piece) {
|
||||
if (!isset($session[$piece])) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
$session = &$session[$piece];
|
||||
}
|
||||
|
||||
return isset($session) ? $session : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta un parametro nella sessione secondo un nome indicato.
|
||||
*
|
||||
* @param string $name Nome del parametro in dot-notation
|
||||
* @param mixed $value Valore da impostare
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function session_set($name, $value)
|
||||
{
|
||||
$session = &$_SESSION;
|
||||
|
||||
if (!empty($name)) {
|
||||
$pieces = explode('.', $name);
|
||||
foreach ($pieces as $piece) {
|
||||
if (!isset($session[$piece])) {
|
||||
$session[$piece] = [];
|
||||
}
|
||||
|
||||
$session = &$session[$piece];
|
||||
}
|
||||
}
|
||||
|
||||
$session = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'URL completo per il gestionale.
|
||||
*
|
||||
|
@ -480,17 +425,7 @@ function session_set($name, $value)
|
|||
*/
|
||||
function base_url()
|
||||
{
|
||||
return App::$baseurl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'URL parziale per il gestionale.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function base_path()
|
||||
{
|
||||
return App::$rootdir;
|
||||
return url('/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -500,5 +435,5 @@ function base_path()
|
|||
*/
|
||||
function base_dir()
|
||||
{
|
||||
return App::$docroot;
|
||||
return base_url().'/legacy/';
|
||||
}
|
||||
|
|
|
@ -119,31 +119,7 @@ function setting($name, $again = false)
|
|||
*/
|
||||
function flash()
|
||||
{
|
||||
return App::flash();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'oggetto dedicato alla gestione dell'autenticazione degli utente.
|
||||
*
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @return \Auth
|
||||
*/
|
||||
function auth()
|
||||
{
|
||||
return \Auth::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'oggetto dedicato alla gestione della traduzione del progetto.
|
||||
*
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @return \Translator
|
||||
*/
|
||||
function trans()
|
||||
{
|
||||
return \Translator::getInstance();
|
||||
return AppLegacy::flash();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -155,7 +131,7 @@ function trans()
|
|||
*/
|
||||
function formatter()
|
||||
{
|
||||
return \Translator::getFormatter();
|
||||
return \AppLegacy::$formatter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -171,28 +147,19 @@ function formatter()
|
|||
*/
|
||||
function tr($string, $parameters = [], $operations = [])
|
||||
{
|
||||
return \Translator::translate($string, $parameters, $operations);
|
||||
$result = _i($string, $parameters);
|
||||
|
||||
return replace($result, $parameters);
|
||||
}
|
||||
|
||||
// Retrocompatibilità (con la funzione gettext)
|
||||
if (!function_exists('_')) {
|
||||
function _($string, $parameters = [], $operations = [])
|
||||
{
|
||||
return tr($string, $parameters, $operations);
|
||||
return _i($string, $parameters);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'oggetto dedicato alla gestione dei log.
|
||||
*
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @return \Monolog\Logger
|
||||
*/
|
||||
function logger()
|
||||
{
|
||||
return Monolog\Registry::getInstance('logs');
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il numero indicato formattato secondo la configurazione del sistema.
|
||||
|
|
10
log.php
10
log.php
|
@ -21,7 +21,7 @@ include_once __DIR__.'/core.php';
|
|||
|
||||
$pageTitle = tr('Log');
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'top.php');
|
||||
|
||||
echo '
|
||||
<div class="box">
|
||||
|
@ -45,10 +45,10 @@ echo '
|
|||
/*
|
||||
LEGGO DALLA TABELLA ZZ_LOG
|
||||
*/
|
||||
if (Auth::admin()) {
|
||||
if (auth()->user()->isAdmin()) {
|
||||
$q = 'SELECT * FROM `zz_logs` ORDER BY `created_at` DESC LIMIT 0, 100';
|
||||
} else {
|
||||
$q = 'SELECT * FROM `zz_logs` WHERE `id_utente`='.prepare(Auth::user()['id']).' ORDER BY `created_at` DESC LIMIT 0, 100';
|
||||
$q = 'SELECT * FROM `zz_logs` WHERE `id_utente`='.prepare(auth()->user()['id']).' ORDER BY `created_at` DESC LIMIT 0, 100';
|
||||
}
|
||||
$rs = $dbo->fetchArray($q);
|
||||
$n = sizeof($rs);
|
||||
|
@ -61,7 +61,7 @@ for ($i = 0; $i < $n; ++$i) {
|
|||
|
||||
$timestamp = Translator::timestampToLocale($rs[$i]['created_at']);
|
||||
|
||||
$status = Auth::getStatus();
|
||||
$status = auth()->getStatus();
|
||||
if ($rs[$i]['stato'] == $status['success']['code']) {
|
||||
$type = 'success';
|
||||
$stato = $status['success']['message'];
|
||||
|
@ -94,4 +94,4 @@ echo '
|
|||
</div>
|
||||
<!-- /.box -->';
|
||||
|
||||
include_once App::filepath('include|custom|', 'bottom.php');
|
||||
include_once AppLegacy::filepath('include|custom|', 'bottom.php');
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Deny from all
|
|
@ -76,9 +76,9 @@ if (function_exists('customComponents')) {
|
|||
}
|
||||
}
|
||||
|
||||
//Fix per funzione base_path non trovata in fase di aggiornamento da versione < 2.4.19
|
||||
if (!function_exists('base_path')) {
|
||||
function base_path()
|
||||
//Fix per funzione base_url non trovata in fase di aggiornamento da versione < 2.4.19
|
||||
if (!function_exists('base_url')) {
|
||||
function base_url()
|
||||
{
|
||||
return ROOTDIR;
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ function search(button) {
|
|||
</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<form action="'.base_path().'/controller.php?id_module='.$id_module.'" method="post" enctype="multipart/form-data" id="update">
|
||||
<form action="'.base_url().'/controller.php?id_module='.$id_module.'" method="post" enctype="multipart/form-data" id="update">
|
||||
<input type="hidden" name="op" value="upload">
|
||||
|
||||
{[ "type": "file", "name": "blob", "required": 1, "accept": ".zip" ]}
|
||||
|
|
|
@ -49,7 +49,7 @@ class UpdateHook extends CachedManager
|
|||
}
|
||||
|
||||
$module = Modules::get('Aggiornamenti');
|
||||
$link = base_path().'/controller.php?id_module='.$module->id;
|
||||
$link = base_url().'/controller.php?id_module='.$module->id;
|
||||
|
||||
$message = tr("E' disponibile la versione _VERSION_ del gestionale", [
|
||||
'_VERSION_' => $update,
|
||||
|
|
|
@ -110,4 +110,4 @@ if (file_exists($extraction_dir.'/VERSION')) {
|
|||
delete($extraction_dir);
|
||||
|
||||
// Redirect
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module);
|
||||
redirect_legacy(base_url().'/editor.php?id_module='.$id_module);
|
||||
|
|
|
@ -67,7 +67,7 @@ $rs = $dbo->fetchArray($query);
|
|||
foreach ($rs as $r) {
|
||||
$result = [];
|
||||
|
||||
$result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['title'] = $r['ragione_sociale'];
|
||||
$result['title'] .= !empty($r['deleted_at']) ? ' <small class="text-danger"><em>('.tr('eliminata').')</em></small>' : '';
|
||||
$result['category'] = 'Anagrafiche';
|
||||
|
@ -114,7 +114,7 @@ $plugin = $dbo->fetchArray("SELECT id FROM zz_plugins WHERE name='Referenti'");
|
|||
foreach ($rs as $r) {
|
||||
$result = [];
|
||||
|
||||
$result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'].'#tab_'.$plugin[0]['id'];
|
||||
$result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'].'#tab_'.$plugin[0]['id'];
|
||||
$result['title'] = $r['nome'];
|
||||
$result['category'] = 'Referenti';
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ switch ($resource) {
|
|||
if (setting('Permetti inserimento sessioni degli altri tecnici')) {
|
||||
} else {
|
||||
//come tecnico posso aprire attività solo a mio nome
|
||||
$user = Auth::user();
|
||||
$user = auth()->user();
|
||||
if ($user['gruppo'] == 'Tecnici' && !empty($user['idanagrafica'])) {
|
||||
$where[] = 'an_anagrafiche.idanagrafica='.$user['idanagrafica'];
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ switch ($resource) {
|
|||
break;
|
||||
|
||||
case 'sedi_azienda':
|
||||
$user = Auth::user();
|
||||
$user = auth()->user();
|
||||
$id_azienda = setting('Azienda predefinita');
|
||||
|
||||
$query = "SELECT * FROM (SELECT '0' AS id, CONCAT_WS(' - ', \"".tr('Sede legale')."\" , (SELECT CONCAT (citta, IF(indirizzo!='',CONCAT(' (', indirizzo, ')'), ''),' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, CONCAT(citta, IF(indirizzo!='',CONCAT(' (', indirizzo, ')'), '')) ) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione";
|
||||
|
|
|
@ -81,7 +81,7 @@ switch (post('op')) {
|
|||
|
||||
$operations = [];
|
||||
|
||||
if (App::debug()) {
|
||||
if (AppLegacy::debug()) {
|
||||
$operations['delete-bulk'] = [
|
||||
'text' => '<span><i class="fa fa-trash"></i> '.tr('Elimina selezionati').'</span> <span class="label label-danger">beta</span>',
|
||||
'data' => [
|
||||
|
@ -102,7 +102,7 @@ $operations['export-csv'] = [
|
|||
],
|
||||
];
|
||||
|
||||
if (App::debug() && $google) {
|
||||
if (AppLegacy::debug() && $google) {
|
||||
$operations['ricerca-coordinate'] = [
|
||||
'text' => '<span><i class="fa fa-map"></i> '.tr('Ricerca coordinate').'</span>',
|
||||
'data' => [
|
||||
|
|
|
@ -53,7 +53,7 @@ if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_ana
|
|||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi fattura di vendita').'" data-href="add.php?id_module='.Modules::get('Fatture di vendita')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file"></i>'.tr('Nuova fattura di vendita').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.Modules::get('Prima nota')['id'].'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile (cliente)').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.Modules::get('Prima nota')['id'].'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile').'
|
||||
</a></li>';
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_ana
|
|||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi fattura di acquisto').'" data-href="add.php?id_module='.Modules::get('Fatture di acquisto')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file fa-flip-horizontal"></i>'.tr('Nuova fattura di acquisto').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.Modules::get('Prima nota')['id'].'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile (fornitore)').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.Modules::get('Prima nota')['id'].'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile').'
|
||||
</a></li>';
|
||||
}
|
||||
|
||||
|
|
|
@ -458,13 +458,13 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
|||
echo '
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<a href="'.base_path().'/editor.php?id_module='.$modulo_banche['id'].'&id_record='.$banca_predefinita->id.'">
|
||||
<a href="'.base_url().'/editor.php?id_module='.$modulo_banche['id'].'&id_record='.$banca_predefinita->id.'">
|
||||
'.tr("Visualizza la banca predefinita per l'Anagrafica").' <i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<a href="'.base_path().'/controller.php?id_module='.$modulo_banche['id'].'&search_Anagrafica='.rawurlencode($anagrafica['ragione_sociale']).'">
|
||||
<a href="'.base_url().'/controller.php?id_module='.$modulo_banche['id'].'&search_Anagrafica='.rawurlencode($anagrafica['ragione_sociale']).'">
|
||||
'.tr("Visualizza le banche disponibili per l'Anagrafica").' <i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -113,14 +113,14 @@ echo '
|
|||
echo '
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<a class="btn btn-xs btn-primary" href="'.base_path().'/actions.php?id_module='.$file->id_module.'&op=download-allegato&id='.$file->id.'&filename='.$file->filename.'" target="_blank">
|
||||
<a class="btn btn-xs btn-primary" href="'.base_url().'/actions.php?id_module='.$file->id_module.'&op=download-allegato&id='.$file->id.'&filename='.$file->filename.'" target="_blank">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>';
|
||||
|
||||
// Anteprime supportate dal browser
|
||||
if ($file->hasPreview()) {
|
||||
echo '
|
||||
<button class="btn btn-xs btn-info" type="button" data-title="'.prepareToField($file->name).' <small style=\'color:white\'><i>('.$file->filename.')</i></small>" data-href="'.base_path().'/view.php?file_id='.$file->id.'">
|
||||
<button class="btn btn-xs btn-info" type="button" data-title="'.prepareToField($file->name).' <small style=\'color:white\'><i>('.$file->filename.')</i></small>" data-href="'.base_url().'/view.php?file_id='.$file->id.'">
|
||||
<i class="fa fa-eye"></i>
|
||||
</button>';
|
||||
} else {
|
||||
|
@ -133,7 +133,7 @@ echo '
|
|||
echo '
|
||||
</td>
|
||||
<td>
|
||||
<a href="'.base_path().'/view.php?file_id='.$file->id.'" target="_blank">
|
||||
<a href="'.base_url().'/view.php?file_id='.$file->id.'" target="_blank">
|
||||
<i class="fa fa-external-link"></i> '.$file->name.'
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
@ -239,8 +239,6 @@ class CSV extends CSVImporter
|
|||
// Fix per campi con contenuti derivati da query implicite
|
||||
if (!empty($record['id_nazione'])) {
|
||||
$record['id_nazione'] = $database->fetchOne('SELECT id FROM an_nazioni WHERE LOWER(nome) = LOWER('.prepare($record['id_nazione']).') OR LOWER(iso2) = LOWER('.prepare($record['id_nazione']).')')['id'];
|
||||
} else {
|
||||
unset($record['id_nazione']);
|
||||
}
|
||||
|
||||
// Separazione dei campi relativi alla sede legale
|
||||
|
|
|
@ -44,7 +44,7 @@ switch ($resource) {
|
|||
($documenti[$i]['n2_documento'] != '') ? $n_documento = $documenti[$i]['n2_documento'] : $n_documento = $documenti[$i]['n_documento'];
|
||||
|
||||
$link_id = Modules::get($documenti[$i]['modulo'])['id'];
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_path().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.Translator::dateToLocale($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_url().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.Translator::dateToLocale($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<td class='table_cell text-right'>".moneyFormat($documenti[$i]['costo_unitario'])."</td></tr>\n";
|
||||
array_push($ids, '"'.$documenti[$i]['id'].'"');
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ switch ($resource) {
|
|||
($documenti[$i]['n2_documento'] != '') ? $n_documento = $documenti[$i]['n2_documento'] : $n_documento = $documenti[$i]['n_documento'];
|
||||
|
||||
$link_id = Modules::get($documenti[$i]['modulo'])['id'];
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_path().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.Translator::dateToLocale($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_url().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.Translator::dateToLocale($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<td class='table_cell text-right'>".moneyFormat($documenti[$i]['costo_unitario'])."</td></tr>\n";
|
||||
array_push($ids, '"'.$documenti[$i]['id'].'"');
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ switch ($resource) {
|
|||
($documenti[$i]['n2_documento'] != '') ? $n_documento = $documenti[$i]['n2_documento'] : $n_documento = $documenti[$i]['n_documento'];
|
||||
|
||||
$link_id = Modules::get($documenti[$i]['modulo'])['id'];
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_path().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.Translator::dateToLocale($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<tr><td class='first_cell text-left'><a href='".base_url().'/editor.php?id_module='.$link_id.'&id_record='.$documenti[$i]['id']."' target=\"_blank\" title=\"Apri il documento su una nuova finestra\">".$documenti[$i]['tipo'].'. n. '.$n_documento.' del '.Translator::dateToLocale($documenti[$i]['data_documento'])." </a></td>\n";
|
||||
echo "<td class='table_cell text-right'>".moneyFormat($documenti[$i]['costo_unitario'])."</td></tr>\n";
|
||||
array_push($ids, '"'.$documenti[$i]['id'].'"');
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ $rs = $dbo->fetchArray($query);
|
|||
foreach ($rs as $r) {
|
||||
$result = [];
|
||||
|
||||
$result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['title'] = $r['codice'].' - '.$r['descrizione'];
|
||||
$result['category'] = 'Articoli';
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ use Plugins\ListinoClienti\DettaglioPrezzo;
|
|||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
switch (post('op')) {
|
||||
case 'change-acquisto':
|
||||
case 'change_acquisto':
|
||||
foreach ($id_records as $id) {
|
||||
$articolo = Articolo::find($id);
|
||||
$percentuale = post('percentuale');
|
||||
|
@ -111,7 +111,7 @@ switch (post('op')) {
|
|||
$_SESSION['superselect']['id_articolo_barcode'] = $id_records;
|
||||
$id_print = Prints::getPrints()['Barcode'];
|
||||
|
||||
redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('barcode', '!=', '')->first()->id);
|
||||
redirect(base_url().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('barcode', '!=', '')->first()->id);
|
||||
exit();
|
||||
|
||||
break;
|
||||
|
@ -177,7 +177,7 @@ switch (post('op')) {
|
|||
}
|
||||
|
||||
$database->commitTransaction();
|
||||
redirect(base_path().'/editor.php?id_module='.Modules::get('Preventivi')['id'].'&id_record='.$id_preventivo);
|
||||
redirect(base_url().'/editor.php?id_module='.Modules::get('Preventivi')['id'].'&id_record='.$id_preventivo);
|
||||
exit();
|
||||
|
||||
break;
|
||||
|
@ -331,7 +331,7 @@ switch (post('op')) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (App::debug()) {
|
||||
if (AppLegacy::debug()) {
|
||||
$operations['delete-bulk'] = [
|
||||
'text' => '<span><i class="fa fa-trash"></i> '.tr('Elimina selezionati').'</span>',
|
||||
'data' => [
|
||||
|
|
|
@ -429,8 +429,8 @@ $(document).ready(function(){
|
|||
input('prezzo_acquisto').disable();
|
||||
}
|
||||
|
||||
$("#prezziacquisto").load("<?php echo base_path(); ?>/ajax_complete.php?module=Articoli&op=getprezziacquisto&idarticolo="+ <?php echo $id_record; ?> + "&limit=20");
|
||||
$("#prezziacquisto").load("<?php echo base_url(); ?>/ajax_complete.php?module=Articoli&op=getprezziacquisto&idarticolo="+ <?php echo $id_record; ?> + "&limit=20");
|
||||
|
||||
$("#prezzivendita").load("<?php echo base_path(); ?>/ajax_complete.php?module=Articoli&op=getprezzivendita&idarticolo="+ <?php echo $id_record; ?> + "&limit=20");
|
||||
$("#prezzivendita").load("<?php echo base_url(); ?>/ajax_complete.php?module=Articoli&op=getprezzivendita&idarticolo="+ <?php echo $id_record; ?> + "&limit=20");
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -27,20 +27,20 @@ echo '
|
|||
<div class="pull-right">';
|
||||
if (empty($_GET['movimentazione_completa'])) {
|
||||
echo '
|
||||
<a class="btn btn-info btn-xs" href="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&movimentazione_completa=1#tab_'.$id_plugin.'">
|
||||
<a class="btn btn-info btn-xs" href="'.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&movimentazione_completa=1#tab_'.$id_plugin.'">
|
||||
<i class="fa fa-eye"></i>
|
||||
'.tr('Mostra tutti i movimenti').'
|
||||
</a>';
|
||||
} else {
|
||||
echo '
|
||||
<a class="btn btn-info btn-xs" href="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&movimentazione_completa=0#tab_'.$id_plugin.'">
|
||||
<a class="btn btn-info btn-xs" href="'.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&movimentazione_completa=0#tab_'.$id_plugin.'">
|
||||
<i class="fa fa-eye-slash"></i>
|
||||
'.tr('Mostra gli ultimi 20 movimenti').'
|
||||
</a>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<a class="btn btn-warning btn-xs" href="'.base_path().'/controller.php?id_module='.Modules::get('Movimenti')->id.'&search_Articolo='.($articolo->codice.' - '.$articolo->descrizione).'">
|
||||
<a class="btn btn-warning btn-xs" href="'.base_url().'/controller.php?id_module='.Modules::get('Movimenti')->id.'&search_Articolo='.($articolo->codice.' - '.$articolo->descrizione).'">
|
||||
<i class="fa fa-external-link"></i>
|
||||
'.tr('Visualizza dettagli').'
|
||||
</a>';
|
||||
|
@ -126,7 +126,7 @@ if (!empty($movimenti)) {
|
|||
echo '
|
||||
<td class="text-center">';
|
||||
|
||||
if (Auth::admin() && $movimento->isManuale()) {
|
||||
if (auth()->user()->isAdmin() && $movimento->isManuale()) {
|
||||
echo '
|
||||
<a class="btn btn-danger btn-xs ask" data-backto="record-edit" data-op="delmovimento" data-idmovimento="'.$movimento->tipo_gruppo.'">
|
||||
<i class="fa fa-trash"></i>
|
||||
|
|
|
@ -77,7 +77,7 @@ class Articolo extends Model
|
|||
$data = ($data ?: date('Y-m-d H:i:s'));
|
||||
$id = $this->registra($qta, $descrizone, $data, $manuale, $array);
|
||||
|
||||
if (empty($this->servizio)) {
|
||||
if ($this->servizio == 0) {
|
||||
$this->qta += $qta;
|
||||
|
||||
$this->save();
|
||||
|
@ -176,7 +176,7 @@ class Articolo extends Model
|
|||
$image = $directory.$this->immagine;
|
||||
$image_thumbnail = $directory.$fileinfo['filename'].'_thumb600.'.$fileinfo['extension'];
|
||||
|
||||
$url = file_exists(base_dir().$image_thumbnail) ? base_path().$image_thumbnail : base_path().$image;
|
||||
$url = file_exists(base_dir().$image_thumbnail) ? base_url().$image_thumbnail : base_url().$image;
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ include_once __DIR__.'/../../../core.php';
|
|||
$id_print = $dbo->fetchOne('SELECT zz_prints.id FROM zz_prints INNER JOIN zz_modules ON zz_prints.id_module=zz_modules.id WHERE zz_modules.name="Articoli" AND zz_prints.name="Inventario magazzino"')['id'];
|
||||
|
||||
echo '
|
||||
<form action="'.base_path().'/pdfgen.php?id_print='.$id_print.'" method="post" target="_blank">
|
||||
<form action="'.base_url().'/pdfgen.php?id_print='.$id_print.'" method="post" target="_blank">
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ if (file_exists($backup_dir)) {
|
|||
loadSize("'.$id.'", "c-'.$id.'");
|
||||
</script>
|
||||
|
||||
<a class="btn btn-primary" href="'.base_path().'/modules/backups/actions.php?op=getfile&number='.$id.'" target="_blank"><i class="fa fa-download"></i> '.tr('Scarica').'</a>
|
||||
<a class="btn btn-primary" href="'.base_url().'/modules/backups/actions.php?op=getfile&number='.$id.'" target="_blank"><i class="fa fa-download"></i> '.tr('Scarica').'</a>
|
||||
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-warning ask" data-backto="record-edit" data-method="post" data-op="restore" data-number="'.$id.'" data-msg="'.tr('Clicca su Ripristina per ripristinare questo backup').'" data-button="Ripristina" data-class="btn btn-lg btn-warning">
|
||||
|
|
|
@ -42,7 +42,7 @@ switch (filter('op')) {
|
|||
|
||||
// Redirect alla categoria se si sta modificando una sottocategoria
|
||||
$database->commitTransaction();
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
|
||||
redirect(base_url().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
|
||||
exit();
|
||||
|
||||
break;
|
||||
|
@ -85,7 +85,7 @@ switch (filter('op')) {
|
|||
} else {
|
||||
// Redirect alla categoria se si sta aggiungendo una sottocategoria
|
||||
$database->commitTransaction();
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
|
||||
redirect(base_url().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
|
||||
exit();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ if (isset($id_record)) {
|
|||
|
||||
?><form action="<?php
|
||||
if (isset($id_original)) {
|
||||
echo base_path().'/controller.php?id_module='.$id_module;
|
||||
echo base_url().'/controller.php?id_module='.$id_module;
|
||||
|
||||
if (isset($id_record)) {
|
||||
echo '&id_record='.$id_record;
|
||||
|
|
|
@ -57,7 +57,7 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
<div class="panel-body">
|
||||
<div class="pull-left">
|
||||
<a class="btn btn-primary" data-href="<?php echo base_path(); ?>/add.php?id_module=<?php echo $id_module; ?>&id_original=<?php echo $id_record; ?>" data-toggle="modal" data-title="<?php echo tr('Aggiungi riga'); ?>"><i class="fa fa-plus"></i> <?php echo tr('Sottocategoria'); ?></a><br>
|
||||
<a class="btn btn-primary" data-href="<?php echo base_url(); ?>/add.php?id_module=<?php echo $id_module; ?>&id_original=<?php echo $id_record; ?>" data-toggle="modal" data-title="<?php echo tr('Aggiungi riga'); ?>"><i class="fa fa-plus"></i> <?php echo tr('Sottocategoria'); ?></a><br>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<hr>
|
||||
|
|
|
@ -29,7 +29,7 @@ foreach ($subcategorie as $sub) {
|
|||
<td>'.$sub['colore'].'</td>
|
||||
<td>'.$sub['nota'].'</td>
|
||||
<td>
|
||||
<a class="btn btn-warning btn-sm" title="Modifica riga" onclick="launch_modal(\''.tr('Modifica sottocategoria').'\', \''.base_path().'/add.php?id_module='.$id_module.'&id_record='.$sub['id'].'&id_original='.$id_record.'\');"><i class="fa fa-edit"></i></a>
|
||||
<a class="btn btn-warning btn-sm" title="Modifica riga" onclick="launch_modal(\''.tr('Modifica sottocategoria').'\', \''.base_url().'/add.php?id_module='.$id_module.'&id_record='.$sub['id'].'&id_original='.$id_record.'\');"><i class="fa fa-edit"></i></a>
|
||||
<a class="btn btn-sm btn-danger ask '.(($n_articoli > 0) ? 'disabled tip' : '').'" data-backto="record-edit" data-id="'.$sub['id'].'" title="'.(($n_articoli > 0) ? 'Sottocategoria collegata a '.$n_articoli.' articoli' : '').'">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
|
|
|
@ -114,7 +114,7 @@ function modificaVariante(id) {
|
|||
|
||||
function rimuoviVariante(id) {
|
||||
if( confirm(\'Rimuovere la variante dalla combinazione?\') ){
|
||||
$.post( \''.base_path().'/modules/combinazioni_articoli/actions.php\', { op: \'remove-variante\', id_articolo: + id }, function(data){ location.href=\''.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'\'; } );
|
||||
$.post( \''.base_url().'/modules/combinazioni_articoli/actions.php\', { op: \'remove-variante\', id_articolo: + id }, function(data){ location.href=\''.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'\'; } );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ if (!empty($id_documento)) {
|
|||
'superamento_soglia_qta' => setting('Permetti il superamento della soglia quantità dei documenti di origine'),
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
echo AppLegacy::load('importa.php', [], $options, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ $module_fatture = 'Fatture di vendita';
|
|||
$id_fatture = Modules::get($module_fatture)['id'];
|
||||
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
|
||||
$segments = Modules::getSegments($id_fatture);
|
||||
$_SESSION['module_'.$id_fatture]['id_segment'] = isset($segments[0]['id']) ? $segments[0]['id'] : null;
|
||||
session(['module_'.$id_fatture.'.id_segment' => isset($segments[0]['id']) ? $segments[0]['id'] : null]);
|
||||
}
|
||||
$id_segment = $_SESSION['module_'.$id_fatture]['id_segment'];
|
||||
$idconto = setting('Conto predefinito fatture di vendita');
|
||||
|
|
|
@ -35,4 +35,4 @@ $options = [
|
|||
'tipo_documento_finale' => $tipo_documento_finale,
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
echo AppLegacy::load('importa.php', [], $options, true);
|
||||
|
|
|
@ -248,7 +248,7 @@ if (!empty($rs)) {
|
|||
</td>
|
||||
|
||||
<td>
|
||||
<button type="button" class="btn btn-warning" data-toggle="tooltip" title="Importa valori da tariffe standard" onclick="if( confirm(\'Importare i valori dalle tariffe standard?\') ){ $.post( \''.base_path().'/modules/contratti/actions.php\', { op: \'import\', idcontratto: \''.$id_record.'\', idtipointervento: \''.$rs[$i]['idtipointervento'].'\' }, function(data){ location.href=\''.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'\'; } ); }">
|
||||
<button type="button" class="btn btn-warning" data-toggle="tooltip" title="Importa valori da tariffe standard" onclick="if( confirm(\'Importare i valori dalle tariffe standard?\') ){ $.post( \''.base_url().'/modules/contratti/actions.php\', { op: \'import\', idcontratto: \''.$id_record.'\', idtipointervento: \''.$rs[$i]['idtipointervento'].'\' }, function(data){ location.href=\''.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'\'; } ); }">
|
||||
<i class="fa fa-download"></i>
|
||||
</button>
|
||||
</td>
|
||||
|
@ -300,7 +300,7 @@ if (!empty($rs)) {
|
|||
</td>
|
||||
|
||||
<td>
|
||||
<button type="button" class="btn btn-warning" data-toggle="tooltip" title="Importa valori da tariffe standard" onclick="if( confirm(\'Importare i valori dalle tariffe standard?\') ){ $.post( \''.base_path().'/modules/contratti/actions.php\', { op: \'import\', idcontratto: \''.$id_record.'\', idtipointervento: \''.$rs[$i]['idtipointervento'].'\' }, function(data){ location.href=\''.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'\'; } ); }">
|
||||
<button type="button" class="btn btn-warning" data-toggle="tooltip" title="Importa valori da tariffe standard" onclick="if( confirm(\'Importare i valori dalle tariffe standard?\') ){ $.post( \''.base_url().'/modules/contratti/actions.php\', { op: \'import\', idcontratto: \''.$id_record.'\', idtipointervento: \''.$rs[$i]['idtipointervento'].'\' }, function(data){ location.href=\''.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'\'; } ); }">
|
||||
<i class="fa fa-download"></i>
|
||||
</button>
|
||||
</td>
|
||||
|
|
|
@ -84,4 +84,4 @@ if (get('is_descrizione') !== null) {
|
|||
$options['op'] = 'manage_barcode';
|
||||
}
|
||||
|
||||
echo App::load($file.'.php', $result, $options);
|
||||
echo AppLegacy::load($file.'.php', $result, $options);
|
||||
|
|
|
@ -65,4 +65,4 @@ if ($riga->isDescrizione()) {
|
|||
$options['op'] = 'manage_sconto';
|
||||
}
|
||||
|
||||
echo App::load($file.'.php', $result, $options);
|
||||
echo AppLegacy::load($file.'.php', $result, $options);
|
||||
|
|
|
@ -32,12 +32,12 @@ switch (filter('op')) {
|
|||
$start = filter('start');
|
||||
$end = filter('end');
|
||||
|
||||
$stati = (array) $_SESSION['dashboard']['idstatiintervento'];
|
||||
$stati = session('dashboard.idstatiintervento', ["'-1'"]);
|
||||
$stati[] = prepare('');
|
||||
|
||||
$tipi = (array) $_SESSION['dashboard']['idtipiintervento'];
|
||||
$zone = (array) $_SESSION['dashboard']['idzone'];
|
||||
$tecnici = (array) $_SESSION['dashboard']['idtecnici'];
|
||||
$tipi = session('dashboard.idtipiintervento', ["'-1'"]);
|
||||
$zone = session('dashboard.idzone', ["'-1'"]);
|
||||
$tecnici = session('dashboard.idtecnici', ["'-1'"]);
|
||||
|
||||
$query = 'SELECT
|
||||
in_interventi_tecnici.id,
|
||||
|
@ -109,7 +109,7 @@ switch (filter('op')) {
|
|||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($sessione['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($sessione['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>Int. '.$sessione['codice'].'</b> '.$sessione['cliente'].'<br><b>'.tr('Tecnici').':</b> '.$sessione['nome_tecnico'],
|
||||
'start' => $sessione['orario_inizio'],
|
||||
'end' => $sessione['orario_fine'],
|
||||
'link' => base_path().'/editor.php?id_module='.$modulo_interventi->id.'&id_record='.$sessione['idintervento'],
|
||||
'link' => base_url().'/editor.php?id_module='.$modulo_interventi->id.'&id_record='.$sessione['idintervento'],
|
||||
'backgroundColor' => $backgroundcolor,
|
||||
'textColor' => color_inverse($backgroundcolor),
|
||||
'borderColor' => ($bordercolor == '#FFFFFF') ? color_darken($bordercolor, 100) : $bordercolor,
|
||||
|
@ -149,7 +149,7 @@ switch (filter('op')) {
|
|||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>Accettazione prev. '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
||||
'start' => $preventivo['data_accettazione'],
|
||||
'end' => $preventivo['data_accettazione'],
|
||||
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
||||
'url' => base_url().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
||||
'backgroundColor' => '#ff7f50',
|
||||
'textColor' => color_inverse('#ff7f50'),
|
||||
'borderColor' => '#ff7f50',
|
||||
|
@ -166,7 +166,7 @@ switch (filter('op')) {
|
|||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>Conclusione prev. '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
||||
'start' => $preventivo['data_conclusione'],
|
||||
'end' => $preventivo['data_conclusione'],
|
||||
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
||||
'url' => base_url().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
||||
'backgroundColor' => '#ff7f50',
|
||||
'textColor' => color_inverse('#ff7f50'),
|
||||
'borderColor' => '#ff7f50',
|
||||
|
|
|
@ -87,7 +87,7 @@ echo '
|
|||
<ul class="dropdown-menu" role="menu">';
|
||||
|
||||
// Stati intervento
|
||||
$stati_sessione = session_get('dashboard.idstatiintervento', []);
|
||||
$stati_sessione = session('dashboard.idstatiintervento', []);
|
||||
foreach ($stati_intervento as $stato) {
|
||||
$attr = '';
|
||||
if (in_array("'".$stato['id']."'", $stati_sessione)) {
|
||||
|
@ -124,7 +124,7 @@ echo '
|
|||
<ul class="dropdown-menu" role="menu">';
|
||||
|
||||
// Tipi intervento
|
||||
$tipi_sessione = session_get('dashboard.idtipiintervento', []);
|
||||
$tipi_sessione = session('dashboard.idtipiintervento', []);
|
||||
foreach ($tipi_intervento as $tipo) {
|
||||
$attr = '';
|
||||
if (in_array("'".$tipo['id']."'", $tipi_sessione)) {
|
||||
|
@ -160,7 +160,7 @@ echo '
|
|||
</button>
|
||||
<ul class="dropdown-menu" role="menu">';
|
||||
|
||||
$tecnici_sessione = session_get('dashboard.idtecnici', []);
|
||||
$tecnici_sessione = session('dashboard.idtecnici', []);
|
||||
foreach ($tecnici_disponibili as $tecnico) {
|
||||
$attr = '';
|
||||
if (in_array("'".$tecnico['id']."'", $tecnici_sessione)) {
|
||||
|
@ -197,7 +197,7 @@ echo '
|
|||
<ul class="dropdown-menu" role="menu">';
|
||||
|
||||
// Zone
|
||||
$zone_sessione = session_get('dashboard.idzone', []);
|
||||
$zone_sessione = session('dashboard.idzone', []);
|
||||
foreach ($zone as $zona) {
|
||||
$attr = '';
|
||||
if (in_array("'".$zona['id']."'", $zone_sessione)) {
|
||||
|
|
|
@ -39,7 +39,7 @@ if (!empty($id_documento)) {
|
|||
'superamento_soglia_qta' => setting('Permetti il superamento della soglia quantità dei documenti di origine'),
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
echo AppLegacy::load('importa.php', [], $options, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ foreach ($rs as $r) {
|
|||
|
||||
$numero = empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'];
|
||||
|
||||
$result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['title'] = $r['tipologia'].' num. '.$numero.' del '.Translator::dateToLocale($r['data']);
|
||||
$result['category'] = $r['tipologia'];
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ if ($module['name'] == 'Ddt di vendita') {
|
|||
$id_fatture = Modules::get($module_fatture)['id'];
|
||||
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
|
||||
$segments = Modules::getSegments($id_fatture);
|
||||
$_SESSION['module_'.$id_fatture]['id_segment'] = isset($segments[0]['id']) ? $segments[0]['id'] : null;
|
||||
session(['module_'.$id_fatture.'.id_segment' => isset($segments[0]['id']) ? $segments[0]['id'] : null]);
|
||||
}
|
||||
$id_segment = $_SESSION['module_'.$id_fatture]['id_segment'];
|
||||
$idconto = setting('Conto predefinito fatture di vendita');
|
||||
|
@ -163,7 +163,7 @@ switch (post('op')) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (App::debug()) {
|
||||
if (AppLegacy::debug()) {
|
||||
$operations['delete-bulk'] = [
|
||||
'text' => '<span><i class="fa fa-trash"></i> '.tr('Elimina selezionati').'</span>',
|
||||
'data' => [
|
||||
|
|
|
@ -48,4 +48,4 @@ $options = [
|
|||
'reversed' => $documento->reversed,
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
echo AppLegacy::load('importa.php', [], $options, true);
|
||||
|
|
|
@ -358,12 +358,12 @@ if (!$block_edit) {
|
|||
$ddt_query = 'SELECT COUNT(*) AS tot FROM dt_ddt WHERE idstatoddt IN (SELECT id FROM dt_statiddt WHERE descrizione IN(\'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoddt=(SELECT id FROM or_tipiordine WHERE dir="'.($dir == 'entrata' ? 'uscita' : 'entrata').'") AND dt_ddt.id IN (SELECT idddt FROM dt_righe_ddt WHERE dt_righe_ddt.idddt = dt_ddt.id AND (qta - qta_evasa) > 0)';
|
||||
$ddt = $dbo->fetchArray($ddt_query)[0]['tot'];
|
||||
echo '
|
||||
<a class="btn btn-sm btn-primary'.(!empty($ddt) ? '' : ' disabled').'" data-href="'.base_path().'/modules/ddt/add_ddt.php?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="'.tr('Aggiungi DDT').'">
|
||||
<a class="btn btn-sm btn-primary'.(!empty($ddt) ? '' : ' disabled').'" data-href="'.base_url().'/modules/ddt/add_ddt.php?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="'.tr('Aggiungi DDT').'">
|
||||
<i class="fa fa-plus"></i> '.tr('Ddt').'
|
||||
</a>';
|
||||
|
||||
echo '
|
||||
<a class="btn btn-sm btn-primary'.(!empty($ordini) ? '' : ' disabled').'" data-href="'.base_path().'/modules/ddt/add_ordine.php?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="'.tr('Aggiungi Ordine').'">
|
||||
<a class="btn btn-sm btn-primary'.(!empty($ordini) ? '' : ' disabled').'" data-href="'.base_url().'/modules/ddt/add_ordine.php?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="'.tr('Aggiungi Ordine').'">
|
||||
<i class="fa fa-plus"></i> '.tr('Ordine').'
|
||||
</a>';
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ if (isset($id_record)) {
|
|||
|
||||
// Se la sede del ddt non è di mia competenza, blocco il ddt in modifica
|
||||
$field_name = ($dir == 'entrata') ? 'idsede_partenza' : 'idsede_destinazione';
|
||||
if (!Auth::admin() && !in_array($record[$field_name], $user->sedi)) {
|
||||
if (!auth()->user()->isAdmin() && !in_array($record[$field_name], $user->sedi)) {
|
||||
$record['flag_completato'] = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,4 +87,4 @@ if (get('is_descrizione') !== null) {
|
|||
$options['op'] = 'manage_barcode';
|
||||
}
|
||||
|
||||
echo App::load($file.'.php', $result, $options);
|
||||
echo AppLegacy::load($file.'.php', $result, $options);
|
||||
|
|
|
@ -67,4 +67,4 @@ if ($riga->isDescrizione()) {
|
|||
$options['op'] = 'manage_sconto';
|
||||
}
|
||||
|
||||
echo App::load($file.'.php', $result, $options);
|
||||
echo AppLegacy::load($file.'.php', $result, $options);
|
||||
|
|
|
@ -59,7 +59,7 @@ class DDT extends Document
|
|||
{
|
||||
$model = new static();
|
||||
|
||||
$user = Auth::user();
|
||||
$user = auth()->user();
|
||||
|
||||
$stato_documento = Stato::where('descrizione', 'Bozza')->first();
|
||||
|
||||
|
|
|
@ -191,8 +191,8 @@ switch (post('op')) {
|
|||
$count = Fattura::where('numero_esterno', $fattura->numero_esterno)
|
||||
->where('id', '!=', $id_record)
|
||||
->where('idanagrafica', '=', $fattura->anagrafica->id)
|
||||
->where('data', '>=', $_SESSION['period_start'])
|
||||
->where('data', '<=', $_SESSION['period_end'])
|
||||
->where('data', '>=', session('period_start'))
|
||||
->where('data', '<=', session('period_end'))
|
||||
->whereHas('tipo', function ($query) use ($direzione) {
|
||||
$query->where('dir', '=', $direzione);
|
||||
})->count();
|
||||
|
|
|
@ -39,7 +39,7 @@ if (!empty($id_documento)) {
|
|||
'superamento_soglia_qta' => setting('Permetti il superamento della soglia quantità dei documenti di origine'),
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
echo AppLegacy::load('importa.php', [], $options, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ if (!empty($id_documento)) {
|
|||
'superamento_soglia_qta' => setting('Permetti il superamento della soglia quantità dei documenti di origine'),
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
echo AppLegacy::load('importa.php', [], $options, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ echo '
|
|||
'_NUM_' => $numero,
|
||||
]).'</p>
|
||||
|
||||
<form action="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post">
|
||||
<form action="'.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post">
|
||||
<input type="hidden" name="op" value="add_intervento">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="dir" value="'.$dir.'">';
|
||||
|
@ -107,7 +107,7 @@ $options = [
|
|||
$ritenuta_acconto = $dbo->fetchOne('SELECT id_ritenuta_acconto_'.($dir == 'uscita' ? 'acquisti' : 'vendite').' AS id_ritenuta_acconto FROM an_anagrafiche WHERE idanagrafica='.prepare($idanagrafica));
|
||||
$options['id_ritenuta_acconto_predefined'] = $ritenuta_acconto['id_ritenuta_acconto'];
|
||||
|
||||
echo App::internalLoad('conti.php', [], $options);
|
||||
echo AppLegacy::internalLoad('conti.php', [], $options);
|
||||
|
||||
// Leggo l'iva predefinita dall'articolo e se non c'è leggo quella predefinita generica
|
||||
$idiva = $fattura->anagrafica->idiva_vendite ?: setting('Iva predefinita');
|
||||
|
|
|
@ -40,7 +40,7 @@ if (!empty($id_documento)) {
|
|||
'superamento_soglia_qta' => setting('Permetti il superamento della soglia quantità dei documenti di origine'),
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
echo AppLegacy::load('importa.php', [], $options, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ if (!empty($id_documento)) {
|
|||
'superamento_soglia_qta' => setting('Permetti il superamento della soglia quantità dei documenti di origine'),
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
echo AppLegacy::load('importa.php', [], $options, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ $rs = $dbo->fetchArray('SELECT mg_articoli.id AS idarticolo, mg_articoli.codice,
|
|||
echo '
|
||||
<p>'.tr('Articolo').': '.$rs[0]['codice'].' - '.$rs[0]['descrizione'].'</p>
|
||||
|
||||
<form action="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post">
|
||||
<form action="'.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'" method="post">
|
||||
<input type="hidden" name="op" value="add_serial">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="idriga" value="'.$idriga.'">
|
||||
|
|
|
@ -53,7 +53,7 @@ foreach ($rs as $r) {
|
|||
|
||||
$numero = empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'];
|
||||
|
||||
$result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['title'] = $r['tipologia'].' num. '.$numero.' del '.Translator::dateToLocale($r['data']);
|
||||
$result['category'] = $r['tipologia'];
|
||||
|
||||
|
|
|
@ -316,8 +316,8 @@ switch (post('op')) {
|
|||
foreach ($id_records as $id) {
|
||||
$fattura_vendita = Fattura::vendita()
|
||||
->whereNotIn('codice_stato_fe', ['ERR', 'NS', 'EC02', 'ERVAL'])
|
||||
->where('data', '>=', $_SESSION['period_start'])
|
||||
->where('data', '<=', $_SESSION['period_end'])
|
||||
->where('data', '>=', session('period_start'))
|
||||
->where('data', '<=', session('period_end'))
|
||||
->where('id', '=', $id)
|
||||
->orderBy('data')
|
||||
->first();
|
||||
|
@ -463,7 +463,7 @@ switch (post('op')) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (App::debug()) {
|
||||
if (AppLegacy::debug()) {
|
||||
$operations['delete-bulk'] = [
|
||||
'text' => '<span><i class="fa fa-trash"></i> '.tr('Elimina selezionati').'</span> <span class="label label-danger">beta</span>',
|
||||
];
|
||||
|
@ -494,7 +494,7 @@ $operations['registrazione-contabile'] = [
|
|||
'title' => tr('Registrazione contabile'),
|
||||
'type' => 'modal',
|
||||
'origine' => 'fatture',
|
||||
'url' => base_path().'/add.php?id_module='.Modules::get('Prima nota')['id'],
|
||||
'url' => base_url().'/add.php?id_module='.Modules::get('Prima nota')['id'],
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -42,11 +42,11 @@ if ($dir == 'entrata') {
|
|||
</button>
|
||||
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
<li><a href="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=nota_addebito&backto=record-edit">
|
||||
<li><a href="'.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=nota_addebito&backto=record-edit">
|
||||
'.tr('Nota di debito').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-href="'.base_path().'/modules/fatture/crea_documento.php?id_module='.$id_module.'&id_record='.$id_record.'&iddocumento='.$id_record.'" data-title="Aggiungi nota di credito">
|
||||
<li><a data-href="'.base_url().'/modules/fatture/crea_documento.php?id_module='.$id_module.'&id_record='.$id_record.'&iddocumento='.$id_record.'" data-title="Aggiungi nota di credito">
|
||||
'.tr('Nota di credito').'
|
||||
</a></li>
|
||||
</ul>
|
||||
|
@ -80,7 +80,7 @@ if (!empty($record['is_fiscale'])) {
|
|||
}
|
||||
|
||||
echo '
|
||||
<a class="btn btn-primary '.(!empty($modulo_prima_nota) && !empty($registrazione_insoluto) ? '' : 'disabled').'" data-href="'.base_path().'/add.php?id_module='.$modulo_prima_nota['id'].'&id_documenti='.$id_record.'&single=1&is_insoluto=1" data-title="'.tr('Registra insoluto').'">
|
||||
<a class="btn btn-primary '.(!empty($modulo_prima_nota) && !empty($registrazione_insoluto) ? '' : 'disabled').'" data-href="'.base_url().'/add.php?id_module='.$modulo_prima_nota['id'].'&id_documenti='.$id_record.'&single=1&is_insoluto=1" data-title="'.tr('Registra insoluto').'">
|
||||
<i class="fa fa-ban fa-inverse"></i> '.tr('Registra insoluto').'
|
||||
</a>';
|
||||
|
||||
|
@ -98,7 +98,7 @@ if (!empty($record['is_fiscale'])) {
|
|||
}
|
||||
|
||||
echo '
|
||||
<a class="btn btn-primary '.(!empty($modulo_prima_nota) && !empty($registrazione_contabile) ? '' : 'disabled').'" data-href="'.base_path().'/add.php?id_module='.$modulo_prima_nota['id'].'&id_documenti='.$id_record.'&single=1" data-title="'.tr('Registra contabile').'">
|
||||
<a class="btn btn-primary '.(!empty($modulo_prima_nota) && !empty($registrazione_contabile) ? '' : 'disabled').'" data-href="'.base_url().'/add.php?id_module='.$modulo_prima_nota['id'].'&id_documenti='.$id_record.'&single=1" data-title="'.tr('Registra contabile').'">
|
||||
<i class="fa fa-euro"></i> '.tr('Registra contabile').'
|
||||
</a>';
|
||||
|
||||
|
|
|
@ -36,4 +36,4 @@ $options = [
|
|||
'allow-empty' => true,
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
echo AppLegacy::load('importa.php', [], $options, true);
|
||||
|
|
|
@ -851,7 +851,7 @@ echo '
|
|||
showCancelButton: true,
|
||||
confirmButtonText: "'.tr('Sì').'"
|
||||
}).then(function (result) {
|
||||
redirect(globals.rootdir + "/editor.php", {
|
||||
redirect_legacy(globals.rootdir + "/editor.php", {
|
||||
id_module: globals.id_module,
|
||||
id_record: globals.id_record,
|
||||
op: "ricalcola_scadenze",
|
||||
|
|
|
@ -112,4 +112,4 @@ if (get('is_descrizione') !== null) {
|
|||
$options['op'] = 'manage_barcode';
|
||||
}
|
||||
|
||||
echo App::load($file.'.php', $result, $options);
|
||||
echo AppLegacy::load($file.'.php', $result, $options);
|
||||
|
|
|
@ -71,4 +71,4 @@ if ($riga->isDescrizione()) {
|
|||
$options['op'] = 'manage_sconto';
|
||||
}
|
||||
|
||||
echo App::load($file.'.php', $result, $options);
|
||||
echo AppLegacy::load($file.'.php', $result, $options);
|
||||
|
|
|
@ -95,7 +95,7 @@ class Fattura extends Document
|
|||
{
|
||||
$model = new static();
|
||||
|
||||
$user = Auth::user();
|
||||
$user = auth()->user();
|
||||
$database = database();
|
||||
|
||||
// Individuazione dello stato predefinito per il documento
|
||||
|
@ -172,6 +172,7 @@ class Fattura extends Document
|
|||
if (empty($id_banca_azienda)) {
|
||||
$id_banca_azienda = $azienda->{'idbanca_'.$conto};
|
||||
}
|
||||
$model->id_banca_azienda = $id_banca_azienda;
|
||||
}
|
||||
|
||||
$model->id_banca_azienda = $id_banca_azienda;
|
||||
|
|
|
@ -48,7 +48,7 @@ class Bollo
|
|||
}
|
||||
|
||||
$righe_bollo = $this->fattura->getRighe()->filter(function ($item, $key) {
|
||||
return $item->aliquota != null && in_array($item->aliquota->codice_natura_fe, ['N1', 'N2.1', 'N2.2', 'N3.1', 'N3.2', 'N3.3', 'N3.4', 'N3.5', 'N3.6', 'N4']);
|
||||
return $item->aliquota != null && in_array($item->aliquota->codice_natura_fe, ['N1', 'N2', 'N3', 'N4']);
|
||||
});
|
||||
$importo_righe_bollo = $righe_bollo->sum('totale_imponibile');
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ WHERE co_documenti.id='.prepare($id_record));
|
|||
if (!empty(setting('Logo stampe'))) {
|
||||
$logo_azienda = base_url().'/'.Models\Upload::where('filename', setting('Logo stampe'))->first()->fileurl;
|
||||
} else {
|
||||
$logo_azienda = str_replace(base_dir(), base_url(), App::filepath('templates/base|custom|/logo_azienda.jpg'));
|
||||
$logo_azienda = str_replace(base_dir(), base_url(), AppLegacy::filepath('templates/base|custom|/logo_azienda.jpg'));
|
||||
$logo_azienda = str_replace('\\', '/', $logo_azienda);
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ elseif ($r['idconto_fornitore'] != '') {
|
|||
$conto_descrizione = $dbo->fetchOne('SELECT CONCAT ((SELECT numero FROM co_pianodeiconti2 WHERE id=co_pianodeiconti3.idpianodeiconti2), ".", numero, " ", descrizione) AS descrizione FROM co_pianodeiconti3 WHERE id='.prepare($conto))['descrizione'];
|
||||
}
|
||||
|
||||
$r_user = $dbo->fetchOne('SELECT * FROM an_anagrafiche WHERE idanagrafica='.prepare(Auth::user()['idanagrafica']));
|
||||
$r_user = $dbo->fetchOne('SELECT * FROM an_anagrafiche WHERE idanagrafica='.prepare(auth()->user()['idanagrafica']));
|
||||
$r_company = $dbo->fetchOne('SELECT * FROM an_anagrafiche WHERE idanagrafica='.prepare(setting('Azienda predefinita')));
|
||||
|
||||
// Variabili da sostituire
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
if (empty($_SESSION['giacenze_sedi']['idsede'])) {
|
||||
$_SESSION['giacenze_sedi']['idsede'] = 0;
|
||||
session(['giacenze_sedi']['idsede' => 0]);
|
||||
}
|
||||
$id_sede = $_SESSION['giacenze_sedi']['idsede'];
|
||||
|
||||
|
|
|
@ -21,5 +21,5 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
if (isset($id_record)) {
|
||||
$id_module = Modules::get('Articoli')['id'];
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record);
|
||||
redirect_legacy(base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ $rs = $dbo->fetchArray($query);
|
|||
foreach ($rs as $r) {
|
||||
$result = [];
|
||||
|
||||
$result['link'] = base_path().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['link'] = base_url().'/editor.php?id_module='.$link_id.'&id_record='.$r['id'];
|
||||
$result['title'] = $r['matricola'].' - '.$r['nome'];
|
||||
$result['category'] = 'Impianti';
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ if (!empty($record['immagine'])) {
|
|||
|
||||
$default_img = '/'.Uploads::getDirectory($id_module).'/'.$fileinfo['filename'].'_thumb600.'.$fileinfo['extension'];
|
||||
|
||||
$img = file_exists(base_dir().$default_img) ? base_path().$default_img : base_path().'/'.Uploads::getDirectory($id_module).'/'.$record['immagine'];
|
||||
$img = file_exists(base_dir().$default_img) ? base_url().$default_img : base_url().'/'.Uploads::getDirectory($id_module).'/'.$record['immagine'];
|
||||
}
|
||||
|
||||
?><form action="" method="post" id="edit-form" enctype="multipart/form-data">
|
||||
|
|
|
@ -123,7 +123,7 @@ foreach ($impianti_collegati as $impianto) {
|
|||
<tr>
|
||||
<td valign="top" class="text-right">'.tr("Componenti soggetti all'intervento").'</td>
|
||||
<td valign="top">
|
||||
<form action="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=link_componenti&matricola='.$impianto['id'].'" method="post">
|
||||
<form action="'.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=link_componenti&matricola='.$impianto['id'].'" method="post">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="id_impianto" value="'.$impianto['id'].'">';
|
||||
|
||||
|
@ -158,7 +158,8 @@ $impianti = !empty($impianti) ? array_column($impianti, 'idimpianto') : [];
|
|||
$sedi = $dbo->fetchArray('SELECT id, nomesede, citta FROM an_sedi WHERE idanagrafica='.prepare($record['idanagrafica'])." UNION SELECT 0, 'Sede legale', '' ORDER BY id");
|
||||
|
||||
echo '
|
||||
<form action="'.base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=link_impianti" method="post">
|
||||
<p><strong>'.tr('Impianti disponibili').'</strong></p>
|
||||
<form action="'.base_url().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=link_impianti" method="post">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
|
@ -168,7 +169,7 @@ echo '
|
|||
<br><br>
|
||||
<button type="submit" class="btn btn-success pull-right" '.$disabled.'><i class="fa fa-check"></i> '.tr('Salva impianti').'</button>
|
||||
|
||||
<button type="button" class="btn btn-primary hide" data-toggle="modal" data-title="'.tr('Aggiungi impianto').'" data-href="'.base_path().'/add.php?id_module='.Modules::get('Impianti')['id'].'&source=Attività&select=idimpianti&id_anagrafica='.$record['idanagrafica'].'&ajax=yes"><i class="fa fa-plus"></i> '.tr('Aggiungi impianto').'</button>
|
||||
<button type="button" class="btn btn-primary hide" data-toggle="modal" data-title="'.tr('Aggiungi impianto').'" data-href="'.base_url().'/add.php?id_module='.Modules::get('Impianti')['id'].'&source=Attività&select=idimpianti&id_anagrafica='.$record['idanagrafica'].'&ajax=yes"><i class="fa fa-plus"></i> '.tr('Aggiungi impianto').'</button>
|
||||
|
||||
</form>';
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue