Seleziona tutti import righe

This commit is contained in:
Beppe 2022-02-22 18:17:35 +01:00
parent 4354f11f00
commit e4e10726fb
1 changed files with 23 additions and 1 deletions

View File

@ -265,6 +265,12 @@ echo '
<h3 class="box-title">'.tr('Righe da importare').'</h3> <h3 class="box-title">'.tr('Righe da importare').'</h3>
</div> </div>
<div class="row">
<div class="col-md-12">
{["type":"checkbox", "label":"'.tr('Seleziona/Deseleziona tutto').'", "name":"import_all", "value":"1"]}
</div>
</div>
<table class="box-body table table-striped table-hover table-condensed"> <table class="box-body table table-striped table-hover table-condensed">
<thead> <thead>
<tr> <tr>
@ -310,7 +316,7 @@ foreach ($righe as $i => $riga) {
// Checkbox - da evadere? // Checkbox - da evadere?
echo ' echo '
<input type="checkbox" '.$attr.' id="checked_'.$i.'" name="evadere['.$riga['id'].']" value="on" onclick="ricalcolaTotaleRiga('.$i.');" />'; <input class="check" type="checkbox" '.$attr.' id="checked_'.$i.'" name="evadere['.$riga['id'].']" value="on" onclick="ricalcolaTotaleRiga('.$i.');" />';
$descrizione = ($riga->isArticolo() ? $riga->articolo->codice.' - ' : '').$riga['descrizione']; $descrizione = ($riga->isArticolo() ? $riga->articolo->codice.' - ' : '').$riga['descrizione'];
@ -618,4 +624,20 @@ echo '
} }
}); });
}); });
$("#import_all").click(function(){
if( $(this).is(":checked") ){
$(".check").each(function(){
if( !$(this).is(":checked") ){
$(this).trigger("click");
}
});
}else{
$(".check").each(function(){
if( $(this).is(":checked") ){
$(this).trigger("click");
}
});
}
});
</script>'; </script>';