List Views: Simplify action handling.

This commit is contained in:
Nate
2019-11-30 11:12:41 -07:00
parent b993ab8197
commit bfb17507f1
30 changed files with 590 additions and 720 deletions
+13 -9
View File
@@ -50,16 +50,20 @@
$contacts = $_POST['contacts'];
}
//delete the contacts
if (permission_exists('contact_delete')) {
if ($action == 'delete' && is_array($contacts) && @sizeof($contacts) != 0) {
//delete
$obj = new contacts;
$obj->delete($contacts);
//redirect
header('Location: contacts.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
//process posted data by action
if ($action != '' && is_array($contacts) && @sizeof($contacts) != 0) {
$obj = new contacts;
switch ($action) {
case 'delete':
if (permission_exists('contact_delete')) {
$obj->delete($contacts);
}
break;
}
header('Location: contacts.php'.($search != '' ? '?search='.urlencode($search) : null));
exit;
}
//retrieve current user's assigned groups (uuids)