From 9abb5d84b49f395a5ccd47ffb258ce1c80b0b95b Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 14 Sep 2012 23:22:46 +0000 Subject: [PATCH] Add call flow context and the license details. --- app/call_flows/app_config.php | 4 +++ app/call_flows/call_flow_delete.php | 24 +++++++++++++ app/call_flows/call_flow_edit.php | 55 ++++++++++++++++++++++++++++- app/call_flows/call_flows.php | 26 ++++++++++++++ 4 files changed, 108 insertions(+), 1 deletion(-) diff --git a/app/call_flows/app_config.php b/app/call_flows/app_config.php index 702b34c043..c3947f30e9 100644 --- a/app/call_flows/app_config.php +++ b/app/call_flows/app_config.php @@ -74,6 +74,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['description']['en'] = 'Enter the feature code.'; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'call_flow_context'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en'] = 'Enter the context.'; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'call_flow_status'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['description']['en'] = 'Select the status.'; diff --git a/app/call_flows/call_flow_delete.php b/app/call_flows/call_flow_delete.php index 746a246c47..8195a3f5e0 100644 --- a/app/call_flows/call_flow_delete.php +++ b/app/call_flows/call_flow_delete.php @@ -1,4 +1,28 @@ + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ require_once "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; diff --git a/app/call_flows/call_flow_edit.php b/app/call_flows/call_flow_edit.php index b6697ce388..5125f7acf2 100644 --- a/app/call_flows/call_flow_edit.php +++ b/app/call_flows/call_flow_edit.php @@ -1,4 +1,28 @@ + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ require_once "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; @@ -25,6 +49,7 @@ else { $call_flow_name = check_str($_POST["call_flow_name"]); $call_flow_extension = check_str($_POST["call_flow_extension"]); $call_flow_feature_code = check_str($_POST["call_flow_feature_code"]); + $call_flow_context = check_str($_POST["call_flow_context"]); $call_flow_status = check_str($_POST["call_flow_status"]); $call_flow_pin_number = check_str($_POST["call_flow_pin_number"]); $call_flow_destination = check_str($_POST["call_flow_destination"]); @@ -53,6 +78,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (strlen($call_flow_name) == 0) { $msg .= "Please provide: Name
\n"; } if (strlen($call_flow_extension) == 0) { $msg .= "Please provide: Extension
\n"; } //if (strlen($call_flow_feature_code) == 0) { $msg .= "Please provide: Feature Code
\n"; } + if (strlen($call_flow_context) == 0) { $msg .= "Please provide: Context
\n"; } //if (strlen($call_flow_status) == 0) { $msg .= "Please provide: Status
\n"; } //if (strlen($call_flow_app) == 0) { $msg .= "Please provide: Application
\n"; } //if (strlen($call_flow_pin_number) == 0) { $msg .= "Please provide: PIN Number
\n"; } @@ -88,6 +114,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "call_flow_name, "; $sql .= "call_flow_extension, "; $sql .= "call_flow_feature_code, "; + $sql .= "call_flow_context, "; $sql .= "call_flow_status, "; $sql .= "call_flow_app, "; $sql .= "call_flow_pin_number, "; @@ -104,6 +131,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'$call_flow_name', "; $sql .= "'$call_flow_extension', "; $sql .= "'$call_flow_feature_code', "; + $sql .= "'$call_flow_context', "; $sql .= "'$call_flow_status', "; $sql .= "'$call_flow_app', "; $sql .= "'$call_flow_pin_number', "; @@ -127,6 +155,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "call_flow_name = '$call_flow_name', "; $sql .= "call_flow_extension = '$call_flow_extension', "; $sql .= "call_flow_feature_code = '$call_flow_feature_code', "; + $sql .= "call_flow_context = '$call_flow_context', "; $sql .= "call_flow_status = '$call_flow_status', "; $sql .= "call_flow_pin_number = '$call_flow_pin_number', "; $sql .= "call_flow_app = '$call_flow_app', "; @@ -187,7 +216,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { // $dialplan_detail_tag = 'action'; //condition, action, antiaction //$dialplan_detail_type = 'transfer'; - //$dialplan_detail_data = $ring_group_extension . ' LUA call_flow.lua'; + //$dialplan_detail_data = $call_flow_extension . ' LUA call_flow.lua'; $dialplan_detail_type = 'lua'; $dialplan_detail_data = 'call_flow.lua'; $dialplan_detail_order = '030'; @@ -233,6 +262,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $call_flow_name = $row["call_flow_name"]; $call_flow_extension = $row["call_flow_extension"]; $call_flow_feature_code = $row["call_flow_feature_code"]; + $call_flow_context = $row["call_flow_context"]; $call_flow_status = $row["call_flow_status"]; $call_flow_app = $row["call_flow_app"]; $call_flow_pin_number = $row["call_flow_pin_number"]; @@ -260,6 +290,18 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { unset ($prep_statement); } + //set the context for users that are not in the superadmin group + if (strlen($call_flow_context) == 0) { + if (!if_group("superadmin")) { + if (count($_SESSION["domains"]) > 1) { + $call_flow_context = $_SESSION['domain_name']; + } + else { + $call_flow_context = "default"; + } + } + } + //show the header require_once "includes/header.php"; @@ -311,6 +353,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo " Context:\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo "Enter the context.\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo " Status:\n"; diff --git a/app/call_flows/call_flows.php b/app/call_flows/call_flows.php index ca7e3b7adb..c52b486127 100644 --- a/app/call_flows/call_flows.php +++ b/app/call_flows/call_flows.php @@ -1,4 +1,28 @@ + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ require_once "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; @@ -78,6 +102,7 @@ require_once "includes/paging.php"; echo "\n"; echo "\n"; echo th_order_by('call_flow_status', 'Status', $order_by, $order); + echo th_order_by('call_flow_name', 'Name', $order_by, $order); echo th_order_by('call_flow_extension', 'Extension', $order_by, $order); echo th_order_by('call_flow_feature_code', 'Feature Code', $order_by, $order); echo "\n"; @@ -105,6 +130,7 @@ require_once "includes/paging.php"; } echo " \n"; echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n";
Destination".$row['call_flow_name']." ".$row['call_flow_extension']." ".$row['call_flow_feature_code']." ".$row['call_flow_app']." ".$row['call_flow_data']."