Merge branch 'master' of https://github.com/fusionpbx/fusionpbx
This commit is contained in:
commit
64e13cf397
|
|
@ -86,7 +86,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
//get order and order by and sanatize the values
|
||||
//get order and order by
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
|
|
@ -124,8 +124,7 @@
|
|||
if ($_GET['show'] == "all" && permission_exists('bridge_all')) {
|
||||
$param .= "&show=all";
|
||||
}
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
|
||||
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
|
||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
|
@ -225,10 +224,10 @@
|
|||
}
|
||||
echo " <td>";
|
||||
if (permission_exists('bridge_edit')) {
|
||||
echo " <a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['bridge_name'])."</a>\n";
|
||||
echo "<a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['bridge_name'])."</a>";
|
||||
}
|
||||
else {
|
||||
echo " ".escape($row['bridge_name'])."\n";
|
||||
echo escape($row['bridge_name']);
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td>".escape($row['bridge_destination'])."</td>\n";
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2019
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
//prepare to page the results
|
||||
$sql = "select count(*) from view_call_block ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
if (!permission_exists('call_block_all') && count($_SESSION['user']['extension']) > 0) {
|
||||
if (!permission_exists('call_block_all') && is_array($_SESSION['user']['extension'] && count($_SESSION['user']['extension']) > 0)) {
|
||||
$sql .= "and extension_uuid in (";
|
||||
$x = 0;
|
||||
foreach ($_SESSION['user']['extension'] as $field) {
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
//get the list
|
||||
$sql = "select * from view_call_block ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
if (!permission_exists('call_block_all') && count($_SESSION['user']['extension']) > 0) {
|
||||
if (!permission_exists('call_block_all') && is_array($_SESSION['user']['extension'] && count($_SESSION['user']['extension']) > 0)) {
|
||||
$sql .= "and extension_uuid in (";
|
||||
$x = 0;
|
||||
foreach ($_SESSION['user']['extension'] as $field) {
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@
|
|||
unset($sql, $parameters);
|
||||
}
|
||||
|
||||
if (!permission_exists('call_block_all')) {
|
||||
if (!permission_exists('call_block_all') && is_array($_SESSION['user']['extension'])) {
|
||||
foreach ($_SESSION['user']['extension'] as $assigned_extension) {
|
||||
$assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@
|
|||
//echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['call_recording_base64'])." </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('xml_cdr_details')) {
|
||||
echo " <a href='/app/xml_cdr/xml_cdr_details.php?id=".escape($row['call_recording_uuid'])."' title='".$text['button-view']."'>$v_link_label_view</a>";
|
||||
echo " <a href='".PROJECT_PATH."/app/xml_cdr/xml_cdr_details.php?id=".escape($row['call_recording_uuid'])."' title='".$text['button-view']."'>$v_link_label_view</a>";
|
||||
}
|
||||
if (permission_exists('call_recording_edit')) {
|
||||
echo "<button type='button' class='btn btn-default list_control_icon' name='' alt='".$text['button-edit']."' onclick=\"window.location='call_recording_edit.php?id=".escape($row['call_recording_uuid'])."'\" value='edit'><span class='fas fa-pencil-alt'></span></input>\n";
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@
|
|||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and enabled = 'true' ";
|
||||
if (!(if_group("admin") || if_group("superadmin"))) {
|
||||
if (count($_SESSION['user']['extension']) > 0) {
|
||||
if (is_array($_SESSION['user']['extension'] && count($_SESSION['user']['extension']) > 0)) {
|
||||
$sql .= "and (";
|
||||
$x = 0;
|
||||
foreach($_SESSION['user']['extension'] as $row) {
|
||||
|
|
@ -349,4 +349,4 @@
|
|||
require_once "resources/footer.php";
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
$text['title-email_template']['sv-se'] = '';
|
||||
$text['title-email_template']['uk-ua'] = '';
|
||||
|
||||
$text['title_description-email_template']['en-us'] = '';
|
||||
$text['title_description-email_template']['en-us'] = 'Define and manage dynamic templates used for system generated outbound emails.';
|
||||
$text['title_description-email_template']['ar-eg'] = '';
|
||||
$text['title_description-email_template']['de-at'] = '';
|
||||
$text['title_description-email_template']['de-ch'] = '';
|
||||
|
|
|
|||
|
|
@ -24,9 +24,10 @@
|
|||
//includes
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('email_template_view')) {
|
||||
//access granted
|
||||
}
|
||||
|
|
@ -39,26 +40,45 @@
|
|||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the action
|
||||
if (is_array($_POST["email_templates"])) {
|
||||
$email_templates = $_POST["email_templates"];
|
||||
foreach($email_templates as $row) {
|
||||
if ($row['action'] == 'delete') {
|
||||
$action = 'delete';
|
||||
break;
|
||||
}
|
||||
//get posted data
|
||||
if (is_array($_POST['email_templates'])) {
|
||||
$action = $_POST['action'];
|
||||
$search = $_POST['search'];
|
||||
$email_templates = $_POST['email_templates'];
|
||||
}
|
||||
|
||||
//copy the email_templates
|
||||
if (permission_exists('email_template_add')) {
|
||||
if ($action == 'copy' && is_array($email_templates) && @sizeof($email_templates) != 0) {
|
||||
//copy
|
||||
$obj = new email_templates;
|
||||
$obj->copy($email_templates);
|
||||
//redirect
|
||||
header('Location: email_templates.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//toggle the email_templates
|
||||
if (permission_exists('email_template_edit')) {
|
||||
if ($action == 'toggle' && is_array($email_templates) && @sizeof($email_templates) != 0) {
|
||||
//toggle
|
||||
$obj = new email_templates;
|
||||
$obj->toggle($email_templates);
|
||||
//redirect
|
||||
header('Location: email_templates.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//delete the email_templates
|
||||
if (permission_exists('email_template_delete')) {
|
||||
if ($action == "delete") {
|
||||
//download
|
||||
if ($action == 'delete' && is_array($email_templates) && @sizeof($email_templates) != 0) {
|
||||
//delete
|
||||
$obj = new email_templates;
|
||||
$obj->delete($email_templates);
|
||||
//redirect
|
||||
message::add($text['message-delete']);
|
||||
header('Location: '.$_SERVER['PHP_SELF']);
|
||||
header('Location: email_templates.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
@ -74,8 +94,8 @@
|
|||
$sql_search .= " lower(template_language) like :search ";
|
||||
$sql_search .= " or lower(template_category) like :search ";
|
||||
$sql_search .= " or lower(template_subcategory) like :search ";
|
||||
//$sql_search .= " or lower(template_subject) like :search ";
|
||||
//$sql_search .= " or lower(template_body) like :search ";
|
||||
$sql_search .= " or lower(template_subject) like :search ";
|
||||
$sql_search .= " or lower(template_body) like :search ";
|
||||
$sql_search .= " or lower(template_type) like :search ";
|
||||
$sql_search .= " or lower(template_enabled) like :search ";
|
||||
$sql_search .= " or lower(template_description) like :search ";
|
||||
|
|
@ -83,10 +103,6 @@
|
|||
$parameters['search'] = '%'.$search.'%';
|
||||
}
|
||||
|
||||
//additional includes
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//prepare to page the results
|
||||
$sql = "select count(*) from v_email_templates ";
|
||||
if ($_GET['show'] == "all" && permission_exists('email_template_all')) {
|
||||
|
|
@ -106,156 +122,166 @@
|
|||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||
$param = "&search=".$search;
|
||||
if ($_GET['show'] == "all" && permission_exists('email_template_all')) {
|
||||
$param .= "&show=all";
|
||||
}
|
||||
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
|
||||
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
|
||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the list
|
||||
$sql = str_replace('count(*)', '*', $sql);
|
||||
$sql .= order_by($order_by, $order, 'template_language', 'asc');
|
||||
if ($order_by) {
|
||||
$sql .= order_by($order_by, $order);
|
||||
}
|
||||
else {
|
||||
$sql .= "order by domain_uuid, template_language asc, template_category asc, template_subcategory asc, template_type asc, template_description asc ";
|
||||
}
|
||||
$sql .= limit_offset($rows_per_page, $offset);
|
||||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//alternate the row style
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create($_SERVER['PHP_SELF']);
|
||||
|
||||
//define the checkbox_toggle function
|
||||
echo "<script type=\"text/javascript\">\n";
|
||||
echo " function checkbox_toggle(item) {\n";
|
||||
echo " var inputs = document.getElementsByTagName(\"input\");\n";
|
||||
echo " for (var i = 0, max = inputs.length; i < max; i++) {\n";
|
||||
echo " if (inputs[i].type === 'checkbox') {\n";
|
||||
echo " if (document.getElementById('checkbox_all').checked == true) {\n";
|
||||
echo " inputs[i].checked = true;\n";
|
||||
echo " }\n";
|
||||
echo " else {\n";
|
||||
echo " inputs[i].checked = false;\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
echo "</script>\n";
|
||||
//additional includes
|
||||
require_once "resources/header.php";
|
||||
|
||||
//show the content
|
||||
echo "<table width='100%' border='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-email_templates']."</b></td>\n";
|
||||
echo " <form method='get' action=''>\n";
|
||||
echo " <td width='50%' style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title-email_templates']." (".$num_rows.")</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
if (permission_exists('email_template_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'link'=>'email_template_edit.php']);
|
||||
}
|
||||
if (permission_exists('email_template_add') && $result) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'onclick'=>"if (confirm('".$text['confirm-copy']."')) { list_action_set('copy'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
if (permission_exists('email_template_edit') && $result) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'onclick'=>"if (confirm('".$text['confirm-toggle']."')) { list_action_set('toggle'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
if (permission_exists('email_template_delete') && $result) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'onclick'=>"if (confirm('".$text['confirm-delete']."')) { list_action_set('delete'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
echo "<form id='form_search' class='inline' method='get'>\n";
|
||||
if (permission_exists('email_template_all')) {
|
||||
if ($_GET['show'] == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>";
|
||||
}
|
||||
else {
|
||||
echo " <input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='email_templates.php?show=all';\">\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']);
|
||||
}
|
||||
}
|
||||
echo " <input type='text' class='txt' style='width: 150px' name='search' id='search' value='".escape($search)."'>\n";
|
||||
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown='list_search_reset();'>";
|
||||
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
|
||||
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'email_templates.php','style'=>($search == '' ? 'display: none;' : null)]);
|
||||
if ($paging_controls_mini != '') {
|
||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
|
||||
}
|
||||
echo " </form>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
echo "<form method='post' action=''>\n";
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo " <th style='width:30px;'>\n";
|
||||
echo " <input type='checkbox' name='checkbox_all' id='checkbox_all' value='' onclick=\"checkbox_toggle();\">\n";
|
||||
echo " </th>\n";
|
||||
echo $text['title_description-email_template']."\n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
echo "<form id='form_list' method='post'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
|
||||
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('email_template_add') || permission_exists('email_template_edit') || permission_exists('email_template_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".($result ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('email_template_all')) {
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, '', '', $param);
|
||||
echo "<th>".$text['label-domain']."</th>\n";
|
||||
//echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, null, null, $param);
|
||||
}
|
||||
echo th_order_by('template_language', $text['label-template_language'], $order_by, $order);
|
||||
echo th_order_by('template_category', $text['label-template_category'], $order_by, $order);
|
||||
echo th_order_by('template_subcategory', $text['label-template_subcategory'], $order_by, $order);
|
||||
//echo th_order_by('domain_uuid', $text['label-domain_uuid'], $order_by, $order);
|
||||
echo th_order_by('template_type', $text['label-template_type'], $order_by, $order);
|
||||
echo th_order_by('template_enabled', $text['label-template_enabled'], $order_by, $order);
|
||||
echo th_order_by('template_description', $text['label-template_description'], $order_by, $order);
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('email_template_add')) {
|
||||
echo " <a href='email_template_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
echo th_order_by('template_language', $text['label-template_language'], $order_by, $order, null, "class='shrink'", $param);
|
||||
echo th_order_by('template_category', $text['label-template_category'], $order_by, $order, null, "class='shrink' style='min-width: 15%'", $param);
|
||||
echo th_order_by('template_subcategory', $text['label-template_subcategory'], $order_by, $order, null, "class='shrink' style='min-width: 15%'", $param);
|
||||
echo th_order_by('template_subject', $text['label-template_subject'], $order_by, $order, null, "class='hide-sm-dn' style='min-width: 20%'", $param);
|
||||
echo th_order_by('template_type', $text['label-template_type'], $order_by, $order, null, "class='shrink'", $param);
|
||||
echo th_order_by('template_enabled', $text['label-template_enabled'], $order_by, $order, null, "class='center' style='min-width: 15%'", $param);
|
||||
echo th_order_by('template_description', $text['label-template_description'], $order_by, $order, null, "class='hide-sm-dn'", $param);
|
||||
if (permission_exists('email_template_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
else {
|
||||
echo " \n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "<tr>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
$x = 0;
|
||||
foreach($result as $row) {
|
||||
if (permission_exists('email_template_edit')) {
|
||||
$tr_link = "href='email_template_edit.php?id=".escape($row['email_template_uuid'])."'";
|
||||
$list_row_url = "email_template_edit.php?id=".urlencode($row['email_template_uuid']);
|
||||
}
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if (permission_exists('email_template_add') || permission_exists('email_template_edit') || permission_exists('email_template_delete')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='email_templates[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='email_templates[$x][uuid]' value='".escape($row['email_template_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' style='align: center; padding: 3px 3px 0px 8px;'>\n";
|
||||
echo " <input type='checkbox' name=\"email_templates[$x][checked]\" id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('chk_all_".$x."').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name=\"email_templates[$x][email_template_uuid]\" value='".escape($row['email_template_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
if ($_GET['show'] == "all" && permission_exists('email_template_all')) {
|
||||
if (strlen($_SESSION['domains'][$row['domain_uuid']]['domain_name']) > 0) {
|
||||
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
|
||||
echo " <td>";
|
||||
if (is_uuid($row['domain_uuid'])) {
|
||||
echo escape($_SESSION['domains'][$row['domain_uuid']]['domain_name']);
|
||||
}
|
||||
else {
|
||||
$domain = $text['label-global'];
|
||||
echo $text['label-global'];
|
||||
}
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($domain)."</td>\n";
|
||||
echo "</td>\n";
|
||||
}
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['template_language'])." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['template_category'])." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['template_subcategory'])." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['template_subject'])." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['template_body'])." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['domain_uuid'])." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['template_type'])." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['template_enabled'])." </td>\n";
|
||||
echo " <td valign='top' class='row_stylebg'>".escape($row['template_description'])." </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
echo " <td>".escape($row['template_language'])." </td>\n";
|
||||
echo " <td>".escape($row['template_category'])." </td>\n";
|
||||
echo " <td>".escape($row['template_subcategory'])." </td>\n";
|
||||
echo " <td class='overflow hide-sm-dn'>";
|
||||
if (permission_exists('email_template_edit')) {
|
||||
echo "<a href='email_template_edit.php?id=".escape($row['email_template_uuid'])."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
echo "<a href='".$list_row_url."'>".escape($row['template_subject'])."</a>";
|
||||
}
|
||||
if (permission_exists('email_template_delete')) {
|
||||
echo "<button type='submit' class='btn btn-default list_control_icon' name=\"email_templates[$x][action]\" alt='".$text['button-delete']."' value='delete'><span class='fas fa-minus'></span></button>";
|
||||
else {
|
||||
echo escape($row['template_subject']);
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td>".escape($row['template_type'])." </td>\n";
|
||||
if (permission_exists('email_template_edit')) {
|
||||
echo " <td class='no-link center'>";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['template_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
}
|
||||
else {
|
||||
echo " <td class='center'>";
|
||||
echo $text['label-'.$row['template_enabled']];
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['template_description'])."</td>\n";
|
||||
if (permission_exists('email_template_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
$x++;
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
}
|
||||
}
|
||||
unset($result, $row);
|
||||
unset($result);
|
||||
|
||||
echo "</table>\n";
|
||||
echo "<br />\n";
|
||||
echo "<div align='center'>".$paging_controls."</div>\n";
|
||||
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='8' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap='nowrap'> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('email_template_add')) {
|
||||
echo "<a href='email_template_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
}
|
||||
else {
|
||||
echo " ";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>";
|
||||
echo "</form>\n";
|
||||
echo "<br /><br />";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
@ -1,30 +1,64 @@
|
|||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
/**
|
||||
* call_recordings class
|
||||
*
|
||||
* @method null download
|
||||
*/
|
||||
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) 2008-2019
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//define the email templates class
|
||||
if (!class_exists('email_templates')) {
|
||||
class email_templates {
|
||||
|
||||
public $db;
|
||||
/**
|
||||
* declare private variables
|
||||
*/
|
||||
private $app_name;
|
||||
private $app_uuid;
|
||||
private $permission_prefix;
|
||||
private $list_page;
|
||||
private $table;
|
||||
private $uuid_prefix;
|
||||
private $toggle_field;
|
||||
private $toggle_values;
|
||||
|
||||
/**
|
||||
* Called when the object is created
|
||||
* called when the object is created
|
||||
*/
|
||||
public function __construct() {
|
||||
//connect to the database if not connected
|
||||
if (!$this->db) {
|
||||
require_once "resources/classes/database.php";
|
||||
$database = new database;
|
||||
$database->connect();
|
||||
$this->db = $database->db;
|
||||
}
|
||||
|
||||
//assign private variables
|
||||
$this->app_name = 'email_templates';
|
||||
$this->app_uuid = '8173e738-2523-46d5-8943-13883befd2fd';
|
||||
$this->permission_prefix = 'email_template_';
|
||||
$this->list_page = 'email_templates.php';
|
||||
$this->table = 'email_templates';
|
||||
$this->uuid_prefix = 'email_template_';
|
||||
$this->toggle_field = 'template_enabled';
|
||||
$this->toggle_values = ['true','false'];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when there are no references to a particular object
|
||||
* called when there are no references to a particular object
|
||||
* unset the variables used in the class
|
||||
*/
|
||||
public function __destruct() {
|
||||
|
|
@ -34,42 +68,192 @@ if (!class_exists('email_templates')) {
|
|||
}
|
||||
|
||||
/**
|
||||
* delete email_templates
|
||||
* delete records
|
||||
*/
|
||||
public function delete($email_templates) {
|
||||
if (permission_exists('email_template_delete')) {
|
||||
public function delete($records) {
|
||||
if (permission_exists($this->permission_prefix.'delete')) {
|
||||
|
||||
//delete multiple email_templates
|
||||
if (is_array($email_templates)) {
|
||||
//get the action
|
||||
foreach($email_templates as $row) {
|
||||
if ($row['action'] == 'delete') {
|
||||
$action = 'delete';
|
||||
break;
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: '.$this->list_page);
|
||||
exit;
|
||||
}
|
||||
|
||||
//delete multiple records
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
|
||||
//build the delete array
|
||||
foreach ($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
|
||||
}
|
||||
}
|
||||
|
||||
//delete the checked rows
|
||||
if ($action == 'delete') {
|
||||
foreach($email_templates as $row) {
|
||||
if ($row['checked'] == 'true') {
|
||||
$sql = "delete from v_email_templates ";
|
||||
$sql .= "where email_template_uuid = '".$row['email_template_uuid']."'; ";
|
||||
$this->db->query($sql);
|
||||
unset($sql);
|
||||
}
|
||||
}
|
||||
unset($email_templates);
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//execute delete
|
||||
$database = new database;
|
||||
$database->app_name = $this->app_name;
|
||||
$database->app_uuid = $this->app_uuid;
|
||||
$database->delete($array);
|
||||
unset($array);
|
||||
|
||||
//set message
|
||||
message::add($text['message-delete']);
|
||||
}
|
||||
unset($records);
|
||||
}
|
||||
}
|
||||
} //end the delete function
|
||||
}
|
||||
|
||||
} //end the class
|
||||
/**
|
||||
* toggle records
|
||||
*/
|
||||
public function toggle($records) {
|
||||
if (permission_exists($this->permission_prefix.'edit')) {
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: '.$this->list_page);
|
||||
exit;
|
||||
}
|
||||
|
||||
//toggle the checked records
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
|
||||
//get current toggle state
|
||||
foreach($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
$record_uuids[] = $this->uuid_prefix."uuid = '".$record['uuid']."'";
|
||||
}
|
||||
}
|
||||
if (is_array($record_uuids) && @sizeof($record_uuids) != 0) {
|
||||
$sql = "select ".$this->uuid_prefix."uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." ";
|
||||
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$sql .= "and ( ".implode(' or ', $record_uuids)." ) ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$rows = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $row) {
|
||||
$states[$row['uuid']] = $row['toggle'];
|
||||
}
|
||||
}
|
||||
unset($sql, $parameters, $rows, $row);
|
||||
}
|
||||
|
||||
//build update array
|
||||
$x = 0;
|
||||
foreach($states as $uuid => $state) {
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
|
||||
$array[$this->table][$x][$this->toggle_field] = $state == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
|
||||
$x++;
|
||||
}
|
||||
|
||||
//save the changes
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//save the array
|
||||
$database = new database;
|
||||
$database->app_name = $this->app_name;
|
||||
$database->app_uuid = $this->app_uuid;
|
||||
$database->save($array);
|
||||
unset($array);
|
||||
|
||||
//set message
|
||||
message::add($text['message-toggle']);
|
||||
}
|
||||
unset($records, $states);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* copy records
|
||||
*/
|
||||
public function copy($records) {
|
||||
if (permission_exists($this->permission_prefix.'add')) {
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: '.$this->list_page);
|
||||
exit;
|
||||
}
|
||||
|
||||
//copy the checked records
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
|
||||
//get checked records
|
||||
foreach($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
$record_uuids[] = $this->uuid_prefix."uuid = '".$record['uuid']."'";
|
||||
}
|
||||
}
|
||||
|
||||
//create insert array from existing data
|
||||
if (is_array($record_uuids) && @sizeof($record_uuids) != 0) {
|
||||
$sql = "select * from v_".$this->table." ";
|
||||
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$sql .= "and ( ".implode(' or ', $record_uuids)." ) ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$rows = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $x => $row) {
|
||||
|
||||
//copy data
|
||||
$array[$this->table][$x] = $row;
|
||||
|
||||
//overwrite
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = uuid();
|
||||
$array[$this->table][$x]['template_description'] = trim($row['template_description'].' ('.$text['label-copy'].')');
|
||||
|
||||
}
|
||||
}
|
||||
unset($sql, $parameters, $rows, $row);
|
||||
}
|
||||
|
||||
//save the changes and set the message
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//save the array
|
||||
$database = new database;
|
||||
$database->app_name = $this->app_name;
|
||||
$database->app_uuid = $this->app_uuid;
|
||||
$database->save($array);
|
||||
unset($array);
|
||||
|
||||
//set message
|
||||
message::add($text['message-copy']);
|
||||
|
||||
}
|
||||
unset($records);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$obj = new email_templates;
|
||||
$obj->delete();
|
||||
*/
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
@ -841,6 +841,26 @@ $text['label-outbound_caller_id_name']['ru-ru'] = "Идентификатор (C
|
|||
$text['label-outbound_caller_id_name']['sv-se'] = "Utgående Namnpresentation";
|
||||
$text['label-outbound_caller_id_name']['uk-ua'] = "";
|
||||
|
||||
$text['label-outbound_cid_name']['en-us'] = "Outbound CID Name";
|
||||
$text['label-outbound_cid_name']['ar-eg'] = "";
|
||||
$text['label-outbound_cid_name']['de-at'] = "Ausgehende Anruferkennung (Name)"; //copied from de-de
|
||||
$text['label-outbound_cid_name']['de-ch'] = "Ausgehende Anruferkennung (Name)"; //copied from de-de
|
||||
$text['label-outbound_cid_name']['de-de'] = "Ausgehende Anruferkennung (Name)";
|
||||
$text['label-outbound_cid_name']['es-cl'] = "Nombre de Caller ID Saliente";
|
||||
$text['label-outbound_cid_name']['es-mx'] = "Nombre de Caller ID Saliente"; //copied from es-cl
|
||||
$text['label-outbound_cid_name']['fr-ca'] = "Nom de l'appelant sortant"; //copied from fr-fr
|
||||
$text['label-outbound_cid_name']['fr-fr'] = "Nom de l'appelant sortant";
|
||||
$text['label-outbound_cid_name']['he-il'] = "";
|
||||
$text['label-outbound_cid_name']['it-it'] = "ID Nome Chiamante Esterno";
|
||||
$text['label-outbound_cid_name']['nl-nl'] = "";
|
||||
$text['label-outbound_cid_name']['pl-pl'] = "Nazwa prezentowana w rozmowach wychodzacych";
|
||||
$text['label-outbound_cid_name']['pt-br'] = "Nome público"; //copied from pt-pt
|
||||
$text['label-outbound_cid_name']['pt-pt'] = "Nome público";
|
||||
$text['label-outbound_cid_name']['ro-ro'] = "";
|
||||
$text['label-outbound_cid_name']['ru-ru'] = "Идентификатор (Caller ID) имени вызывающего абонента";
|
||||
$text['label-outbound_cid_name']['sv-se'] = "Utgående Namnpresentation";
|
||||
$text['label-outbound_cid_name']['uk-ua'] = "";
|
||||
|
||||
$text['label-number_alias']['en-us'] = "Number Alias";
|
||||
$text['label-number_alias']['ar-eg'] = "";
|
||||
$text['label-number_alias']['de-at'] = "Alternative Nummer"; //copied from de-de
|
||||
|
|
@ -1121,6 +1141,26 @@ $text['label-effective_caller_id_name']['ru-ru'] = "Эффективный ид
|
|||
$text['label-effective_caller_id_name']['sv-se'] = "Effektiv Namnpresentation";
|
||||
$text['label-effective_caller_id_name']['uk-ua'] = "";
|
||||
|
||||
$text['label-effective_cid_name']['en-us'] = "Effective CID Name";
|
||||
$text['label-effective_cid_name']['ar-eg'] = "إسم المتصل الفعال";
|
||||
$text['label-effective_cid_name']['de-at'] = "Tatsächliche Anruferkennung (Name)"; //copied from de-de
|
||||
$text['label-effective_cid_name']['de-ch'] = "Tatsächliche Anruferkennung (Name)"; //copied from de-de
|
||||
$text['label-effective_cid_name']['de-de'] = "Tatsächliche Anruferkennung (Name)";
|
||||
$text['label-effective_cid_name']['es-cl'] = "Nombre de Caller ID Efectivo";
|
||||
$text['label-effective_cid_name']['es-mx'] = "Nombre de Caller ID Efectivo"; //copied from es-cl
|
||||
$text['label-effective_cid_name']['fr-ca'] = "Nom interne"; //copied from fr-fr
|
||||
$text['label-effective_cid_name']['fr-fr'] = "Nom interne";
|
||||
$text['label-effective_cid_name']['he-il'] = "";
|
||||
$text['label-effective_cid_name']['it-it'] = "ID Nome Chiamante Effettivo";
|
||||
$text['label-effective_cid_name']['nl-nl'] = "";
|
||||
$text['label-effective_cid_name']['pl-pl'] = "Prezentacja nazwy dzwoniącego (rozmowy wew)";
|
||||
$text['label-effective_cid_name']['pt-br'] = "Nome interno";
|
||||
$text['label-effective_cid_name']['pt-pt'] = "Nome Interno";
|
||||
$text['label-effective_cid_name']['ro-ro'] = "";
|
||||
$text['label-effective_cid_name']['ru-ru'] = "Эффективный идентификатор (Caller ID) имени вызывающего абонента";
|
||||
$text['label-effective_cid_name']['sv-se'] = "Effektiv Namnpresentation";
|
||||
$text['label-effective_cid_name']['uk-ua'] = "";
|
||||
|
||||
$text['label-domain']['en-us'] = "Domain";
|
||||
$text['label-domain']['ar-eg'] = "النطاق";
|
||||
$text['label-domain']['de-at'] = "Domäne"; //copied from de-de
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('extension_view')) {
|
||||
|
|
@ -38,64 +39,100 @@
|
|||
exit;
|
||||
}
|
||||
|
||||
//get the registrations
|
||||
if (permission_exists('extension_registered')) {
|
||||
$obj = new registrations;
|
||||
$registrations = $obj->get('all');
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the http values and set them as variables
|
||||
$search = $_GET["search"];
|
||||
//get posted data
|
||||
if (is_array($_POST['extensions'])) {
|
||||
$action = $_POST['action'];
|
||||
$search = $_POST['search'];
|
||||
$extensions = $_POST['extensions'];
|
||||
}
|
||||
|
||||
//toggle the extensions
|
||||
if (permission_exists('extension_enabled')) {
|
||||
if ($action == 'toggle' && is_array($extensions) && @sizeof($extensions) != 0) {
|
||||
//toggle
|
||||
$obj = new extension;
|
||||
$obj->toggle($extensions);
|
||||
//redirect
|
||||
header('Location: extensions.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//delete the extensions
|
||||
if (permission_exists('extension_delete')) {
|
||||
if ($action == 'delete' && is_array($extensions) && @sizeof($extensions) != 0) {
|
||||
//delete
|
||||
$obj = new extension;
|
||||
$obj->delete($extensions);
|
||||
//redirect
|
||||
header('Location: extensions.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//get order and order by
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//handle search term
|
||||
$search = $_GET["search"];
|
||||
//add the search term
|
||||
$search = strtolower($_GET["search"]);
|
||||
if (strlen($search) > 0) {
|
||||
$search = strtolower($search);
|
||||
$sql_search = "and ( ";
|
||||
$sql_search .= " lower(extension) like :search ";
|
||||
$sql_search .= " or lower(call_group) like :search ";
|
||||
$sql_search .= " or lower(user_context) like :search ";
|
||||
$sql_search .= " or lower(enabled) like :search ";
|
||||
$sql_search .= " or lower(description) like :search ";
|
||||
$sql_search = " and ( ";
|
||||
$sql_search .= "lower(extension) like :search ";
|
||||
$sql_search .= "or lower(number_alias) like :search ";
|
||||
$sql_search .= "or lower(effective_caller_id_name) like :search ";
|
||||
$sql_search .= "or lower(effective_caller_id_number) like :search ";
|
||||
$sql_search .= "or lower(outbound_caller_id_name) like :search ";
|
||||
$sql_search .= "or lower(outbound_caller_id_number) like :search ";
|
||||
$sql_search .= "or lower(emergency_caller_id_name) like :search ";
|
||||
$sql_search .= "or lower(emergency_caller_id_number) like :search ";
|
||||
$sql_search .= "or lower(directory_first_name) like :search ";
|
||||
$sql_search .= "or lower(directory_last_name) like :search ";
|
||||
$sql_search .= "or lower(call_group) like :search ";
|
||||
$sql_search .= "or lower(user_context) like :search ";
|
||||
$sql_search .= "or lower(enabled) like :search ";
|
||||
$sql_search .= "or lower(description) like :search ";
|
||||
$sql_search .= ") ";
|
||||
$parameters['search'] = '%'.$search.'%';
|
||||
}
|
||||
|
||||
//get total extension count
|
||||
$sql = "select count(extension_uuid) from v_extensions ";
|
||||
if (!($_GET['show'] == "all" && permission_exists('extension_all'))) {
|
||||
//get total extension count for domain
|
||||
if (is_numeric($_SESSION['limit']['extensions']['numeric'])) {
|
||||
$sql = "select count(*) from v_extensions ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$total_extensions = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
}
|
||||
|
||||
//get total extension count
|
||||
$sql = "select count(*) from v_extensions where true ";
|
||||
if (!($_GET['show'] == "all" && permission_exists('extension_all'))) {
|
||||
$sql .= "and domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
}
|
||||
$sql .= $sql_search;
|
||||
$database = new database;
|
||||
$total_extensions = $database->select($sql, $parameters, 'column');
|
||||
|
||||
//additional includes
|
||||
$document['title'] = $text['title-extensions'];
|
||||
require_once "resources/paging.php";
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$param = "&search=".urlencode($search);
|
||||
$param = "&search=".$search;
|
||||
if ($_GET['show'] == "all" && permission_exists('extension_all')) {
|
||||
$param .= "&show=all";
|
||||
}
|
||||
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
|
||||
list($paging_controls_mini, $rows_per_page, $var_3) = paging($total_extensions, $param, $rows_per_page, true); //top
|
||||
list($paging_controls, $rows_per_page, $var_3) = paging($total_extensions, $param, $rows_per_page); //bottom
|
||||
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page); //bottom
|
||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true); //top
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the extensions
|
||||
$sql = "select * from v_extensions ";
|
||||
if (!($_GET['show'] == "all" && permission_exists('extension_all'))) {
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
}
|
||||
$sql .= $sql_search;
|
||||
$sql = str_replace('count(*)', '*', $sql);
|
||||
if ($order_by == '' || $order_by == 'extension') {
|
||||
if ($db_type == 'pgsql') {
|
||||
$sql .= 'order by natural_sort(extension) '.$order; //function in app_defaults.php
|
||||
|
|
@ -112,115 +149,131 @@
|
|||
$extensions = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//set the alternating styles
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
//get the registrations
|
||||
if (permission_exists('extension_registered')) {
|
||||
$obj = new registrations;
|
||||
$registrations = $obj->get('all');
|
||||
}
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create($_SERVER['PHP_SELF']);
|
||||
|
||||
//include the header
|
||||
$document['title'] = $text['title-extensions'];
|
||||
require_once "resources/header.php";
|
||||
|
||||
//show the content
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left' width='100%'>\n";
|
||||
echo " <b>".$text['header-extensions']." (".$total_extensions.")</b><br>\n";
|
||||
echo " </td>\n";
|
||||
echo " <form method='get' action=''>\n";
|
||||
echo " <td style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
|
||||
if (permission_exists('extension_all')) {
|
||||
if ($_GET['show'] == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>";
|
||||
}
|
||||
else {
|
||||
echo " <input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='extensions.php?show=all';\">\n";
|
||||
}
|
||||
}
|
||||
if (permission_exists('extension_import')) {
|
||||
echo "<input type='button' class='btn' alt='".$text['button-import']."' onclick=\"window.location='extension_imports.php'\" value='".$text['button-import']."'>\n";
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['header-extensions']." (".$num_rows.")</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
if (permission_exists('extension_import') && (!is_numeric($_SESSION['limit']['extensions']['numeric']) || $total_extensions < $_SESSION['limit']['extensions']['numeric'])) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-import'],'icon'=>$_SESSION['theme']['button_icon_import'],'link'=>'extension_imports.php']);
|
||||
}
|
||||
if (permission_exists('extension_export')) {
|
||||
echo " <input type='button' class='btn' value='".$text['button-export']."' onclick=\"window.location.href='extension_download.php'\">\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-export'],'icon'=>$_SESSION['theme']['button_icon_export'],'link'=>'extension_download.php']);
|
||||
}
|
||||
echo " <input type='text' class='txt' style='width: 150px; margin-left: 15px;' name='search' id='search' value='".escape($search)."'>";
|
||||
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
|
||||
$margin_left = permission_exists('extension_import') || permission_exists('extension_export') ? "margin-left: 15px;" : null;
|
||||
if (permission_exists('extension_add') && (!is_numeric($_SESSION['limit']['extensions']['numeric']) || $total_extensions < $_SESSION['limit']['extensions']['numeric'])) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'style'=>$margin_left,'link'=>'extension_edit.php']);
|
||||
unset($margin_left);
|
||||
}
|
||||
if (permission_exists('extension_enabled') && $extensions) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'style'=>$margin_left,'onclick'=>"if (confirm('".$text['confirm-toggle']."')) { list_action_set('toggle'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
unset($margin_left);
|
||||
}
|
||||
if (permission_exists('extension_delete') && $extensions) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'style'=>$margin_left,'onclick'=>"if (confirm('".$text['confirm-delete']."')) { list_action_set('delete'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
unset($margin_left);
|
||||
}
|
||||
echo "<form id='form_search' class='inline' method='get'>\n";
|
||||
if (permission_exists('extension_all')) {
|
||||
if ($_GET['show'] == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>";
|
||||
}
|
||||
else {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']);
|
||||
}
|
||||
}
|
||||
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown='list_search_reset();'>";
|
||||
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search','style'=>($search != '' ? 'display: none;' : null)]);
|
||||
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'extensions.php','style'=>($search == '' ? 'display: none;' : null)]);
|
||||
if ($paging_controls_mini != '') {
|
||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
|
||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </form>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2'>\n";
|
||||
echo " ".$text['description-extensions']."\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br />";
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
echo "<form name='frm' method='post' action='extension_delete.php'>\n";
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
if (permission_exists('extension_delete') && is_array($extensions)) {
|
||||
echo "<th style='width: 30px; text-align: center; padding: 0px;'><input type='checkbox' id='chk_all' onchange=\"(this.checked) ? check('all') : check('none');\"></th>";
|
||||
echo $text['description-extensions']."\n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
echo "<form id='form_list' method='post'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
|
||||
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('extension_enabled') || permission_exists('extension_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".($extensions ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('extension_all')) {
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param);
|
||||
echo "<th>".$text['label-domain']."</th>\n";
|
||||
//echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
|
||||
}
|
||||
echo th_order_by('extension', $text['label-extension'], $order_by, $order);
|
||||
echo th_order_by('effective_caller_id_name', $text['label-effective_cid_name'], $order_by, $order, null, "class='hide-xs'");
|
||||
echo th_order_by('outbound_caller_id_name', $text['label-outbound_cid_name'], $order_by, $order, null, "class='hide-sm-dn'");
|
||||
echo th_order_by('call_group', $text['label-call_group'], $order_by, $order);
|
||||
//echo th_order_by('voicemail_mail_to', $text['label-voicemail_mail_to'], $order_by, $order);
|
||||
if (permission_exists("extension_user_context")) {
|
||||
echo th_order_by('user_context', $text['label-user_context'], $order_by, $order);
|
||||
}
|
||||
if (permission_exists('extension_registered')) {
|
||||
echo "<th>".$text['label-is_registered']."</th>\n";
|
||||
}
|
||||
echo th_order_by('enabled', $text['label-enabled'], $order_by, $order);
|
||||
echo th_order_by('description', $text['label-description'], $order_by, $order);
|
||||
|
||||
echo "<td class='list_control_icon'>\n";
|
||||
if (permission_exists('extension_add')) {
|
||||
if ($_SESSION['limit']['extensions']['numeric'] == '' || ($_SESSION['limit']['extensions']['numeric'] != '' && $total_extensions < $_SESSION['limit']['extensions']['numeric'])) {
|
||||
echo "<a href='extension_edit.php' alt='".$text['button-add']."'>".$v_link_label_add."</a>";
|
||||
}
|
||||
echo th_order_by('enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
|
||||
echo th_order_by('description', $text['label-description'], $order_by, $order, null, "class='hide-sm-dn'");
|
||||
if (permission_exists('extension_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
if (permission_exists('extension_delete') && is_array($extensions)) {
|
||||
echo "<a href='javascript:void(0);' onclick=\"if (confirm('".$text['confirm-delete']."')) { document.forms.frm.submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
if (is_array($extensions) && @sizeof($extensions) != 0) {
|
||||
$x = 0;
|
||||
foreach($extensions as $row) {
|
||||
if (permission_exists('extension_edit')) {
|
||||
$tr_link = "href='extension_edit.php?id=".urlencode($row['extension_uuid']).(is_numeric($page) ? '&page='.$page : null)."'";
|
||||
$list_row_url = "extension_edit.php?id=".urlencode($row['extension_uuid']).(is_numeric($page) ? '&page='.urlencode($page) : null);
|
||||
}
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
if (permission_exists('extension_delete')) {
|
||||
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center; vertical-align: middle; padding: 0px;'>";
|
||||
echo " <input type='checkbox' name='id[]' id='checkbox_".escape($row['extension_uuid'])."' value='".escape($row['extension_uuid'])."' onclick=\"if (!this.checked) { document.getElementById('chk_all').checked = false; }\">";
|
||||
echo " </td>";
|
||||
$ext_ids[] = 'checkbox_'.$row['extension_uuid'];
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if (permission_exists('extension_enabled') || permission_exists('extension_delete')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='extensions[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='extensions[$x][uuid]' value='".escape($row['extension_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('extension_all')) {
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."</td>\n";
|
||||
echo " <td>".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."</td>\n";
|
||||
}
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
echo " <td>";
|
||||
if (permission_exists('extension_edit')) {
|
||||
echo "<a ".$tr_link.">".escape($row['extension'])."</a>";
|
||||
echo "<a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['extension'])."</a>";
|
||||
}
|
||||
else {
|
||||
echo escape($row['extension']);
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['call_group'])." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['voicemail_mail_to']." </td>\n";
|
||||
echo " </td>\n";
|
||||
|
||||
echo " <td class='hide-xs'>".escape($row['effective_caller_id_name'])." </td>\n";
|
||||
echo " <td class='hide-sm-dn'>".escape($row['outbound_caller_id_name'])." </td>\n";
|
||||
echo " <td>".escape($row['call_group'])." </td>\n";
|
||||
if (permission_exists("extension_user_context")) {
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['user_context'])."</td>\n";
|
||||
echo " <td>".escape($row['user_context'])."</td>\n";
|
||||
}
|
||||
if (permission_exists('extension_registered')) {
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
echo " <td>";
|
||||
$extension_number = $row['extension'].'@'.$_SESSION['domain_name'];
|
||||
$extension_number_alias = $row['number_alias'];
|
||||
if(strlen($extension_number_alias) > 0) {
|
||||
|
|
@ -229,88 +282,61 @@
|
|||
$found_count = 0;
|
||||
if (is_array($registrations)) {
|
||||
foreach ($registrations as $array) {
|
||||
if (
|
||||
($extension_number == $array['user']) ||
|
||||
($extension_number_alias != '' &&
|
||||
$extension_number_alias == $array['user']
|
||||
)
|
||||
) {
|
||||
if ($extension_number == $array['user'] || ($extension_number_alias != '' && $extension_number_alias == $array['user'])) {
|
||||
$found_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($found_count > 0) {
|
||||
echo "Yes ($found_count)";
|
||||
} else {
|
||||
echo "No";
|
||||
echo $text['label-true']." (".$found_count.")";
|
||||
}
|
||||
else {
|
||||
echo $text['label-false'];
|
||||
}
|
||||
unset($extension_number, $extension_number_alias, $found_count, $array);
|
||||
echo " </td>\n";
|
||||
}
|
||||
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".($row['enabled'] == 'true' ? $text['label-true'] : $text['label-false'])."</td>\n";
|
||||
echo " <td valign='top' class='row_stylebg' width='30%'>".escape($row['description'])." </td>\n";
|
||||
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('extension_edit')) {
|
||||
echo "<a ".$tr_link." alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
if (permission_exists('extension_enabled')) {
|
||||
echo " <td class='no-link center'>";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
}
|
||||
if (permission_exists('extension_delete')) {
|
||||
echo "<a href='extension_delete.php?id[]=".escape($row['extension_uuid']).(is_numeric($page) ? '&page='.$page : null)."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
else {
|
||||
echo " <td class='center'>";
|
||||
echo $text['label-'.$row['enabled']];
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['description'])."</td>\n";
|
||||
if (permission_exists('extension_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
$c = ($c) ? 0 : 1;
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($extensions) && @sizeof($extensions) != 0) {
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan='20' class='list_control_icons'>\n";
|
||||
if (permission_exists('extension_add')) {
|
||||
if ($_SESSION['limit']['extensions']['numeric'] == '' || ($_SESSION['limit']['extensions']['numeric'] != '' && $total_extensions < $_SESSION['limit']['extensions']['numeric'])) {
|
||||
echo "<a href='extension_edit.php' alt='".$text['button-add']."'>".$v_link_label_add."</a>";
|
||||
}
|
||||
}
|
||||
if (permission_exists('extension_delete')) {
|
||||
echo "<a href='javascript:void(0);' onclick=\"if (confirm('".$text['confirm-delete']."')) { document.forms.frm.submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
echo "<br />\n";
|
||||
echo "<div align='center'>".$paging_controls."</div>\n";
|
||||
|
||||
unset($extensions, $row);
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
echo "</form>\n";
|
||||
|
||||
if (strlen($paging_controls) > 0) {
|
||||
echo "<br />";
|
||||
echo $paging_controls."\n";
|
||||
}
|
||||
|
||||
echo "<br /><br />".((is_array($extensions)) ? "<br /><br />" : null);
|
||||
|
||||
// check or uncheck all checkboxes
|
||||
if (is_array($ext_ids) && @sizeof($ext_ids) != 0) {
|
||||
echo "<script>\n";
|
||||
echo " function check(what) {\n";
|
||||
echo " document.getElementById('chk_all').checked = (what == 'all') ? true : false;\n";
|
||||
foreach ($ext_ids as $ext_id) {
|
||||
echo " document.getElementById('".$ext_id."').checked = (what == 'all') ? true : false;\n";
|
||||
}
|
||||
echo " }\n";
|
||||
echo "</script>\n";
|
||||
}
|
||||
|
||||
if (is_array($extensions)) {
|
||||
// check all checkboxes
|
||||
key_press('ctrl+a', 'down', 'document', null, null, "check('all');", true);
|
||||
//define keyboard shortcuts
|
||||
if ($extensions) {
|
||||
// check all
|
||||
key_press('ctrl+a', 'down', 'document', null, null, "list_all_check();", true);
|
||||
|
||||
// delete checked
|
||||
key_press('delete', 'up', 'document', array('#search'), $text['confirm-delete'], 'document.forms.frm.submit();', true);
|
||||
if (permission_exists('extension_delete')) {
|
||||
key_press('delete', 'up', 'document', array('#search'), $text['confirm-delete'], "list_action_set('delete'); list_form_submit('form_list');", true);
|
||||
}
|
||||
}
|
||||
|
||||
unset($extensions);
|
||||
|
||||
//show the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,35 +1,38 @@
|
|||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
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/
|
||||
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.
|
||||
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 Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010 - 2016
|
||||
All Rights Reserved.
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2019
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//define the directory class
|
||||
if (!class_exists('extension')) {
|
||||
class extension {
|
||||
|
||||
/**
|
||||
* declare public variables
|
||||
*/
|
||||
public $domain_uuid;
|
||||
public $domain_name;
|
||||
private $app_uuid;
|
||||
public $extension_uuid;
|
||||
public $extension;
|
||||
public $voicemail_id;
|
||||
|
|
@ -70,11 +73,39 @@ if (!class_exists('extension')) {
|
|||
public $enabled;
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* declare private variables
|
||||
*/
|
||||
private $app_name;
|
||||
private $app_uuid;
|
||||
private $permission_prefix;
|
||||
private $list_page;
|
||||
private $table;
|
||||
private $uuid_prefix;
|
||||
private $toggle_field;
|
||||
private $toggle_values;
|
||||
|
||||
/**
|
||||
* called when the object is created
|
||||
*/
|
||||
public function __construct() {
|
||||
//set the application id
|
||||
|
||||
//assign private variables
|
||||
$this->app_name = 'extensions';
|
||||
$this->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3';
|
||||
$this->permission_prefix = 'extension_';
|
||||
$this->list_page = 'extensions.php';
|
||||
$this->table = 'extensions';
|
||||
$this->uuid_prefix = 'extension_';
|
||||
$this->toggle_field = 'enabled';
|
||||
$this->toggle_values = ['true','false'];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* called when there are no references to a particular object
|
||||
* unset the variables used in the class
|
||||
*/
|
||||
public function __destruct() {
|
||||
foreach ($this as $key => $value) {
|
||||
unset($this->$key);
|
||||
|
|
@ -512,6 +543,221 @@ if (!class_exists('extension')) {
|
|||
$_SESSION["reload_xml"] = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete records
|
||||
*/
|
||||
public function delete($records) {
|
||||
if (permission_exists($this->permission_prefix.'delete')) {
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: '.$this->list_page);
|
||||
exit;
|
||||
}
|
||||
|
||||
//delete multiple records
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
|
||||
//build the delete array
|
||||
$y = @sizeof($records) + 1;
|
||||
foreach ($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
|
||||
//get the extension details
|
||||
$sql = "select extension, number_alias, user_context, follow_me_uuid from v_extensions ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and extension_uuid = :extension_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$parameters['extension_uuid'] = $record['uuid'];
|
||||
$database = new database;
|
||||
$row = $database->execute($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0) {
|
||||
|
||||
//for use below and to clear cache (bottom)
|
||||
$extensions[$x] = $row;
|
||||
|
||||
//build delete array
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $record['uuid'];
|
||||
$array['extension_users'][$x]['extension_uuid'] = $record['uuid'];
|
||||
$array['follow_me'][$x]['follow_me_uuid'] = $extensions[$x]['follow_me_uuid'];
|
||||
$array['follow_me_destinations'][$x]['follow_me_uuid'] = $extensions[$x]['follow_me_uuid'];
|
||||
|
||||
//include ring group destinations, if exists
|
||||
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/ring_groups/app_config.php")) {
|
||||
$array['ring_group_destinations'][$x]['destination_number'] = $extensions[$x]['extension'];
|
||||
$array['ring_group_destinations'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
if ($extensions[$x]['number_alias'] != '') {
|
||||
$array['ring_group_destinations'][$y]['destination_number'] = $extensions[$x]['number_alias'];
|
||||
$array['ring_group_destinations'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
}
|
||||
$y++;
|
||||
}
|
||||
|
||||
}
|
||||
unset($sql, $parameters, $row);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//delete the checked rows
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p->add('extension_user_delete', 'temp');
|
||||
$p->add('follow_me_delete', 'temp');
|
||||
$p->add('follow_me_destination_delete', 'temp');
|
||||
$p->add('ring_group_destination_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
$database = new database;
|
||||
$database->app_name = $this->app_name;
|
||||
$database->app_uuid = $this->app_uuid;
|
||||
$database->delete($array);
|
||||
unset($array);
|
||||
|
||||
//revoke temporary permissions
|
||||
$p->delete('extension_user_delete', 'temp');
|
||||
$p->delete('follow_me_delete', 'temp');
|
||||
$p->delete('follow_me_destination_delete', 'temp');
|
||||
$p->delete('ring_group_destination_delete', 'temp');
|
||||
|
||||
//clear the cache
|
||||
foreach ($extensions as $x => $extension) {
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:".$extension['extension']."@".$extension['user_context']);
|
||||
if (permission_exists('number_alias') && strlen($extension['number_alias']) > 0) {
|
||||
$cache->delete("directory:".$extension['number_alias']."@".$extension['user_context']);
|
||||
}
|
||||
}
|
||||
unset($extensions);
|
||||
|
||||
//synchronize configuration
|
||||
if (is_writable($_SESSION['switch']['extensions']['dir'])) {
|
||||
$this->xml();
|
||||
}
|
||||
|
||||
//set message
|
||||
message::add($text['message-delete']);
|
||||
|
||||
}
|
||||
unset($records);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* toggle records
|
||||
*/
|
||||
public function toggle($records) {
|
||||
if (permission_exists($this->permission_prefix.'enabled')) {
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate($_SERVER['PHP_SELF'])) {
|
||||
message::add($text['message-invalid_token'],'negative');
|
||||
header('Location: '.$this->list_page);
|
||||
exit;
|
||||
}
|
||||
|
||||
//toggle the checked records
|
||||
if (is_array($records) && @sizeof($records) != 0) {
|
||||
|
||||
//get current toggle state
|
||||
foreach($records as $x => $record) {
|
||||
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||
$record_uuids[] = $this->uuid_prefix."uuid = '".$record['uuid']."'";
|
||||
}
|
||||
}
|
||||
if (is_array($record_uuids) && @sizeof($record_uuids) != 0) {
|
||||
$sql = "select ".$this->uuid_prefix."uuid as uuid, ".$this->toggle_field." as toggle, extension, number_alias, user_context from v_".$this->table." ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and ( ".implode(' or ', $record_uuids)." ) ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$rows = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $row) {
|
||||
//for use below and to clear cache (bottom)
|
||||
$extensions[$row['uuid']]['state'] = $row['toggle'];
|
||||
$extensions[$row['uuid']]['extension'] = $row['extension'];
|
||||
$extensions[$row['uuid']]['number_alias'] = $row['number_alias'];
|
||||
$extensions[$row['uuid']]['user_context'] = $row['user_context'];
|
||||
}
|
||||
}
|
||||
unset($sql, $parameters, $rows, $row);
|
||||
}
|
||||
|
||||
//build update array
|
||||
$x = 0;
|
||||
foreach($extensions as $uuid => $extension) {
|
||||
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
|
||||
$array[$this->table][$x][$this->toggle_field] = $extension['state'] == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0];
|
||||
$x++;
|
||||
}
|
||||
|
||||
//save the changes
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p->add('extension_edit', 'temp');
|
||||
|
||||
//save the array
|
||||
$database = new database;
|
||||
$database->app_name = $this->app_name;
|
||||
$database->app_uuid = $this->app_uuid;
|
||||
$database->save($array);
|
||||
unset($array);
|
||||
|
||||
//revoke temporary permissions
|
||||
$p->delete('extension_edit', 'temp');
|
||||
|
||||
//synchronize configuration
|
||||
if (is_writable($_SESSION['switch']['extensions']['dir'])) {
|
||||
$this->xml();
|
||||
}
|
||||
|
||||
//write the provision files
|
||||
if (strlen($_SESSION['provision']['path']['text']) > 0) {
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/provision')) {
|
||||
$prov = new provision;
|
||||
$prov->domain_uuid = $_SESSION['domain_uuid'];
|
||||
$response = $prov->write();
|
||||
}
|
||||
}
|
||||
|
||||
//clear the cache
|
||||
foreach ($extensions as $uuid => $extension) {
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:".$extension['extension']."@".$extension['user_context']);
|
||||
if (permission_exists('number_alias') && strlen($extension['number_alias']) > 0) {
|
||||
$cache->delete("directory:".$extension['number_alias']."@".$extension['user_context']);
|
||||
}
|
||||
}
|
||||
unset($extensions);
|
||||
|
||||
//set message
|
||||
message::add($text['message-toggle']);
|
||||
|
||||
}
|
||||
unset($records);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -221,7 +221,15 @@
|
|||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "1";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Polycom headset memory mode 0=Disabled - 1=Enabled ";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Polycom headset memory mode 0=Disabled - 1=Enabled";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "2e8fdb67-a4e5-42ed-9ec9-440836b0c44e";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "polycom_analog_headset_option";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "0";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Polycom EHS. 0=No EHS compatible headset, 1=Jabra,2=Plantronics,3=Sennheiser";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "947aa9ea-5769-4ef6-8c55-4144962359c5";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
|
||||
//get http post variables and set them to php variables
|
||||
if (is_array($_POST)) {
|
||||
$domain_uuid = $_POST['domain_uuid'];
|
||||
$stream_uuid = $_POST["stream_uuid"];
|
||||
$stream_name = $_POST["stream_name"];
|
||||
$stream_location = $_POST["stream_location"];
|
||||
|
|
|
|||
|
|
@ -124,6 +124,19 @@
|
|||
if ($action == 'add') {
|
||||
$dialplan_context = $_SESSION['domain_name'];
|
||||
}
|
||||
if ($action == 'update') {
|
||||
$sql = "select * from v_dialplans ";
|
||||
$sql .= "where dialplan_uuid = :dialplan_uuid ";
|
||||
$parameters['dialplan_uuid'] = $dialplan_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0) {
|
||||
$domain_uuid = $row["domain_uuid"];
|
||||
$dialplan_context = $row["dialplan_context"];
|
||||
}
|
||||
unset($sql, $parameters, $row);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//process main dialplan entry
|
||||
|
|
@ -461,6 +474,7 @@
|
|||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p->add('dialplan_detail_add', 'temp');
|
||||
$p->add('dialplan_detail_edit', 'temp');
|
||||
|
||||
//execute insert
|
||||
$database = new database;
|
||||
|
|
@ -471,6 +485,7 @@
|
|||
|
||||
//revoke temporary permissions
|
||||
$p->delete('dialplan_detail_add', 'temp');
|
||||
$p->delete('dialplan_detail_edit', 'temp');
|
||||
}
|
||||
|
||||
//update the dialplan xml
|
||||
|
|
@ -494,8 +509,12 @@
|
|||
else if ($action == "update") {
|
||||
message::add($text['message-update']);
|
||||
}
|
||||
header("Location: time_condition_edit.php?id=".$dialplan_uuid.($app_uuid != '' ? "&app_uuid=".$app_uuid : null));
|
||||
exit;
|
||||
|
||||
//redirect the browser
|
||||
if (is_uuid($dialplan_uuid)) {
|
||||
header("Location: time_condition_edit.php?id=".$dialplan_uuid.($app_uuid != '' ? "&app_uuid=".$app_uuid : null));
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@
|
|||
}
|
||||
|
||||
//set the assigned extensions
|
||||
if (!permission_exists('xml_cdr_domain')) {
|
||||
if (!permission_exists('xml_cdr_domain') && is_array($_SESSION['user']['extension'])) {
|
||||
foreach ($_SESSION['user']['extension'] as $row) {
|
||||
if (is_uuid($row['extension_uuid'])) {
|
||||
$extension_uuids[] = $row['extension_uuid'];
|
||||
|
|
@ -286,7 +286,7 @@
|
|||
$sql .= "where c.domain_uuid = :domain_uuid \n";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
}
|
||||
if (!permission_exists('xml_cdr_domain')) { //only show the user their calls
|
||||
if (!permission_exists('xml_cdr_domain') && is_array($extension_uuids)) { //only show the user their calls
|
||||
$sql .= "and (c.extension_uuid = '".implode("' or c.extension_uuid = '", $extension_uuids)."') ";
|
||||
}
|
||||
if ($missed == true) {
|
||||
|
|
@ -537,11 +537,11 @@
|
|||
}
|
||||
}
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
$result_count = count($result);
|
||||
$result_count = (count($result) ? count($result) : 0);
|
||||
unset($database, $sql, $parameters);
|
||||
|
||||
//return the paging
|
||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true, $result_count); //top
|
||||
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page, false, $result_count); //bottom
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2019
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
|
@ -283,7 +283,7 @@
|
|||
|
||||
//if not admin or superadmin, only show own calls
|
||||
if (!permission_exists('xml_cdr_domain')) {
|
||||
if (count($_SESSION['user']['extension']) > 0) { // extensions are assigned to this user
|
||||
if (is_array($_SESSION['user']['extension']) && count($_SESSION['user']['extension']) > 0) { // extensions are assigned to this user
|
||||
// create simple user extension array
|
||||
foreach ($_SESSION['user']['extension'] as $row) {
|
||||
$user_extensions[] = $row['user'];
|
||||
|
|
@ -491,4 +491,4 @@
|
|||
$x++;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ class cache {
|
|||
return false;
|
||||
}
|
||||
|
||||
//send a custom event
|
||||
|
||||
//run the memcache
|
||||
$command = "memcache set ".$key." ".$value;
|
||||
$result = event_socket_request($fp, 'api '.$command);
|
||||
|
|
@ -67,7 +65,7 @@ class cache {
|
|||
* @var string $key cache id
|
||||
*/
|
||||
public function get($key) {
|
||||
|
||||
|
||||
//cache method memcache
|
||||
if ($_SESSION['cache']['method']['text'] == "memcache") {
|
||||
// connect to event socket
|
||||
|
|
@ -84,7 +82,6 @@ class cache {
|
|||
|
||||
//close event socket
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
|
||||
//get the file cache
|
||||
|
|
@ -126,7 +123,6 @@ class cache {
|
|||
|
||||
//close event socket
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
|
||||
//cache method file
|
||||
|
|
@ -134,7 +130,7 @@ class cache {
|
|||
//change the delimiter
|
||||
$key = str_replace(":", ".", $key);
|
||||
|
||||
// connect to event socket
|
||||
//connect to event socket
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
if ($fp === false) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -732,8 +732,8 @@
|
|||
</section>
|
||||
</document>]];
|
||||
--set the cache
|
||||
local key = "directory:" .. user .. "@" .. domain_name;
|
||||
ok, err = cache.set(key, XML_STRING, expire["directory"]);
|
||||
--local key = "directory:" .. user .. "@" .. domain_name;
|
||||
--ok, err = cache.set(key, XML_STRING, expire["directory"]);
|
||||
--freeswitch.consoleLog("notice", "[xml_handler] " .. user .. "@" .. domain_name .. "\n");
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -5927,15 +5927,18 @@
|
|||
<!-- # Enable Manual VLAN Configuration. 0 - Disable, 1 - Enable. Default is 0. -->
|
||||
<!-- # Number: 0,1 -->
|
||||
<!-- # Mandatory -->
|
||||
<P22174>0</P22174>
|
||||
{if isset($grandstream_lan_port_vlan) }
|
||||
<P22174>1</P22174>
|
||||
|
||||
<!-- # Layer 2 QoS. 802.1Q/VLAN Tag (VLAN classification for RTP). Default is 0 -->
|
||||
<!-- # Number: 0 - 4094 -->
|
||||
<!-- # Mandatory -->
|
||||
{if isset($grandstream_lan_port_vlan) }
|
||||
|
||||
<P51>{$grandstream_lan_port_vlan}</P51>
|
||||
|
||||
{else}
|
||||
<P51>0</P51>
|
||||
<P22174>0</P22174>
|
||||
{/if}
|
||||
|
||||
<!-- # Layer 2 QoS. 802.1p priority value (0 - 7). Default is 0 -->
|
||||
|
|
@ -6647,7 +6650,7 @@
|
|||
<!-- # This is a string of up to 256 characters that should contain a path to the XML file. It MUST be in the host/path format. -->
|
||||
<!-- # For example: directory.grandstream.com/engineering -->
|
||||
<!-- # String -->
|
||||
{if isset($grandstream_phonebook_download)}
|
||||
{if isset($grandstream_phonebook_xml_server_path)}
|
||||
<P331>{$grandstream_phonebook_xml_server_path}{$mac}/</P331>
|
||||
{elseif isset($grandstream_phonebook_xml_server_path)}
|
||||
<P331>{$grandstream_phonebook_xml_server_path}</P331>
|
||||
|
|
@ -6682,7 +6685,7 @@
|
|||
<!-- # Phonebook Key Function. 0 - Default, 1 - LDAP Search, 2 - Local Phonebook, 3 - Local Group, 4 - Broadsoft Phonebook -->
|
||||
<!-- # Number: 0, 1, 2, 3, 4. -->
|
||||
<!-- # Mandatory -->
|
||||
{if isset($contact_grandstream)}
|
||||
{if isset($contact_groups) || isset($contact_users) || isset($contact_extensions)}
|
||||
<P1526>2</P1526>
|
||||
{else}
|
||||
<P1526>0</P1526>
|
||||
|
|
|
|||
|
|
@ -5927,15 +5927,18 @@
|
|||
<!-- # Enable Manual VLAN Configuration. 0 - Disable, 1 - Enable. Default is 0. -->
|
||||
<!-- # Number: 0,1 -->
|
||||
<!-- # Mandatory -->
|
||||
<P22174>0</P22174>
|
||||
{if isset($grandstream_lan_port_vlan) }
|
||||
<P22174>1</P22174>
|
||||
|
||||
<!-- # Layer 2 QoS. 802.1Q/VLAN Tag (VLAN classification for RTP). Default is 0 -->
|
||||
<!-- # Number: 0 - 4094 -->
|
||||
<!-- # Mandatory -->
|
||||
{if isset($grandstream_lan_port_vlan) }
|
||||
|
||||
<P51>{$grandstream_lan_port_vlan}</P51>
|
||||
|
||||
{else}
|
||||
<P51>0</P51>
|
||||
<P22174>0</P22174>
|
||||
{/if}
|
||||
|
||||
<!-- # Layer 2 QoS. 802.1p priority value (0 - 7). Default is 0 -->
|
||||
|
|
@ -6647,7 +6650,7 @@
|
|||
<!-- # This is a string of up to 256 characters that should contain a path to the XML file. It MUST be in the host/path format. -->
|
||||
<!-- # For example: directory.grandstream.com/engineering -->
|
||||
<!-- # String -->
|
||||
{if isset($grandstream_phonebook_download)}
|
||||
{if isset($grandstream_phonebook_xml_server_path)}
|
||||
<P331>{$grandstream_phonebook_xml_server_path}{$mac}/</P331>
|
||||
{elseif isset($grandstream_phonebook_xml_server_path)}
|
||||
<P331>{$grandstream_phonebook_xml_server_path}</P331>
|
||||
|
|
@ -6682,7 +6685,7 @@
|
|||
<!-- # Phonebook Key Function. 0 - Default, 1 - LDAP Search, 2 - Local Phonebook, 3 - Local Group, 4 - Broadsoft Phonebook -->
|
||||
<!-- # Number: 0, 1, 2, 3, 4. -->
|
||||
<!-- # Mandatory -->
|
||||
{if isset($contact_grandstream)}
|
||||
{if isset($contact_groups) || isset($contact_users) || isset($contact_extensions)}
|
||||
<P1526>2</P1526>
|
||||
{else}
|
||||
<P1526>0</P1526>
|
||||
|
|
|
|||
|
|
@ -5927,15 +5927,18 @@
|
|||
<!-- # Enable Manual VLAN Configuration. 0 - Disable, 1 - Enable. Default is 0. -->
|
||||
<!-- # Number: 0,1 -->
|
||||
<!-- # Mandatory -->
|
||||
<P22174>0</P22174>
|
||||
{if isset($grandstream_lan_port_vlan) }
|
||||
<P22174>1</P22174>
|
||||
|
||||
<!-- # Layer 2 QoS. 802.1Q/VLAN Tag (VLAN classification for RTP). Default is 0 -->
|
||||
<!-- # Number: 0 - 4094 -->
|
||||
<!-- # Mandatory -->
|
||||
{if isset($grandstream_lan_port_vlan) }
|
||||
|
||||
<P51>{$grandstream_lan_port_vlan}</P51>
|
||||
|
||||
{else}
|
||||
<P51>0</P51>
|
||||
<P22174>0</P22174>
|
||||
{/if}
|
||||
|
||||
<!-- # Layer 2 QoS. 802.1p priority value (0 - 7). Default is 0 -->
|
||||
|
|
@ -6647,7 +6650,7 @@
|
|||
<!-- # This is a string of up to 256 characters that should contain a path to the XML file. It MUST be in the host/path format. -->
|
||||
<!-- # For example: directory.grandstream.com/engineering -->
|
||||
<!-- # String -->
|
||||
{if isset($grandstream_phonebook_download)}
|
||||
{if isset($grandstream_phonebook_xml_server_path)}
|
||||
<P331>{$grandstream_phonebook_xml_server_path}{$mac}/</P331>
|
||||
{elseif isset($grandstream_phonebook_xml_server_path)}
|
||||
<P331>{$grandstream_phonebook_xml_server_path}</P331>
|
||||
|
|
@ -6682,7 +6685,7 @@
|
|||
<!-- # Phonebook Key Function. 0 - Default, 1 - LDAP Search, 2 - Local Phonebook, 3 - Local Group, 4 - Broadsoft Phonebook -->
|
||||
<!-- # Number: 0, 1, 2, 3, 4. -->
|
||||
<!-- # Mandatory -->
|
||||
{if isset($contact_grandstream)}
|
||||
{if isset($contact_groups) || isset($contact_users) || isset($contact_extensions)}
|
||||
<P1526>2</P1526>
|
||||
{else}
|
||||
<P1526>0</P1526>
|
||||
|
|
|
|||
|
|
@ -5927,15 +5927,18 @@
|
|||
<!-- # Enable Manual VLAN Configuration. 0 - Disable, 1 - Enable. Default is 0. -->
|
||||
<!-- # Number: 0,1 -->
|
||||
<!-- # Mandatory -->
|
||||
<P22174>0</P22174>
|
||||
{if isset($grandstream_lan_port_vlan) }
|
||||
<P22174>1</P22174>
|
||||
|
||||
<!-- # Layer 2 QoS. 802.1Q/VLAN Tag (VLAN classification for RTP). Default is 0 -->
|
||||
<!-- # Number: 0 - 4094 -->
|
||||
<!-- # Mandatory -->
|
||||
{if isset($grandstream_lan_port_vlan) }
|
||||
|
||||
<P51>{$grandstream_lan_port_vlan}</P51>
|
||||
|
||||
{else}
|
||||
<P51>0</P51>
|
||||
<P22174>0</P22174>
|
||||
{/if}
|
||||
|
||||
<!-- # Layer 2 QoS. 802.1p priority value (0 - 7). Default is 0 -->
|
||||
|
|
@ -6647,7 +6650,7 @@
|
|||
<!-- # This is a string of up to 256 characters that should contain a path to the XML file. It MUST be in the host/path format. -->
|
||||
<!-- # For example: directory.grandstream.com/engineering -->
|
||||
<!-- # String -->
|
||||
{if isset($grandstream_phonebook_download)}
|
||||
{if isset($grandstream_phonebook_xml_server_path)}
|
||||
<P331>{$grandstream_phonebook_xml_server_path}{$mac}/</P331>
|
||||
{elseif isset($grandstream_phonebook_xml_server_path)}
|
||||
<P331>{$grandstream_phonebook_xml_server_path}</P331>
|
||||
|
|
@ -6682,7 +6685,7 @@
|
|||
<!-- # Phonebook Key Function. 0 - Default, 1 - LDAP Search, 2 - Local Phonebook, 3 - Local Group, 4 - Broadsoft Phonebook -->
|
||||
<!-- # Number: 0, 1, 2, 3, 4. -->
|
||||
<!-- # Mandatory -->
|
||||
{if isset($contact_grandstream)}
|
||||
{if isset($contact_groups) || isset($contact_users) || isset($contact_extensions)}
|
||||
<P1526>2</P1526>
|
||||
{else}
|
||||
<P1526>0</P1526>
|
||||
|
|
|
|||
|
|
@ -6650,7 +6650,7 @@
|
|||
<!-- # This is a string of up to 256 characters that should contain a path to the XML file. It MUST be in the host/path format. -->
|
||||
<!-- # For example: directory.grandstream.com/engineering -->
|
||||
<!-- # String -->
|
||||
{if isset($grandstream_phonebook_download)}
|
||||
{if isset($grandstream_phonebook_xml_server_path)}
|
||||
<P331>{$grandstream_phonebook_xml_server_path}{$mac}/</P331>
|
||||
{elseif isset($grandstream_phonebook_xml_server_path)}
|
||||
<P331>{$grandstream_phonebook_xml_server_path}</P331>
|
||||
|
|
@ -6685,7 +6685,7 @@
|
|||
<!-- # Phonebook Key Function. 0 - Default, 1 - LDAP Search, 2 - Local Phonebook, 3 - Local Group, 4 - Broadsoft Phonebook -->
|
||||
<!-- # Number: 0, 1, 2, 3, 4. -->
|
||||
<!-- # Mandatory -->
|
||||
{if isset($contact_grandstream)}
|
||||
{if isset($contact_groups) || isset($contact_users) || isset($contact_extensions)}
|
||||
<P1526>2</P1526>
|
||||
{else}
|
||||
<P1526>0</P1526>
|
||||
|
|
|
|||
|
|
@ -429,6 +429,16 @@ echo "<script language='JavaScript' type='text/javascript' src='<!--{project_pat
|
|||
}
|
||||
}
|
||||
|
||||
function list_all_check() {
|
||||
var inputs = document.getElementsByTagName('input');
|
||||
document.getElementById('checkbox_all').checked;
|
||||
for (var i = 0, max = inputs.length; i < max; i++) {
|
||||
if (inputs[i].type === 'checkbox') {
|
||||
inputs[i].checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function list_self_check(checkbox_id) {
|
||||
var inputs = document.getElementsByTagName('input');
|
||||
for (var i = 0, max = inputs.length; i < max; i++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue