1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-27 00:06:14 +01:00

Elimina tutti per newsletter

This commit is contained in:
Luca 2021-06-01 17:22:27 +02:00
parent 4d6863bc37
commit 6c4e020c20
2 changed files with 23 additions and 1 deletions

View File

@ -163,6 +163,22 @@ switch (filter('op')) {
break;
case 'remove_all_receiver':
//$receiver = post('id');
$anagrafiche = $newsletter->anagrafiche;
foreach ($anagrafiche as $anagrafica) {
$newsletter->anagrafiche()->detach($anagrafica->id);
}
flash()->info(tr('Tutti i destinatari sono stati rimossi dalla newsletter!'));
break;
// Duplica newsletter
case 'copy':

View File

@ -203,7 +203,13 @@ if (!$anagrafiche->isEmpty()) {
echo '
</tbody>
</table>';
</table>
<a class="btn btn-danger ask pull-right" data-backto="record-edit" data-op="remove_all_receiver">
<i class="fa fa-trash"> Elimina tutti</i>
</a>
';
} else {
echo '<div class="alert alert-info fa fa-info-circle"> '.tr('Nessuna anagrafica collegata alla campagna').'.</div>';
}