diff --git a/app/feature_codes/feature_codes.php b/app/feature_codes/feature_codes.php index b9c6aa4c75..4131e4dd46 100644 --- a/app/feature_codes/feature_codes.php +++ b/app/feature_codes/feature_codes.php @@ -121,14 +121,16 @@ //set the feature dialing code eg. *67 $feature_code = $row['dialplan_number'] ?? ''; + $dialplan_name = $row['dialplan_name'] ?? ''; + //set the dialplan name to use underscores for the text array lookup - $dialplan_name = str_replace('-','_', $row['dialplan_name'] ?? ''); + $array_key = str_replace(['-',' '],'_', $row['dialplan_name'] ?? ''); //set the feature code name to be the internationalized name when possible - $feature_name = $dialplan_text['label-dialplan_'.$dialplan_name] ?? $dialplan_name; + $feature_name = format_feature_name($dialplan_text['label-dialplan_'.$array_key] ?? $dialplan_name); //set the dialplan description - $feature_description = $row['dialplan_description'] ?? $dialplan_text['description-dialplan_'.$dialplan_name] ?? ''; + $feature_description = $row['dialplan_description'] ?? $dialplan_text['description-dialplan_'.$array_key] ?? ''; //replace the ${number} variable in the description with the dialed number used to activate the dialplan $feature_description = str_replace('${number}', $feature_code, $feature_description); @@ -325,23 +327,26 @@ //set the feature dialing code eg. *67 $feature_code = $row['dialplan_number'] ?? ''; + $dialplan_name = $row['dialplan_name'] ?? ''; + //set the dialplan name to use underscores for the text array lookup - $dialplan_name = str_replace('-','_', $row['dialplan_name'] ?? ''); + $array_key = str_replace(['-',' '],'_', $row['dialplan_name'] ?? ''); //set the feature code name to be the internationalized name when possible - $feature_name = $dialplan_text['label-dialplan_'.$dialplan_name] ?? $dialplan_name; + $feature_name = format_feature_name($dialplan_text['label-dialplan_'.$array_key] ?? $dialplan_name); //set the dialplan description - $feature_description = $row['dialplan_description'] ?? $dialplan_text['description-dialplan_'.$dialplan_name] ?? ''; + $feature_description = $row['dialplan_description'] ?? $dialplan_text['description-dialplan_'.$array_key] ?? ''; //replace the ${number} variable in the description with the dialed number used to activate the dialplan $feature_description = str_replace('${number}', $feature_code, $feature_description); //output the row echo "\n"; - echo " ".escape($row['dialplan_number'])."\n"; - echo " ".escape(format_feature_name($feature_name))."\n"; + echo " ".escape($feature_code)."\n"; + echo " ".escape($feature_name)."\n"; echo " ".escape($feature_description)."\n"; + //when raw permissions are enabled output the raw dialplan xml (first 100 characters) column if (permission_exists('feature_codes_raw')) { $raw_display = isset($row['dialplan_xml']) ? htmlspecialchars(substr($row['dialplan_xml'], 0, 100)) : ''; @@ -352,8 +357,7 @@ } echo "\n"; } - } - else { + } else { $colspan = permission_exists('feature_codes_raw') ? 4 : 3; echo "\n"; echo " ".$text['label-no_features']."\n";