Update ring groups add enterprise originate as an option along with leg delay and leg timeout.
This commit is contained in:
parent
3af809eb98
commit
24e7dad3aa
|
|
@ -150,4 +150,12 @@
|
|||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select the extension.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'extension_delay';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'extension_timeout';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
|
||||
$z++;
|
||||
?>
|
||||
|
|
@ -71,9 +71,11 @@
|
|||
|
||||
$text['label-strategy']['en-us'] = 'Strategy';
|
||||
|
||||
$text['dropdown-sequence']['en-us'] = 'sequence';
|
||||
$text['select-sequence']['en-us'] = 'sequence';
|
||||
|
||||
$text['dropdown-simultaneous']['en-us'] = 'simultaneous';
|
||||
$text['select-simultaneous']['en-us'] = 'simultaneous';
|
||||
|
||||
$text['select-enterprise']['en-us'] = 'enterprise';
|
||||
|
||||
$text['label-sequence']['en-us'] = 'Select the strategy.';
|
||||
|
||||
|
|
@ -115,4 +117,10 @@
|
|||
|
||||
$text['label-extensions']['en-us'] = 'Extensions';
|
||||
|
||||
$text['label-delay']['en-us'] = 'Delay';
|
||||
$text['label-delay']['pt-pt'] = '';
|
||||
|
||||
$text['label-timeout']['en-us'] = 'Timeout';
|
||||
$text['label-timeout']['pt-pt'] = '';
|
||||
|
||||
?>
|
||||
|
|
@ -69,6 +69,25 @@ else {
|
|||
$action = "add";
|
||||
}
|
||||
|
||||
//define the destination_select function
|
||||
function destination_select($select_name, $select_value, $select_default) {
|
||||
if (strlen($select_value) == 0) { $select_value = $select_default; }
|
||||
echo " <select class='formfld' style='width: 45px;' name='$select_name'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
|
||||
$i = 0;
|
||||
while($i <= 100) {
|
||||
if ($select_value == $i) {
|
||||
echo " <option value='$i' selected='selected'>$i</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='$i'>$i</option>\n";
|
||||
}
|
||||
$i = $i + 5;
|
||||
}
|
||||
echo "</select>\n";
|
||||
}
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (count($_POST)>0) {
|
||||
//set variables from http values
|
||||
|
|
@ -88,6 +107,8 @@ else {
|
|||
$ring_group_timeout_app = array_shift($ring_group_timeout_array);
|
||||
$ring_group_timeout_data = join(':', $ring_group_timeout_array);
|
||||
$extension_uuid = check_str($_POST["extension_uuid"]);
|
||||
$extension_delay = check_str($_POST["extension_delay"]);
|
||||
$extension_timeout = check_str($_POST["extension_timeout"]);
|
||||
|
||||
//set the context for users that are not in the superadmin group
|
||||
if (!if_group("superadmin")) {
|
||||
|
|
@ -207,6 +228,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$sql .= "domain_uuid, ";
|
||||
$sql .= "ring_group_uuid, ";
|
||||
$sql .= "ring_group_extension_uuid, ";
|
||||
$sql .= "extension_delay, ";
|
||||
if (strlen($extension_timeout) > 0) {
|
||||
$sql .= "extension_timeout, ";
|
||||
}
|
||||
$sql .= "extension_uuid ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
|
|
@ -214,6 +239,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
$sql .= "'".$_SESSION['domain_uuid']."', ";
|
||||
$sql .= "'$ring_group_uuid', ";
|
||||
$sql .= "'$ring_group_extension_uuid', ";
|
||||
$sql .= "'$extension_delay', ";
|
||||
if (strlen($extension_timeout) > 0) {
|
||||
$sql .= "'$extension_timeout', ";
|
||||
}
|
||||
$sql .= "'$extension_uuid' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
|
|
@ -355,7 +384,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['label-ring-group']."</b></td>\n";
|
||||
|
||||
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='ring_groups.php'\" value='".$text['button-back']."'></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
|
|
@ -407,16 +435,22 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo " <select class='formfld' name='ring_group_strategy'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($ring_group_strategy == "sequence") {
|
||||
echo " <option value='selected' selected='selected'>".$text['dropdown-sequence']."</option>\n";
|
||||
echo " <option value='selected' selected='selected'>".$text['select-sequence']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='sequence'>".$text['dropdown-sequence']."</option>\n";
|
||||
echo " <option value='sequence'>".$text['select-sequence']."</option>\n";
|
||||
}
|
||||
if ($ring_group_strategy == "simultaneous") {
|
||||
echo " <option value='simultaneous' selected='selected'>".$text['dropdown-simultaneous']."</option>\n";
|
||||
echo " <option value='simultaneous' selected='selected'>".$text['select-simultaneous']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='simultaneous'>".$text['dropdown-simultaneous']."</option>\n";
|
||||
echo " <option value='simultaneous'>".$text['select-simultaneous']."</option>\n";
|
||||
}
|
||||
if ($ring_group_strategy == "enterprise") {
|
||||
echo " <option value='enterprise' selected='selected'>".$text['select-enterprise']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='enterprise'>".$text['select-enterprise']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
|
|
@ -428,21 +462,37 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo " <td class='vncell' valign='top'>".$text['label-extensions'].":</td>";
|
||||
echo " <td class='vtable' align='left'>";
|
||||
if ($action == "update") {
|
||||
echo " <table width='52%'>\n";
|
||||
$sql = "SELECT g.ring_group_extension_uuid, e.extension_uuid, e.extension ";
|
||||
echo " <table width='52%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
$sql = "SELECT g.ring_group_extension_uuid, e.extension_uuid, g.extension_delay, g.extension_timeout, e.extension ";
|
||||
$sql .= "FROM v_ring_groups as r, v_ring_group_extensions as g, v_extensions as e ";
|
||||
$sql .= "where g.ring_group_uuid = r.ring_group_uuid ";
|
||||
$sql .= "where g.ring_group_uuid = r.ring_group_uuid ";
|
||||
$sql .= "and g.domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and g.ring_group_uuid = '".$ring_group_uuid."' ";
|
||||
$sql .= "and e.extension_uuid = g.extension_uuid ";
|
||||
$sql .= "order by e.extension asc ";
|
||||
$sql .= "order by g.extension_delay asc, e.extension asc ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
echo "<tr>\n";
|
||||
echo " <td class='vtable'>".$text['label-extension']."</td>\n";
|
||||
echo " <td class='vtable'>".$text['label-delay']."</td>\n";
|
||||
echo " <td class='vtable'>".$text['label-timeout']."</td>\n";
|
||||
echo " <td></td>\n";
|
||||
echo "</tr>\n";
|
||||
foreach($result as $field) {
|
||||
if (strlen($field['extension_delay']) == 0) { $field['extension_delay'] = "0"; }
|
||||
if (strlen($field['extension_timeout']) == 0) { $field['extension_timeout'] = "30"; }
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vtable'>".$field['extension']."</td>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
echo " ".$field['extension'];
|
||||
echo " </td>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
echo " ".$field['extension_delay']." \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
echo " ".$field['extension_timeout']." \n";
|
||||
echo " </td>\n";
|
||||
echo " <td>\n";
|
||||
echo " <a href='ring_groups_edit.php?id=".$field['ring_group_extension_uuid']."&ring_group_uuid=".$ring_group_uuid."&a=delete' alt='delete' onclick=\"return confirm('".$text['message-delete']."')\">$v_link_label_delete</a>\n";
|
||||
echo " </td>\n";
|
||||
|
|
@ -463,6 +513,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo " <option value='".$field['extension_uuid']."'>".$field['extension']."</option>\n";
|
||||
}
|
||||
echo " </select>";
|
||||
echo " \n";
|
||||
|
||||
echo " ".$text['label-delay']." ";
|
||||
destination_select('extension_delay', $extension_delay, '0');
|
||||
echo " ".$text['label-timeout']." \n";
|
||||
destination_select('extension_timeout', $extension_timeout, '30');
|
||||
if ($action == "update") {
|
||||
echo " <input type=\"submit\" class='btn' value=\"".$text['button-add']."\">\n";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue