From 1bdf5cbc3db6061ecf86c11932fa714233199ada Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 20 Feb 2014 07:20:55 +0000 Subject: [PATCH] Ring group improvements designed improve usability. --- app/ring_groups/app_languages.php | 7 +- .../ring_group_destination_delete.php | 20 +- app/ring_groups/ring_group_edit.php | 564 ++++++++---------- 3 files changed, 276 insertions(+), 315 deletions(-) diff --git a/app/ring_groups/app_languages.php b/app/ring_groups/app_languages.php index 335102bbe6..31cd9d2539 100644 --- a/app/ring_groups/app_languages.php +++ b/app/ring_groups/app_languages.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2013 + Portions created by the Initial Developer are Copyright (C) 2014 the Initial Developer. All Rights Reserved. Contributor(s): @@ -46,6 +46,11 @@ $text['label-extension']['pt-pt'] = "Extensão"; $text['label-extension']['fr-fr'] = "Extension"; + $text['description-extension']['en-us'] = "Enter the extension number."; + $text['description-extension']['es-cl'] = "Introduzca el número de extensión."; + $text['description-extension']['pt-pt'] = "Digite o número do ramal."; + $text['description-extension']['fr-fr'] = "Entrez le numéro de poste."; + $text['label-ring-group-extension']['en-us'] = "Ring Group Extension"; $text['label-ring-group-extension']['es-cl'] = "Extensión de grupo de llamado"; $text['label-ring-group-extension']['pt-pt'] = "Extensão associada ao grupo de ring"; diff --git a/app/ring_groups/ring_group_destination_delete.php b/app/ring_groups/ring_group_destination_delete.php index 1a69e9aad3..5a2ca0f6fb 100644 --- a/app/ring_groups/ring_group_destination_delete.php +++ b/app/ring_groups/ring_group_destination_delete.php @@ -46,23 +46,21 @@ else { $ring_group_uuid = check_str($_GET["ring_group_uuid"]); } -if (strlen($id)>0) { - //delete ring_group_destination +//delete ring_group_destination + if (strlen($id)>0) { $sql = "delete from v_ring_group_destinations "; $sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "and ring_group_destination_uuid = '$id' "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); unset($sql); -} + } -//redirect the user - require_once "resources/header.php"; - echo "\n"; - echo "
\n"; - echo $text['message-delete']."\n"; - echo "
\n"; - require_once "resources/footer.php"; - return; +//save the message to a session variable + $_SESSION['message'] = $text['message-delete']; + +//redirect the browser + header("Location: ring_group_edit.php?id=$ring_group_uuid"); + exit; ?> \ No newline at end of file diff --git a/app/ring_groups/ring_group_edit.php b/app/ring_groups/ring_group_edit.php index edc3319b82..85af19c9e6 100644 --- a/app/ring_groups/ring_group_edit.php +++ b/app/ring_groups/ring_group_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2010-2013 + Portions created by the Initial Developer are Copyright (C) 2010-2014 the Initial Developer. All Rights Reserved. Contributor(s): @@ -52,12 +52,11 @@ else { $sql .= "and ring_group_uuid = '".$ring_group_uuid."' "; $sql .= "and user_uuid = '".$user_uuid."' "; $db->exec(check_sql($sql)); + //save the message to a session variable + $_SESSION['message'] = $text['message-add']; //redirect the browser - require_once "resources/header.php"; - echo "\n"; - echo "
".$text['message-delete']."
"; - require_once "resources/footer.php"; - return; + header("Location: ring_group_edit.php?id=$ring_group_uuid"); + exit; } //action add or update @@ -69,30 +68,6 @@ else { $action = "add"; } -//define the destination_select function - function destination_select($select_name, $select_value, $select_default) { - if (strlen($select_value) == 0) { $select_value = $select_default; } - echo " \n"; - } - //get http post variables and set them to php variables if (count($_POST) > 0) { //set variables from http values @@ -148,28 +123,28 @@ else { $sql_insert .= "'".$user_uuid."' "; $sql_insert .= ")"; $db->exec($sql_insert); + //save the message to a session variable + $_SESSION['message'] = $text['message-add']; //redirect the browser - require_once "resources/header.php"; - echo "\n"; - echo "
".$text['message-add']."
"; - require_once "resources/footer.php"; - return; + header("Location: ring_group_edit.php?id=$ring_group_uuid"); + exit; } //process the HTTP POST if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { - $msg = ''; - if ($action == "update") { - $ring_group_uuid = check_str($_POST["ring_group_uuid"]); - } + //get the ring group uuid + if (strlen($ring_group_uuid) == 0) { + $ring_group_uuid = check_str($_REQUEST["ring_group_uuid"]); + } //check for all required data + $msg = ''; if (strlen($ring_group_name) == 0) { $msg .= $text['message-name']."
\n"; } if (strlen($ring_group_extension) == 0) { $msg .= $text['message-extension']."
\n"; } if (strlen($ring_group_strategy) == 0) { $msg .= $text['message-strategy']."
\n"; } if (strlen($ring_group_timeout_sec) == 0) { $msg .= $text['message-strategy']."
\n"; } - if (strlen($ring_group_timeout_app) == 0) { $msg .= $text['message-timeout-action']."
\n"; } + //if (strlen($ring_group_timeout_app) == 0) { $msg .= $text['message-timeout-action']."
\n"; } //if (strlen($ring_group_cid_name_prefix) == 0) { $msg .= "Please provide: Caller ID Prefix
\n"; } //if (strlen($ring_group_ringback) == 0) { $msg .= "Please provide: Ringback
\n"; } if (strlen($ring_group_enabled) == 0) { $msg .= $text['message-enabled']."
\n"; } @@ -189,204 +164,155 @@ else { //add or update the database if ($_POST["persistformvar"] != "true") { - if ($action == "add") { - //prepare the uuids - $ring_group_uuid = uuid(); - $dialplan_uuid = uuid(); - //add the ring group - $sql = "insert into v_ring_groups "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "ring_group_uuid, "; - $sql .= "ring_group_name, "; - $sql .= "ring_group_extension, "; - $sql .= "ring_group_context, "; - $sql .= "ring_group_strategy, "; - $sql .= "ring_group_timeout_sec, "; - $sql .= "ring_group_timeout_app, "; - $sql .= "ring_group_timeout_data, "; - $sql .= "ring_group_cid_name_prefix, "; - $sql .= "ring_group_ringback, "; - $sql .= "ring_group_enabled, "; - $sql .= "ring_group_description, "; - $sql .= "dialplan_uuid "; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'".$_SESSION['domain_uuid']."', "; - $sql .= "'".$ring_group_uuid."', "; - $sql .= "'$ring_group_name', "; - $sql .= "'$ring_group_extension', "; - $sql .= "'$ring_group_context', "; - $sql .= "'$ring_group_strategy', "; - $sql .= "'$ring_group_timeout_sec', "; - $sql .= "'$ring_group_timeout_app', "; - $sql .= "'$ring_group_timeout_data', "; - $sql .= "'$ring_group_cid_name_prefix', "; - $sql .= "'$ring_group_ringback', "; - $sql .= "'$ring_group_enabled', "; - $sql .= "'$ring_group_description', "; - $sql .= "'$dialplan_uuid' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); - } //if ($action == "add") + //set the app and data + $ring_group_timeout_array = explode(":", $ring_group_timeout_action); + $ring_group_timeout_app = array_shift($ring_group_timeout_array); + $ring_group_timeout_data = join(':', $ring_group_timeout_array); + $_POST["ring_group_timeout_app"] = $ring_group_timeout_app; + $_POST["ring_group_timeout_data"] = $ring_group_timeout_data; - if ($action == "update") { - $sql = "update v_ring_groups set "; - $sql .= "ring_group_name = '$ring_group_name', "; - $sql .= "ring_group_extension = '$ring_group_extension', "; - if (if_group("superadmin")) { - $sql .= "ring_group_context = '$ring_group_context', "; + //remove the action + unset($_POST["ring_group_timeout_action"]); + + //remove the user_uuid + unset($_POST["user_uuid"]); + + //add the domain_uuid + if (strlen($_POST["domain_uuid"]) == 0) { + $_POST["domain_uuid"] = $_SESSION['domain_uuid']; } - $sql .= "ring_group_strategy = '$ring_group_strategy', "; - $sql .= "ring_group_timeout_sec = '$ring_group_timeout_sec', "; - $sql .= "ring_group_timeout_app = '$ring_group_timeout_app', "; - $sql .= "ring_group_timeout_data = '$ring_group_timeout_data', "; - $sql .= "ring_group_cid_name_prefix = '$ring_group_cid_name_prefix', "; - $sql .= "ring_group_ringback = '$ring_group_ringback', "; - $sql .= "ring_group_enabled = '$ring_group_enabled', "; - $sql .= "ring_group_description = '$ring_group_description' "; - //$sql .= "dialplan_uuid = '$dialplan_uuid' "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and ring_group_uuid = '$ring_group_uuid' "; - $db->exec(check_sql($sql)); - unset($sql); - } - if ($action == "update" || $action == "add") { - //if destination then add it to ring group destinations - if (strlen($destination_number) > 0) { - $ring_group_destination_uuid = uuid(); - $sql = "insert into v_ring_group_destinations "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "ring_group_uuid, "; - $sql .= "ring_group_destination_uuid, "; - $sql .= "destination_delay, "; - $sql .= "destination_timeout, "; - $sql .= "destination_prompt, "; - $sql .= "destination_number "; - $sql .= ") "; - $sql .= "values "; - $sql .= "("; - $sql .= "'".$_SESSION['domain_uuid']."', "; - $sql .= "'$ring_group_uuid', "; - $sql .= "'$ring_group_destination_uuid', "; - $sql .= "'$destination_delay', "; - if (strlen($destination_timeout) > 0) { - $sql .= "'$destination_timeout', "; + //add the dialplan_uuid + if (strlen($_POST["dialplan_uuid"]) == 0) { + $dialplan_uuid = uuid(); + $_POST["dialplan_uuid"] = $dialplan_uuid; + } + + //update the ring group destinations array + $x = 0; + foreach ($_POST["ring_group_destinations"] as $row) { + //add the domain_uuid + if (strlen($_POST["ring_group_destinations"][$x]["domain_uuid"]) == 0) { + $_POST["ring_group_destinations"][$x]["domain_uuid"] = $_SESSION['domain_uuid']; } - else { - $sql .= "'30', "; + //unset the empty row + if (strlen($_POST["ring_group_destinations"][$x]["destination_number"]) == 0) { + unset($_POST["ring_group_destinations"][$x]); } - if (strlen($destination_prompt) > 0) { - $sql .= "'$destination_prompt', "; + //unset ring_group_destination_uuid if the field has no value + if (strlen($row["ring_group_destination_uuid"]) == 0) { + unset($_POST["ring_group_destinations"][$x]["ring_group_destination_uuid"]); } - else { - $sql .= "null, "; - } - $sql .= "'$destination_number' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); - } + //increment the row + $x++; + } - //delete from the dialplan details - $sql = "delete from v_dialplan_details "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and dialplan_uuid = '".$dialplan_uuid."' "; - $db->exec(check_sql($sql)); - unset($sql); + //save to the data + $orm = new orm; + $orm->name('ring_groups'); + if (strlen($ring_group_uuid) > 0) { + $orm->uuid($ring_group_uuid); + } + $orm->save($_POST); + $message = $orm->message; + if (strlen($ring_group_uuid) == 0) { + $ring_group_uuid = $message['uuid']; + $_GET["id"] = $ring_group_uuid; + } + } - //delete from the dialplan - $sql = "delete from v_dialplans "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and dialplan_uuid = '".$dialplan_uuid."' "; - $db->exec(check_sql($sql)); - unset($sql); + //delete the dialplan details + $sql = "delete from v_dialplan_details "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and dialplan_uuid = '".$dialplan_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - //add the dialplan - require_once "resources/classes/database.php"; - $database = new database; - $database->db = $db; - $database->table = "v_dialplans"; - $database->fields['domain_uuid'] = $_SESSION['domain_uuid']; - $database->fields['dialplan_uuid'] = $dialplan_uuid; - $database->fields['dialplan_name'] = $ring_group_name; - $database->fields['dialplan_order'] = '333'; - $database->fields['dialplan_context'] = $ring_group_context; - $database->fields['dialplan_enabled'] = 'true'; - $database->fields['dialplan_description'] = $ring_group_description; - $database->fields['app_uuid'] = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2'; - $database->add(); + //delete from the dialplan + $sql = "delete from v_dialplans "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and dialplan_uuid = '".$dialplan_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - //add the dialplan details - $database->table = "v_dialplan_details"; - $database->fields['domain_uuid'] = $_SESSION['domain_uuid']; - $database->fields['dialplan_uuid'] = $dialplan_uuid; - $database->fields['dialplan_detail_uuid'] = uuid(); - $database->fields['dialplan_detail_tag'] = 'condition'; //condition, action, antiaction - $database->fields['dialplan_detail_type'] = 'destination_number'; - $database->fields['dialplan_detail_data'] = '^'.$ring_group_extension.'$'; - $database->fields['dialplan_detail_order'] = '000'; - $database->add(); + //add the dialplan + $database = new database; + $database->db = $db; + $database->table = "v_dialplans"; + $database->fields['domain_uuid'] = $_SESSION['domain_uuid']; + $database->fields['dialplan_uuid'] = $dialplan_uuid; + $database->fields['dialplan_name'] = $ring_group_name; + $database->fields['dialplan_order'] = '333'; + $database->fields['dialplan_context'] = $ring_group_context; + $database->fields['dialplan_enabled'] = 'true'; + $database->fields['dialplan_description'] = $ring_group_description; + $database->fields['app_uuid'] = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2'; + $database->add(); - //add the dialplan details - $database->table = "v_dialplan_details"; - $database->fields['domain_uuid'] = $_SESSION['domain_uuid']; - $database->fields['dialplan_uuid'] = $dialplan_uuid; - $database->fields['dialplan_detail_uuid'] = uuid(); - $database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction - $database->fields['dialplan_detail_type'] = 'set'; - $database->fields['dialplan_detail_data'] = 'ring_group_uuid='.$ring_group_uuid; - $database->fields['dialplan_detail_order'] = '025'; - $database->add(); + //add the dialplan details + $database->table = "v_dialplan_details"; + $database->fields['domain_uuid'] = $_SESSION['domain_uuid']; + $database->fields['dialplan_uuid'] = $dialplan_uuid; + $database->fields['dialplan_detail_uuid'] = uuid(); + $database->fields['dialplan_detail_tag'] = 'condition'; //condition, action, antiaction + $database->fields['dialplan_detail_type'] = 'destination_number'; + $database->fields['dialplan_detail_data'] = '^'.$ring_group_extension.'$'; + $database->fields['dialplan_detail_order'] = '000'; + $database->add(); - //add the dialplan details - $database->table = "v_dialplan_details"; - $database->fields['domain_uuid'] = $_SESSION['domain_uuid']; - $database->fields['dialplan_uuid'] = $dialplan_uuid; - $database->fields['dialplan_detail_uuid'] = uuid(); - $database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction - $database->fields['dialplan_detail_type'] = 'lua'; - $database->fields['dialplan_detail_data'] = 'app.lua ring_groups'; - $database->fields['dialplan_detail_order'] = '030'; - $database->add(); + //add the dialplan details + $database->table = "v_dialplan_details"; + $database->fields['domain_uuid'] = $_SESSION['domain_uuid']; + $database->fields['dialplan_uuid'] = $dialplan_uuid; + $database->fields['dialplan_detail_uuid'] = uuid(); + $database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction + $database->fields['dialplan_detail_type'] = 'set'; + $database->fields['dialplan_detail_data'] = 'ring_group_uuid='.$ring_group_uuid; + $database->fields['dialplan_detail_order'] = '025'; + $database->add(); - //save the xml - save_dialplan_xml(); + //add the dialplan details + $database->table = "v_dialplan_details"; + $database->fields['domain_uuid'] = $_SESSION['domain_uuid']; + $database->fields['dialplan_uuid'] = $dialplan_uuid; + $database->fields['dialplan_detail_uuid'] = uuid(); + $database->fields['dialplan_detail_tag'] = 'action'; //condition, action, antiaction + $database->fields['dialplan_detail_type'] = 'lua'; + $database->fields['dialplan_detail_data'] = 'app.lua ring_groups'; + $database->fields['dialplan_detail_order'] = '030'; + $database->add(); - //apply settings reminder - $_SESSION["reload_xml"] = true; + //save the xml + save_dialplan_xml(); - //delete the dialplan context from memcache - $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); - if ($fp) { - $switch_cmd = "memcache delete dialplan:".$ring_group_context; - $switch_result = event_socket_request($fp, 'api '.$switch_cmd); - } + //apply settings reminder + $_SESSION["reload_xml"] = true; + + //delete the dialplan context from memcache + $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); + if ($fp) { + $switch_cmd = "memcache delete dialplan:".$ring_group_context; + $switch_result = event_socket_request($fp, 'api '.$switch_cmd); + } + + //set the message + if ($action == "add") { + //save the message to a session variable + $_SESSION['message'] = $text['message-add']; + //redirect the browser + header("Location: ring_group_edit.php?id=$ring_group_uuid"); + exit; + } + if ($action == "update") { + //save the message to a session variable + $_SESSION['message'] = $text['message-update']; + } - //redirect the browser - require_once "resources/header.php"; - echo "\n"; - echo "
\n"; - if ($action == "add") { - echo $text['message-add']."\n"; - } - if ($action == "update") { - echo $text['message-update']."\n"; - } - echo "
\n"; - require_once "resources/footer.php"; - exit; - } - } //if ($_POST["persistformvar"] != "true") } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form - if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { - $ring_group_uuid = $_GET["id"]; + if (strlen($ring_group_uuid) == 0) { $ring_group_uuid = check_str($_GET["id"]); } + if (strlen($ring_group_uuid) > 0) { $sql = "select * from v_ring_groups "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and ring_group_uuid = '$ring_group_uuid' "; @@ -413,6 +339,43 @@ else { } } +//get the ring group destination array + if ($action == "add") { $x = 0; $limit = 5; } + if (strlen($ring_group_uuid) > 0) { + $sql = "SELECT * FROM v_ring_group_destinations "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and ring_group_uuid = '".$ring_group_uuid."' "; + $sql .= "order by destination_delay, destination_number asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $ring_group_destinations = $prep_statement->fetchAll(PDO::FETCH_NAMED); + $x = count($ring_group_destinations); + $limit = $x + 1; + } + + while($x < $limit) { + $ring_group_destinations[$x]['destination_number'] = ''; + $ring_group_destinations[$x]['destination_delay'] = ''; + $ring_group_destinations[$x]['destination_timeout'] = ''; + $ring_group_destinations[$x]['destination_prompt_confirm'] = ''; + $x++; + } + unset($limit); + +//get the ring group users + if (strlen($ring_group_uuid) > 0) { + $sql = "SELECT u.username, r.user_uuid, r.ring_group_uuid FROM v_ring_group_users as r, v_users as u "; + $sql .= "where r.user_uuid = u.user_uuid "; + $sql .= "and u.user_enabled = 'true' "; + $sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and r.ring_group_uuid = '".$ring_group_uuid."' "; + $sql .= "order by u.username asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $ring_group_users = $prep_statement->fetchAll(PDO::FETCH_NAMED); + //$ring_group_users[$x]['username'] = ''; + } + //set defaults if (strlen($ring_group_timeout_sec) == 0) { $ring_group_timeout_sec = '30'; } if (strlen($ring_group_enabled) == 0) { $ring_group_enabled = 'true'; } @@ -443,7 +406,7 @@ else { echo "\n"; echo "".$text['label-ring-group']."\n"; echo "\n"; - echo " \n"; + echo " \n"; echo " \n"; echo "\n"; echo "\n"; @@ -495,6 +458,9 @@ else { echo "\n"; echo " \n"; } - } - unset($sql, $result); - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - destination_select('destination_delay', $destination_delay, '0'); - echo " \n"; - echo " \n"; - destination_select('destination_timeout', $destination_timeout, '30'); - echo " \n"; - - if (permission_exists('ring_group_prompt')) { + echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + + echo " \n"; + echo " \n"; + + if (permission_exists('ring_group_prompt')) { + echo " \n"; + echo " \n"; + echo " \n"; + } + echo " \n"; + //echo " \n"; + echo " \n"; + echo " \n"; + if (strlen($row['ring_group_destination_uuid']) > 0) { + //echo " $v_link_label_edit\n"; + echo " $v_link_label_delete\n"; + } + echo " \n"; + echo " \n"; + + echo " "; + echo " "; + $x++; + } + echo " \n"; echo " ".$text['description-destinations']."\n"; echo "
\n"; echo " "; @@ -612,14 +578,14 @@ else { echo " ".$text['label-call-timeout'].":\n"; echo "\n"; echo "\n"; - echo " \n"; - echo "
\n"; + echo " \n"; + echo "
\n"; echo $text['description-timeout']."\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo " ".$text['label-timeout_destination'].":\n"; echo "\n"; echo "\n"; @@ -694,17 +660,7 @@ else { echo " ".$text['label-user_list'].":"; echo " "; echo " \n"; - $sql = "SELECT u.username, r.user_uuid, r.ring_group_uuid FROM v_ring_group_users as r, v_users as u "; - $sql .= "where r.user_uuid = u.user_uuid "; - $sql .= "and u.user_enabled = 'true' "; - $sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and r.ring_group_uuid = '".$ring_group_uuid."' "; - $sql .= "order by u.username asc "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - $result_count = count($result); - foreach($result as $field) { + foreach($ring_group_users as $field) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " "; echo "
".$field['username']."\n"; @@ -773,11 +729,13 @@ else { echo "
\n"; - if ($action == "update") { + if (strlen($dialplan_uuid) > 0) { echo " \n"; + } + if (strlen($ring_group_uuid) > 0) { echo " \n"; } - echo " \n"; + echo " \n"; echo "
";