File tree Expand file tree Collapse file tree
plugins/impianti_intervento Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6363 </div>
6464
6565 <div class="col-md-2">
66- <button title=" ' .tr ('Aggiungi impianto all \'attività ' ).'" class="btn btn-success btn-block tip" type="button" onclick="addImpianto()" ' .$ disabled .' style="margin-top: 25px ;">
67- <i class="fa fa-plus mr-1 "></i> ' .tr ('Aggiungi ' ).'
66+ <button title=" ' .tr ('Aggiungi impianto all \'attività ' ).'" class="btn btn-primary tip" type="button" onclick="addImpianto()" ' .$ disabled .' style="margin-top: 20px ;">
67+ <i class="fa fa-plus"></i> ' .tr ('Aggiungi ' ).'
6868 </button>
6969 </div>
7070 <div class="col-md-2">
@@ -118,6 +118,14 @@ function toggleDettagli(trigger) {
118118 $("[data-toggle= \'tooltip \']").tooltip();
119119
120120 caricaImpianti();
121+
122+ // Aggiungi evento per ricerca con tasto Invio
123+ $("#input-cerca").on("keypress", function(e) {
124+ if (e.which === 13) { // Tasto Invio
125+ e.preventDefault();
126+ caricaImpianti();
127+ }
128+ });
121129});
122130
123131function caricaImpianti() {
Original file line number Diff line number Diff line change 6868 </thead>
6969 <tbody> ' ;
7070} else {
71+ // Determina il messaggio in base alla presenza di una ricerca
72+ $ search_term = get ('search ' );
73+ if (!empty ($ search_term )) {
74+ // Se c'è una ricerca attiva, mostra "Nessun risultato"
75+ $ title = tr ('Nessun risultato ' );
76+ $ message = tr ('La ricerca non ha prodotto risultati. Prova con termini diversi. ' );
77+ } else {
78+ // Se non c'è ricerca, mostra il messaggio originale
79+ $ title = tr ('Nessun impianto collegato ' );
80+ $ message = tr ('Utilizza il modulo sopra per aggiungere impianti a questa attività ' );
81+ }
82+
7183 echo '
7284 <div class="alert alert-info text-center">
7385 <i class="fa fa-info-circle fa-2x mb-2"></i>
74- <h5> ' .tr ( ' Nessun impianto collegato ' ) .'</h5>
75- <p class="mb-0"> ' .tr ( ' Utilizza il modulo sopra per aggiungere impianti a questa attività ' ) .'</p>
86+ <h5> ' .$ title .'</h5>
87+ <p class="mb-0"> ' .$ message .'</p>
7688 </div> ' ;
7789 return ;
7890}
You can’t perform that action at this time.
0 commit comments