List Views: Simplify action handling.
This commit is contained in:
+18
-20
@@ -50,28 +50,26 @@
|
||||
$fax_servers = $_POST['fax_servers'];
|
||||
}
|
||||
|
||||
//copy the fax servers
|
||||
if (permission_exists('fax_extension_copy')) {
|
||||
if ($action == 'copy' && is_array($fax_servers) && @sizeof($fax_servers) != 0) {
|
||||
//copy
|
||||
$obj = new fax;
|
||||
$obj->copy($fax_servers);
|
||||
//redirect
|
||||
header('Location: fax.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
//process posted data by action
|
||||
if ($action != '' && is_array($fax_servers) && @sizeof($fax_servers) != 0) {
|
||||
$obj = new fax;
|
||||
|
||||
//delete the fax servers
|
||||
if (permission_exists('fax_extension_delete')) {
|
||||
if ($action == 'delete' && is_array($fax_servers) && @sizeof($fax_servers) != 0) {
|
||||
//delete
|
||||
$obj = new fax;
|
||||
$obj->delete($fax_servers);
|
||||
//redirect
|
||||
header('Location: fax.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
switch ($action) {
|
||||
case 'copy':
|
||||
if (permission_exists('fax_extension_copy')) {
|
||||
$obj->copy($fax_servers);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
if (permission_exists('fax_extension_delete')) {
|
||||
$obj->delete($fax_servers);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
header('Location: fax.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
|
||||
//get order and order by
|
||||
|
||||
Reference in New Issue
Block a user