Theme: Minor CSS tweaks.
Ring Groups: Rework forwarding controls - integrate into Dashboard view and Ring Group edit page.
This commit is contained in:
parent
6976624c67
commit
a1dda766d8
|
|
@ -253,17 +253,6 @@ $text['label-url']['sv-se'] = "URL";
|
||||||
$text['label-url']['de-at'] = "URL";
|
$text['label-url']['de-at'] = "URL";
|
||||||
$text['label-url']['he'] = "";
|
$text['label-url']['he'] = "";
|
||||||
|
|
||||||
$text['label-tools']['en-us'] = "Tools";
|
|
||||||
$text['label-tools']['es-cl'] = "Herramientas";
|
|
||||||
$text['label-tools']['fr-fr'] = "Outils";
|
|
||||||
$text['label-tools']['pt-pt'] = "Ferramentas";
|
|
||||||
$text['label-tools']['pt-br'] = "Ferramentas";
|
|
||||||
$text['label-tools']['pl'] = "Narzędzia";
|
|
||||||
$text['label-tools']['sv-se'] = "Verktyg";
|
|
||||||
$text['label-tools']['uk'] = "Параметри";
|
|
||||||
$text['label-tools']['de-at'] = "Funktionen";
|
|
||||||
$text['label-tools']['he'] = "כלים";
|
|
||||||
|
|
||||||
$text['label-timeout_destination']['en-us'] = "Timeout Destination";
|
$text['label-timeout_destination']['en-us'] = "Timeout Destination";
|
||||||
$text['label-timeout_destination']['es-cl'] = "Timeout de destino";
|
$text['label-timeout_destination']['es-cl'] = "Timeout de destino";
|
||||||
$text['label-timeout_destination']['fr-fr'] = "Destination si non réponse";
|
$text['label-timeout_destination']['fr-fr'] = "Destination si non réponse";
|
||||||
|
|
@ -363,6 +352,20 @@ $text['label-missed_call']['sv-se'] = "Missat Samtal";
|
||||||
$text['label-missed_call']['de-at'] = "Verpasster Anruf";
|
$text['label-missed_call']['de-at'] = "Verpasster Anruf";
|
||||||
$text['label-missed_call']['he'] = "שיחה שלא נענתה";
|
$text['label-missed_call']['he'] = "שיחה שלא נענתה";
|
||||||
|
|
||||||
|
$text['label-forwarding']['en-us'] = "Forwarding";
|
||||||
|
$text['label-forwarding']['es-cl'] = "reenvío";
|
||||||
|
$text['label-forwarding']['pt-pt'] = "encaminhando";
|
||||||
|
$text['label-forwarding']['fr-fr'] = "Expéditeur";
|
||||||
|
$text['label-forwarding']['pt-br'] = "encaminhando";
|
||||||
|
$text['label-forwarding']['pl'] = "Przekierowanie";
|
||||||
|
$text['label-forwarding']['he'] = "שילוח";
|
||||||
|
$text['label-forwarding']['uk'] = "експедиція";
|
||||||
|
$text['label-forwarding']['sv-se'] = "Spedition";
|
||||||
|
$text['label-forwarding']['de-at'] = "Weiterleiten";
|
||||||
|
$text['label-forwarding']['ro'] = "expediere";
|
||||||
|
$text['label-forwarding']['fa'] = "";
|
||||||
|
$text['label-forwarding']['ar-eg'] = "إعادة توجيه";
|
||||||
|
|
||||||
$text['label-forward_destination']['en-us'] = "Number";
|
$text['label-forward_destination']['en-us'] = "Number";
|
||||||
$text['label-forward_destination']['es-cl'] = "Número";
|
$text['label-forward_destination']['es-cl'] = "Número";
|
||||||
$text['label-forward_destination']['fr-fr'] = "Numéro";
|
$text['label-forward_destination']['fr-fr'] = "Numéro";
|
||||||
|
|
@ -648,16 +651,16 @@ $text['description-ringback']['uk'] = "";
|
||||||
$text['description-ringback']['de-at'] = "Definiert was der Anrufer hört, während die Ziele angerufen werden.";
|
$text['description-ringback']['de-at'] = "Definiert was der Anrufer hört, während die Ziele angerufen werden.";
|
||||||
$text['description-ringback']['he'] = "";
|
$text['description-ringback']['he'] = "";
|
||||||
|
|
||||||
$text['description-ring-group-forward']['en-us'] = "Forwards calls to an alternate destination for extension ";
|
$text['description-ring-group-forward']['en-us'] = "Forward a called Ring Group to an alternate destination.";
|
||||||
$text['description-ring-group-forward']['es-cl'] = "Desvía las llamadas a un destino alternativo";
|
$text['description-ring-group-forward']['es-cl'] = "Reenviar una llamada de grupo de anillo a un destino alternativo.";
|
||||||
$text['description-ring-group-forward']['fr-fr'] = "Renvoyer les appels vers une destination alternative ";
|
$text['description-ring-group-forward']['fr-fr'] = "Transférer un groupe appelé Anneau vers une autre destination.";
|
||||||
$text['description-ring-group-forward']['pt-pt'] = "Encaminhar chamadas para um destino alternativo.";
|
$text['description-ring-group-forward']['pt-pt'] = "Encaminhar uma chamada Grupo de toque em um destino alternativo.";
|
||||||
$text['description-ring-group-forward']['pt-br'] = "Encaminhar chamadas para um destino alternativo";
|
$text['description-ring-group-forward']['pt-br'] = "Encaminhar uma chamada Grupo de toque em um destino alternativo.";
|
||||||
$text['description-ring-group-forward']['pl'] = "Przekazuje rozmowy na alternatywny numer.";
|
$text['description-ring-group-forward']['pl'] = "Przekazuje rozmowy na alternatywny numer.";
|
||||||
$text['description-ring-group-forward']['sv-se'] = "Vidarekoppla samtal till en alternativ destination för anknytning.";
|
$text['description-ring-group-forward']['sv-se'] = "Vidarekoppla samtal till en alternativ destination för anknytning.";
|
||||||
$text['description-ring-group-forward']['uk'] = "";
|
$text['description-ring-group-forward']['uk'] = "Перенаправлення під назвою Ring Group в альтернативне місце призначення.";
|
||||||
$text['description-ring-group-forward']['de-at'] = "Leitet Anrufe an ein alternatives Ziel weiter.";
|
$text['description-ring-group-forward']['de-at'] = "Leitet Anrufe an ein alternatives Ziel weiter.";
|
||||||
$text['description-ring-group-forward']['he'] = "";
|
$text['description-ring-group-forward']['he'] = "קדימה שנקראה טבעת קבוצת יעד חלופי.";
|
||||||
|
|
||||||
$text['description-name']['en-us'] = "Enter a name.";
|
$text['description-name']['en-us'] = "Enter a name.";
|
||||||
$text['description-name']['es-cl'] = "Ingrese un nombre.";
|
$text['description-name']['es-cl'] = "Ingrese un nombre.";
|
||||||
|
|
@ -755,17 +758,4 @@ $text['description-cid-name-prefix']['pl'] = "Prefiks prezentacji nazwy dzwonią
|
||||||
$text['description-cid-name-prefix']['sv-se'] = "Ange namnpresentation prefix.";
|
$text['description-cid-name-prefix']['sv-se'] = "Ange namnpresentation prefix.";
|
||||||
$text['description-cid-name-prefix']['uk'] = "";
|
$text['description-cid-name-prefix']['uk'] = "";
|
||||||
$text['description-cid-name-prefix']['de-at'] = "Setzen Sie ein Präfix für die Anruferkennung (Name)";
|
$text['description-cid-name-prefix']['de-at'] = "Setzen Sie ein Präfix für die Anruferkennung (Name)";
|
||||||
$text['description-cid-name-prefix']['he'] = "";
|
$text['description-cid-name-prefix
|
||||||
|
|
||||||
$text['description']['en-us'] = "A ring group is a set of destinations that can be called with a ring strategy.";
|
|
||||||
$text['description']['es-cl'] = "Un grupo de llamado es un conjunto de destino que pueden ser llamados con una estrategía de llamado.";
|
|
||||||
$text['description']['fr-fr'] = "Un groupe de sonnerie est un groupe de destinations pouvant être appelé via une stratégie de sonnerie.";
|
|
||||||
$text['description']['pt-pt'] = "Um grupo é um conjunto de destinos que podem ser chamados segunda uma determinada estratégia.";
|
|
||||||
$text['description']['pt-br'] = "Editar informações da conta.";
|
|
||||||
$text['description']['pl'] = "Grupa odbiorców rozmowy składa się z kilku destynacji (numery kom, stacjonarne lub numery wew) na które można dzwonić za pomocą różnych strategii.";
|
|
||||||
$text['description']['sv-se'] = "En ringgrupp är en uppsättning av destinationer som kan anropas med en ringstrategi.";
|
|
||||||
$text['description']['uk'] = "Редагування інформації облікового запису";
|
|
||||||
$text['description']['de-at'] = "Rufgruppen sind gruppierte Ziele, welche über eine vordefinierte Rufstrategie angerufen werden.";
|
|
||||||
$text['description']['he'] = "ערוך את פרטי החשבון";
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
@ -102,6 +102,8 @@ else {
|
||||||
$ring_group_skip_active = check_str($_POST["ring_group_skip_active"]);
|
$ring_group_skip_active = check_str($_POST["ring_group_skip_active"]);
|
||||||
$ring_group_missed_call_app = check_str($_POST["ring_group_missed_call_app"]);
|
$ring_group_missed_call_app = check_str($_POST["ring_group_missed_call_app"]);
|
||||||
$ring_group_missed_call_data = check_str($_POST["ring_group_missed_call_data"]);
|
$ring_group_missed_call_data = check_str($_POST["ring_group_missed_call_data"]);
|
||||||
|
$ring_group_forward_enabled = check_str($_POST["ring_group_forward_enabled"]);
|
||||||
|
$ring_group_forward_destination = check_str($_POST["ring_group_forward_destination"]);
|
||||||
$ring_group_enabled = check_str($_POST["ring_group_enabled"]);
|
$ring_group_enabled = check_str($_POST["ring_group_enabled"]);
|
||||||
$ring_group_description = check_str($_POST["ring_group_description"]);
|
$ring_group_description = check_str($_POST["ring_group_description"]);
|
||||||
$dialplan_uuid = check_str($_POST["dialplan_uuid"]);
|
$dialplan_uuid = check_str($_POST["dialplan_uuid"]);
|
||||||
|
|
@ -392,6 +394,8 @@ else {
|
||||||
$ring_group_skip_active = $row["ring_group_skip_active"];
|
$ring_group_skip_active = $row["ring_group_skip_active"];
|
||||||
$ring_group_missed_call_app = $row["ring_group_missed_call_app"];
|
$ring_group_missed_call_app = $row["ring_group_missed_call_app"];
|
||||||
$ring_group_missed_call_data = $row["ring_group_missed_call_data"];
|
$ring_group_missed_call_data = $row["ring_group_missed_call_data"];
|
||||||
|
$ring_group_forward_enabled = $row["ring_group_forward_enabled"];
|
||||||
|
$ring_group_forward_destination = $row["ring_group_forward_destination"];
|
||||||
$ring_group_enabled = $row["ring_group_enabled"];
|
$ring_group_enabled = $row["ring_group_enabled"];
|
||||||
$ring_group_description = $row["ring_group_description"];
|
$ring_group_description = $row["ring_group_description"];
|
||||||
$dialplan_uuid = $row["dialplan_uuid"];
|
$dialplan_uuid = $row["dialplan_uuid"];
|
||||||
|
|
@ -405,7 +409,7 @@ else {
|
||||||
//get the ring group destination array
|
//get the ring group destination array
|
||||||
if ($action == "add") { $x = 0; $limit = 5; }
|
if ($action == "add") { $x = 0; $limit = 5; }
|
||||||
if (strlen($ring_group_uuid) > 0) {
|
if (strlen($ring_group_uuid) > 0) {
|
||||||
$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."' ";
|
||||||
$sql .= "order by destination_delay, destination_number asc ";
|
$sql .= "order by destination_delay, destination_number asc ";
|
||||||
|
|
@ -427,7 +431,7 @@ else {
|
||||||
|
|
||||||
//get the ring group users
|
//get the ring group users
|
||||||
if (strlen($ring_group_uuid) > 0) {
|
if (strlen($ring_group_uuid) > 0) {
|
||||||
$sql = "SELECT u.username, r.user_uuid, r.ring_group_uuid FROM v_ring_group_users as r, v_users as u ";
|
$sql = "select u.username, r.user_uuid, r.ring_group_uuid from v_ring_group_users as r, v_users as u ";
|
||||||
$sql .= "where r.user_uuid = u.user_uuid ";
|
$sql .= "where r.user_uuid = u.user_uuid ";
|
||||||
$sql .= "and u.user_enabled = 'true' ";
|
$sql .= "and u.user_enabled = 'true' ";
|
||||||
$sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
$sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||||
|
|
@ -455,14 +459,14 @@ else {
|
||||||
echo "<form method='post' name='frm' action=''>\n";
|
echo "<form method='post' name='frm' action=''>\n";
|
||||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['label-ring-group']."</b></td>\n";
|
echo "<td align='left' width='30%' nowrap='nowrap' valign='top'><b>".$text['label-ring-group']."</b></td>\n";
|
||||||
echo "<td width='70%' align='right'>\n";
|
echo "<td width='70%' align='right'>\n";
|
||||||
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='ring_groups.php'\" value='".$text['button-back']."'>\n";
|
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='ring_groups.php'\" value='".$text['button-back']."'>\n";
|
||||||
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo "<td align='left' colspan='2'>\n";
|
echo "<td align='left' colspan='2' valign='top'>\n";
|
||||||
echo $text['description']."<br /><br />\n";
|
echo $text['description']."<br /><br />\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
@ -774,6 +778,21 @@ else {
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "<tr>\n";
|
||||||
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||||
|
echo " ".$text['label-forwarding']."\n";
|
||||||
|
echo "</td>\n";
|
||||||
|
echo "<td class='vtable' align='left'>\n";
|
||||||
|
echo " <select class='formfld' name='ring_group_forward_enabled' id='ring_group_forward_enabled' onchange=\"(this.selectedIndex == 1) ? document.getElementById('ring_group_forward_destination').focus() : null;\">";
|
||||||
|
echo " <option value='false'>".$text['option-disabled']."</option>";
|
||||||
|
echo " <option value='true' ".(($ring_group_forward_enabled == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>";
|
||||||
|
echo " </select>";
|
||||||
|
echo "<input class='formfld' style='min-width: 95px;' type='text' name='ring_group_forward_destination' id='ring_group_forward_destination' placeholder=\"".$text['label-forward_destination']."\" maxlength='255' value=\"".$ring_group_forward_destination."\">";
|
||||||
|
echo "<br />\n";
|
||||||
|
echo $text['description-ring-group-forward']."\n";
|
||||||
|
echo "</td>\n";
|
||||||
|
echo "</tr>\n";
|
||||||
|
|
||||||
if (if_group("superadmin")) {
|
if (if_group("superadmin")) {
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
require_once "root.php";
|
require_once "root.php";
|
||||||
require_once "resources/require.php";
|
require_once "resources/require.php";
|
||||||
require_once "resources/check_auth.php";
|
require_once "resources/check_auth.php";
|
||||||
if (permission_exists('ring_group_forward')) {
|
if (permission_exists('ring_group_edit') || permission_exists('ring_group_forward')) {
|
||||||
//access granted
|
//access granted
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -46,23 +46,32 @@ require_once "resources/paging.php";
|
||||||
$order_by = $_GET["order_by"];
|
$order_by = $_GET["order_by"];
|
||||||
$order = $_GET["order"];
|
$order = $_GET["order"];
|
||||||
|
|
||||||
//show the content
|
//update ring group forwarding
|
||||||
|
if (sizeof($_POST) > 0) {
|
||||||
|
$ring_groups = $_POST['ring_group_forward_enabled'];
|
||||||
|
$destinations = $_POST['ring_group_forward_destination'];
|
||||||
|
|
||||||
if (!$is_included) {
|
if (is_array($ring_groups) && sizeof($ring_groups) > 0) {
|
||||||
echo "<table width='100%' border='0'>\n";
|
foreach ($ring_groups as $ring_group_uuid => $ring_group_forward_enabled) {
|
||||||
echo " <tr>\n";
|
//remove non-numeric characters
|
||||||
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-ring_groups']."</b></td>\n";
|
$ring_group_foreward_destination = preg_replace("~[^0-9]~", "", $destinations[$ring_group_uuid]);
|
||||||
echo " <td width='50%' align='right'> </td>\n";
|
//update the ring group
|
||||||
echo " </tr>\n";
|
$sql = "update v_ring_groups set ";
|
||||||
echo " <tr>\n";
|
$sql .= "ring_group_forward_enabled = '".check_str($ring_group_forward_enabled)."', ";
|
||||||
echo " <td align='left' colspan='2'>\n";
|
$sql .= "ring_group_forward_destination = '".check_str($ring_group_foreward_destination)."' ";
|
||||||
echo " ".$text['description']."<br /><br />\n";
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||||
echo " </td>\n";
|
$sql .= "and ring_group_uuid = '".$ring_group_uuid."' ";
|
||||||
echo " </tr>\n";
|
$db->exec(check_sql($sql));
|
||||||
echo "</table>\n";
|
unset($sql);
|
||||||
|
}
|
||||||
|
//redirect the user
|
||||||
|
$_SESSION["message"] = $text['message-update'];
|
||||||
|
header("Location: ".$_REQUEST['return_url']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//prepare to page the results
|
//prepare to page the results
|
||||||
if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) {
|
if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) {
|
||||||
//show all ring groups
|
//show all ring groups
|
||||||
$sql = "select count(*) as num_rows from v_ring_groups ";
|
$sql = "select count(*) as num_rows from v_ring_groups ";
|
||||||
|
|
@ -88,12 +97,9 @@ require_once "resources/paging.php";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//prepare to page the results
|
//prepare to page the results
|
||||||
if ($is_included == 'true') {
|
if ($is_included == 'true') {
|
||||||
$rows_per_page = 10;
|
$rows_per_page = 10;
|
||||||
if ($num_rows > 10) {
|
|
||||||
echo "<script>document.getElementById('btn_viewall_ringgroups').style.display = 'inline';</script>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||||
|
|
@ -104,14 +110,14 @@ require_once "resources/paging.php";
|
||||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||||
$offset = $rows_per_page * $page;
|
$offset = $rows_per_page * $page;
|
||||||
|
|
||||||
//get the list
|
//get the list
|
||||||
if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) {
|
if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) {
|
||||||
//show all ring groups
|
//show all ring groups
|
||||||
$sql = "select * from v_ring_groups ";
|
$sql = "select * from v_ring_groups ";
|
||||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//show only assigned fax extensions
|
//show only assigned ring groups
|
||||||
$sql = "select r.ring_group_uuid, r.ring_group_extension, r.ring_group_description from v_ring_groups as r, v_ring_group_users as u ";
|
$sql = "select r.ring_group_uuid, r.ring_group_extension, r.ring_group_description from v_ring_groups as r, v_ring_group_users as u ";
|
||||||
$sql .= "where r.ring_group_uuid = u.ring_group_uuid ";
|
$sql .= "where r.ring_group_uuid = u.ring_group_uuid ";
|
||||||
$sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
$sql .= "and r.domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||||
|
|
@ -121,48 +127,77 @@ require_once "resources/paging.php";
|
||||||
$sql .= "order by ring_group_extension asc ";
|
$sql .= "order by ring_group_extension asc ";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$sql .= "order by $order_by $order ";
|
$sql .= "order by ".$order_by." ".$order." ";
|
||||||
}
|
}
|
||||||
$sql .= " limit $rows_per_page offset $offset ";
|
$sql .= " limit ".$rows_per_page." offset ".$offset." ";
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$result = $prep_statement->fetchAll();
|
$result = $prep_statement->fetchAll();
|
||||||
$result_count = count($result);
|
$result_count = count($result);
|
||||||
unset ($prep_statement, $sql);
|
unset ($prep_statement, $sql);
|
||||||
|
|
||||||
$c = 0;
|
if ($num_rows > 10) {
|
||||||
$row_style["0"] = "row_style0";
|
echo " <div style='float: right;'><input id='btn_viewall_ringgroups' type='button' class='btn' value='".$text['button-view_all']."' onclick=\"document.location.href='".PROJECT_PATH."/app/ring_groups/ring_group_forward.php';\"></div>\n";
|
||||||
$row_style["1"] = "row_style1";
|
}
|
||||||
|
echo " <div style='float: left;'>";
|
||||||
|
echo " <b>".$text['header-ring-group-forward']."</b><br />";
|
||||||
|
if (!$is_included) {
|
||||||
|
echo " ".$text['description-ring-group-forward']."<br />";
|
||||||
|
}
|
||||||
|
echo " <br />";
|
||||||
|
echo " </div>\n";
|
||||||
|
|
||||||
|
echo "<form method='post' name='frm' action='".PROJECT_PATH."/app/ring_groups/ring_group_forward.php'>\n";
|
||||||
|
echo "<input type='hidden' name='return_url' value='".$_SERVER['REQUEST_URI']."'>\n";
|
||||||
|
|
||||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo th_order_by('ring_group_name', $text['label-name'], $order_by, $order);
|
echo th_order_by('ring_group_name', $text['label-name'], $order_by, $order);
|
||||||
echo th_order_by('ring_group_extension', $text['label-extension'], $order_by, $order);
|
echo th_order_by('ring_group_extension', $text['label-extension'], $order_by, $order);
|
||||||
echo "<th>".$text['label-tools']."</th>";
|
echo "<th>".$text['label-forwarding']."</th>";
|
||||||
|
if (!$is_included) {
|
||||||
echo th_order_by('ring_group_description', $text['label-description'], $order_by, $order);
|
echo th_order_by('ring_group_description', $text['label-description'], $order_by, $order);
|
||||||
|
}
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
|
|
||||||
|
$c = 0;
|
||||||
if ($result_count > 0) {
|
if ($result_count > 0) {
|
||||||
foreach($result as $row) {
|
foreach($result as $row) {
|
||||||
$tr_link = "href='".PROJECT_PATH."/app/ring_groups/ring_group_forward_edit.php?id=".$row['ring_group_uuid']."&return_url=".urlencode($_SERVER['PHP_SELF'])."'";
|
$onclick = "onclick=\"document.getElementById('".$row['ring_group_uuid']."').selectedIndex = (document.getElementById('".$row['ring_group_uuid']."').selectedIndex) ? 0 : 1; if (document.getElementById('".$row['ring_group_uuid']."').selectedIndex) { document.getElementById('destination').focus(); }\"";
|
||||||
echo "<tr ".$tr_link.">\n";
|
echo "<tr>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_name']." </td>\n";
|
echo " <td valign='top' class='row_style".$c."' ".$onclick.">".$row['ring_group_name']." </td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_extension']." </td>\n";
|
echo " <td valign='top' class='row_style".$c."' ".$onclick.">".$row['ring_group_extension']." </td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'><a href='".PROJECT_PATH."/app/ring_groups/ring_group_forward_edit.php?id=".$row['ring_group_uuid']."&return_url=".urlencode($_SERVER['PHP_SELF'])."' alt='".$text['link-call-forward']."'>".$text['link-call-forward']."</a></td>\n";
|
echo " <td valign='top' class='row_style".$c." row_style_slim' width='5'>";
|
||||||
echo " <td valign='top' class='row_stylebg'>".$row['ring_group_description']." </td>\n";
|
echo " <select class='formfld' name='ring_group_forward_enabled[".$row['ring_group_uuid']."]' id='".$row['ring_group_uuid']."' onchange=\"(this.selectedIndex == 1) ? document.getElementById('destination').focus() : null;\">";
|
||||||
|
echo " <option value='false'>".$text['option-disabled']."</option>";
|
||||||
|
echo " <option value='true' ".(($row["ring_group_forward_enabled"] == 'true') ? "selected='selected'" : null).">".$text['option-enabled']."</option>";
|
||||||
|
echo " </select>";
|
||||||
|
echo "<input class='formfld' style='min-width: 95px;' type='text' name='ring_group_forward_destination[".$row['ring_group_uuid']."]' id='destination' placeholder=\"".$text['label-forward_destination']."\" maxlength='255' value=\"".$row["ring_group_forward_destination"]."\">";
|
||||||
|
echo " </td>\n";
|
||||||
|
if (!$is_included) {
|
||||||
|
echo " <td valign='top' class='row_stylebg tr_link_void' ".$onclick.">".$row['ring_group_description']." </td>\n";
|
||||||
|
}
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
if ($c==0) { $c=1; } else { $c=0; }
|
$c = ($c) ? 0 : 1;
|
||||||
} //end foreach
|
}
|
||||||
unset($sql, $result, $row_count);
|
unset($sql, $result, $row_count);
|
||||||
} //end if results
|
}
|
||||||
|
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
echo "<br>";
|
||||||
|
|
||||||
|
if ($result_count > 0) {
|
||||||
|
echo "<div style='float: right;'><input type='submit' class='btn' value='".$text['button-save']."'></div>\n";
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "</form>";
|
||||||
|
|
||||||
|
if (!$is_included) {
|
||||||
echo "<center>".$paging_controls."</center>\n";
|
echo "<center>".$paging_controls."</center>\n";
|
||||||
|
echo "<br><br>";
|
||||||
echo "</div>";
|
}
|
||||||
|
|
||||||
//include the footer
|
//include the footer
|
||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
|
||||||
|
|
@ -1,175 +0,0 @@
|
||||||
<?php
|
|
||||||
/*
|
|
||||||
FusionPBX
|
|
||||||
Version: MPL 1.1
|
|
||||||
|
|
||||||
The contents of this file are subject to the Mozilla Public License Version
|
|
||||||
1.1 (the "License"); you may not use this file except in compliance with
|
|
||||||
the License. You may obtain a copy of the License at
|
|
||||||
http://www.mozilla.org/MPL/
|
|
||||||
|
|
||||||
Software distributed under the License is distributed on an "AS IS" basis,
|
|
||||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
||||||
for the specific language governing rights and limitations under the
|
|
||||||
License.
|
|
||||||
|
|
||||||
The Original Code is FusionPBX
|
|
||||||
|
|
||||||
The Initial Developer of the Original Code is
|
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
|
||||||
Portions created by the Initial Developer are Copyright (C) 2013
|
|
||||||
the Initial Developer. All Rights Reserved.
|
|
||||||
|
|
||||||
Contributor(s):
|
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
|
||||||
*/
|
|
||||||
require_once "root.php";
|
|
||||||
require_once "resources/require.php";
|
|
||||||
require_once "resources/check_auth.php";
|
|
||||||
|
|
||||||
//check permissions
|
|
||||||
if (permission_exists('ring_group_add') || permission_exists('ring_group_edit') || permission_exists('ring_group_forward')) {
|
|
||||||
//access granted
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo "access denied";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
//add multi-lingual support
|
|
||||||
$language = new text;
|
|
||||||
$text = $language->get();
|
|
||||||
|
|
||||||
//show the header
|
|
||||||
require_once "resources/header.php";
|
|
||||||
//$document['title-ring_groups'] = $text['title-ring_group_forward'];
|
|
||||||
|
|
||||||
//get the hunt_group_uuid
|
|
||||||
$ring_group_uuid = check_str($_REQUEST["id"]);
|
|
||||||
|
|
||||||
//process the HTTP post
|
|
||||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
||||||
//get http post variables and set them to php variables
|
|
||||||
if (count($_POST)>0) {
|
|
||||||
$ring_group_forward_enabled = check_str($_POST["ring_group_forward_enabled"]);
|
|
||||||
$ring_group_forward_destination = check_str($_POST["ring_group_forward_destination"]);
|
|
||||||
if (strlen($ring_group_forward_destination) > 0) {
|
|
||||||
$ring_group_forward_destination = preg_replace("~[^0-9]~", "",$ring_group_forward_destination);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//check for all required data
|
|
||||||
//if (strlen($ring_group_forward_enabled) == 0) { $msg .= $text['message-required'].$text['label-call_forward']."<br>\n"; }
|
|
||||||
//if (strlen($ring_group_forward_destination) == 0) { $msg .= $text['message-required'].$text['label-number']."<br>\n"; }
|
|
||||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|
||||||
require_once "resources/header.php";
|
|
||||||
require_once "resources/persist_form_var.php";
|
|
||||||
echo "<div align='center'>\n";
|
|
||||||
echo "<table><tr><td>\n";
|
|
||||||
echo $msg."<br />";
|
|
||||||
echo "</td></tr></table>\n";
|
|
||||||
persistformvar($_POST);
|
|
||||||
echo "</div>\n";
|
|
||||||
require_once "resources/footer.php";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//update the ring group
|
|
||||||
$sql = "update v_ring_groups set ";
|
|
||||||
$sql .= "ring_group_forward_enabled = '$ring_group_forward_enabled', ";
|
|
||||||
$sql .= "ring_group_forward_destination = '$ring_group_forward_destination' ";
|
|
||||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
||||||
$sql .= "and ring_group_uuid = '$ring_group_uuid' ";
|
|
||||||
$db->exec(check_sql($sql));
|
|
||||||
unset($sql);
|
|
||||||
|
|
||||||
//redirect the user
|
|
||||||
$_SESSION["message"] = $text['message-update'];
|
|
||||||
header("Location: ".$_REQUEST['return_url']);
|
|
||||||
return;
|
|
||||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
|
||||||
|
|
||||||
//pre-populate the form
|
|
||||||
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
|
|
||||||
$ring_group_uuid = $_GET["id"];
|
|
||||||
$sql = "select * from v_ring_groups ";
|
|
||||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
||||||
$sql .= "and ring_group_uuid = '$ring_group_uuid' ";
|
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
|
||||||
$prep_statement->execute();
|
|
||||||
$result = $prep_statement->fetchAll();
|
|
||||||
foreach ($result as &$row) {
|
|
||||||
$ring_group_name = $row["ring_group_name"];
|
|
||||||
$ring_group_extension = $row["ring_group_extension"];
|
|
||||||
$ring_group_forward_enabled = $row["ring_group_forward_enabled"];
|
|
||||||
$ring_group_forward_destination = $row["ring_group_forward_destination"];
|
|
||||||
$ring_group_description = $row["ring_group_description"];
|
|
||||||
}
|
|
||||||
unset ($prep_statement);
|
|
||||||
}
|
|
||||||
|
|
||||||
//show the content
|
|
||||||
echo "<form method='post' name='frm' action=''>\n";
|
|
||||||
echo "<input type='hidden' name='return_url' value='".$_REQUEST['return_url']."'>\n";
|
|
||||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
||||||
echo "<tr>\n";
|
|
||||||
echo "<td align='left' width='30%' nowrap>\n";
|
|
||||||
echo " <b>".$text['header-ring-group-forward']."</b>\n";
|
|
||||||
echo "</td>\n";
|
|
||||||
echo "<td width='70%' align='right'>\n";
|
|
||||||
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='".$_REQUEST['return_url']."';\" value='".$text['button-back']."'>\n";
|
|
||||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
|
||||||
echo "</td>\n";
|
|
||||||
echo "</tr>\n";
|
|
||||||
echo "<tr>\n";
|
|
||||||
echo "<td colspan='2'>\n";
|
|
||||||
echo " ".$text['description-ring-group-forward']." ".$ring_group_extension."<br /><br />\n";
|
|
||||||
echo "</td>\n";
|
|
||||||
echo "</tr>\n";
|
|
||||||
|
|
||||||
echo "<tr>\n";
|
|
||||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
|
||||||
echo " <strong>".$text['label-call-forward']."</strong>\n";
|
|
||||||
echo "</td>\n";
|
|
||||||
echo "<td class='vtable' align='left'>\n";
|
|
||||||
if ($ring_group_forward_enabled == "true") {
|
|
||||||
echo " <input type='radio' name='ring_group_forward_enabled' value='true' checked='checked'/> ".$text['option-enabled']." \n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo " <input type='radio' name='ring_group_forward_enabled' value='true' /> ".$text['option-enabled']." \n";
|
|
||||||
}
|
|
||||||
if ($ring_group_forward_enabled == "false" || $ring_group_forward_enabled == "") {
|
|
||||||
echo " <input type='radio' name='ring_group_forward_enabled' value='false' checked='checked' /> ".$text['option-disabled']." \n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo " <input type='radio' name='ring_group_forward_enabled' value='false' /> ".$text['option-disabled']." \n";
|
|
||||||
}
|
|
||||||
echo "<br />\n";
|
|
||||||
echo "<br />\n";
|
|
||||||
echo "</td>\n";
|
|
||||||
echo "</tr>\n";
|
|
||||||
|
|
||||||
echo "<tr>\n";
|
|
||||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
|
||||||
echo " ".$text['label-forward_destination']."\n";
|
|
||||||
echo "</td>\n";
|
|
||||||
echo "<td class='vtable' align='left'>\n";
|
|
||||||
echo " <input class='formfld' type='text' name='ring_group_forward_destination' maxlength='255' value=\"$ring_group_forward_destination\">\n";
|
|
||||||
echo "<br />\n";
|
|
||||||
echo "</td>\n";
|
|
||||||
echo "</tr>\n";
|
|
||||||
|
|
||||||
echo " <tr>\n";
|
|
||||||
echo " <td colspan='2' align='right'>\n";
|
|
||||||
echo " <input type='hidden' name='id' value='$ring_group_uuid'>\n";
|
|
||||||
echo " <br>";
|
|
||||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
|
||||||
echo " </td>\n";
|
|
||||||
echo " </tr>";
|
|
||||||
echo "</table>";
|
|
||||||
echo "<br><br>";
|
|
||||||
echo "</form>";
|
|
||||||
|
|
||||||
//show the footer
|
|
||||||
require_once "resources/footer.php";
|
|
||||||
?>
|
|
||||||
|
|
@ -114,10 +114,9 @@ require_once "resources/paging.php";
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo th_order_by('ring_group_name', $text['label-name'], $order_by, $order);
|
echo th_order_by('ring_group_name', $text['label-name'], $order_by, $order);
|
||||||
echo th_order_by('ring_group_extension', $text['label-extension'], $order_by, $order);
|
echo th_order_by('ring_group_extension', $text['label-extension'], $order_by, $order);
|
||||||
|
echo th_order_by('ring_group_strategy', $text['label-strategy'], $order_by, $order);
|
||||||
|
echo th_order_by('ring_group_forward_enabled', $text['label-forwarding'], $order_by, $order);
|
||||||
echo th_order_by('ring_group_enabled', $text['label-enabled'], $order_by, $order);
|
echo th_order_by('ring_group_enabled', $text['label-enabled'], $order_by, $order);
|
||||||
if (permission_exists('ring_group_forward')) {
|
|
||||||
echo "<th>".$text['label-tools']."</th>";
|
|
||||||
}
|
|
||||||
echo th_order_by('ring_group_description', $text['header-description'], $order_by, $order);
|
echo th_order_by('ring_group_description', $text['header-description'], $order_by, $order);
|
||||||
echo "<td class='list_control_icons'>";
|
echo "<td class='list_control_icons'>";
|
||||||
if (permission_exists('ring_group_add')) {
|
if (permission_exists('ring_group_add')) {
|
||||||
|
|
@ -141,10 +140,9 @@ require_once "resources/paging.php";
|
||||||
}
|
}
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_extension']." </td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".$row['ring_group_extension']." </td>\n";
|
||||||
|
echo " <td valign='top' class='".$row_style[$c]."'>".$text['option-'.$row['ring_group_strategy']]." </td>\n";
|
||||||
|
echo " <td valign='top' class='".$row_style[$c]."'>".(($row['ring_group_forward_enabled'] == 'true') ? format_phone($row['ring_group_forward_destination']) : null)." </td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-'.$row['ring_group_enabled']]." </td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-'.$row['ring_group_enabled']]." </td>\n";
|
||||||
if (permission_exists('ring_group_forward')) {
|
|
||||||
echo " <td valign='top' class='".$row_style[$c]." tr_link_void'><a href='".PROJECT_PATH."/app/ring_groups/ring_group_forward_edit.php?id=".$row['ring_group_uuid']."&return_url=".urlencode($_SERVER['PHP_SELF'])."' alt='".$text['link-call-forward']."'>".$text['link-call-forward']."</a></td>\n";
|
|
||||||
}
|
|
||||||
echo " <td valign='top' class='row_stylebg'>".$row['ring_group_description']." </td>\n";
|
echo " <td valign='top' class='row_stylebg'>".$row['ring_group_description']." </td>\n";
|
||||||
echo " <td class='list_control_icons'>";
|
echo " <td class='list_control_icons'>";
|
||||||
if (permission_exists('ring_group_edit')) {
|
if (permission_exists('ring_group_edit')) {
|
||||||
|
|
|
||||||
|
|
@ -1078,17 +1078,6 @@ $text['header-user_dashboard']['ro'] = "Panou control utilizator";
|
||||||
$text['header-user_dashboard']['fa'] = "";
|
$text['header-user_dashboard']['fa'] = "";
|
||||||
$text['header-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
|
$text['header-user_dashboard']['ar-eg'] = "الصفحه الرئيسيه للمستخدم";
|
||||||
|
|
||||||
$text['header-ring_groups']['en-us'] = "Ring Groups";
|
|
||||||
$text['header-ring_groups']['es-cl'] = "Grupo de llamado";
|
|
||||||
$text['header-ring_groups']['fr-fr'] = "Groupes de Sonnerie";
|
|
||||||
$text['header-ring_groups']['pt-pt'] = "Grupos";
|
|
||||||
$text['header-ring_groups']['pt-br'] = "Configurações da Conta";
|
|
||||||
$text['header-ring_groups']['pl'] = "Grupy odbiorców rozmów";
|
|
||||||
$text['header-ring_groups']['sv-se'] = "Ringgrupper";
|
|
||||||
$text['header-ring_groups']['uk'] = "Групи";
|
|
||||||
$text['header-ring_groups']['de-at'] = "Rufgruppen";
|
|
||||||
$text['header-ring_groups']['he'] = "קבוצות חיוג";
|
|
||||||
|
|
||||||
$text['header-call_routing']['en-us'] = "Call Routing";
|
$text['header-call_routing']['en-us'] = "Call Routing";
|
||||||
$text['header-call_routing']['es-cl'] = "Enrutamiento de Llamadas";
|
$text['header-call_routing']['es-cl'] = "Enrutamiento de Llamadas";
|
||||||
$text['header-call_routing']['pt-pt'] = "Roteamento de Chamadas";
|
$text['header-call_routing']['pt-pt'] = "Roteamento de Chamadas";
|
||||||
|
|
@ -1293,4 +1282,4 @@ $text['button-view_all']['ro'] = "";
|
||||||
$text['button-view_all']['de-at'] = "Alle anzeigen";
|
$text['button-view_all']['de-at'] = "Alle anzeigen";
|
||||||
$text['button-view_all']['he'] = "הצג הכל";
|
$text['button-view_all']['he'] = "הצג הכל";
|
||||||
|
|
||||||
?>
|
?> | ||||||