remove instances where a pointer is used in a foreach loop for value (#7108)
This commit is contained in:
parent
0583c5b429
commit
2cbb4dbc31
|
|
@ -77,7 +77,7 @@ if (!class_exists('basic_operator_panel')) {
|
|||
|
||||
//store extension status by user uuid
|
||||
if (isset($extensions)) {
|
||||
foreach($extensions as &$row) {
|
||||
foreach ($extensions as $row) {
|
||||
if ($row['user_uuid'] != '') {
|
||||
$ext_user_status[$row['user_uuid']] = $row['user_status'];
|
||||
unset($row['user_status']);
|
||||
|
|
@ -97,7 +97,7 @@ if (!class_exists('basic_operator_panel')) {
|
|||
//build the response
|
||||
$x = 0;
|
||||
if (isset($extensions)) {
|
||||
foreach($extensions as &$row) {
|
||||
foreach ($extensions as $row) {
|
||||
$user = $row['extension'];
|
||||
if (!empty($row['number_alias'])) {
|
||||
$user = $row['number_alias'];
|
||||
|
|
@ -143,7 +143,7 @@ if (!class_exists('basic_operator_panel')) {
|
|||
//add the active call details
|
||||
$found = false;
|
||||
if (isset($json_array['rows'])) {
|
||||
foreach($json_array['rows'] as &$field) {
|
||||
foreach ($json_array['rows'] as $field) {
|
||||
$presence_id = $field['presence_id'];
|
||||
$presence = explode("@", $presence_id);
|
||||
$presence_id = $presence[0];
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ring_gr
|
|||
if (permission_exists('call_block_extension')) {
|
||||
if (!empty($extensions)) {
|
||||
echo " <optgroup label='".$text['label-extension']."'>\n";
|
||||
foreach ($extensions as &$row) {
|
||||
foreach ($extensions as $row) {
|
||||
$selected = ($call_block_app == 'extension' && $call_block_data == $row['extension']) ? "selected='selected'" : null;
|
||||
echo " <option value='extension:".urlencode($row["extension"])."' ".$selected.">".escape($row['extension'])." ".escape($row['description'])."</option>\n";
|
||||
}
|
||||
|
|
@ -501,7 +501,7 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ring_gr
|
|||
if (permission_exists('call_block_ivr')) {
|
||||
if (!empty($ivrs)) {
|
||||
echo " <optgroup label='".$text['label-ivr_menus']."'>\n";
|
||||
foreach ($ivrs as &$row) {
|
||||
foreach ($ivrs as $row) {
|
||||
$selected = ($call_block_app == 'ivr' && $call_block_data == $row['ivr_menu_extension']) ? "selected='selected'" : null;
|
||||
echo " <option value='ivr:".urlencode($row["ivr_menu_extension"])."' ".$selected.">".escape($row['ivr_menu_name'])." ".escape($row['ivr_menu_extension'])."</option>\n";
|
||||
}
|
||||
|
|
@ -511,7 +511,7 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ring_gr
|
|||
if (permission_exists('call_block_ring_group')) {
|
||||
if (!empty($ring_groups)) {
|
||||
echo " <optgroup label='".$text['label-ring_groups']."'>\n";
|
||||
foreach ($ring_groups as &$row) {
|
||||
foreach ($ring_groups as $row) {
|
||||
$selected = ($call_block_app == 'ring_group' && $call_block_data == $row['ring_group_extension']) ? "selected='selected'" : null;
|
||||
echo " <option value='ring_group:".urlencode($row["ring_group_extension"])."' ".$selected.">".escape($row['ring_group_name'])." ".escape($row['ring_group_extension'])."</option>\n";
|
||||
}
|
||||
|
|
@ -521,7 +521,7 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ring_gr
|
|||
if (permission_exists('call_block_voicemail')) {
|
||||
if (!empty($voicemails)) {
|
||||
echo " <optgroup label='".$text['label-voicemail']."'>\n";
|
||||
foreach ($voicemails as &$row) {
|
||||
foreach ($voicemails as $row) {
|
||||
$selected = ($call_block_app == 'voicemail' && $call_block_data == $row['voicemail_id']) ? "selected='selected'" : null;
|
||||
echo " <option value='voicemail:".urlencode($row["voicemail_id"])."' ".$selected.">".escape($row['voicemail_id'])." ".escape($row['voicemail_description'])."</option>\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ if ($domains_processed == 1) {
|
|||
$sql .= "and (t.call_center_queue_uuid is null or t.call_center_agent_uuid is null) ";
|
||||
$tiers = $database->select($sql, null, 'all');
|
||||
if (!empty($tiers)) {
|
||||
foreach ($tiers as $index => &$row) {
|
||||
foreach ($tiers as $index => $row) {
|
||||
if ($row['call_center_queue_uuid'] == null && $row['queue_uuid'] != null) {
|
||||
$array['call_center_tiers'][$index]['call_center_queue_uuid'] = $row['queue_uuid'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@
|
|||
unset($sql, $parameters);
|
||||
|
||||
if (!empty($tiers)) {
|
||||
foreach ($tiers as &$row) {
|
||||
foreach ($tiers as $row) {
|
||||
$call_center_agent_uuid = $row["call_center_agent_uuid"];
|
||||
$call_center_queue_uuid = $row["call_center_queue_uuid"];
|
||||
$queue_extension = $row["queue_extension"];
|
||||
|
|
@ -543,7 +543,7 @@
|
|||
unset($sql, $parameters);
|
||||
|
||||
if (!empty($call_center_queues)) {
|
||||
foreach ($call_center_queues as &$row) {
|
||||
foreach ($call_center_queues as $row) {
|
||||
$queue_name = $row["queue_name"];
|
||||
$dialplan_uuid = $row["dialplan_uuid"];
|
||||
$database_queue_name = $row["queue_name"];
|
||||
|
|
|
|||
|
|
@ -468,7 +468,7 @@
|
|||
$result = $database->select($sql, $parameters, 'all');
|
||||
|
||||
unset($destinations);
|
||||
foreach ($result as $x => &$row) {
|
||||
foreach ($result as $x => $row) {
|
||||
$destinations[$x]['uuid'] = $row["follow_me_destination_uuid"];
|
||||
$destinations[$x]['destination'] = $row["follow_me_destination"];
|
||||
$destinations[$x]['delay'] = $row["follow_me_delay"];
|
||||
|
|
@ -510,7 +510,7 @@
|
|||
echo "<script type=\"text/javascript\">\n";
|
||||
echo "\$(function() {\n";
|
||||
echo " var extensions = [\n";
|
||||
foreach ($extensions as &$row) {
|
||||
foreach ($extensions as $row) {
|
||||
if (empty($number_alias)) {
|
||||
echo " \"".escape($row["extension"])."\",\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
//build a new array with domain_name
|
||||
$rows = array();
|
||||
if (isset($results["rows"])) {
|
||||
foreach ($results["rows"] as &$row) {
|
||||
foreach ($results["rows"] as $row) {
|
||||
//get the domain
|
||||
if (!empty($row['context']) && $row['context'] != "public" && $row['context'] != "default") {
|
||||
if (substr_count($row['context'], '@') > 0) {
|
||||
|
|
@ -186,7 +186,7 @@
|
|||
|
||||
if (is_array($rows)) {
|
||||
$x = 0;
|
||||
foreach ($rows as &$row) {
|
||||
foreach ($rows as $row) {
|
||||
|
||||
//set the php variables
|
||||
foreach ($row as $key => $value) {
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@
|
|||
$parameters['src'] = $src;
|
||||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
$dest_cid_name = $row["outbound_caller_id_name"];
|
||||
$dest_cid_number = $row["outbound_caller_id_number"];
|
||||
break; //limit to 1 row
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ if (!class_exists('conference_centers')) {
|
|||
$database = new database;
|
||||
$conference_sessions = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($conference_sessions)) {
|
||||
foreach ($conference_sessions as &$row) {
|
||||
foreach ($conference_sessions as $row) {
|
||||
$recording = $row['recording'];
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ if (!empty($_GET)) {
|
|||
$result = $database->select($sql, $parameters, 'all');
|
||||
if (!empty($result)) {
|
||||
$e = 1;
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
$vcard->data['email'.$e] = $row["email_address"];
|
||||
if ($e++ == 2) { break; } //limit to 2 rows
|
||||
}
|
||||
|
|
@ -125,7 +125,7 @@ if (!empty($_GET)) {
|
|||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
$phone_label = $row["phone_label"];
|
||||
$phone_number = $row["phone_number"];
|
||||
if ($phone_label == $text['option-work']) { $vcard_phone_type = 'work'; }
|
||||
|
|
@ -154,7 +154,7 @@ if (!empty($_GET)) {
|
|||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
$address_type = $row["address_type"];
|
||||
$address_street = $row["address_street"];
|
||||
$address_extended = $row["address_extended"];
|
||||
|
|
|
|||
|
|
@ -1768,7 +1768,7 @@
|
|||
echo " <select name='fax_uuid' id='fax_uuid' class='formfld' style='".$select_style."'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
if ($row["fax_uuid"] == $fax_uuid) {
|
||||
echo " <option value='".escape($row["fax_uuid"])."' selected='selected'>".escape($row["fax_extension"])." ".escape($row["fax_name"])."</option>\n";
|
||||
}
|
||||
|
|
@ -1796,7 +1796,7 @@
|
|||
echo " <select name='provider_uuid' id='provider_uuid' class='formfld' style='".$select_style."'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if (!empty($providers)) {
|
||||
foreach ($providers as &$row) {
|
||||
foreach ($providers as $row) {
|
||||
if ($row["provider_uuid"] == $provider_uuid) {
|
||||
echo " <option value='".escape($row["provider_uuid"])."' selected='selected'>".escape($row["provider_name"])."</option>\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ if (!class_exists('destinations')) {
|
|||
//get the array from the app_config.php files
|
||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
|
||||
$x = 0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
try {
|
||||
include($config_path);
|
||||
}
|
||||
|
|
@ -204,8 +204,8 @@ if (!class_exists('destinations')) {
|
|||
$x++;
|
||||
}
|
||||
$i = 0;
|
||||
foreach ($apps as $x => &$app) {
|
||||
if (isset($app['destinations'])) foreach ($app['destinations'] as &$row) {
|
||||
foreach ($apps as $x => $app) {
|
||||
if (isset($app['destinations'])) foreach ($app['destinations'] as $row) {
|
||||
if (permission_exists($this->singular($row["name"])."_destinations")) {
|
||||
$this->destinations[] = $row;
|
||||
}
|
||||
|
|
@ -569,7 +569,7 @@ if (!class_exists('destinations')) {
|
|||
//get the array from the app_config.php files
|
||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
|
||||
$x = 0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
try {
|
||||
include($config_path);
|
||||
}
|
||||
|
|
@ -579,9 +579,9 @@ if (!class_exists('destinations')) {
|
|||
$x++;
|
||||
}
|
||||
$i = 0;
|
||||
foreach ($apps as $x => &$app) {
|
||||
foreach ($apps as $x => $app) {
|
||||
if (isset($app['destinations'])) {
|
||||
foreach ($app['destinations'] as &$row) {
|
||||
foreach ($app['destinations'] as $row) {
|
||||
$this->destinations[] = $row;
|
||||
}
|
||||
}
|
||||
|
|
@ -779,7 +779,7 @@ if (!class_exists('destinations')) {
|
|||
//get the array from the app_config.php files
|
||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
|
||||
$x = 0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
try {
|
||||
include($config_path);
|
||||
}
|
||||
|
|
@ -789,9 +789,9 @@ if (!class_exists('destinations')) {
|
|||
$x++;
|
||||
}
|
||||
$i = 0;
|
||||
foreach ($apps as $x => &$app) {
|
||||
foreach ($apps as $x => $app) {
|
||||
if (isset($app['destinations'])) {
|
||||
foreach ($app['destinations'] as &$row) {
|
||||
foreach ($app['destinations'] as $row) {
|
||||
$this->destinations[] = $row;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ if ($domains_processed == 1) {
|
|||
$sql .= "and k.device_key_vendor is null ";
|
||||
$device_keys = $database->select($sql, null, 'all');
|
||||
if (!empty($device_keys)) {
|
||||
foreach ($device_keys as $index => &$row) {
|
||||
foreach ($device_keys as $index => $row) {
|
||||
$array['device_keys'][$index]['device_key_uuid'] = $row["device_key_uuid"];
|
||||
$array['device_keys'][$index]['device_key_vendor'] = $row["device_vendor"];
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ if ($domains_processed == 1) {
|
|||
|
||||
//loop through the device_keys to build the data array
|
||||
if (!empty($device_profile_keys)) {
|
||||
foreach ($device_profile_keys as $index => &$row) {
|
||||
foreach ($device_profile_keys as $index => $row) {
|
||||
$array['device_profile_keys'][$index]['device_profile_key_uuid'] = $row["device_key_uuid"];
|
||||
$array['device_profile_keys'][$index]['domain_uuid'] = $row["domain_uuid"];
|
||||
$array['device_profile_keys'][$index]['device_profile_uuid'] = $row["device_profile_uuid"];
|
||||
|
|
@ -131,7 +131,7 @@ if ($domains_processed == 1) {
|
|||
|
||||
//loop through the device_keys to build the data array
|
||||
if (!empty($device_profile_keys)) {
|
||||
foreach ($device_profile_keys as $index => &$row) {
|
||||
foreach ($device_profile_keys as $index => $row) {
|
||||
$array['device_profile_settings'][$index]['device_profile_setting_uuid'] = $row["device_setting_uuid"];
|
||||
$array['device_profile_settings'][$index]['domain_uuid'] = $row["domain_uuid"];
|
||||
$array['device_profile_settings'][$index]['device_profile_uuid'] = $row["device_profile_uuid"];
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
}
|
||||
|
||||
//find and remove the "|2" that denotes a duplicate header
|
||||
foreach ($headers as &$header) {
|
||||
foreach ($headers as $header) {
|
||||
$pos = strpos($header, '|');
|
||||
if ($pos !== false) {
|
||||
$header = substr($header, 0, $pos);
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@
|
|||
//remove empty device keys
|
||||
if (isset($row['device_keys'])) {
|
||||
$y = 0;
|
||||
foreach ($row['device_keys'] as &$sub_row) {
|
||||
foreach ($row['device_keys'] as $sub_row) {
|
||||
if (count($sub_row) == 2) {
|
||||
unset($array['devices'][$x]['device_keys']);
|
||||
}
|
||||
|
|
@ -377,7 +377,7 @@
|
|||
//remove empty device lines
|
||||
if (isset($row['device_lines'])) {
|
||||
$y = 0;
|
||||
foreach ($row['device_lines'] as &$sub_row) {
|
||||
foreach ($row['device_lines'] as $sub_row) {
|
||||
if (count($sub_row) == 2) {
|
||||
unset($array['devices'][$x]['device_lines']);
|
||||
}
|
||||
|
|
@ -413,7 +413,7 @@
|
|||
//remove empty device keys
|
||||
if (isset($row['device_keys'])) {
|
||||
$y = 0;
|
||||
foreach ($row['device_keys'] as &$sub_row) {
|
||||
foreach ($row['device_keys'] as $sub_row) {
|
||||
if (count($sub_row) == 2) {
|
||||
unset($array['devices'][$x]['device_keys']);
|
||||
}
|
||||
|
|
@ -424,7 +424,7 @@
|
|||
//remove empty device lines
|
||||
if (isset($row['device_lines'])) {
|
||||
$y = 0;
|
||||
foreach ($row['device_lines'] as &$sub_row) {
|
||||
foreach ($row['device_lines'] as $sub_row) {
|
||||
if (count($sub_row) == 2) {
|
||||
unset($array['devices'][$x]['device_lines']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@
|
|||
$parameters['device_profile_uuid'] = $device_profile_uuid;
|
||||
$database = new database;
|
||||
$result = $database->execute($sql, $parameters, 'all');
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
$domain_uuid = $row["domain_uuid"];
|
||||
$device_profile_name = $row["device_profile_name"];
|
||||
$device_profile_keys = $row["device_profile_keys"] ?? null;
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@
|
|||
$vendor_function_groups = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
unset($group_list);
|
||||
foreach ($vendor_function_groups as &$sub_row) {
|
||||
foreach ($vendor_function_groups as $sub_row) {
|
||||
$group_list[] = escape($sub_row["group_name"]).(($sub_row['group_domain_uuid'] != '') ? "@".escape($_SESSION['domains'][$sub_row['group_domain_uuid']]['domain_name']) : null);
|
||||
}
|
||||
$group_list = isset($group_list) ? implode(', ', $group_list) : '';
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@
|
|||
|
||||
//add or update the device keys
|
||||
if (is_array($_POST['device_keys'])) {
|
||||
foreach ($_POST['device_keys'] as &$row) {
|
||||
foreach ($_POST['device_keys'] as $row) {
|
||||
|
||||
//validate the data
|
||||
$save = true;
|
||||
|
|
@ -187,7 +187,7 @@
|
|||
//process the profile keys
|
||||
if (!empty($row["device_profile_uuid"])) {
|
||||
//get the profile key settings from the array
|
||||
foreach ($device_profile_keys as &$field) {
|
||||
foreach ($device_profile_keys as $field) {
|
||||
if ($device_key_uuid == $field["device_key_uuid"]) {
|
||||
$database = $field;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -684,7 +684,7 @@
|
|||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
echo " <select name='destination_uuid' id='destination_uuid' class='formfld' >\n";
|
||||
echo " <option></option>\n";
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
if (empty($row["dialplan_uuid"])) {
|
||||
echo " <option value='".escape($row["destination_uuid"])."' style=\"font-weight:bold;\">".escape($row["destination_number"])." ".escape($row["destination_description"])."</option>\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@
|
|||
$group = 0;
|
||||
$order = 5;
|
||||
if (isset($dialplan['condition'])) {
|
||||
foreach ($dialplan['condition'] as &$row) {
|
||||
foreach ($dialplan['condition'] as $row) {
|
||||
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $domain_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
|
|
@ -369,7 +369,7 @@
|
|||
}
|
||||
$order = $order + 5;
|
||||
if (isset($row['action'])) {
|
||||
foreach ($row['action'] as &$row2) {
|
||||
foreach ($row['action'] as $row2) {
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $domain_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
|
|
@ -396,7 +396,7 @@
|
|||
}
|
||||
}
|
||||
if (isset($row['anti-action'])) {
|
||||
foreach ($row['anti-action'] as &$row2) {
|
||||
foreach ($row['anti-action'] as $row2) {
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $domain_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'anti-action';
|
||||
|
|
@ -515,7 +515,7 @@
|
|||
unset($sql, $parameters);
|
||||
$x = 0; $y = 0;
|
||||
if (!empty($dialplans)) {
|
||||
foreach ($dialplans as &$row) {
|
||||
foreach ($dialplans as $row) {
|
||||
//if the previous dialplan uuid has not been set then set it
|
||||
if (!isset($previous_dialplan_uuid)) { $previous_dialplan_uuid = $row['dialplan_uuid']; }
|
||||
|
||||
|
|
@ -1027,7 +1027,7 @@
|
|||
|
||||
//get the array of xml files and then process thm
|
||||
$xml_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/resources/switch/conf/dialplan/*.xml");
|
||||
foreach ($xml_list as &$xml_file) {
|
||||
foreach ($xml_list as $xml_file) {
|
||||
//get and parse the xml
|
||||
$xml_string = file_get_contents($xml_file);
|
||||
//get the order number prefix from the file name
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@
|
|||
$group = 0;
|
||||
$order = 5;
|
||||
if (isset($dialplan['condition'])) {
|
||||
foreach ($dialplan['condition'] as &$row) {
|
||||
foreach ($dialplan['condition'] as $row) {
|
||||
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $domain_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
|
|
@ -374,7 +374,7 @@
|
|||
}
|
||||
$order = $order + 5;
|
||||
if (isset($row['action'])) {
|
||||
foreach ($row['action'] as &$row2) {
|
||||
foreach ($row['action'] as $row2) {
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $domain_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
|
|
@ -401,7 +401,7 @@
|
|||
}
|
||||
}
|
||||
if (isset($row['anti-action'])) {
|
||||
foreach ($row['anti-action'] as &$row2) {
|
||||
foreach ($row['anti-action'] as $row2) {
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $domain_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'anti-action';
|
||||
|
|
@ -518,7 +518,7 @@
|
|||
unset($sql, $parameters);
|
||||
$x = 0; $y = 0;
|
||||
if (!empty($dialplans)) {
|
||||
foreach ($dialplans as &$row) {
|
||||
foreach ($dialplans as $row) {
|
||||
//if the previous dialplan uuid has not been set then set it
|
||||
if (!isset($previous_dialplan_uuid)) { $previous_dialplan_uuid = $row['dialplan_uuid']; }
|
||||
|
||||
|
|
@ -1087,7 +1087,7 @@
|
|||
|
||||
//get the array of xml files and then process thm
|
||||
$xml_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/resources/switch/conf/dialplan/*.xml");
|
||||
foreach ($xml_list as &$xml_file) {
|
||||
foreach ($xml_list as $xml_file) {
|
||||
//get and parse the xml
|
||||
$xml_string = file_get_contents($xml_file);
|
||||
//get the order number prefix from the file name
|
||||
|
|
|
|||
|
|
@ -1474,7 +1474,7 @@
|
|||
if (!empty($destinations)) {
|
||||
echo " <select name='outbound_caller_id_name' id='outbound_caller_id_name' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach ($destinations as &$row) {
|
||||
foreach ($destinations as $row) {
|
||||
if(!empty($row["destination_caller_id_name"])){
|
||||
if (!empty($outbound_caller_id_name) && $row["destination_caller_id_name"] == $outbound_caller_id_name) {
|
||||
echo " <option value='".escape($row["destination_caller_id_name"])."' selected='selected'>".escape($row["destination_caller_id_name"])."</option>\n";
|
||||
|
|
@ -1511,7 +1511,7 @@
|
|||
if (!empty($destinations)) {
|
||||
echo " <select name='outbound_caller_id_number' id='outbound_caller_id_number' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach ($destinations as &$row) {
|
||||
foreach ($destinations as $row) {
|
||||
$tmp = $row["destination_caller_id_number"];
|
||||
if(empty($tmp)){
|
||||
$tmp = $row["destination_number"];
|
||||
|
|
@ -1552,7 +1552,7 @@
|
|||
if (!empty($emergency_destinations)) {
|
||||
echo " <select name='emergency_caller_id_name' id='emergency_caller_id_name' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach ($emergency_destinations as &$row) {
|
||||
foreach ($emergency_destinations as $row) {
|
||||
$tmp = $row["destination_caller_id_name"];
|
||||
if(empty($tmp)){
|
||||
$tmp = $row["destination_description"];
|
||||
|
|
@ -1598,7 +1598,7 @@
|
|||
if (permission_exists('emergency_caller_id_select_empty')) {
|
||||
echo " <option value=''></option>\n";
|
||||
}
|
||||
foreach ($emergency_destinations as &$row) {
|
||||
foreach ($emergency_destinations as $row) {
|
||||
$tmp = $row["destination_caller_id_number"];
|
||||
if(empty($tmp)){
|
||||
$tmp = $row["destination_number"];
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ if (!class_exists('extension')) {
|
|||
$call_group = $row['call_group'] ?? '';
|
||||
$call_group = str_replace(";", ",", $call_group);
|
||||
$tmp_array = explode(",", $call_group);
|
||||
foreach ($tmp_array as &$tmp_call_group) {
|
||||
foreach ($tmp_array as $tmp_call_group) {
|
||||
$tmp_call_group = trim($tmp_call_group);
|
||||
if (!empty($tmp_call_group)) {
|
||||
if (empty($call_group_array[$tmp_call_group])) {
|
||||
|
|
@ -508,7 +508,7 @@ if (!class_exists('extension')) {
|
|||
$xml .= " to keep searching for the user in the directory.\n";
|
||||
$xml .= " -->\n";
|
||||
$extension_array = explode(",", $extension_list);
|
||||
foreach ($extension_array as &$tmp_extension) {
|
||||
foreach ($extension_array as $tmp_extension) {
|
||||
$xml .= " <user id=\"$tmp_extension\" type=\"pointer\"/>\n";
|
||||
}
|
||||
$xml .= " </users>\n";
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@
|
|||
if (count($destinations) > 0) {
|
||||
echo "<select class='formfld' name='extensions[".$x."][outbound_caller_id]' id='outbound_caller_id_number_".$x."' style='width: 100%; min-width: 150px;'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach ($destinations as &$field) {
|
||||
foreach ($destinations as $field) {
|
||||
if (!empty($field['destination_caller_id_number'])) {
|
||||
echo "<option value='".escape($field['destination_caller_id_name'])."@".escape($field['destination_caller_id_number'])."' ".($row['outbound_caller_id_number'] == $field['destination_caller_id_number'] ? "selected='selected'" : null).">".escape($field['destination_caller_id_name'])." ".escape($field['destination_caller_id_number'])."</option>\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ unset($sql);
|
|||
function arr_to_map(&$arr){
|
||||
if (!empty($arr)){
|
||||
$map = Array();
|
||||
foreach($arr as &$val){
|
||||
foreach ($arr as $val){
|
||||
$map[$val] = true;
|
||||
}
|
||||
return $map;
|
||||
|
|
@ -187,17 +187,17 @@ if (!empty($result) && @sizeof($result) != 0) {
|
|||
|
||||
//Debug print
|
||||
print('attachments:' . "\n");
|
||||
foreach($message['attachments'] as &$attachment){
|
||||
foreach ($message['attachments'] as $attachment){
|
||||
print(' - ' . $attachment['type'] . ' - ' . $attachment['name'] . ': ' . $attachment['size'] . ' disposition: ' . $attachment['disposition'] . "\n");
|
||||
}
|
||||
print('messages:' . "\n");
|
||||
foreach($message['messages'] as &$msg){
|
||||
foreach ($message['messages'] as $msg){
|
||||
print(' - ' . $msg['type'] . ' - ' . $msg['size'] . "\n");
|
||||
// print($msg['data']);
|
||||
// print("\n--------------------------------------------------------\n");
|
||||
}
|
||||
|
||||
foreach($message['messages'] as &$msg){
|
||||
foreach ($message['messages'] as $msg){
|
||||
if(($msg['size'] > 0)) {
|
||||
$fax_message = $msg['data'];
|
||||
break;
|
||||
|
|
@ -217,7 +217,7 @@ if (!empty($result) && @sizeof($result) != 0) {
|
|||
$emailed_files = Array();
|
||||
$attachments = $message['attachments'];
|
||||
if (sizeof($attachments) > 0) {
|
||||
foreach ($attachments as &$attachment) {
|
||||
foreach ($attachments as $attachment) {
|
||||
$fax_file_extension = pathinfo($attachment['name'], PATHINFO_EXTENSION);
|
||||
|
||||
//block unknown files
|
||||
|
|
|
|||
|
|
@ -893,7 +893,7 @@ if (!$included) {
|
|||
|
||||
//build the contact labels
|
||||
if (is_array($contacts) && @sizeof($contacts) != 0) {
|
||||
foreach ($contacts as &$row) {
|
||||
foreach ($contacts as $row) {
|
||||
if ($row['contact_organization'] != '') {
|
||||
$contact_option_label = $row['contact_organization'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ function parse_message($connection, $message_number, $option = null, $to_charset
|
|||
$flatten = Array(1 => $structure);
|
||||
}
|
||||
|
||||
foreach($flatten as $id => &$part){
|
||||
foreach ($flatten as $id => $part){
|
||||
switch($part->type) {
|
||||
case TYPETEXT:
|
||||
$message = parse_message_decode_text($connection, $part, $message_number, $id, $option, $to_charset);
|
||||
|
|
@ -39,7 +39,7 @@ function parse_message_decode_text($connection, &$part, $message_number, $id, $o
|
|||
if($msg && $to_charset){
|
||||
$charset = '';
|
||||
if(isset($part->parameters) && count($part->parameters)) {
|
||||
foreach($part->parameters as &$parameter){
|
||||
foreach ($part->parameters as $parameter){
|
||||
if($parameter->attribute == 'CHARSET') {
|
||||
$charset = $parameter->value;
|
||||
break;
|
||||
|
|
@ -123,7 +123,7 @@ function parse_message_get_type(&$part){
|
|||
}
|
||||
|
||||
function parse_message_flatten(&$structure, &$result = array(), $prefix = '', $index = 1, $fullPrefix = true) {
|
||||
foreach($structure as &$part) {
|
||||
foreach ($structure as $part) {
|
||||
if(isset($part->parts)) {
|
||||
if($part->type == TYPEMESSAGE) {
|
||||
parse_message_flatten($part->parts, $result, $prefix.$index.'.', 0, false);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
|
||||
//get the the ivr menu options
|
||||
$y = 0;
|
||||
foreach ($ivr_menu_options as &$row) {
|
||||
foreach ($ivr_menu_options as $row) {
|
||||
//update the uuids
|
||||
$row['ivr_menu_uuid'] = $ivr_menu_uuid;
|
||||
$row['ivr_menu_option_uuid'] = uuid();
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@
|
|||
$ivr->ivr_menu_uuid = $ivr_menu_uuid;
|
||||
$ivr_menus = $ivr->find();
|
||||
if (!empty($ivr_menus)) {
|
||||
foreach ($ivr_menus as &$row) {
|
||||
foreach ($ivr_menus as $row) {
|
||||
$dialplan_uuid = $row["dialplan_uuid"];
|
||||
$ivr_menu_name = $row["ivr_menu_name"];
|
||||
$ivr_menu_extension = $row["ivr_menu_extension"];
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@
|
|||
$database = new database;
|
||||
$sub_result = $database->select($sub_sql, $parameters, 'all');
|
||||
if (is_array($sub_result) && @sizeof($sub_result) != 0) {
|
||||
foreach ($sub_result as &$sub_row) {
|
||||
foreach ($sub_result as $sub_row) {
|
||||
//$ivr_menu_uuid = $sub_row["ivr_menu_uuid"];
|
||||
$ivr_menu_option_digits = $sub_row["ivr_menu_option_digits"];
|
||||
$ivr_menu_option_action = $sub_row["ivr_menu_option_action"];
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
$sql .= "where module_order is null ";
|
||||
$modules = $database->select($sql, null, 'all');
|
||||
if (is_array($modules) && @sizeof($modules) != 0) {
|
||||
foreach ($modules as $index => &$row) {
|
||||
foreach ($modules as $index => $row) {
|
||||
//get the module details
|
||||
$mod = $module->info($row['module_name']);
|
||||
//update the module order
|
||||
|
|
|
|||
|
|
@ -674,7 +674,7 @@ if (!class_exists('modules')) {
|
|||
//set the default
|
||||
$result = false;
|
||||
//look for the module
|
||||
foreach ($this->modules as &$row) {
|
||||
foreach ($this->modules as $row) {
|
||||
if ($row['module_name'] == $name) {
|
||||
$result = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@
|
|||
$recordings = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($recordings) && @sizeof($recordings) != 0) {
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
foreach ($recordings as $row) {
|
||||
$recording_name = $row["recording_name"];
|
||||
$recording_filename = $row["recording_filename"];
|
||||
if ($music_on_hold_chime_list == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename && !empty($music_on_hold_chime_list)) {
|
||||
|
|
@ -396,7 +396,7 @@
|
|||
$result = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
echo "<optgroup label='Phrases'>\n";
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
if ($music_on_hold_chime_list == "phrase:".$row["phrase_uuid"]) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='phrase:".escape($row["phrase_uuid"])."' selected='selected'>".escape($row["phrase_name"])."</option>\n";
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
$number_translation = new number_translations;
|
||||
|
||||
//process the xml files
|
||||
foreach ($xml_list as &$xml_file) {
|
||||
foreach ($xml_list as $xml_file) {
|
||||
//get and parse the xml
|
||||
$number_translation->xml = file_get_contents($xml_file);
|
||||
$number_translation->import();
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ if (!class_exists('number_translations')) {
|
|||
//loop through the condition array
|
||||
$order = 5;
|
||||
if (isset($number_translation['rule'])) {
|
||||
foreach ($number_translation['rule'] as &$row) {
|
||||
foreach ($number_translation['rule'] as $row) {
|
||||
if (array_key_exists('@attributes', $row)) {
|
||||
$row = $row['@attributes'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ if ($domains_processed == 1) {
|
|||
$sql .= "from v_phrase_details where phrase_detail_function = 'play-file' ";
|
||||
$result = $database->select($sql, null, 'all');
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
foreach ($result as $index => &$row) {
|
||||
foreach ($result as $index => $row) {
|
||||
$phrase_detail_uuid = $row['phrase_detail_uuid'];
|
||||
$phrase_detail_data = $row['phrase_detail_data'];
|
||||
if (substr_count($phrase_detail_data, $setting->get('switch','recordings').'/'.$domain_name) > 0) {
|
||||
|
|
@ -105,7 +105,7 @@ if ($domains_processed == 1) {
|
|||
$sql .= "and phrase_detail_data like 'lua(streamfile.lua %)' ";
|
||||
$result = $database->select($sql, null, 'all');
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
foreach ($result as $index => &$row) {
|
||||
foreach ($result as $index => $row) {
|
||||
$phrase_detail_uuid = $row['phrase_detail_uuid'];
|
||||
$phrase_detail_data = $row['phrase_detail_data'];
|
||||
//update function and data to use standard method
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@
|
|||
if (is_array($recordings) && @sizeof($recordings) != 0) {
|
||||
echo "var opt_group = document.createElement('optgroup');\n";
|
||||
echo "opt_group.label = \"".$text['label-recordings']."\";\n";
|
||||
foreach ($recordings as &$row) {
|
||||
foreach ($recordings as $row) {
|
||||
if (!empty($_SESSION['recordings']['storage_type']['text']) && $_SESSION['recordings']['storage_type']['text'] == 'base64') {
|
||||
echo "opt_group.appendChild(new Option(\"".$row["recording_name"]."\", \"\${lua streamfile.lua ".$row["recording_filename"]."}\"));\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@
|
|||
$database_contacts = $this->database->select($sql, $parameters, 'all');
|
||||
if (is_array($database_contacts)) {
|
||||
$x = 0;
|
||||
foreach ($database_contacts as &$row) {
|
||||
foreach ($database_contacts as $row) {
|
||||
$uuid = $row['contact_uuid'];
|
||||
$phone_label = strtolower($row['phone_label'] ?? '');
|
||||
$contact_category = strtolower($row['contact_category'] ?? '');
|
||||
|
|
@ -1269,7 +1269,7 @@
|
|||
|
||||
//process each device
|
||||
if (is_array($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
//get the values from the database and set as variables
|
||||
$domain_uuid = $row["domain_uuid"];
|
||||
$device_uuid = $row["device_uuid"];
|
||||
|
|
@ -1311,7 +1311,7 @@
|
|||
|
||||
//loop through the provision templates
|
||||
if (is_array($dir_array)) {
|
||||
foreach ($dir_array as &$template_path) {
|
||||
foreach ($dir_array as $template_path) {
|
||||
if (is_dir($template_path)) continue;
|
||||
if (!file_exists($template_path)) continue;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
$sql .= "or recording_base64 = '' ";
|
||||
$result = $database->select($sql, null, 'all');
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
//set the variables
|
||||
$recording_uuid = $row['recording_uuid'];
|
||||
$recording_domain_uuid = $row['domain_uuid'];
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
$sql .= "where recording_base64 is not null ";
|
||||
$result = $database->select($sql, null, 'all');
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
//set the variables
|
||||
$recording_uuid = $row['recording_uuid'];
|
||||
$recording_domain_uuid = $row['domain_uuid'];
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@
|
|||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
$array_recordings[$row['recording_uuid']] = $row['recording_filename'];
|
||||
$array_base64_exists[$row['recording_uuid']] = ($row['recording_base64'] != '') ? true : false;
|
||||
//if not base64, convert back to local files and remove base64 from db
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ if (!class_exists('switch_recordings')) {
|
|||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
$recordings[$_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name']."/".$row['recording_filename']] = $row['recording_filename'];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
$sip_profile_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/switch/resources/conf/sip_profiles/*.xml.noload';
|
||||
}
|
||||
$xml_files = glob($sip_profile_dir);
|
||||
foreach ($xml_files as $x => &$xml_file) {
|
||||
foreach ($xml_files as $x => $xml_file) {
|
||||
//load the sip profile xml and save it into an array
|
||||
$sip_profile_xml = file_get_contents($xml_file);
|
||||
$xml = simplexml_load_string($sip_profile_xml);
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
$sip_profile_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/switch/resources/conf/sip_profiles/*.xml.noload';
|
||||
}
|
||||
$xml_files = glob($sip_profile_dir);
|
||||
foreach ($xml_files as $x => &$xml_file) {
|
||||
foreach ($xml_files as $x => $xml_file) {
|
||||
//load the sip profile xml and save it into an array
|
||||
$sip_profile_xml = file_get_contents($xml_file);
|
||||
$xml = simplexml_load_string($sip_profile_xml);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ if (is_uuid($sip_profile_uuid) && $sip_profile_name != '') {
|
|||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
foreach ($result as $x => &$row) {
|
||||
foreach ($result as $x => $row) {
|
||||
$array['sip_profile_domains'][$x]['sip_profile_domain_uuid'] = uuid();
|
||||
$array['sip_profile_domains'][$x]['sip_profile_uuid'] = $sip_profile_uuid_new;
|
||||
$array['sip_profile_domains'][$x]['sip_profile_domain_name'] = $row["sip_profile_domain_name"];
|
||||
|
|
@ -109,7 +109,7 @@ if (is_uuid($sip_profile_uuid) && $sip_profile_name != '') {
|
|||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
foreach ($result as $x => &$row) {
|
||||
foreach ($result as $x => $row) {
|
||||
$array['sip_profile_settings'][$x]['sip_profile_setting_uuid'] = uuid();
|
||||
$array['sip_profile_settings'][$x]['sip_profile_uuid'] = $sip_profile_uuid_new;
|
||||
$array['sip_profile_settings'][$x]['sip_profile_setting_name'] = $row["sip_profile_setting_name"];
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ if ($domains_processed == 1) {
|
|||
$database = new database;
|
||||
$result = $database->select($sql, null, 'all');
|
||||
if (!empty($result)) {
|
||||
foreach ($result as $x => &$row) {
|
||||
foreach ($result as $x => $row) {
|
||||
$voicemail_greeting_uuid = $row['voicemail_greeting_uuid'];
|
||||
$greeting_id = preg_replace('{\D}', '', $row['greeting_filename']);
|
||||
//build update array
|
||||
|
|
@ -75,7 +75,7 @@ if ($domains_processed == 1) {
|
|||
$database = new database;
|
||||
$result = $database->select($sql, null, 'all');
|
||||
if (!empty($result)) {
|
||||
foreach ($result as $x => &$row) {
|
||||
foreach ($result as $x => $row) {
|
||||
$voicemail_greeting_uuid = $row['voicemail_greeting_uuid'];
|
||||
$greeting_domain_uuid = $row['domain_uuid'];
|
||||
$voicemail_id = $row['voicemail_id'];
|
||||
|
|
@ -117,7 +117,7 @@ if ($domains_processed == 1) {
|
|||
$database = new database;
|
||||
$result = $database->select($sql, null, 'all');
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
foreach ($result as $x => &$row) {
|
||||
foreach ($result as $x => $row) {
|
||||
//set variables
|
||||
$voicemail_greeting_uuid = $row['voicemail_greeting_uuid'];
|
||||
$greeting_domain_uuid = $row['domain_uuid'];
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@
|
|||
|
||||
//add the voicemail messages to the array
|
||||
if (is_array($voicemails)) {
|
||||
foreach ($voicemails as &$row) {
|
||||
foreach ($voicemails as $row) {
|
||||
//get the voicemail messages
|
||||
$row['messages'] = $this->voicemail_messages($row['voicemail_id']);
|
||||
}
|
||||
|
|
@ -310,7 +310,7 @@
|
|||
|
||||
//update the array with additional information
|
||||
if (is_array($result)) {
|
||||
foreach($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
//set the greeting directory
|
||||
$path = $this->settings->get('switch', 'voicemail', '/var/lib/freeswitch/storage').'/default/'.$_SESSION['domain_name'].'/'.$row['voicemail_id'];
|
||||
if (file_exists($path.'/msg_'.$row['voicemail_message_uuid'].'.wav')) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
$messages[$field['voicemail_uuid']]['ext'] = $field['voicemail_id'];
|
||||
$messages[$field['voicemail_uuid']]['total'] = 0;
|
||||
$messages[$field['voicemail_uuid']]['new'] = 0;
|
||||
foreach($field['messages'] as &$row) {
|
||||
foreach ($field['messages'] as $row) {
|
||||
if ($row['message_status'] == '') {
|
||||
$messages[$field['voicemail_uuid']]['new']++;
|
||||
$messages['new']++;
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@
|
|||
$voicemails_count_tmp = $database->select($sql, $parameters, 'all');
|
||||
|
||||
$voicemails_count = array();
|
||||
foreach ($voicemails_count_tmp as &$row) {
|
||||
foreach ($voicemails_count_tmp as $row) {
|
||||
$voicemails_count[$row['voicemail_uuid']] = $row['voicemail_count'];
|
||||
}
|
||||
unset($sql, $parameters, $voicemails_count_tmp);
|
||||
|
|
@ -188,7 +188,7 @@
|
|||
$voicemail_greetings_count_tmp = $database->select($sql, $parameters, 'all');
|
||||
|
||||
$voicemail_greetings_count = array();
|
||||
foreach ($voicemail_greetings_count_tmp as &$row) {
|
||||
foreach ($voicemail_greetings_count_tmp as $row) {
|
||||
$voicemail_greetings_count[$row['voicemail_id']] = $row['greeting_count'];
|
||||
}
|
||||
unset($sql, $parameters, $voicemail_greetings_count_tmp);
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@
|
|||
echo " <select class='formfld' name='extension_uuid' id='extension_uuid'>\n";
|
||||
echo " <option value=''></option>";
|
||||
if (is_array($extensions) && @sizeof($extensions) != 0) {
|
||||
foreach ($extensions as &$row) {
|
||||
foreach ($extensions as $row) {
|
||||
$selected = ($row['extension_uuid'] == $extension_uuid) ? "selected" : null;
|
||||
echo " <option value='".escape($row['extension_uuid'])."' ".escape($selected).">".((is_numeric($row['extension'])) ? escape($row['extension']) : escape($row['number_alias'])." (".escape($row['extension']).")")."</option>";
|
||||
}
|
||||
|
|
@ -592,7 +592,7 @@
|
|||
echo " <select class='formfld' name='call_center_queue_uuid' id='call_center_queue_uuid'>\n";
|
||||
echo " <option value=''></option>";
|
||||
if (is_array($call_center_queues) && @sizeof($call_center_queues) != 0) {
|
||||
foreach ($call_center_queues as &$row) {
|
||||
foreach ($call_center_queues as $row) {
|
||||
$selected = ($row['call_center_queue_uuid'] == $call_center_queue_uuid) ? "selected" : null;
|
||||
echo " <option value='".escape($row['call_center_queue_uuid'])."' ".escape($selected).">".((is_numeric($row['queue_extension'])) ? escape($row['queue_extension']." (".$row['queue_name'].")") : escape($row['queue_extension'])." (".escape($row['queue_extension']).")")."</option>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@
|
|||
echo " <select class='formfld' name='extension_uuid' id='extension_uuid'>\n";
|
||||
echo " <option value=''></option>";
|
||||
if (is_array($extensions) && @sizeof($extensions) != 0) {
|
||||
foreach ($extensions as &$row) {
|
||||
foreach ($extensions as $row) {
|
||||
$selected = (!empty($caller_extension_uuid) && $row['extension_uuid'] == $caller_extension_uuid) ? "selected" : null;
|
||||
echo " <option value='".escape($row['extension_uuid'])."' ".escape($selected).">".((is_numeric($row['extension'])) ? escape($row['extension']) : escape($row['number_alias'])." (".escape($row['extension']).")")."</option>";
|
||||
}
|
||||
|
|
@ -325,7 +325,7 @@
|
|||
echo " <select class='formfld' name='call_center_queue_uuid' id='call_center_queue_uuid'>\n";
|
||||
echo " <option value=''></option>";
|
||||
if (is_array($call_center_queues) && @sizeof($call_center_queues) != 0) {
|
||||
foreach ($call_center_queues as &$row) {
|
||||
foreach ($call_center_queues as $row) {
|
||||
$selected = ($row['call_center_queue_uuid'] == $call_center_queue_uuid) ? "selected" : null;
|
||||
echo " <option value='".escape($row['call_center_queue_uuid'])."' ".escape($selected).">".((is_numeric($row['queue_extension'])) ? escape($row['queue_extension']." (".$row['queue_name'].")") : escape($row['queue_extension'])." (".escape($row['queue_extension']).")")."</option>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ if (!empty($domains_processed) && $domains_processed == 1) {
|
|||
$sql = "select * from v_databases ";
|
||||
$sql .= "where database_driver is null ";
|
||||
$result = $database->select($sql, null, 'all');
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
$database_uuid = $row["database_uuid"];
|
||||
$database_type = $row["database_type"];
|
||||
$database_type_array = explode(":", $database_type);
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@
|
|||
$sql .= "where menu_uuid = :menu_uuid ";
|
||||
$parameters['menu_uuid'] = $row['default_setting_value'];
|
||||
$sub_result = $database->select($sql, $parameters ?? null, 'all');
|
||||
foreach ($sub_result as &$sub_row) {
|
||||
foreach ($sub_result as $sub_row) {
|
||||
echo $sub_row["menu_language"]." - ".$sub_row["menu_name"]."\n";
|
||||
}
|
||||
unset($sql, $sub_result, $sub_row);
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@
|
|||
|
||||
$time_zone_found = false;
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
//get the dialplan_uuid
|
||||
$dialplan_uuid = $row["dialplan_uuid"];
|
||||
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@
|
|||
$database = new database;
|
||||
$sub_result = $database->select($sql, $parameters, 'all');
|
||||
if (!empty($sub_result)) {
|
||||
foreach ($sub_result as &$sub_row) {
|
||||
foreach ($sub_result as $sub_row) {
|
||||
echo escape($sub_row["menu_language"])." - ".escape($sub_row["menu_name"])."\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class events {
|
|||
* @return boolean $value
|
||||
*/
|
||||
public function check_required($category) {
|
||||
foreach ($this->required['headers'] as &$header) {
|
||||
foreach ($this->required['headers'] as $header) {
|
||||
if ($category == $header) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -131,7 +131,7 @@ class events {
|
|||
*/
|
||||
public function send() {
|
||||
//check for required headers are present return false if any are missing
|
||||
foreach ($this->headers as &$header) {
|
||||
foreach ($this->headers as $header) {
|
||||
if (!$this->check_required($header)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@
|
|||
|
||||
//add group_member to the users array
|
||||
if (!empty($users)) {
|
||||
foreach ($users as &$field) {
|
||||
foreach ($users as $field) {
|
||||
$field['group_member'] = 'false';
|
||||
if (!empty($user_groups)) {
|
||||
foreach($user_groups as $row) {
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
|
||||
if (is_array($user_groups) && @sizeof($user_groups) != 0) {
|
||||
$x = 0;
|
||||
foreach ($user_groups as &$row) {
|
||||
foreach ($user_groups as $row) {
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>";
|
||||
if (permission_exists('group_member_delete')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@
|
|||
unset($sql, $parameters);
|
||||
|
||||
if (is_array($result) && sizeof($result) != 0) {
|
||||
foreach ($result as $x => &$row) {
|
||||
foreach ($result as $x => $row) {
|
||||
//define group permissions values
|
||||
$domain_uuid = $row["domain_uuid"];
|
||||
$permission_name = $row["permission_name"];
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
//get the $apps array from the installed apps from the core and mod directories
|
||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_config.php");
|
||||
$x = 0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
include($config_path);
|
||||
$x++;
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@
|
|||
//get the $apps array from the installed apps from the core and mod directories
|
||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_config.php");
|
||||
$x = 0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
include($config_path);
|
||||
$x++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@
|
|||
|
||||
$group_list = '';
|
||||
if (!empty($sub_result) && sizeof($sub_result) != 0) {
|
||||
foreach ($sub_result as &$sub_row) {
|
||||
foreach ($sub_result as $sub_row) {
|
||||
$group_array[] = $sub_row["group_name"].((!empty($sub_row['group_domain_uuid'])) ? "@".$_SESSION['domains'][$sub_row['group_domain_uuid']]['domain_name'] : null);
|
||||
}
|
||||
$group_list = !empty($group_array) ? implode(', ', $group_array) : '';
|
||||
|
|
@ -306,7 +306,7 @@
|
|||
unset($sql, $group_list);
|
||||
|
||||
if (!empty($sub_result) && sizeof($sub_result) != 0) {
|
||||
foreach ($sub_result as &$sub_row) {
|
||||
foreach ($sub_result as $sub_row) {
|
||||
$group_list[] = $sub_row["group_name"].((!empty($sub_row['group_domain_uuid'])) ? "@".$_SESSION['domains'][$sub_row['group_domain_uuid']]['domain_name'] : null);
|
||||
}
|
||||
$group_list = implode(', ', $group_list);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ if ($domains_processed == 1) {
|
|||
//get the $apps array from the installed apps from the core and mod directories
|
||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_config.php");
|
||||
$x = 0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
include($config_path);
|
||||
$x++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@
|
|||
$database = new database;
|
||||
$result = $database->select($sql, null, 'all');
|
||||
if (is_array($result) && sizeof($result) != 0) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
if ($row["menu_name"] == 'default') {
|
||||
echo "<option selected value='".$row["menu_uuid"]."|".$row["menu_language"]."'>".$row["menu_name"]."</option>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
|||
|
||||
$time_zone_found = false;
|
||||
if (is_array($result) && sizeof($result) != 0) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
//get the dialplan_uuid
|
||||
$dialplan_uuid = $row["dialplan_uuid"];
|
||||
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@
|
|||
$database = new database;
|
||||
$sub_result = $database->select($sql, $parameters, 'all');
|
||||
if (!empty($sub_result)) {
|
||||
foreach ($sub_result as &$sub_row) {
|
||||
foreach ($sub_result as $sub_row) {
|
||||
echo escape($sub_row["menu_language"])." - ".escape($sub_row["menu_name"])."\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -645,14 +645,14 @@
|
|||
$tmp = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
if ($this->type == "pgsql" || $this->type == "sqlite" || $this->type == "mssql") {
|
||||
if (is_array($tmp)) {
|
||||
foreach ($tmp as &$row) {
|
||||
foreach ($tmp as $row) {
|
||||
$result[]['name'] = $row['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($this->type == "mysql") {
|
||||
if (is_array($tmp)) {
|
||||
foreach ($tmp as &$row) {
|
||||
foreach ($tmp as $row) {
|
||||
$table_array = array_values($row);
|
||||
$result[]['name'] = $table_array[0];
|
||||
}
|
||||
|
|
@ -2815,7 +2815,7 @@
|
|||
|
||||
//get the domain_uuid
|
||||
$domain_uuid = '';
|
||||
foreach($old_array as &$data_array) {
|
||||
foreach ($old_array as $data_array) {
|
||||
foreach ($data_array as $row) {
|
||||
if (!empty($row['domain_uuid'])) {
|
||||
$domain_uuid = $row['domain_uuid'];
|
||||
|
|
@ -2968,7 +2968,7 @@
|
|||
$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
|
||||
$x = 0;
|
||||
if (is_array($config_list)) {
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
include($config_path);
|
||||
$x++;
|
||||
}
|
||||
|
|
@ -3011,7 +3011,7 @@
|
|||
//search through all fields to see if domain_uuid exists
|
||||
foreach (self::$apps as $x => &$app) {
|
||||
if (is_array($app['db'])) {
|
||||
foreach ($app['db'] as $y => &$row) {
|
||||
foreach ($app['db'] as $y => $row) {
|
||||
if (is_array($row['table']['name'])) {
|
||||
$table_name = $row['table']['name']['text'];
|
||||
}
|
||||
|
|
@ -3065,15 +3065,15 @@
|
|||
}
|
||||
}
|
||||
$x = 0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
include($config_path);
|
||||
$x++;
|
||||
}
|
||||
|
||||
//search through all fields to find relations
|
||||
if (!empty($apps) && is_array($apps)) {
|
||||
foreach ($apps as $x => &$app) {
|
||||
foreach ($app['db'] as $y => &$row) {
|
||||
foreach ($apps as $x => $app) {
|
||||
foreach ($app['db'] as $y => $row) {
|
||||
foreach ($row['fields'] as $z => $field) {
|
||||
if (!empty($field['deprecated']) && $field['deprecated'] != "true") {
|
||||
if (!empty($field['key']['type']) && $field['key']['type'] == "foreign") {
|
||||
|
|
|
|||
|
|
@ -501,7 +501,7 @@
|
|||
$call_group = $row['call_group'];
|
||||
$call_group = str_replace(";", ",", $call_group);
|
||||
$tmp_array = explode(",", $call_group);
|
||||
foreach ($tmp_array as &$tmp_call_group) {
|
||||
foreach ($tmp_array as $tmp_call_group) {
|
||||
if (!empty($tmp_call_group)) {
|
||||
if (empty($call_group_array[$tmp_call_group])) {
|
||||
$call_group_array[$tmp_call_group] = $row['extension'];
|
||||
|
|
@ -603,7 +603,7 @@
|
|||
$xml .= " to keep searching for the user in the directory.\n";
|
||||
$xml .= " -->\n";
|
||||
$extension_array = explode(",", $extension_list);
|
||||
foreach ($extension_array as &$tmp_extension) {
|
||||
foreach ($extension_array as $tmp_extension) {
|
||||
$xml .= " <user id=\"$tmp_extension\" type=\"pointer\"/>\n";
|
||||
}
|
||||
$xml .= " </users>\n";
|
||||
|
|
|
|||
|
|
@ -144,13 +144,13 @@ if (!class_exists('domains')) {
|
|||
//get the $apps array from the installed apps from the core and mod directories
|
||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_config.php");
|
||||
$x=0;
|
||||
if (isset($config_list)) foreach ($config_list as &$config_path) {
|
||||
if (isset($config_list)) foreach ($config_list as $config_path) {
|
||||
include($config_path);
|
||||
$x++;
|
||||
}
|
||||
|
||||
//delete the domain data from all tables in the database
|
||||
if (isset($apps)) foreach ($apps as &$app) {
|
||||
if (isset($apps)) foreach ($apps as $app) {
|
||||
if (isset($app['db'])) foreach ($app['db'] as $row) {
|
||||
if (is_array($row['table']['name'])) {
|
||||
$table_name = $row['table']['name']['text'];
|
||||
|
|
@ -623,7 +623,7 @@ if (!class_exists('domains')) {
|
|||
$config_list = array_merge((array)$config_list_1, (array)$config_list_2);
|
||||
unset($config_list_1,$config_list_2);
|
||||
$x=0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
$app_path = dirname($config_path);
|
||||
$app_path = preg_replace('/\A.*(\/.*\/.*)\z/', '$1', $app_path);
|
||||
include($config_path);
|
||||
|
|
@ -650,7 +650,7 @@ if (!class_exists('domains')) {
|
|||
|
||||
//get the list of installed apps from the core and mod directories and run the php code in app_defaults.php
|
||||
$default_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_defaults.php");
|
||||
foreach ($default_list as &$default_path) {
|
||||
foreach ($default_list as $default_path) {
|
||||
include($default_path);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ if (!class_exists('email')) {
|
|||
|
||||
//get the attachments and add to the email
|
||||
$x = 0;
|
||||
foreach ($decoded[0]["Parts"] as &$parts_array) {
|
||||
foreach ($decoded[0]["Parts"] as $parts_array) {
|
||||
//image/tiff;name="testfax.tif"
|
||||
//text/plain; charset=ISO-8859-1; format=flowed
|
||||
$content_type = $parts_array["Parts"][0]["Headers"]["content-type:"];
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ class event_socket {
|
|||
}
|
||||
|
||||
$cmd_array = explode("\n", $cmd);
|
||||
foreach ($cmd_array as &$value) {
|
||||
foreach ($cmd_array as $value) {
|
||||
fputs($this->fp, $value."\n");
|
||||
}
|
||||
fputs($this->fp, "\n"); //second line feed to end the headers
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ if (!class_exists('groups')) {
|
|||
//build the apps array
|
||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_config.php");
|
||||
$x = 0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
include($config_path);
|
||||
$x++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ if (!class_exists('schema')) {
|
|||
//get the list of installed apps from the core and mod directories
|
||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
|
||||
$x=0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
foreach ($config_list as $config_path) {
|
||||
try {
|
||||
include($config_path);
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ if (!class_exists('schema')) {
|
|||
|
||||
//check if a column exists in sqlite
|
||||
private function sqlite_column_exists($table_info, $column_name) {
|
||||
foreach ($table_info as $key => &$row) {
|
||||
foreach ($table_info as $key => $row) {
|
||||
if ($row['name'] == $column_name) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -274,21 +274,21 @@ if (!class_exists('schema')) {
|
|||
//database type
|
||||
private function db_data_type($db_type, $table_info, $column_name) {
|
||||
if ($db_type == "sqlite") {
|
||||
foreach ($table_info as $key => &$row) {
|
||||
foreach ($table_info as $key => $row) {
|
||||
if ($row['name'] == $column_name) {
|
||||
return $row['type'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($db_type == "pgsql") {
|
||||
foreach ($table_info as $key => &$row) {
|
||||
foreach ($table_info as $key => $row) {
|
||||
if ($row['column_name'] == $column_name) {
|
||||
return $row['data_type'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($db_type == "mysql") {
|
||||
foreach ($table_info as $key => &$row) {
|
||||
foreach ($table_info as $key => $row) {
|
||||
if ($row['Field'] == $column_name) {
|
||||
return $row['Type'];
|
||||
}
|
||||
|
|
@ -298,7 +298,7 @@ if (!class_exists('schema')) {
|
|||
|
||||
//sqlite column exists
|
||||
private function db_sqlite_column_exists($table_info, $column_name) {
|
||||
foreach ($table_info as $key => &$row) {
|
||||
foreach ($table_info as $key => $row) {
|
||||
if ($row['name'] == $column_name) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -348,7 +348,7 @@ if (!class_exists('schema')) {
|
|||
//database create table
|
||||
public function db_create_table ($apps, $db_type, $table) {
|
||||
if (empty($apps)) { return false; }
|
||||
if (is_array($apps)) foreach ($apps as $x => &$app) {
|
||||
if (is_array($apps)) foreach ($apps as $x => $app) {
|
||||
if (!empty($app['db']) && is_array($app['db'])) foreach ($app['db'] as $y => $row) {
|
||||
if (!empty($row['table']['name']) && is_array($row['table']['name'])) {
|
||||
$table_name = $row['table']['name']['text'];
|
||||
|
|
@ -393,7 +393,7 @@ if (!class_exists('schema')) {
|
|||
//database insert
|
||||
private function db_insert_into ($apps, $db_type, $table) {
|
||||
global $db_name;
|
||||
foreach ($apps as $x => &$app) {
|
||||
foreach ($apps as $x => $app) {
|
||||
foreach ($app['db'] as $y => $row) {
|
||||
if ($row['table']['name'] == $table) {
|
||||
$sql = "INSERT INTO " . $row['table']['name'] . " (";
|
||||
|
|
@ -520,8 +520,8 @@ if (!class_exists('schema')) {
|
|||
|
||||
//update the app db array add exists true or false
|
||||
$sql = '';
|
||||
foreach ($this->apps as $x => &$app) {
|
||||
if (isset($app['db'])) foreach ($app['db'] as $y => &$row) {
|
||||
foreach ($this->apps as $x => $app) {
|
||||
if (isset($app['db'])) foreach ($app['db'] as $y => $row) {
|
||||
if (isset($row['table']['name'])) {
|
||||
if (is_array($row['table']['name'])) {
|
||||
$table_name = $row['table']['name']['text'];
|
||||
|
|
@ -582,8 +582,8 @@ if (!class_exists('schema')) {
|
|||
$sql_update = '';
|
||||
|
||||
//add missing tables and fields
|
||||
foreach ($this->apps as $x => &$app) {
|
||||
if (isset($app['db'])) foreach ($app['db'] as $y => &$row) {
|
||||
foreach ($this->apps as $x => $app) {
|
||||
if (isset($app['db'])) foreach ($app['db'] as $y => $row) {
|
||||
if (is_array($row['table']['name'])) {
|
||||
$table_name = $row['table']['name']['text'];
|
||||
if ($this->db_table_exists($db_type, $db_name, $row['table']['name']['deprecated'])) {
|
||||
|
|
@ -735,8 +735,8 @@ if (!class_exists('schema')) {
|
|||
}
|
||||
}
|
||||
//rebuild and populate the table
|
||||
foreach ($this->apps as $x => &$app) {
|
||||
if (isset($app['db'])) foreach ($app['db'] as $y => &$row) {
|
||||
foreach ($this->apps as $x => $app) {
|
||||
if (isset($app['db'])) foreach ($app['db'] as $y => $row) {
|
||||
if (is_array($row['table']['name'])) {
|
||||
$table_name = $row['table']['name']['text'];
|
||||
}
|
||||
|
|
@ -792,7 +792,7 @@ if (!class_exists('schema')) {
|
|||
$response .= "<tr>\n";
|
||||
//build the html while looping through the app db array
|
||||
$sql = '';
|
||||
foreach ($this->apps as &$app) {
|
||||
foreach ($this->apps as $app) {
|
||||
if (isset($app['db'])) foreach ($app['db'] as $row) {
|
||||
if (is_array($row['table']['name'])) {
|
||||
$table_name = $row['table']['name']['text'];
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class sounds {
|
|||
$database = new database;
|
||||
$recordings = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($recordings) && @sizeof($recordings) != 0) {
|
||||
foreach ($recordings as $x => &$row) {
|
||||
foreach ($recordings as $x => $row) {
|
||||
$recording_name = $row["recording_name"];
|
||||
$recording_filename = $row["recording_filename"];
|
||||
$recording_path = !empty($this->full_path) && is_array($this->full_path) && in_array('recordings', $this->full_path) ? $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/' : null;
|
||||
|
|
@ -66,7 +66,7 @@ class sounds {
|
|||
$database = new database;
|
||||
$phrases = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($phrases) && @sizeof($phrases) != 0) {
|
||||
foreach ($phrases as &$row) {
|
||||
foreach ($phrases as $row) {
|
||||
$array['phrases'][$x]['name'] = "phrase:".$row["phrase_name"];
|
||||
$array['phrases'][$x]['value'] = "phrase:".$row["phrase_uuid"];
|
||||
$x++;
|
||||
|
|
|
|||
|
|
@ -845,7 +845,7 @@
|
|||
if (is_numeric(trim($phone_number ?? '', ' +'))) {
|
||||
if (isset($_SESSION["format"]["phone"])) {
|
||||
$phone_number = trim($phone_number, ' +');
|
||||
foreach ($_SESSION["format"]["phone"] as &$format) {
|
||||
foreach ($_SESSION["format"]["phone"] as $format) {
|
||||
$format_count = substr_count($format, 'x');
|
||||
$format_count = $format_count + substr_count($format, 'R');
|
||||
$format_count = $format_count + substr_count($format, 'r');
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@
|
|||
echo "<select name='domain_name' class='txt login' style='".$placeholder_color." width: 200px; text-align: center; text-align-last: center; margin-bottom: 8px;' onclick=\"this.style.color='".$click_change_color."';\" onchange=\"this.style.color='".$click_change_color."';\">\n";
|
||||
echo " <option value='' disabled selected hidden>".$text['label-domain']."</option>\n";
|
||||
sort($_SESSION['login']['domain_name']);
|
||||
foreach ($_SESSION['login']['domain_name'] as &$row) {
|
||||
foreach ($_SESSION['login']['domain_name'] as $row) {
|
||||
echo " <option value='".escape($row)."'>".escape($row)."</option>\n";
|
||||
}
|
||||
echo "</select><br />\n";
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ function save_gateway_xml() {
|
|||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
if ($row['enabled'] != "false") {
|
||||
//set the default profile as external
|
||||
$profile = $row['profile'];
|
||||
|
|
@ -284,7 +284,7 @@ function save_var_xml() {
|
|||
$prev_var_category = '';
|
||||
$xml = '';
|
||||
if (!empty($variables)) {
|
||||
foreach ($variables as &$row) {
|
||||
foreach ($variables as $row) {
|
||||
if ($row['var_category'] != 'Provision') {
|
||||
if ($prev_var_category != $row['var_category']) {
|
||||
$xml .= "\n<!-- ".$row['var_category']." -->\n";
|
||||
|
|
@ -359,7 +359,7 @@ function outbound_route_to_bridge($domain_uuid, $destination_number, array $chan
|
|||
$result = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
$dialplan_uuid = $row["dialplan_uuid"];
|
||||
$dialplan_detail_uuid = $row["dialplan_detail_uuid"];
|
||||
$outbound_routes[$dialplan_uuid][$dialplan_detail_uuid]["dialplan_detail_tag"] = $row["dialplan_detail_tag"];
|
||||
|
|
@ -371,9 +371,9 @@ function outbound_route_to_bridge($domain_uuid, $destination_number, array $chan
|
|||
|
||||
if (!empty($outbound_routes)) {
|
||||
$x = 0;
|
||||
foreach ($outbound_routes as &$dialplan) {
|
||||
foreach ($outbound_routes as $dialplan) {
|
||||
$condition_match = [];
|
||||
foreach ($dialplan as &$dialplan_details) {
|
||||
foreach ($dialplan as $dialplan_details) {
|
||||
if (!empty($dialplan_details['dialplan_detail_tag']) && $dialplan_details['dialplan_detail_tag'] == "condition") {
|
||||
if ($dialplan_details['dialplan_detail_type'] == "destination_number") {
|
||||
$pattern = '/'.$dialplan_details['dialplan_detail_data'].'/';
|
||||
|
|
@ -404,7 +404,7 @@ function outbound_route_to_bridge($domain_uuid, $destination_number, array $chan
|
|||
}
|
||||
|
||||
if (!in_array('false', $condition_match)) {
|
||||
foreach ($dialplan as &$dialplan_details) {
|
||||
foreach ($dialplan as $dialplan_details) {
|
||||
$dialplan_detail_data = $dialplan_details['dialplan_detail_data'] ?? '';
|
||||
if (
|
||||
!empty($dialplan_details['dialplan_detail_tag']) &&
|
||||
|
|
@ -433,7 +433,7 @@ function outbound_route_to_bridge($domain_uuid, $destination_number, array $chan
|
|||
}
|
||||
//$destination_number = '1231234';
|
||||
//$bridge_array = outbound_route_to_bridge ($domain_uuid, $destination_number);
|
||||
//foreach ($bridge_array as &$bridge) {
|
||||
//foreach ($bridge_array as $bridge) {
|
||||
// echo "bridge: ".$bridge."<br />";
|
||||
//}
|
||||
|
||||
|
|
@ -561,7 +561,7 @@ if (!function_exists('save_call_center_xml')) {
|
|||
|
||||
//prepare Queue XML string
|
||||
$x=0;
|
||||
foreach ($call_center_queues as &$row) {
|
||||
foreach ($call_center_queues as $row) {
|
||||
$queue_name = $row["queue_name"];
|
||||
$queue_extension = $row["queue_extension"];
|
||||
$queue_strategy = $row["queue_strategy"];
|
||||
|
|
@ -631,7 +631,7 @@ if (!function_exists('save_call_center_xml')) {
|
|||
|
||||
$x=0;
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
//get the values from the db and set as php variables
|
||||
$agent_name = $row["agent_name"];
|
||||
$agent_type = $row["agent_type"];
|
||||
|
|
@ -721,7 +721,7 @@ if (!function_exists('save_call_center_xml')) {
|
|||
|
||||
$x=0;
|
||||
if (!empty($result)) {
|
||||
foreach ($result as &$row) {
|
||||
foreach ($result as $row) {
|
||||
$agent_name = $row["agent_name"];
|
||||
$queue_name = $row["queue_name"];
|
||||
$tier_level = $row["tier_level"];
|
||||
|
|
@ -913,7 +913,7 @@ if (!function_exists('save_sip_profile_xml')) {
|
|||
$result_2 = $database->select($sql, $parameters, 'all');
|
||||
if (!empty($result_2)) {
|
||||
$sip_profile_settings = '';
|
||||
foreach ($result_2 as &$row_2) {
|
||||
foreach ($result_2 as $row_2) {
|
||||
$sip_profile_settings .= " <param name=\"".$row_2["sip_profile_setting_name"]."\" value=\"".$row_2["sip_profile_setting_value"]."\"/>\n";
|
||||
}
|
||||
}
|
||||
|
|
@ -991,7 +991,7 @@ if(!function_exists('path_join')) {
|
|||
}
|
||||
|
||||
$prefix = null;
|
||||
foreach($paths as &$path) {
|
||||
foreach ($paths as $path) {
|
||||
if($prefix === null && !empty($path)) {
|
||||
if(substr($path, 0, 1) == '/') $prefix = '/';
|
||||
else $prefix = '';
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ if (!function_exists('path_join')) {
|
|||
}
|
||||
|
||||
$prefix = null;
|
||||
foreach($paths as &$path) {
|
||||
foreach ($paths as $path) {
|
||||
if ($prefix === null && !empty($path)) {
|
||||
if (substr($path, 0, 1) == '/') $prefix = '/';
|
||||
else $prefix = '';
|
||||
|
|
|
|||
Loading…
Reference in New Issue