mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
List Views: Simplify action handling.
This commit is contained in:
@@ -50,40 +50,32 @@
|
||||
$call_flows = $_POST['call_flows'];
|
||||
}
|
||||
|
||||
//copy the call flows
|
||||
if (permission_exists('call_flow_add')) {
|
||||
if ($action == 'copy' && is_array($call_flows) && @sizeof($call_flows) != 0) {
|
||||
//copy
|
||||
$obj = new call_flows;
|
||||
$obj->copy($call_flows);
|
||||
//redirect
|
||||
header('Location: call_flows.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
//process posted data by action
|
||||
if ($action != '' && is_array($call_flows) && @sizeof($call_flows) != 0) {
|
||||
$obj = new call_flows;
|
||||
|
||||
//toggle the call flows
|
||||
if (permission_exists('call_flow_edit')) {
|
||||
if ($action == 'toggle' && is_array($call_flows) && @sizeof($call_flows) != 0) {
|
||||
//toggle
|
||||
$obj = new call_flows;
|
||||
$obj->toggle($call_flows);
|
||||
//redirect
|
||||
header('Location: call_flows.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
switch ($action) {
|
||||
case 'copy':
|
||||
if (permission_exists('call_flow_add')) {
|
||||
$obj->copy($call_flows);
|
||||
}
|
||||
break;
|
||||
|
||||
//delete the call flows
|
||||
if (permission_exists('call_flow_delete')) {
|
||||
if ($action == 'delete' && is_array($call_flows) && @sizeof($call_flows) != 0) {
|
||||
//delete
|
||||
$obj = new call_flows;
|
||||
$obj->delete($call_flows);
|
||||
//redirect
|
||||
header('Location: call_flows.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
case 'toggle':
|
||||
if (permission_exists('call_flow_edit')) {
|
||||
$obj->toggle($call_flows);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
if (permission_exists('call_flow_delete')) {
|
||||
$obj->delete($call_flows);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
header('Location: call_flows.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
|
||||
//get variables used to control the order
|
||||
|
||||
Reference in New Issue
Block a user