|
25 | 25 | include_once __DIR__.'/../../core.php'; |
26 | 26 |
|
27 | 27 | switch (post('op')) { |
28 | | - case 'delete-bulk': |
| 28 | + case 'delete_bulk': |
29 | 29 | $id_tipo_azienda = Tipo::where('name', 'Azienda')->first()->id; |
30 | 30 |
|
31 | 31 | foreach ($id_records as $id) { |
|
49 | 49 |
|
50 | 50 | break; |
51 | 51 |
|
52 | | - case 'ricerca-coordinate': |
| 52 | + case 'search_coordinates': |
53 | 53 | foreach ($id_records as $id) { |
54 | 54 | $anagrafica = Anagrafica::find($id); |
55 | 55 | $anagrafica->save(); |
56 | 56 | } |
57 | 57 |
|
58 | 58 | break; |
59 | 59 |
|
60 | | - case 'export-csv': |
| 60 | + case 'export_csv': |
61 | 61 | $file = temp_file(); |
62 | 62 | $exporter = new CSV($file); |
63 | 63 |
|
|
70 | 70 | download($file, 'anagrafiche.csv'); |
71 | 71 | break; |
72 | 72 |
|
73 | | - case 'cambia-relazione': |
| 73 | + case 'change_relation': |
74 | 74 | $idrelazione = post('idrelazione'); |
75 | 75 |
|
76 | 76 | foreach ($id_records as $id) { |
|
82 | 82 | } |
83 | 83 | break; |
84 | 84 |
|
85 | | - case 'aggiorna-listino': |
| 85 | + case 'update_price_list': |
86 | 86 | $id_listino = post('id_listino') ?: 0; |
87 | 87 | foreach ($id_records as $id) { |
88 | 88 | $anagrafica = Anagrafica::find($id); |
|
99 | 99 |
|
100 | 100 | $operations = []; |
101 | 101 |
|
102 | | -$operations['ricerca-coordinate'] = [ |
103 | | - 'text' => '<span><i class="fa fa-map"></i> '.tr('Ricerca coordinate').'</span>', |
104 | | - 'data' => [ |
105 | | - 'msg' => tr('Ricercare le coordinate per le anagrafiche selezionate senza latitudine e longitudine?'), |
106 | | - 'button' => tr('Procedi'), |
107 | | - 'class' => 'btn btn-lg btn-warning', |
108 | | - ], |
109 | | -]; |
110 | | - |
111 | | -$operations['cambia-relazione'] = [ |
| 102 | +$operations['change_relation'] = [ |
112 | 103 | 'text' => '<span><i class="fa fa-copy"></i> '.tr('Cambia relazione').'</span>', |
113 | 104 | 'data' => [ |
114 | 105 | 'msg' => tr('Vuoi davvero cambiare la relazione delle anagrafiche selezionate?').'<br><br>{[ "type": "select", "label": "'.tr('Relazione con il cliente').'", "name": "idrelazione", "required": 1, "ajax-source": "relazioni"]}', |
|
117 | 108 | ], |
118 | 109 | ]; |
119 | 110 |
|
120 | | -$operations['aggiorna-listino'] = [ |
121 | | - 'text' => '<span><i class="fa fa-refresh"></i> '.tr('Imposta listino').'</span>', |
| 111 | +$operations['delete_bulk'] = [ |
| 112 | + 'text' => '<span><i class="fa fa-trash"></i> '.tr('Elimina').'</span>', |
122 | 113 | 'data' => [ |
123 | | - 'msg' => tr('Vuoi impostare il listino cliente selezionato a queste anagrafiche?').'<br><br>{[ "type": "select", "label": "'.tr('Listino cliente').'", "name": "id_listino", "required": 0, "ajax-source": "listini", "placeholder": "'.tr('Nessun listino').'" ]}', |
| 114 | + 'msg' => tr('Vuoi davvero eliminare le anagrafiche selezionate?'), |
124 | 115 | 'button' => tr('Procedi'), |
125 | | - 'class' => 'btn btn-lg btn-warning', |
| 116 | + 'class' => 'btn btn-lg btn-danger', |
126 | 117 | ], |
127 | 118 | ]; |
128 | 119 |
|
129 | | -$operations['export-csv'] = [ |
| 120 | +$operations['export_csv'] = [ |
130 | 121 | 'text' => '<span><i class="fa fa-download"></i> '.tr('Esporta').'</span>', |
131 | 122 | 'data' => [ |
132 | 123 | 'msg' => tr('Vuoi esportare un CSV con le anagrafiche selezionate?'), |
|
136 | 127 | ], |
137 | 128 | ]; |
138 | 129 |
|
139 | | -$operations['delete-bulk'] = [ |
140 | | - 'text' => '<span><i class="fa fa-trash"></i> '.tr('Elimina').'</span>', |
| 130 | +$operations['update_price_list'] = [ |
| 131 | + 'text' => '<span><i class="fa fa-refresh"></i> '.tr('Imposta listino').'</span>', |
141 | 132 | 'data' => [ |
142 | | - 'msg' => tr('Vuoi davvero eliminare le anagrafiche selezionate?'), |
| 133 | + 'msg' => tr('Vuoi impostare il listino cliente selezionato a queste anagrafiche?').'<br><br>{[ "type": "select", "label": "'.tr('Listino cliente').'", "name": "id_listino", "required": 0, "ajax-source": "listini", "placeholder": "'.tr('Nessun listino').'" ]}', |
143 | 134 | 'button' => tr('Procedi'), |
144 | | - 'class' => 'btn btn-lg btn-danger', |
| 135 | + 'class' => 'btn btn-lg btn-warning', |
| 136 | + ], |
| 137 | +]; |
| 138 | + |
| 139 | +$operations['search_coordinates'] = [ |
| 140 | + 'text' => '<span><i class="fa fa-map"></i> '.tr('Ricerca coordinate').'</span>', |
| 141 | + 'data' => [ |
| 142 | + 'msg' => tr('Ricercare le coordinate per le anagrafiche selezionate senza latitudine e longitudine?'), |
| 143 | + 'button' => tr('Procedi'), |
| 144 | + 'class' => 'btn btn-lg btn-warning', |
145 | 145 | ], |
146 | 146 | ]; |
147 | 147 |
|
|
0 commit comments