@@ -48,6 +48,7 @@ function initGestioneAllegati(gestione) {
4848 id_module : gestione . data ( 'id_module' ) ,
4949 id_plugin : gestione . data ( 'id_plugin' ) ,
5050 id_record : gestione . data ( 'id_record' ) ,
51+ id_category : gestione . data ( 'id_category' )
5152 } ) . toString ( ) ;
5253
5354 let dragdrop = new Dropzone ( dropzone_id , {
@@ -96,40 +97,6 @@ function modificaCategoriaAllegati(gestione, pulsanteModifica) {
9697 inputNome . removeClass ( "hidden" ) ;
9798}
9899
99- /**
100- * Funzione per salvare le modifiche effettuate su una categoria di allegati.
101- * @param gestione
102- * @param pulsanteSalva
103- */
104- function salvaCategoriaAllegati ( gestione , pulsanteSalva ) {
105- const categoria = $ ( pulsanteSalva ) . parent ( ) . parent ( ) ;
106-
107- const nome = categoria . find ( ".box-title" ) ;
108- const inputNome = categoria . find ( ".category-name" ) ;
109-
110- mostraCaricamentoAllegati ( gestione ) ;
111-
112- $ . ajax ( {
113- url : globals . rootdir + "/actions.php" ,
114- cache : false ,
115- type : "POST" ,
116- data : {
117- op : "modifica-categoria-allegato" ,
118- id_module : gestione . data ( 'id_module' ) ,
119- id_plugin : gestione . data ( 'id_plugin' ) ,
120- id_record : gestione . data ( 'id_record' ) ,
121- category : nome . text ( ) ,
122- name : inputNome . val ( ) ,
123- } ,
124- success : function ( data ) {
125- ricaricaAllegati ( gestione ) ;
126- } ,
127- error : function ( gestione ) {
128- ricaricaAllegati ( gestione ) ;
129- }
130- } ) ;
131- }
132-
133100/**
134101 * Funzione per caricare un nuovo allegato.
135102 * @param gestione
@@ -176,6 +143,7 @@ function ricaricaAllegati(gestione) {
176143 id_module : gestione . data ( 'id_module' ) ,
177144 id_plugin : gestione . data ( 'id_plugin' ) ,
178145 id_record : gestione . data ( 'id_record' ) ,
146+ id_category : gestione . data ( 'id_category' )
179147 } ) . toString ( ) ;
180148
181149 $ ( id ) . load ( globals . rootdir + "/ajax.php?" + params , function ( ) {
@@ -295,34 +263,3 @@ function rimuoviAllegato(button) {
295263 } ) ;
296264 } ) . catch ( swal . noop ) ;
297265}
298-
299- function impostaCategorieAllegatiDisponibili ( gestione , categorie ) {
300- // Disabilitazione per rimozione input in aggiunta
301- return ;
302-
303- const id = "#" + gestione . attr ( 'id' ) ;
304- const input = $ ( "#modifica-allegato #categoria_allegato" ) [ 0 ] ;
305-
306- autocomplete ( {
307- minLength : 0 ,
308- input : input ,
309- emptyMsg : globals . translations . noResults ,
310- fetch : function ( text , update ) {
311- text = text . toLowerCase ( ) ;
312- const suggestions = categorie . filter ( n => n . toLowerCase ( ) . startsWith ( text ) ) ;
313-
314- // Trasformazione risultati in formato leggibile
315- const results = suggestions . map ( function ( result ) {
316- return {
317- label : result ,
318- value : result
319- }
320- } ) ;
321-
322- update ( results ) ;
323- } ,
324- onSelect : function ( item ) {
325- input . value = item . label ;
326- } ,
327- } ) ;
328- }
0 commit comments