If there is no item in the group of destinations then don't the group name.

This commit is contained in:
markjcrane 2015-08-07 19:50:06 -05:00
parent ebe536c66d
commit c0a0cb308b
1 changed files with 25 additions and 22 deletions

View File

@ -168,6 +168,7 @@ class destinations {
$text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$name);
}
if (count($row['result']['data']) > 0 and strlen($row['select_value'][$destination_type]) > 0) {
$response .= " <optgroup label='".$text2['title-'.$label]."'>\n";
foreach ($row['result']['data'] as $data) {
$select_value = $row['select_value'][$destination_type];
@ -195,6 +196,7 @@ class destinations {
$response .= " </optgroup>\n";
unset($text);
}
}
$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='&#9665;'>";
@ -206,6 +208,7 @@ class destinations {
}
/*
$obj = new destinations;
//$destinations = $obj->destinations;
echo $obj->select('ivr', 'example1', 'menu-exec-app:transfer 32 XML voip.fusionpbx.com');
echo $obj->select('ivr', 'example2', '');
echo $obj->select('ivr', 'example3', '');