diff --git a/modules/interventi/bulk.php b/modules/interventi/bulk.php index 7471decea..3d32f87a9 100755 --- a/modules/interventi/bulk.php +++ b/modules/interventi/bulk.php @@ -252,7 +252,7 @@ return [ 'cambia_stato' => [ 'text' => ' '.tr('Cambia stato'), 'data' => [ - 'title' => tr('Vuoi davvero cambinare le stato per questi interventi?'), + 'title' => tr('Vuoi davvero cambiare lo stato per questi interventi?'), 'msg' => tr('Seleziona lo stato in cui spostare tutti gli interventi non completati').'.

{[ "type": "select", "label": "'.tr('Stato').'", "name": "id_stato", "required": 1, "values": "query=SELECT idstatointervento AS id, descrizione, colore AS _bgcolor_ FROM in_statiintervento WHERE deleted_at IS NULL" ]}', 'button' => tr('Procedi'), diff --git a/modules/ordini/bulk.php b/modules/ordini/bulk.php index 6643676c2..a05d587a5 100644 --- a/modules/ordini/bulk.php +++ b/modules/ordini/bulk.php @@ -112,6 +112,29 @@ switch (post('op')) { flash()->warning(tr('Nessun ordine fatturato!')); } break; + + case 'cambia_stato': + $id_stato = post('id_stato'); + + $n_ordini = 0; + + foreach ($id_records as $id) { + $dbo->update('or_ordini', [ + 'idstatoordine' => $id_stato, + ], ['id' => $id]); + + ++$n_ordini; + } + + if ($n_ordini > 0) { + flash()->info(tr('Stato cambiato a _NUM_ ordini!', [ + '_NUM_' => $n_ordini, + ])); + } else { + flash()->warning(tr('Nessun ordine modificato!')); + } + + break; } if ($module['name'] == 'Ordini cliente') { $operations['crea_fattura'] = [ @@ -126,8 +149,16 @@ $operations['crea_fattura'] = [ ], ]; } -if($operations){ - return $operations; -} else { - return; -} \ No newline at end of file + +$operations['cambia_stato'] = [ + 'text' => ' '.tr('Cambia stato'), + 'data' => [ + 'title' => tr('Vuoi davvero cambiare lo stato per questi ordini?'), + 'msg' => tr('Seleziona lo stato in cui spostare tutti gli ordini').'.
+
{[ "type": "select", "label": "'.tr('Stato').'", "name": "id_stato", "required": 1, "values": "query=SELECT id, descrizione FROM or_statiordine" ]}', + 'button' => tr('Procedi'), + 'class' => 'btn btn-lg btn-warning', + 'blank' => false, + ], +]; + return $operations; \ No newline at end of file