mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
If select_found is false then show the custom select.
This commit is contained in:
@@ -171,10 +171,9 @@ class destinations {
|
||||
$response .= "\n";
|
||||
}
|
||||
|
||||
//default selection found to false
|
||||
$selection_found = false;
|
||||
//set default to false
|
||||
$select_found = false;
|
||||
|
||||
//print_r($switch);
|
||||
$response .= " <select name='".$destination_name."' id='".$destination_id."' class='formfld' style='".$select_style."' onchange=\"".$onchange."\">\n";
|
||||
$response .= " <option value=''></option>\n";
|
||||
foreach ($this->destinations as $row) {
|
||||
@@ -217,13 +216,16 @@ class destinations {
|
||||
$select_value = str_replace("\${context}", $_SESSION['context'], $select_value); //to do: context can come from the array
|
||||
$select_label = str_replace("\${domain_name}", $_SESSION['domain_name'], $select_label);
|
||||
$select_label = str_replace("\${context}", $_SESSION['context'], $select_label);
|
||||
if ($select_value == $destination_value) { $selected = "selected='selected' "; } else { $selected = ''; }
|
||||
$response .= " <option value='".$select_value."' $selected>".trim($select_label)."</option>\n";
|
||||
if ($select_value == $destination_value) { $selected = "selected='selected' "; $select_found = true; } else { $selected = ''; }
|
||||
$response .= " <option value='".$select_value."' ".$selected.">".trim($select_label)."</option>\n";
|
||||
}
|
||||
$response .= " </optgroup>\n";
|
||||
unset($text);
|
||||
}
|
||||
}
|
||||
if (!$select_found) {
|
||||
$response .= " <option value='".$select_value."' selected='selected'>".trim($select_label)."</option>\n";
|
||||
}
|
||||
$response .= " </select>\n";
|
||||
if (if_group("superadmin")) {
|
||||
$response .= "<input type='button' id='btn_select_to_input_".$destination_id."' class='btn' name='' alt='back' onclick='changeToInput".$destination_id."(document.getElementById(\"".$destination_id."\"));this.style.visibility = \"hidden\";' value='◁'>";
|
||||
|
||||
Reference in New Issue
Block a user