diff --git a/add.php b/add.php
index 1bd24820d..40656843d 100755
--- a/add.php
+++ b/add.php
@@ -53,15 +53,10 @@ echo '
';
diff --git a/assets/src/js/functions/functions.js b/assets/src/js/functions/functions.js
index cb0efb0c5..286274c43 100755
--- a/assets/src/js/functions/functions.js
+++ b/assets/src/js/functions/functions.js
@@ -488,16 +488,6 @@ function restart_inputs() {
$('.openstamanager-input').each(function () {
input(this);
});
- /*
- start_datepickers();
- start_inputmask();
-
- initNumbers();
- start_superselect();
-
- // Autosize per le textarea
- initTextareaInput($('.autosize'));
- */
}
/**
@@ -707,12 +697,13 @@ function hideTableColumn(table, column) {
/**
* Funzione per aggiungere in un *endpoint* il contenuto di uno specifico *template*, effettuando delle sostituzioni di base e inizializzando i campi aggiunti.
- * @param endpoint_selector
- * @param template_selector
- * @param replaces
+ * @param {string|jQuery|HTMLElement} endpoint_selector
+ * @param {string|jQuery|HTMLElement} template_selector
+ * @param {object} replaces
+ * @param {boolean} prepend
* @returns {*|jQuery|HTMLElement}
*/
-function aggiungiContenuto(endpoint_selector, template_selector, replaces = {}) {
+function aggiungiContenuto(endpoint_selector, template_selector, replaces = {}, prepend = false) {
let template = $(template_selector);
let endpoint = $(endpoint_selector);
@@ -729,7 +720,11 @@ function aggiungiContenuto(endpoint_selector, template_selector, replaces = {})
// Aggiunta del contenuto
let element = $(content);
- endpoint.append(element);
+ if (prepend) {
+ endpoint.prepend(element);
+ } else {
+ endpoint.append(element);
+ }
// Rigenerazione degli input interni
element.find('.openstamanager-input').each(function () {
diff --git a/editor.php b/editor.php
index 1f4fbabe5..5bade559b 100755
--- a/editor.php
+++ b/editor.php
@@ -263,15 +263,10 @@ if (empty($record) || !$has_access) {
';
diff --git a/modules/anagrafiche/add.php b/modules/anagrafiche/add.php
index 1cd5436b7..e47facb35 100755
--- a/modules/anagrafiche/add.php
+++ b/modules/anagrafiche/add.php
@@ -35,20 +35,18 @@ echo '
- {[ "type": "select", "label": "'.tr('Tipo di anagrafica').'", "name": "idtipoanagrafica[]", "multiple": "1", "required": 1, "values": "query=SELECT idtipoanagrafica AS id, descrizione FROM an_tipianagrafiche WHERE idtipoanagrafica NOT IN (SELECT DISTINCT(x.idtipoanagrafica) FROM an_tipianagrafiche_anagrafiche x INNER JOIN an_tipianagrafiche t ON x.idtipoanagrafica = t.idtipoanagrafica INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica = x.idanagrafica WHERE t.descrizione = \'Azienda\' AND deleted_at IS NULL) ORDER BY descrizione", "value": "'.(isset($idtipoanagrafica) ? $idtipoanagrafica : null).'", "readonly": '.(!empty(get('readonly_tipo')) ? 1 : 0).' ]}
+ {[ "type": "select", "label": "'.tr('Tipo di anagrafica').'", "name": "idtipoanagrafica[]", "id": "idtipoanagrafica_add", "multiple": "1", "required": 1, "values": "query=SELECT idtipoanagrafica AS id, descrizione FROM an_tipianagrafiche WHERE idtipoanagrafica NOT IN (SELECT DISTINCT(x.idtipoanagrafica) FROM an_tipianagrafiche_anagrafiche x INNER JOIN an_tipianagrafiche t ON x.idtipoanagrafica = t.idtipoanagrafica INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica = x.idanagrafica WHERE t.descrizione = \'Azienda\' AND deleted_at IS NULL) ORDER BY descrizione", "value": "'.(isset($idtipoanagrafica) ? $idtipoanagrafica : null).'", "readonly": '.(!empty(get('readonly_tipo')) ? 1 : 0).' ]}
-
- {[ "type": "text", "label": "'.tr('Cognome').'", "name": "cognome", "id": "cognome_add", "required": 0 ]}
+ {[ "type": "text", "label": "'.tr('Cognome').'", "name": "cognome", "id": "cognome_add" ]}
- {[ "type": "text", "label": "'.tr('Nome').'", "name": "nome", "id": "nome_add", "required": 0 ]}
+ {[ "type": "text", "label": "'.tr('Nome').'", "name": "nome", "id": "nome_add" ]}
-
';
echo '
@@ -72,10 +70,8 @@ echo '
- {[ "type": "select", "label": "'.tr('Tipologia').'", "name": "tipo", "values": "list=\"\": \"'.tr('Non specificato').'\", \"Azienda\": \"'.tr('Azienda').'\", \"Privato\": \"'.tr('Privato').'\", \"Ente pubblico\": \"'.tr('Ente pubblico').'\"" ]}
+ {[ "type": "select", "label": "'.tr('Tipologia').'", "name": "tipo", "id": "tipo_add", "values": "list=\"\": \"'.tr('Non specificato').'\", \"Azienda\": \"'.tr('Azienda').'\", \"Privato\": \"'.tr('Privato').'\", \"Ente pubblico\": \"'.tr('Ente pubblico').'\"" ]}
-
-
@@ -99,7 +95,7 @@ echo '
- {[ "type": "select", "label": "'.tr('Nazione').'", "name": "id_nazione", "values": "query=SELECT id AS id, CONCAT_WS(\' - \', iso2, nome) AS descrizione FROM an_nazioni ORDER BY CASE WHEN iso2=\'IT\' THEN -1 ELSE iso2 END" ]}
+ {[ "type": "select", "label": "'.tr('Nazione').'", "name": "id_nazione", "id": "id_nazione_add", "values": "query=SELECT id AS id, CONCAT_WS(\' - \', iso2, nome) AS descrizione FROM an_nazioni ORDER BY CASE WHEN iso2=\'IT\' THEN -1 ELSE iso2 END" ]}
@@ -125,7 +121,7 @@ echo '
echo '
- {[ "type": "text", "label": "'.tr('Codice destinatario').'", "name": "codice_destinatario", "required": 0, "class": "text-center text-uppercase alphanumeric-mask", "maxlength": "7", "extra": "", "help": "'.tr($help_codice_destinatario).'", "readonly": "1" ]}
+ {[ "type": "text", "label": "'.tr('Codice destinatario').'", "name": "codice_destinatario", "class": "text-center text-uppercase alphanumeric-mask", "maxlength": "7", "extra": "", "help": "'.tr($help_codice_destinatario).'", "readonly": "1" ]}
@@ -141,39 +137,37 @@ echo '
?>