Enable the changes to do not disturb that make it far more efficient and no longer dependent on hunt groups. It is also compatible with the extensions and dialplan running from the database without any additional work for the system.

This commit is contained in:
Mark Crane 2012-09-29 21:53:24 +00:00
parent f233f207fb
commit 634f55f610
2 changed files with 26 additions and 32 deletions

View File

@ -34,23 +34,24 @@ else {
exit; exit;
} }
function destination_select($select_name, $select_value, $select_default) { //define the destination_select function
if (strlen($select_value) == 0) { $select_value = $select_default; } function destination_select($select_name, $select_value, $select_default) {
echo " <select class='formfld' style='width: 45px;' name='$select_name'>\n"; if (strlen($select_value) == 0) { $select_value = $select_default; }
echo " <option value=''></option>\n"; echo " <select class='formfld' style='width: 45px;' name='$select_name'>\n";
echo " <option value=''></option>\n";
$i=5; $i=5;
while($i<=100) { while($i<=100) {
if ($select_value == $i) { if ($select_value == $i) {
echo " <option value='$i' selected='selected'>$i</option>\n"; echo " <option value='$i' selected='selected'>$i</option>\n";
}
else {
echo " <option value='$i'>$i</option>\n";
}
$i=$i+5;
} }
else { echo "</select>\n";
echo " <option value='$i'>$i</option>\n";
}
$i=$i+5;
} }
echo "</select>\n";
}
//get the extension_uuid //get the extension_uuid
$extension_uuid = $_REQUEST["id"]; $extension_uuid = $_REQUEST["id"];
@ -286,9 +287,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
unset ($prep_statement); unset ($prep_statement);
//include the classes //include the classes
include "includes/classes/call_forward.php"; include "includes/classes/switch_call_forward.php";
include "includes/classes/follow_me.php"; include "includes/classes/switch_follow_me.php";
include "includes/classes/do_not_disturb.php"; include "includes/classes/switch_do_not_disturb.php";
//call forward config //call forward config
if (permission_exists('call_forward')) { if (permission_exists('call_forward')) {

View File

@ -57,8 +57,7 @@ $order = $_GET["order"];
echo " <br />"; echo " <br />";
} }
$sql = ""; $sql = "select * from v_extensions ";
$sql .= " select * from v_extensions ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and enabled = 'true' "; $sql .= "and enabled = 'true' ";
if (!(if_group("admin") || if_group("superadmin"))) { if (!(if_group("admin") || if_group("superadmin"))) {
@ -96,8 +95,7 @@ $order = $_GET["order"];
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
$sql = ""; $sql = "select * from v_extensions ";
$sql .= " select * from v_extensions ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and enabled = 'true' "; $sql .= "and enabled = 'true' ";
if (!(if_group("admin") || if_group("superadmin"))) { if (!(if_group("admin") || if_group("superadmin"))) {
@ -129,7 +127,6 @@ $order = $_GET["order"];
$result_count = count($result); $result_count = count($result);
unset ($prep_statement, $sql); unset ($prep_statement, $sql);
$c = 0; $c = 0;
$row_style["0"] = "row_style0"; $row_style["0"] = "row_style0";
$row_style["1"] = "row_style1"; $row_style["1"] = "row_style1";
@ -141,27 +138,24 @@ $order = $_GET["order"];
echo "<th>Description</th>\n"; echo "<th>Description</th>\n";
echo "</tr>\n"; echo "</tr>\n";
if ($result_count == 0) { if ($result_count > 0) {
//no results
}
else { //received results
foreach($result as $row) { foreach($result as $row) {
echo "<tr >\n"; echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[extension]."</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row['extension']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>\n"; echo " <td valign='top' class='".$row_style[$c]."'>\n";
if (permission_exists('call_forward')) { if (permission_exists('call_forward')) {
echo " <a href='".PROJECT_PATH."/app/calls/v_call_edit.php?id=".$row[extension_uuid]."&a=call_forward' alt='Call Forward'>Call Forward</a> \n"; echo " <a href='".PROJECT_PATH."/app/calls/v_call_edit.php?id=".$row['extension_uuid']."&a=call_forward' alt='Call Forward'>Call Forward</a> \n";
echo " &nbsp;&nbsp;\n"; echo " &nbsp;&nbsp;\n";
} }
if (permission_exists('follow_me')) { if (permission_exists('follow_me')) {
echo " <a href='".PROJECT_PATH."/app/calls/v_call_edit.php?id=".$row[extension_uuid]."&a=follow_me' alt='Follow Me'>Follow Me</a> \n"; echo " <a href='".PROJECT_PATH."/app/calls/v_call_edit.php?id=".$row['extension_uuid']."&a=follow_me' alt='Follow Me'>Follow Me</a> \n";
echo " &nbsp;&nbsp;\n"; echo " &nbsp;&nbsp;\n";
} }
if (permission_exists('do_not_disturb')) { if (permission_exists('do_not_disturb')) {
echo " <a href='".PROJECT_PATH."/app/calls/v_call_edit.php?id=".$row[extension_uuid]."&a=do_not_disturb' alt='Do Not Disturb'>Do Not Disturb</a> \n"; echo " <a href='".PROJECT_PATH."/app/calls/v_call_edit.php?id=".$row['extension_uuid']."&a=do_not_disturb' alt='Do Not Disturb'>Do Not Disturb</a> \n";
} }
echo " </td>\n"; echo " </td>\n";
echo " <td valign='top' class='row_stylebg' width='40%'>".$row[description]."&nbsp;</td>\n"; echo " <td valign='top' class='row_stylebg' width='40%'>".$row['description']."&nbsp;</td>\n";
echo "</tr>\n"; echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; } if ($c==0) { $c=1; } else { $c=0; }
} //end foreach } //end foreach
@ -192,5 +186,4 @@ $order = $_GET["order"];
require_once "includes/footer.php"; require_once "includes/footer.php";
} }
?> ?>