Add the format number to destinations list and adjust the function to only process numeric.
This commit is contained in:
@@ -178,7 +178,7 @@ else {
|
|||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$_SESSION['domains'][$row['domain_uuid']]['domain_name']."</td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".$_SESSION['domains'][$row['domain_uuid']]['domain_name']."</td>\n";
|
||||||
}
|
}
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['destination_type'])."</td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['destination_type'])."</td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'><a href='destination_edit.php?id=".$row['destination_uuid']."'>".$row['destination_number']."</a></td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'><a href='destination_edit.php?id=".$row['destination_uuid']."'>".format_phone($row['destination_number'])."</a></td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['destination_context']."</td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".$row['destination_context']."</td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['destination_enabled'])."</td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['destination_enabled'])."</td>\n";
|
||||||
echo " <td valign='top' class='row_stylebg'>".$row['destination_description']." </td>\n";
|
echo " <td valign='top' class='row_stylebg'>".$row['destination_description']." </td>\n";
|
||||||
|
|||||||
@@ -771,13 +771,15 @@ function format_string ($format, $data) {
|
|||||||
|
|
||||||
//get the format and use it to format the phone number
|
//get the format and use it to format the phone number
|
||||||
function format_phone($phone_number) {
|
function format_phone($phone_number) {
|
||||||
foreach ($_SESSION["format"]["phone"] as &$format) {
|
if (is_numeric($phone_number)) {
|
||||||
$format_count = substr_count($format, 'x');
|
foreach ($_SESSION["format"]["phone"] as &$format) {
|
||||||
$format_count = $format_count + substr_count($format, 'R');
|
$format_count = substr_count($format, 'x');
|
||||||
$format_count = $format_count + substr_count($format, 'r');
|
$format_count = $format_count + substr_count($format, 'R');
|
||||||
if ($format_count == strlen($phone_number)) {
|
$format_count = $format_count + substr_count($format, 'r');
|
||||||
//format the number
|
if ($format_count == strlen($phone_number)) {
|
||||||
$phone_number = format_string($format, $phone_number);
|
//format the number
|
||||||
|
$phone_number = format_string($format, $phone_number);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $phone_number;
|
return $phone_number;
|
||||||
|
|||||||
Reference in New Issue
Block a user