diff --git a/assets/src/css/style.css b/assets/src/css/style.css
index 095e7f9e5..57bf57765 100755
--- a/assets/src/css/style.css
+++ b/assets/src/css/style.css
@@ -1041,7 +1041,7 @@ div.tip {
background: #222222;
}
-.decimal-number {
+.number-input {
text-align: right;
}
diff --git a/assets/src/js/functions/dates.js b/assets/src/js/functions/dates.js
index 5768056eb..a051517cb 100755
--- a/assets/src/js/functions/dates.js
+++ b/assets/src/js/functions/dates.js
@@ -42,6 +42,8 @@ function initDateInput(input) {
minDate: moment($this.attr('min-date')).isValid() ? $this.attr('min-date') : false,
maxDate: moment($this.attr('max-date')).isValid() ? $this.attr('max-date') : false,
});
+
+ return true;
}
function initTimestampInput(input) {
@@ -72,7 +74,9 @@ function initTimestampInput(input) {
$this.on("dp.hide", function (e) {
$('#tecnici > div').addClass('table-responsive');
- })
+ });
+
+ return true;
}
function initTimeInput(input) {
@@ -88,6 +92,8 @@ function initTimeInput(input) {
minDate: moment($this.attr('min-date')).isValid() ? $this.attr('min-date') : false,
maxDate: moment($this.attr('max-date')).isValid() ? $this.attr('max-date') : false,
});
+
+ return true;
}
/**
diff --git a/assets/src/js/functions/input.js b/assets/src/js/functions/input.js
index 025c976a5..8b2908367 100644
--- a/assets/src/js/functions/input.js
+++ b/assets/src/js/functions/input.js
@@ -42,7 +42,13 @@ function input(name) {
if (!element.data("input-controller")) {
return new Input(element);
} else {
- return element.data("input-controller");
+ const controller = element.data("input-controller");
+
+ if (!element.data("input-init")) {
+ controller.init();
+ }
+
+ return controller;
}
}
@@ -54,49 +60,53 @@ function input(name) {
function Input(element) {
this.element = element;
- // Controllo sulla gestione precedente
- if (this.element.data("input-controller")) {
- return this.element.data("input-controller");
- }
-
this.element.data("input-controller", this);
this.element.data("required", this.element.attr("required"));
- let htmlElement = element[0];
+ this.init();
+}
+
+
+Input.prototype.init = function () {
+ let initCompleted = false;
+ let htmlElement = this.element[0];
+
// Operazioni di inizializzazione per input specifici
// Inizializzazione per date
if (this.element.hasClass('timestamp-picker')) {
- initTimestampInput(htmlElement);
+ initCompleted = initTimestampInput(htmlElement);
} else if (this.element.hasClass('datepicker')) {
- initDateInput(htmlElement);
+ initCompleted = initDateInput(htmlElement);
} else if (this.element.hasClass('timepicker')) {
- initTimeInput(htmlElement);
+ initCompleted = initTimeInput(htmlElement);
}
// Inizializzazione per campi numerici
- else if (this.element.hasClass('decimal-number')) {
- initNumberInput(htmlElement);
+ else if (this.element.hasClass('number-input')) {
+ initCompleted = initNumberInput(htmlElement);
}
// Inizializzazione per textarea
else if (this.element.hasClass('editor-input')) {
- initEditorInput(htmlElement);
+ initCompleted = initEditorInput(htmlElement);
}
// Inizializzazione per textarea
else if (this.element.hasClass('autosize')) {
- initTextareaInput(htmlElement);
+ initCompleted = initTextareaInput(htmlElement);
}
// Inizializzazione per select
- else if (this.element.hasClass('superselect') || this.element.hasClass('superselectajax')) {
- initSelectInput(htmlElement);
+ else if (this.element.hasClass('select-input')) {
+ initCompleted = initSelectInput(htmlElement);
}
// Inizializzazione alternativa per maschere
else {
- initMaskInput(htmlElement);
+ initCompleted = initMaskInput(htmlElement);
}
+
+ this.element.data("input-init", initCompleted);
}
Input.prototype.getElement = function () {
@@ -200,7 +210,7 @@ Input.prototype.get = function () {
}
// Gestione dei valori numerici
- if (this.element.hasClass("decimal-number")) {
+ if (this.element.hasClass("number-input")) {
const autonumeric = this.element.data("autonumeric");
if (autonumeric) {
diff --git a/assets/src/js/functions/inputmask.js b/assets/src/js/functions/inputmask.js
index 97842bec2..c42619150 100644
--- a/assets/src/js/functions/inputmask.js
+++ b/assets/src/js/functions/inputmask.js
@@ -42,6 +42,8 @@ function initMaskInput(input) {
regex: "[0-9,.+\-]*",
});
}
+
+ return true;
}
/**
diff --git a/assets/src/js/functions/numbers.js b/assets/src/js/functions/numbers.js
index c69c46a0b..6891b0a34 100644
--- a/assets/src/js/functions/numbers.js
+++ b/assets/src/js/functions/numbers.js
@@ -22,7 +22,7 @@
* @deprecated
*/
function initNumbers() {
- $('.decimal-number').each(function () {
+ $('.number-input').each(function () {
input(this);
});
}
@@ -30,7 +30,7 @@ function initNumbers() {
function initNumberInput(input) {
let $input = $(input);
if (AutoNumeric.isManagedByAutoNumeric(input)) {
- return;
+ return true;
}
let min = $input.attr('min-value') && $input.attr('min-value') !== "undefined" ? $input.attr('min-value') : null;
@@ -58,4 +58,6 @@ function initNumberInput(input) {
});
$input.data("autonumeric", autonumeric);
+
+ return true;
}
diff --git a/assets/src/js/functions/select.js b/assets/src/js/functions/select.js
index 0bc89b807..f3c183f1c 100755
--- a/assets/src/js/functions/select.js
+++ b/assets/src/js/functions/select.js
@@ -23,7 +23,7 @@
*/
function start_superselect() {
$('.superselect, .superselectajax').each(function () {
- input(this);
+ input(this);
});
}
@@ -170,19 +170,26 @@ function updateSelectOption(name, value) {
})
}
-function initSelectInput(input){
- if ($(input).hasClass('superselect')){
+/**
+ * @param input
+ */
+function initSelectInput(input) {
+ let $input = $(input);
+
+ if ($input.hasClass('superselect')) {
initStaticSelectInput(input);
} else {
initDynamicSelectInput(input);
}
+
+ return $input.data('select');
}
/**
* Statico.
* @param input
*/
-function initStaticSelectInput(input){
+function initStaticSelectInput(input) {
let $input = $(input);
$input.select2({
@@ -203,7 +210,7 @@ function initStaticSelectInput(input){
* Dinamico.
* @param input
*/
-function initDynamicSelectInput(input){
+function initDynamicSelectInput(input) {
let $input = $(input);
$input.select2({
diff --git a/assets/src/js/functions/textarea.js b/assets/src/js/functions/textarea.js
index 7c392b8ad..8c432b45b 100644
--- a/assets/src/js/functions/textarea.js
+++ b/assets/src/js/functions/textarea.js
@@ -18,6 +18,8 @@
function initTextareaInput(input) {
autosize($(input));
+
+ return true;
}
function initEditorInput(input) {
@@ -45,4 +47,6 @@ function initEditorInput(input) {
$input.trigger("change", event);
});
});
+
+ return true;
}
diff --git a/core.php b/core.php
index 030fe12a8..d12978432 100755
--- a/core.php
+++ b/core.php
@@ -148,23 +148,6 @@ Monolog\ErrorHandler::register($logger, [], Monolog\Logger::ERROR, Monolog\Logge
// Database
$dbo = $database = database();
-/* SESSIONE */
-if (!API\Response::isAPIRequest()) {
- // Barra di debug (necessario per loggare tutte le query)
- if (App::debug()) {
- $debugbar = new DebugBar\DebugBar();
-
- $debugbar->addCollector(new DebugBar\DataCollector\MemoryCollector());
- $debugbar->addCollector(new DebugBar\DataCollector\PhpInfoCollector());
-
- $debugbar->addCollector(new DebugBar\DataCollector\RequestDataCollector());
- $debugbar->addCollector(new DebugBar\DataCollector\TimeDataCollector());
-
- $debugbar->addCollector(new DebugBar\Bridge\MonologCollector($logger));
- $debugbar->addCollector(new Extensions\EloquentCollector($dbo->getCapsule()));
- }
-}
-
/* INTERNAZIONALIZZAZIONE */
// Istanziamento del gestore delle traduzioni del progetto
$lang = !empty($config['lang']) ? $config['lang'] : (isset($_GET['lang']) ? $_GET['lang'] : null);
diff --git a/include/bottom.php b/include/bottom.php
index 79f2e5945..bc9397e97 100755
--- a/include/bottom.php
+++ b/include/bottom.php
@@ -58,7 +58,6 @@ if (Auth::check()) {
window.onbeforeunload = null;
';
- echo $debugbarRenderer->render();
}
$custom_css = setting('CSS Personalizzato');
diff --git a/include/top.php b/include/top.php
index 6a15baa6e..170e1065f 100755
--- a/include/top.php
+++ b/include/top.php
@@ -260,15 +260,6 @@ echo '
';
if (Auth::check()) {
- // Barra di debug
- if (App::debug()) {
- $debugbarRenderer = $debugbar->getJavascriptRenderer();
- $debugbarRenderer->setIncludeVendors(false);
- $debugbarRenderer->setBaseUrl($paths['assets'].'/php-debugbar');
-
- echo $debugbarRenderer->renderHead();
- }
-
if (setting('Abilita esportazione Excel e PDF')) {
echo '
diff --git a/modules/dashboard/edit.php b/modules/dashboard/edit.php
index a1762c684..91b36cf45 100755
--- a/modules/dashboard/edit.php
+++ b/modules/dashboard/edit.php
@@ -253,7 +253,7 @@ WHERE (SELECT COUNT(*) FROM in_interventi_tecnici WHERE in_interventi_tecnici.id
->sortBy('data');
echo '
-