2012-06-04 14:58:40 +00:00
<? php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
2018-06-13 01:21:44 -06:00
Portions created by the Initial Developer are Copyright (C) 2008-2018
2012-06-04 14:58:40 +00:00
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
2015-02-28 02:32:25 +00:00
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
2012-06-04 14:58:40 +00:00
*/
2016-10-05 01:19:05 -06:00
//includes
require_once "root.php" ;
require_once "resources/require.php" ;
require_once "resources/check_auth.php" ;
//check permissions
if ( permission_exists ( 'follow_me' ) || permission_exists ( 'call_forward' ) || permission_exists ( 'do_not_disturb' )) {
//access granted
}
else {
echo "access denied" ;
exit ;
}
2012-10-24 07:02:52 +00:00
//add multi-lingual support
2015-01-18 10:06:08 +00:00
$language = new text ;
$text = $language -> get ();
2012-06-04 14:58:40 +00:00
2012-09-29 21:53:24 +00:00
//define the destination_select function
function destination_select ( $select_name , $select_value , $select_default ) {
if ( strlen ( $select_value ) == 0 ) { $select_value = $select_default ; }
2014-02-26 04:58:16 +00:00
echo " <select class='formfld' style='width: 55px;' name=' $select_name '> \n " ;
2012-11-21 05:59:07 +00:00
$i = 0 ;
while ( $i <= 100 ) {
2016-10-05 01:19:05 -06:00
echo " <option value='" . $i . "' " . (( $select_value == $i ) ? "selected='selected'" : null ) . ">" . $i . "</option> \n " ;
2012-11-21 05:59:07 +00:00
$i = $i + 5 ;
2012-06-04 14:58:40 +00:00
}
2012-09-29 21:53:24 +00:00
echo "</select> \n " ;
2012-06-04 14:58:40 +00:00
}
//get the extension_uuid
2012-10-08 22:04:57 +00:00
$extension_uuid = check_str ( $_REQUEST [ "id" ]);
2012-06-04 14:58:40 +00:00
//get the extension number
2012-09-29 15:58:06 +00:00
$sql = "select * from v_extensions " ;
2012-06-04 14:58:40 +00:00
$sql .= "where domain_uuid = ' $domain_uuid ' " ;
$sql .= "and extension_uuid = ' $extension_uuid ' " ;
2015-09-07 10:47:57 +02:00
if ( ! ( permission_exists ( 'follow_me' ) || permission_exists ( 'call_forward' ) || permission_exists ( 'do_not_disturb' ))) {
2012-06-04 14:58:40 +00:00
if ( count ( $_SESSION [ 'user' ][ 'extension' ]) > 0 ) {
$sql .= "and (" ;
$x = 0 ;
foreach ( $_SESSION [ 'user' ][ 'extension' ] as $row ) {
if ( $x > 0 ) { $sql .= "or " ; }
$sql .= "extension = '" . $row [ 'user' ] . "' " ;
$x ++ ;
}
$sql .= ")" ;
}
else {
//hide any results when a user has not been assigned an extension
$sql .= "and extension = 'disabled' " ;
}
}
$prep_statement = $db -> prepare ( check_sql ( $sql ));
$prep_statement -> execute ();
$result = $prep_statement -> fetchAll ( PDO :: FETCH_NAMED );
if ( count ( $result ) == 0 ) {
echo "access denied" ;
exit ;
}
else {
foreach ( $result as & $row ) {
$extension = $row [ "extension" ];
2013-05-01 17:05:53 +00:00
$accountcode = $row [ "accountcode" ];
2012-06-04 14:58:40 +00:00
$effective_caller_id_name = $row [ "effective_caller_id_name" ];
$effective_caller_id_number = $row [ "effective_caller_id_number" ];
$outbound_caller_id_name = $row [ "outbound_caller_id_name" ];
$outbound_caller_id_number = $row [ "outbound_caller_id_number" ];
2012-09-29 15:58:06 +00:00
$do_not_disturb = $row [ "do_not_disturb" ];
2012-12-16 07:39:03 +00:00
$forward_all_destination = $row [ "forward_all_destination" ];
$forward_all_enabled = $row [ "forward_all_enabled" ];
$forward_busy_destination = $row [ "forward_busy_destination" ];
$forward_busy_enabled = $row [ "forward_busy_enabled" ];
2014-12-03 05:55:01 +00:00
$forward_no_answer_destination = $row [ "forward_no_answer_destination" ];
$forward_no_answer_enabled = $row [ "forward_no_answer_enabled" ];
2015-12-09 14:00:44 -08:00
$forward_user_not_registered_destination = $row [ "forward_user_not_registered_destination" ];
$forward_user_not_registered_enabled = $row [ "forward_user_not_registered_enabled" ];
2012-11-21 05:59:07 +00:00
$follow_me_uuid = $row [ "follow_me_uuid" ];
2015-02-28 04:07:15 +00:00
$forward_caller_id_uuid = $row [ "forward_caller_id_uuid" ];
2012-06-04 14:58:40 +00:00
break ; //limit to 1 row
}
2012-09-29 15:58:06 +00:00
if ( strlen ( $do_not_disturb ) == 0 ) {
$do_not_disturb = "false" ;
}
2012-06-04 14:58:40 +00:00
}
unset ( $prep_statement );
2016-10-05 01:19:05 -06:00
//process post vars
2018-04-05 10:23:27 -06:00
if ( count ( $_POST ) > 0 && strlen ( $_POST [ "persistformvar" ]) == 0 ) {
2016-10-05 01:19:05 -06:00
//get http post variables and set them to php variables
2018-04-05 10:23:27 -06:00
if ( count ( $_POST ) > 0 ) {
2016-10-05 01:19:05 -06:00
$forward_all_enabled = check_str ( $_POST [ "forward_all_enabled" ]);
$forward_all_destination = check_str ( $_POST [ "forward_all_destination" ]);
$forward_busy_enabled = check_str ( $_POST [ "forward_busy_enabled" ]);
$forward_busy_destination = check_str ( $_POST [ "forward_busy_destination" ]);
$forward_no_answer_enabled = check_str ( $_POST [ "forward_no_answer_enabled" ]);
$forward_no_answer_destination = check_str ( $_POST [ "forward_no_answer_destination" ]);
$forward_user_not_registered_enabled = check_str ( $_POST [ "forward_user_not_registered_enabled" ]);
$forward_user_not_registered_destination = check_str ( $_POST [ "forward_user_not_registered_destination" ]);
$forward_caller_id_uuid = check_str ( $_POST [ "forward_caller_id_uuid" ]);
$cid_name_prefix = check_str ( $_POST [ "cid_name_prefix" ]);
$cid_number_prefix = check_str ( $_POST [ "cid_number_prefix" ]);
$follow_me_enabled = check_str ( $_POST [ "follow_me_enabled" ]);
$follow_me_caller_id_uuid = check_str ( $_POST [ "follow_me_caller_id_uuid" ]);
$follow_me_ignore_busy = check_str ( $_POST [ "follow_me_ignore_busy" ]);
$n = 0 ;
foreach ( $_POST [ "destinations" ] as $field ) {
$destinations [ $n ][ 'uuid' ] = check_str ( $field [ 'uuid' ]);
$destinations [ $n ][ 'destination' ] = check_str ( $field [ 'destination' ]);
$destinations [ $n ][ 'delay' ] = check_str ( $field [ 'delay' ]);
$destinations [ $n ][ 'prompt' ] = check_str ( $field [ 'prompt' ]);
$destinations [ $n ][ 'timeout' ] = check_str ( $field [ 'timeout' ]);
$n ++ ;
}
$dnd_enabled = check_str ( $_POST [ "dnd_enabled" ]);
2012-06-04 14:58:40 +00:00
}
2016-10-05 01:19:05 -06:00
//check for all required data
if ( strlen ( $msg ) > 0 && strlen ( $_POST [ "persistformvar" ]) == 0 ) {
require_once "resources/header.php" ;
require_once "resources/persist_form_var.php" ;
echo "<div align='center'> \n " ;
echo "<table><tr><td> \n " ;
echo $msg . "<br />" ;
echo "</td></tr></table> \n " ;
persistformvar ( $_POST );
echo "</div> \n " ;
require_once "resources/footer.php" ;
return ;
}
2012-06-04 14:58:40 +00:00
2016-10-05 01:19:05 -06:00
//include the classes
include "resources/classes/call_forward.php" ;
include "resources/classes/follow_me.php" ;
include "resources/classes/do_not_disturb.php" ;
//call forward config
if ( permission_exists ( 'call_forward' )) {
2017-04-14 02:39:41 -06:00
//sanitize the destinations
$forward_all_destination = str_replace ( '$' , '' , $forward_all_destination );
$forward_busy_destination = str_replace ( '$' , '' , $forward_busy_destination );
$forward_no_answer_destination = str_replace ( '$' , '' , $forward_no_answer_destination );
$forward_user_not_registered_destination = str_replace ( '$' , '' , $forward_user_not_registered_destination );
//build the array
2016-10-05 01:19:05 -06:00
$extensions [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$extensions [ 'extension_uuid' ] = $extension_uuid ;
$extensions [ 'forward_all_enabled' ] = $forward_all_enabled ;
$extensions [ 'forward_all_destination' ] = $forward_all_destination ;
$extensions [ 'forward_busy_enabled' ] = $forward_busy_enabled ;
$extensions [ 'forward_busy_destination' ] = $forward_busy_destination ;
$extensions [ 'forward_no_answer_enabled' ] = $forward_no_answer_enabled ;
$extensions [ 'forward_no_answer_destination' ] = $forward_no_answer_destination ;
$extensions [ 'forward_user_not_registered_enabled' ] = $forward_user_not_registered_enabled ;
$extensions [ 'forward_user_not_registered_destination' ] = $forward_user_not_registered_destination ;
$extensions [ 'forward_caller_id_uuid' ] = $forward_caller_id_uuid ;
}
2012-06-04 14:58:40 +00:00
2016-10-05 01:19:05 -06:00
//do not disturb (dnd) config
if ( permission_exists ( 'do_not_disturb' )) {
$extensions [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$extensions [ 'extension_uuid' ] = $extension_uuid ;
$extensions [ 'do_not_disturb' ] = $dnd_enabled ;
}
2012-06-04 14:58:40 +00:00
2016-10-05 01:19:05 -06:00
//follow me config
if ( permission_exists ( 'follow_me' )) {
//build the follow me array
if ( $follow_me_uuid == '' ) {
$follow_me_uuid = uuid ();
$extensions [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$extensions [ 'extension_uuid' ] = $extension_uuid ;
$extensions [ 'follow_me_uuid' ] = $follow_me_uuid ;
}
$follow_me [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$follow_me [ 'follow_me_uuid' ] = $follow_me_uuid ;
$follow_me [ 'cid_name_prefix' ] = $cid_name_prefix ;
$follow_me [ 'cid_number_prefix' ] = $cid_number_prefix ;
$follow_me [ 'follow_me_caller_id_uuid' ] = $follow_me_caller_id_uuid ;
$follow_me [ 'follow_me_ignore_busy' ] = $follow_me_ignore_busy ;
$d = 0 ;
$destination_found = false ;
foreach ( $destinations as $field ) {
if ( $field [ 'destination' ] != '' ) {
2017-04-14 02:39:41 -06:00
//sanitize the destination
$field [ 'destination' ] = str_replace ( '$' , '' , $field [ 'destination' ]);
//build the array
2016-10-05 01:19:05 -06:00
$follow_me [ 'follow_me_destinations' ][ $d ][ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$follow_me [ 'follow_me_destinations' ][ $d ][ 'follow_me_uuid' ] = $follow_me_uuid ;
$follow_me [ 'follow_me_destinations' ][ $d ][ 'follow_me_destination_uuid' ] = $field [ 'uuid' ];
$follow_me [ 'follow_me_destinations' ][ $d ][ 'follow_me_destination' ] = $field [ 'destination' ];
$follow_me [ 'follow_me_destinations' ][ $d ][ 'follow_me_delay' ] = $field [ 'delay' ];
$follow_me [ 'follow_me_destinations' ][ $d ][ 'follow_me_prompt' ] = $field [ 'prompt' ];
$follow_me [ 'follow_me_destinations' ][ $d ][ 'follow_me_timeout' ] = $field [ 'timeout' ];
$follow_me [ 'follow_me_destinations' ][ $d ][ 'follow_me_order' ] = $d ;
$destination_found = true ;
$d ++ ;
}
else {
$follow_me_delete_uuids [] = $field [ 'uuid' ];
}
}
$follow_me [ 'follow_me_enabled' ] = ( $destination_found ) ? $follow_me_enabled : 'false' ;
}
2013-01-15 21:55:10 +00:00
2016-10-05 01:19:05 -06:00
//prepare the array
if ( is_array ( $extensions ) && sizeof ( $extensions ) > 0 ) {
$array [ 'extensions' ][] = $extensions ;
}
if ( is_array ( $follow_me ) && sizeof ( $follow_me ) > 0 ) {
$array [ 'follow_me' ][] = $follow_me ;
}
2013-01-15 21:55:10 +00:00
2018-04-05 10:23:27 -06:00
//add the dialplan permission
$p = new permissions ;
$p -> add ( "extension_edit" , "temp" );
2016-10-05 01:19:05 -06:00
//save the data
2016-10-18 09:28:23 -06:00
$database = new database ;
$database -> app_name = 'call_routing' ;
$database -> app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d' ;
$database -> save ( $array );
//$message = $database->message;
2012-06-04 14:58:40 +00:00
2018-04-05 10:23:27 -06:00
//remove the temporary permission
$p -> delete ( "extension_edit" , "temp" );
2016-10-05 01:19:05 -06:00
//delete empty destination records
if ( is_array ( $follow_me_delete_uuids ) && sizeof ( $follow_me_delete_uuids ) > 0 ) {
$sql = "delete from v_follow_me_destinations where follow_me_destination_uuid in ('" . implode ( "','" , $follow_me_delete_uuids ) . "') " ;
2015-05-20 02:46:06 +00:00
$db -> exec ( check_sql ( $sql ));
2012-06-04 14:58:40 +00:00
}
2016-10-05 01:19:05 -06:00
//call forward config
if ( permission_exists ( 'call_forward' )) {
$call_forward = new call_forward ;
$call_forward -> domain_uuid = $_SESSION [ 'domain_uuid' ];
$call_forward -> domain_name = $_SESSION [ 'domain_name' ];
$call_forward -> extension_uuid = $extension_uuid ;
$call_forward -> forward_all_destination = $forward_all_destination ;
$call_forward -> forward_all_enabled = $forward_all_enabled ;
$call_forward -> forward_caller_id_uuid = $forward_caller_id_uuid ;
2012-06-04 14:58:40 +00:00
}
2016-10-05 01:19:05 -06:00
//do not disturb (dnd) config
if ( permission_exists ( 'do_not_disturb' )) {
$dnd = new do_not_disturb ;
$dnd -> domain_uuid = $_SESSION [ 'domain_uuid' ];
$dnd -> domain_name = $_SESSION [ 'domain_name' ];
$dnd -> extension_uuid = $extension_uuid ;
$dnd -> extension = $extension ;
$dnd -> enabled = $dnd_enabled ;
2013-01-15 21:55:10 +00:00
}
2016-10-05 01:19:05 -06:00
//if follow me is enabled then process call forward and dnd first
if ( $follow_me_enabled == "true" ) {
2013-01-15 21:55:10 +00:00
//call forward
$call_forward -> set ();
unset ( $call_forward );
//dnd
$dnd -> set ();
$dnd -> user_status ();
unset ( $dnd );
}
2012-06-04 14:58:40 +00:00
2016-10-05 01:19:05 -06:00
//follow me config and process
if ( permission_exists ( 'follow_me' )) {
$follow_me = new follow_me ;
$follow_me -> domain_uuid = $_SESSION [ 'domain_uuid' ];
$follow_me -> extension_uuid = $extension_uuid ;
$follow_me -> follow_me_uuid = $follow_me_uuid ;
$follow_me -> follow_me_ignore_busy = $follow_me_ignore_busy ;
$follow_me -> follow_me_caller_id_uuid = $follow_me_caller_id_uuid ;
$follow_me -> follow_me_enabled = $follow_me_enabled ;
$follow_me -> set ();
unset ( $follow_me );
}
2013-01-17 06:14:31 +00:00
2016-10-05 01:19:05 -06:00
//if dnd or call forward are enabled process them last
if ( $follow_me_enabled != "true" ) {
if ( $forward_all_enabled == "true" ) {
//dnd
$dnd -> set ();
$dnd -> user_status ();
unset ( $dnd );
//call forward
$call_forward -> set ();
unset ( $call_forward );
}
else {
//call forward
$call_forward -> set ();
unset ( $call_forward );
//dnd
$dnd -> set ();
$dnd -> user_status ();
unset ( $dnd );
}
}
2017-11-09 14:09:56 -05:00
//send feature event notify to the phone
if ( $_SESSION [ 'device' ][ 'feature_sync' ][ 'boolean' ] == "true" ) {
$ring_count = ceil ( $call_timeout / 6 );
$feature_event_notify = new feature_event_notify ;
$feature_event_notify -> domain_name = $_SESSION [ 'domain_name' ];
$feature_event_notify -> extension = $extension ;
$feature_event_notify -> do_not_disturb = $dnd_enabled ;
$feature_event_notify -> ring_count = $ring_count ;
$feature_event_notify -> forward_all_enabled = $forward_all_enabled ;
$feature_event_notify -> forward_busy_enabled = $forward_busy_enabled ;
$feature_event_notify -> forward_no_answer_enabled = $forward_no_answer_enabled ;
//workaround for freeswitch not sending NOTIFY when destination values are nil. Send 0.
if ( $forward_all_destination == "" ) {
$feature_event_notify -> forward_all_destination = "0" ;
} else {
$feature_event_notify -> forward_all_destination = $forward_all_destination ;
}
if ( $forward_busy_destination == "" ) {
$feature_event_notify -> forward_busy_destination = "0" ;
} else {
$feature_event_notify -> forward_busy_destination = $forward_busy_destination ;
}
if ( $forward_no_answer_destination == "" ) {
$feature_event_notify -> forward_no_answer_destination = "0" ;
} else {
$feature_event_notify -> forward_no_answer_destination = $forward_no_answer_destination ;
}
$feature_event_notify -> send_notify ();
unset ( $feature_event_notify );
}
2016-10-05 01:19:05 -06:00
//synchronize configuration
if ( is_readable ( $_SESSION [ 'switch' ][ 'extensions' ][ 'dir' ])) {
require_once "app/extensions/resources/classes/extension.php" ;
$ext = new extension ;
$ext -> xml ();
unset ( $ext );
}
//clear the cache
$cache = new cache ;
$cache -> delete ( "directory:" . $extension . "@" . $_SESSION [ 'domain_name' ]);
if ( strlen ( $number_alias ) > 0 ){
$cache -> delete ( "directory:" . $number_alias . "@" . $_SESSION [ 'domain_name' ]);
}
2013-01-17 06:14:31 +00:00
2019-02-19 10:30:23 -07:00
//add the message
2018-08-31 03:09:01 +00:00
message :: add ( $text [ 'confirm-update' ]);
2016-10-05 01:19:05 -06:00
}
2012-06-04 14:58:40 +00:00
//show the header
2013-07-06 06:29:50 +00:00
require_once "resources/header.php" ;
2012-06-04 14:58:40 +00:00
//pre-populate the form
2015-04-05 03:12:46 +00:00
if ( $follow_me_uuid != '' ) {
$sql = "select * from v_follow_me " ;
2016-10-05 01:19:05 -06:00
$sql .= "where domain_uuid = '" . $domain_uuid . "' " ;
$sql .= "and follow_me_uuid = '" . $follow_me_uuid . "' " ;
2015-04-05 03:12:46 +00:00
$prep_statement = $db -> prepare ( check_sql ( $sql ));
$prep_statement -> execute ();
$result = $prep_statement -> fetchAll ( PDO :: FETCH_NAMED );
foreach ( $result as & $row ) {
$cid_name_prefix = $row [ "cid_name_prefix" ];
$cid_number_prefix = $row [ "cid_number_prefix" ];
$follow_me_enabled = $row [ "follow_me_enabled" ];
$follow_me_caller_id_uuid = $row [ "follow_me_caller_id_uuid" ];
2015-07-30 16:21:50 +04:00
$follow_me_ignore_busy = $row [ "follow_me_ignore_busy" ];
2015-04-05 03:12:46 +00:00
$sql = "select * from v_follow_me_destinations " ;
2016-10-05 01:19:05 -06:00
$sql .= "where follow_me_uuid = '" . $follow_me_uuid . "' " ;
2015-04-05 03:12:46 +00:00
$sql .= "order by follow_me_order asc " ;
$prep_statement_2 = $db -> prepare ( check_sql ( $sql ));
$prep_statement_2 -> execute ();
$result2 = $prep_statement_2 -> fetchAll ( PDO :: FETCH_NAMED );
2016-10-05 01:19:05 -06:00
foreach ( $result2 as $x => & $row2 ) {
$destinations [ $x ][ 'uuid' ] = $row2 [ "follow_me_destination_uuid" ];
$destinations [ $x ][ 'destination' ] = $row2 [ "follow_me_destination" ];
$destinations [ $x ][ 'delay' ] = $row2 [ "follow_me_delay" ];
$destinations [ $x ][ 'prompt' ] = $row2 [ "follow_me_prompt" ];
$destinations [ $x ][ 'timeout' ] = $row2 [ "follow_me_timeout" ];
2012-11-21 05:59:07 +00:00
}
2015-04-05 03:12:46 +00:00
unset ( $prep_statement_2 );
2012-06-04 14:58:40 +00:00
}
2015-04-05 03:12:46 +00:00
unset ( $prep_statement );
2012-06-04 14:58:40 +00:00
}
2012-09-29 15:58:06 +00:00
//set the default
if ( ! isset ( $dnd_enabled )) {
//set the value from the database
$dnd_enabled = $do_not_disturb ;
}
2012-12-09 04:58:05 +00:00
//prepare the autocomplete
2013-06-09 04:45:18 +00:00
echo "<script src= \" " . PROJECT_PATH . "/resources/jquery/jquery-ui-1.9.2.min.js \" ></script> \n " ;
echo "<link rel= \" stylesheet \" href= \" " . PROJECT_PATH . "/resources/jquery/jquery-ui.css \" /> \n " ;
2012-12-09 04:58:05 +00:00
echo "<script type= \" text/javascript \" > \n " ;
echo " \$ (function() { \n " ;
echo " var extensions = [ \n " ;
$sql = "select * from v_extensions " ;
$sql .= "where domain_uuid = ' $domain_uuid ' " ;
$sql .= "order by extension, number_alias asc " ;
$prep_statement = $db -> prepare ( check_sql ( $sql ));
$prep_statement -> execute ();
$result = $prep_statement -> fetchAll ( PDO :: FETCH_NAMED );
foreach ( $result as & $row ) {
if ( strlen ( $number_alias ) == 0 ) {
2018-08-31 14:08:44 -06:00
echo " \" " . escape ( $row [ "extension" ]) . " \" , \n " ;
2012-12-09 04:58:05 +00:00
}
else {
2018-08-31 14:08:44 -06:00
echo " \" " . escape ( $row [ "number_alias" ]) . " \" , \n " ;
2012-12-09 04:58:05 +00:00
}
}
echo " ]; \n " ;
2016-10-05 01:19:05 -06:00
for ( $n = 0 ; $n <= ((( $_SESSION [ 'follow_me' ][ 'max_destinations' ][ 'numeric' ] != '' ) ? $_SESSION [ 'follow_me' ][ 'max_destinations' ][ 'numeric' ] : 5 ) - 1 ); $n ++ ) {
echo " \$ ( \" #destination_" . $n . " \" ).autocomplete({ \n " ;
echo " source: extensions \n " ;
echo " }); \n " ;
}
2012-12-09 04:58:05 +00:00
echo "}); \n " ;
echo "</script> \n " ;
2012-06-04 14:58:40 +00:00
//show the content
echo "<form method='post' name='frm' action=''> \n " ;
2015-03-22 00:53:56 +00:00
2015-02-15 07:59:02 +00:00
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'> \n " ;
2012-06-04 14:58:40 +00:00
echo "<tr> \n " ;
2015-03-22 00:53:56 +00:00
echo "<td align='left' width='30%' nowrap='nowrap' valign='top'> \n " ;
2012-10-24 07:02:52 +00:00
echo " <b>" . $text [ 'title' ] . "</b> \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
2015-03-22 00:53:56 +00:00
echo "<td width='70%' align='right' valign='top'> \n " ;
2019-02-19 10:30:23 -07:00
echo " <input type='button' class='btn' name='' alt='" . $text [ 'button-back' ] . "' onclick= \" window.location='/' \" value='" . $text [ 'button-back' ] . "'> \n " ;
2014-04-26 23:37:41 +00:00
echo " <input type='submit' name='submit' class='btn' value='" . $text [ 'button-save' ] . "'> \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
echo "<tr> \n " ;
echo "<td align='left' colspan='2'> \n " ;
2017-09-23 17:50:46 -06:00
echo " " . $text [ 'description' ] . " <strong>" . escape ( $extension ) . "</strong><br /><br /> \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
echo "<tr> \n " ;
2012-11-21 05:59:07 +00:00
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2014-11-29 18:14:23 +00:00
echo " <strong>" . $text [ 'label-call-forward' ] . "</strong> \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
2016-02-25 11:16:36 -07:00
$on_click = "document.getElementById('follow_me_disabled').checked=true; " ;
$on_click .= "$('#tr_follow_me_settings').slideUp('fast'); " ;
$on_click .= "document.getElementById('dnd_disabled').checked=true; " ;
$on_click .= "document.getElementById('forward_all_destination').focus(); " ;
2014-11-29 18:14:23 +00:00
echo " <label for='forward_all_disabled'><input type='radio' name='forward_all_enabled' id='forward_all_disabled' onclick= \"\" value='false' " . (( $forward_all_enabled == "false" || $forward_all_enabled == "" ) ? "checked='checked'" : null ) . " /> " . $text [ 'label-disabled' ] . "</label> \n " ;
2018-08-31 13:36:45 -06:00
echo " <label for='forward_all_enabled'><input type='radio' name='forward_all_enabled' id='forward_all_enabled' onclick= \" $on_click \" value='true' " . (( $forward_all_enabled == "true" ) ? "checked='checked'" : null ) . " /> " . $text [ 'label-enabled' ] . "</label> \n " ;
2012-06-04 14:58:40 +00:00
unset ( $on_click );
2014-10-30 05:39:04 +00:00
echo " " ;
2017-09-23 17:50:46 -06:00
echo " <input class='formfld' type='text' name='forward_all_destination' id='forward_all_destination' maxlength='255' placeholder= \" " . $text [ 'label-destination' ] . " \" value= \" " . escape ( $forward_all_destination ) . " \" > \n " ;
2016-10-05 01:19:05 -06:00
echo " <br />" . $text [ 'description-call_forward' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
2014-10-29 16:06:53 +00:00
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2014-11-29 18:14:23 +00:00
echo " " . $text [ 'label-on-busy' ] . " \n " ;
2014-10-29 16:06:53 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
2014-11-29 18:14:23 +00:00
$on_click = "document.getElementById('dnd_disabled').checked=true;" ;
2014-10-30 05:39:04 +00:00
$on_click .= "document.getElementById('forward_busy_destination').focus();" ;
2014-11-29 18:14:23 +00:00
echo " <label for='forward_busy_disabled'><input type='radio' name='forward_busy_enabled' id='forward_busy_disabled' onclick= \"\" value='false' " . (( $forward_busy_enabled == "false" || $forward_busy_enabled == "" ) ? "checked='checked'" : null ) . " /> " . $text [ 'label-disabled' ] . "</label> \n " ;
2018-08-31 13:36:45 -06:00
echo " <label for='forward_busy_enabled'><input type='radio' name='forward_busy_enabled' id='forward_busy_enabled' onclick= \" $on_click \" value='true' " . (( $forward_busy_enabled == "true" ) ? "checked='checked'" : null ) . "/> " . $text [ 'label-enabled' ] . "</label> \n " ;
2014-10-29 16:06:53 +00:00
unset ( $on_click );
2014-10-30 05:39:04 +00:00
echo " " ;
2017-09-23 17:50:46 -06:00
echo " <input class='formfld' type='text' name='forward_busy_destination' id='forward_busy_destination' maxlength='255' placeholder= \" " . $text [ 'label-destination' ] . " \" value= \" " . escape ( $forward_busy_destination ) . " \" > \n " ;
2016-10-05 01:19:05 -06:00
echo " <br />" . $text [ 'description-on-busy' ] . " \n " ;
2014-10-29 16:06:53 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
2014-11-29 18:14:23 +00:00
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2014-12-03 05:55:01 +00:00
echo " " . $text [ 'label-no_answer' ] . " \n " ;
2014-11-29 18:14:23 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
$on_click = "document.getElementById('dnd_disabled').checked=true;" ;
2014-12-03 05:55:01 +00:00
$on_click .= "document.getElementById('forward_no_answer_destination').focus();" ;
echo " <label for='forward_no_answer_disabled'><input type='radio' name='forward_no_answer_enabled' id='forward_no_answer_disabled' onclick= \"\" value='false' " . (( $forward_no_answer_enabled == "false" || $forward_no_answer_enabled == "" ) ? "checked='checked'" : null ) . " /> " . $text [ 'label-disabled' ] . "</label> \n " ;
echo " <label for='forward_no_answer_enabled'><input type='radio' name='forward_no_answer_enabled' id='forward_no_answer_enabled' onclick= \" $on_click \" value='true' " . (( $forward_no_answer_enabled == "true" ) ? "checked='checked'" : null ) . "/> " . $text [ 'label-enabled' ] . "</label> \n " ;
2014-11-29 18:14:23 +00:00
unset ( $on_click );
echo " " ;
2017-09-23 17:50:46 -06:00
echo " <input class='formfld' type='text' name='forward_no_answer_destination' id='forward_no_answer_destination' maxlength='255' placeholder= \" " . $text [ 'label-destination' ] . " \" value= \" " . escape ( $forward_no_answer_destination ) . " \" > \n " ;
2016-10-05 01:19:05 -06:00
echo " <br />" . $text [ 'description-no_answer' ] . " \n " ;
2014-11-29 18:14:23 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
2015-12-09 14:00:44 -08:00
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
echo " " . $text [ 'label-not_registered' ] . " \n " ;
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
2016-02-25 11:16:36 -07:00
$on_click = "document.getElementById('forward_user_not_registered_destination').focus();" ;
2015-12-09 14:00:44 -08:00
echo " <label for='forward_user_not_registered_disabled'><input type='radio' name='forward_user_not_registered_enabled' id='forward_user_not_registered_disabled' onclick= \"\" value='false' " . (( $forward_user_not_registered_enabled == "false" || $forward_user_not_registered_enabled == "" ) ? "checked='checked'" : null ) . " /> " . $text [ 'label-disabled' ] . "</label> \n " ;
echo " <label for='forward_user_not_registered_enabled'><input type='radio' name='forward_user_not_registered_enabled' id='forward_user_not_registered_enabled' onclick= \" $on_click \" value='true' " . (( $forward_user_not_registered_enabled == "true" ) ? "checked='checked'" : null ) . "/> " . $text [ 'label-enabled' ] . "</label> \n " ;
unset ( $on_click );
echo " " ;
2017-09-23 17:50:46 -06:00
echo " <input class='formfld' type='text' name='forward_user_not_registered_destination' id='forward_user_not_registered_destination' maxlength='255' placeholder= \" " . $text [ 'label-destination' ] . " \" value= \" " . escape ( $forward_user_not_registered_destination ) . " \" > \n " ;
2016-10-05 01:19:05 -06:00
echo " <br />" . $text [ 'description-not_registered' ] . " \n " ;
2015-12-09 14:00:44 -08:00
echo "</td> \n " ;
echo "</tr> \n " ;
2018-03-09 20:08:12 -07:00
if ( permission_exists ( 'call_forward_caller_id' )) {
2018-08-31 13:36:45 -06:00
$sql_forward = "select destination_uuid, destination_number, destination_description, destination_caller_id_number, destination_caller_id_name from v_destinations where domain_uuid = '" . escape ( $domain_uuid ) . "' and destination_type = 'inbound' order by destination_number asc " ;
2016-10-05 01:19:05 -06:00
$prep_statement_forward = $db -> prepare ( check_sql ( $sql_forward ));
$prep_statement_forward -> execute ();
$result_forward = $prep_statement_forward -> fetchAll ( PDO :: FETCH_ASSOC );
if ( count ( $result_forward ) > 0 ) {
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>" ;
echo $text [ 'label-cid-number' ];
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
echo " <select name='forward_caller_id_uuid' id='forward_caller_id_uuid' class='formfld' > \n " ;
echo " <option value=''></option> \n " ;
foreach ( $result_forward as & $row_forward ) {
$selected = $row_forward [ "destination_uuid" ] == $forward_caller_id_uuid ? "selected='selected' " : '' ;
$caller_id_number = $row_forward [ 'destination_caller_id_number' ];
if ( strlen ( $caller_id_number ) == 0 ){
$caller_id_number = $row_forward [ 'destination_number' ];
}
$caller_id_name = $row_forward [ 'destination_caller_id_name' ];
if ( strlen ( $caller_id_name ) == 0 ){
$caller_id_name = $row_forward [ 'destination_description' ];
}
2018-06-13 01:21:44 -06:00
echo " <option value='" . escape ( $row_forward [ "destination_uuid" ]) . "' " . escape ( $selected ) . ">" . escape ( format_phone ( $caller_id_number )) . " : " . $caller_id_name . "</option> \n " ;
2016-10-05 01:19:05 -06:00
}
echo " </select><br /> \n " ;
echo $text [ 'description-cid-number' ] . " \n " ;
echo "</td> \n " ;
echo "</tr> \n " ;
}
unset ( $sql_forward , $prep_statement_forward , $result_forward , $row_forward );
}
2014-10-30 05:39:04 +00:00
echo "<tr><td colspan='2'><br /></td></tr> \n " ;
2014-10-29 16:06:53 +00:00
2012-06-04 14:58:40 +00:00
echo "<tr> \n " ;
2012-11-21 05:59:07 +00:00
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2014-11-29 18:14:23 +00:00
echo " <strong>" . $text [ 'label-follow-me' ] . "</strong> \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
2016-02-25 11:16:36 -07:00
$on_click = "document.getElementById('forward_all_disabled').checked=true; " ;
$on_click .= "document.getElementById('dnd_disabled').checked=true; " ;
2018-03-09 20:08:12 -07:00
if ( permission_exists ( 'follow_me_caller_id' )) {
2016-02-25 11:16:36 -07:00
$on_click .= "document.getElementById('follow_me_caller_id_uuid').focus(); " ;
}
echo " <label for='follow_me_disabled'><input type='radio' name='follow_me_enabled' id='follow_me_disabled' onclick= \" $('#tr_follow_me_settings').slideUp('fast'); \" value='false' " . (( $follow_me_enabled == "false" || $follow_me_enabled == "" ) ? "checked='checked'" : null ) . " /> " . $text [ 'label-disabled' ] . "</label> \n " ;
2018-08-31 13:36:45 -06:00
echo " <label for='follow_me_enabled'><input type='radio' name='follow_me_enabled' id='follow_me_enabled' onclick= \" $('#tr_follow_me_settings').slideDown('fast'); $on_click \" value='true' " . (( $follow_me_enabled == "true" ) ? "checked='checked'" : null ) . "/> " . $text [ 'label-enabled' ] . "</label> \n " ;
2012-06-04 14:58:40 +00:00
unset ( $on_click );
echo "</td> \n " ;
echo "</tr> \n " ;
2016-02-25 11:16:36 -07:00
echo "</table> \n " ;
2012-06-04 14:58:40 +00:00
2016-02-26 14:35:58 -07:00
if ( $follow_me_enabled == "true" ) { $style = '' ; } else { $style = 'display: none;' ; }
echo "<div id='tr_follow_me_settings' style=' $style '> \n " ;
2016-02-25 11:16:36 -07:00
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'> \n " ;
2012-06-04 14:58:40 +00:00
echo "<tr> \n " ;
2016-02-25 11:16:36 -07:00
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2014-11-29 18:14:23 +00:00
echo " " . $text [ 'label-destinations' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
2016-02-25 11:16:36 -07:00
echo "<td width='70%' class='vtable' align='left'> \n " ;
2012-12-09 04:58:05 +00:00
2014-08-14 05:36:23 +00:00
echo " <table border='0' cellpadding='2' cellspacing='0'> \n " ;
echo " <tr> \n " ;
echo " <td class='vtable'>" . $text [ 'label-destination_number' ] . "</td> \n " ;
echo " <td class='vtable'>" . $text [ 'label-destination_delay' ] . "</td> \n " ;
echo " <td class='vtable'>" . $text [ 'label-destination_timeout' ] . "</td> \n " ;
if ( permission_exists ( 'follow_me_prompt' )) {
echo " <td class='vtable'>" . $text [ 'label-destination_prompt' ] . "</td> \n " ;
}
echo " </tr> \n " ;
2016-10-05 01:19:05 -06:00
//output destinations
for ( $n = 0 ; $n <= ((( $_SESSION [ 'follow_me' ][ 'max_destinations' ][ 'numeric' ] != '' ) ? $_SESSION [ 'follow_me' ][ 'max_destinations' ][ 'numeric' ] : 5 ) - 1 ); $n ++ ) {
echo " <input type='hidden' name='destinations[" . $n . "][uuid]' value='" . (( $destinations [ $n ][ 'uuid' ] != '' ) ? $destinations [ $n ][ 'uuid' ] : uuid ()) . "'> \n " ;
echo " <tr> \n " ;
2017-09-23 17:50:46 -06:00
echo " <td><input class='formfld' style='min-width: 135px;' type='text' name='destinations[" . $n . "][destination]' id='destination_" . $n . "' maxlength='255' value= \" " . escape ( $destinations [ $n ][ 'destination' ]) . " \" ></td> \n " ;
2016-10-05 01:19:05 -06:00
echo " <td> \n " ;
destination_select ( 'destinations[' . $n . '][delay]' , $destinations [ $n ][ 'delay' ], '0' );
echo " </td> \n " ;
echo " <td> \n " ;
destination_select ( 'destinations[' . $n . '][timeout]' , $destinations [ $n ][ 'timeout' ], (( $_SESSION [ 'follow_me' ][ 'timeout' ][ 'numeric' ] != '' ) ? $_SESSION [ 'follow_me' ][ 'timeout' ][ 'numeric' ] : 30 ));
echo " </td> \n " ;
if ( permission_exists ( 'follow_me_prompt' )) {
echo " <td> \n " ;
echo " <select class='formfld' style='width: 90px;' name='destinations[" . $n . "][prompt]'> \n " ;
echo " <option value=''></option> \n " ;
echo " <option value='1' " . (( $destinations [ $n ][ 'prompt' ]) ? "selected='selected'" : null ) . ">" . $text [ 'label-destination_prompt_confirm' ] . "</option> \n " ;
//echo " <option value='2'>".$text['label-destination_prompt_announce]."</option>\n";
echo " </select> \n " ;
echo " </td> \n " ;
}
echo " </tr> \n " ;
2014-08-14 05:36:23 +00:00
}
2012-06-04 14:58:40 +00:00
2014-08-14 05:36:23 +00:00
echo " </table> \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
2016-02-26 14:13:32 -07:00
if ( permission_exists ( 'follow_me_ignore_busy' )) {
echo " <tr> \n " ;
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'>" ;
2016-10-05 01:19:05 -06:00
echo $text [ 'label-ignore_busy' ];
2016-02-26 14:13:32 -07:00
echo " </td> \n " ;
echo " <td class='vtable' align='left'> \n " ;
echo " <label for='follow_me_ignore_busy_false'><input type='radio' name='follow_me_ignore_busy' id='follow_me_ignore_busy_false' value='false' onclick= \"\" " . (( $follow_me_ignore_busy == "false" || $follow_me_ignore_busy == "" ) ? "checked='checked'" : null ) . " /> " . $text [ 'label-disabled' ] . "</label> \n " ;
2018-08-31 13:36:45 -06:00
echo " <label for='follow_me_ignore_busy_true'><input type='radio' name='follow_me_ignore_busy' id='follow_me_ignore_busy_true' value='true' onclick= \" $on_click \" " . (( $follow_me_ignore_busy == "true" ) ? "checked='checked'" : null ) . " /> " . $text [ 'label-enabled' ] . "</label> \n " ;
2016-02-26 14:13:32 -07:00
echo " <br /> \n " ;
2016-10-05 01:19:05 -06:00
echo $text [ 'description-ignore_busy' ] . " \n " ;
2016-02-26 14:13:32 -07:00
echo " </td> \n " ;
echo " </tr> \n " ;
}
2015-07-30 16:21:50 +04:00
2018-03-09 20:08:12 -07:00
if ( permission_exists ( 'follow_me_caller_id' )) {
2018-08-31 13:36:45 -06:00
$sql_follow_me = "select destination_uuid, destination_number, destination_description, destination_caller_id_number, destination_caller_id_name from v_destinations where domain_uuid = '" . escape ( $domain_uuid ) . "' and destination_type = 'inbound' order by destination_number asc " ;
2016-10-05 01:19:05 -06:00
$prep_statement_follow_me = $db -> prepare ( check_sql ( $sql_follow_me ));
$prep_statement_follow_me -> execute ();
$result_follow_me = $prep_statement_follow_me -> fetchAll ( PDO :: FETCH_ASSOC );
if ( count ( $result_follow_me ) > 0 ) {
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>" ;
echo $text [ 'label-cid-number' ];
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
echo " <select name='follow_me_caller_id_uuid' id='follow_me_caller_id_uuid' class='formfld' > \n " ;
echo " <option value=''></option> \n " ;
foreach ( $result_follow_me as & $row_follow_me ) {
$selected = $row_follow_me [ "destination_uuid" ] == $follow_me_caller_id_uuid ? "selected='selected'" : '' ;
$caller_id_number = $row_follow_me [ 'destination_caller_id_number' ];
if ( strlen ( $caller_id_number ) == 0 ){
$caller_id_number = $row_follow_me [ 'destination_number' ];
}
$caller_id_name = $row_follow_me [ 'destination_caller_id_name' ];
if ( strlen ( $caller_id_name ) == 0 ){
$caller_id_name = $row_follow_me [ 'destination_description' ];
}
2018-06-13 01:21:44 -06:00
echo " <option value='" . escape ( $row_follow_me [ "destination_uuid" ]) . "' " . escape ( $selected ) . ">" . format_phone ( escape ( $caller_id_number )) . " : " . escape ( $caller_id_name ) . "</option> \n " ;
2016-10-05 01:19:05 -06:00
}
echo " </select><br /> \n " ;
echo $text [ 'description-cid-number' ] . " \n " ;
echo "</td> \n " ;
echo "</tr> \n " ;
}
unset ( $sql_follow_me , $prep_statement_follow_me , $result_follow_me , $row_follow_me );
}
2013-05-01 17:05:53 +00:00
if ( permission_exists ( 'follow_me_cid_name_prefix' )) {
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2014-11-29 18:14:23 +00:00
echo " " . $text [ 'label-cid-name-prefix' ] . " \n " ;
2013-05-01 17:05:53 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
2018-06-13 01:21:44 -06:00
echo " <input class='formfld' type='text' name='cid_name_prefix' maxlength='255' value='" . escape ( $cid_name_prefix ) . "'> \n " ;
2013-05-01 17:05:53 +00:00
echo "<br /> \n " ;
2016-10-05 01:19:05 -06:00
echo $text [ 'description-cid-name-prefix' ] . " \n " ;
2013-05-01 17:05:53 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
}
2012-12-18 07:13:49 +00:00
2013-07-06 04:48:23 +00:00
if ( permission_exists ( 'follow_me_cid_number_prefix' )) {
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2014-11-29 18:14:23 +00:00
echo " " . $text [ 'label-cid-number-prefix' ] . " \n " ;
2013-07-06 04:48:23 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
2018-06-13 01:21:44 -06:00
echo " <input class='formfld' type='text' name='cid_number_prefix' maxlength='255' value='" . escape ( $cid_number_prefix ) . "'> \n " ;
2013-07-06 04:48:23 +00:00
echo "<br /> \n " ;
2016-10-05 01:19:05 -06:00
echo $text [ 'description-cid-number-prefix' ] . " \n " ;
2013-07-06 04:48:23 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
}
2016-02-25 11:16:36 -07:00
echo "</table> \n " ;
echo "</div> \n " ;
2012-06-04 14:58:40 +00:00
2016-02-25 11:16:36 -07:00
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'> \n " ;
echo "<tr><td colspan='2'><br /></td></tr> \n " ;
2012-06-04 14:58:40 +00:00
echo "<tr> \n " ;
2016-02-25 11:16:36 -07:00
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2014-11-29 18:14:23 +00:00
echo " <strong>" . $text [ 'label-dnd' ] . "</strong> \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
2016-02-25 11:16:36 -07:00
echo "<td width='70%' class='vtable' align='left'> \n " ;
2014-11-29 18:14:23 +00:00
$on_click = "document.getElementById('forward_all_disabled').checked=true;" ;
$on_click .= "document.getElementById('follow_me_disabled').checked=true;" ;
2016-02-25 11:16:36 -07:00
$on_click .= "$('#tr_follow_me_settings').slideUp('fast'); " ;
2014-11-29 18:14:23 +00:00
echo " <label for='dnd_disabled'><input type='radio' name='dnd_enabled' id='dnd_disabled' value='false' onclick= \"\" " . (( $dnd_enabled == "false" || $dnd_enabled == "" ) ? "checked='checked'" : null ) . " /> " . $text [ 'label-disabled' ] . "</label> \n " ;
echo " <label for='dnd_enabled'><input type='radio' name='dnd_enabled' id='dnd_enabled' value='true' onclick= \" $on_click \" " . (( $dnd_enabled == "true" ) ? "checked='checked'" : null ) . " /> " . $text [ 'label-enabled' ] . "</label> \n " ;
2012-06-04 14:58:40 +00:00
echo " <br /> \n " ;
echo "</td> \n " ;
echo "</tr> \n " ;
echo " <tr> \n " ;
echo " <td colspan='2' align='right'> \n " ;
if ( $action == "update" ) {
2018-06-13 01:21:44 -06:00
echo " <input type='hidden' name='id' value='" . escape ( $extension_uuid ) . "'> \n " ;
2012-06-04 14:58:40 +00:00
}
2016-10-05 01:19:05 -06:00
echo " <br />" ;
echo " <input type='submit' class='btn' value='" . $text [ 'button-save' ] . "'> \n " ;
2012-06-04 14:58:40 +00:00
echo " </td> \n " ;
echo " </tr>" ;
echo "</table>" ;
2016-10-05 01:19:05 -06:00
echo "<br /><br />" ;
2012-06-04 14:58:40 +00:00
echo "</form>" ;
2014-08-14 06:06:20 +00:00
//include the footer
require_once "resources/footer.php" ;
2017-09-23 17:50:46 -06:00
2015-12-09 14:00:44 -08:00
?>