When adding a ring group re-enable the ability to add the first destination at the same time.

This commit is contained in:
Mark Crane 2013-08-15 23:30:35 +00:00
parent 0918706ffd
commit 5f9a99736b
1 changed files with 53 additions and 54 deletions

View File

@ -484,8 +484,15 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " <tr>"; echo " <tr>";
echo " <td class='vncell' valign='top'>".$text['label-destinations'].":</td>"; echo " <td class='vncell' valign='top'>".$text['label-destinations'].":</td>";
echo " <td class='vtable' align='left'>"; echo " <td class='vtable' align='left'>";
if ($action == "update") {
echo " <table width='52%' border='0' cellpadding='0' cellspacing='0'>\n"; echo " <table width='52%' border='0' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td class='vtable'>".$text['label-destination_number']."</td>\n";
echo " <td class='vtable'>".$text['label-destination_delay']."</td>\n";
echo " <td class='vtable'>".$text['label-destination_timeout']."</td>\n";
echo " <td class='vtable'>".$text['label-destination_prompt']."</td>\n";
echo " <td></td>\n";
echo " </tr>\n";
if ($action == "update") {
$sql = "SELECT * FROM v_ring_group_destinations "; $sql = "SELECT * FROM v_ring_group_destinations ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and ring_group_uuid = '".$ring_group_uuid."' "; $sql .= "and ring_group_uuid = '".$ring_group_uuid."' ";
@ -494,13 +501,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$prep_statement->execute(); $prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result); $result_count = count($result);
echo "<tr>\n";
echo " <td class='vtable'>".$text['label-destination_number']."</td>\n";
echo " <td class='vtable'>".$text['label-destination_delay']."</td>\n";
echo " <td class='vtable'>".$text['label-destination_timeout']."</td>\n";
echo " <td class='vtable'>".$text['label-destination_prompt']."</td>\n";
echo " <td></td>\n";
echo "</tr>\n";
foreach($result as $field) { foreach($result as $field) {
if (strlen($field['destination_delay']) == 0) { $field['destination_delay'] = "0"; } if (strlen($field['destination_delay']) == 0) { $field['destination_delay'] = "0"; }
if (strlen($field['destination_timeout']) == 0) { $field['destination_timeout'] = "30"; } if (strlen($field['destination_timeout']) == 0) { $field['destination_timeout'] = "30"; }
@ -531,6 +531,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " </td>\n"; echo " </td>\n";
echo " </tr>\n"; echo " </tr>\n";
} }
}
unset($sql, $result);
echo " <tr>\n"; echo " <tr>\n";
echo " <td>\n"; echo " <td>\n";
@ -551,14 +553,11 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " </select>\n"; echo " </select>\n";
echo " </td>\n"; echo " </td>\n";
echo " <td>\n"; echo " <td>\n";
if ($action == "update") {
echo " <input type=\"submit\" class='btn' value=\"".$text['button-add']."\">\n"; echo " <input type=\"submit\" class='btn' value=\"".$text['button-add']."\">\n";
}
echo " </td>\n"; echo " </td>\n";
echo " </tr>\n"; echo " </tr>\n";
echo " </table>\n"; echo " </table>\n";
}
unset($sql, $result);
echo " ".$text['description-destinations']."\n"; echo " ".$text['description-destinations']."\n";
echo " <br />\n"; echo " <br />\n";
echo " </td>"; echo " </td>";