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 "