diff --git a/app/fax/app_config.php b/app/fax/app_config.php index a1353a68c4..8f56102320 100644 --- a/app/fax/app_config.php +++ b/app/fax/app_config.php @@ -185,6 +185,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "fax_prefix"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "fax_name"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "faxname"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; diff --git a/app/fax/app_languages.php b/app/fax/app_languages.php index 185eb77b62..9e289369d2 100644 --- a/app/fax/app_languages.php +++ b/app/fax/app_languages.php @@ -464,6 +464,14 @@ $text['label-fax_destination']['pt-br'] = "Destino"; $text['label-fax_destination']['pl'] = "Destynacja"; $text['label-fax_destination']['sv-se'] = "Destination"; +$text['label-fax_prefix']['en-us'] = "Prefix"; +$text['label-fax_prefix']['es-cl'] = "Prefijo"; +$text['label-fax_prefix']['pt-pt'] = "Prefixo"; +$text['label-fax_prefix']['fr-fr'] = "Préfixe"; +$text['label-fax_prefix']['pt-br'] = "Prefixo"; +$text['label-fax_prefix']['pl'] = "Prefiks"; +$text['label-fax_prefix']['sv-se'] = "Prefix"; + $text['label-fax_date']['en-us'] = "Date"; $text['label-fax_date']['es-cl'] = "Fecha"; $text['label-fax_date']['pt-pt'] = "Data"; @@ -1280,6 +1288,14 @@ $text['description-destination-number']['pt-br'] = "Insira o número de faz para $text['description-destination-number']['pl'] = "Wprowadź numer faksu docelowego."; $text['description-destination-number']['sv-se'] = "Ange fax destinations-nummer."; +$text['description-fax_prefix']['en-us'] = "Enter a prefix number to add to the beginning of the FAX destination number."; +$text['description-fax_prefix']['es-cl'] = "Introduzca un número de prefijo para añadir al principio del número de destino de fax."; +$text['description-fax_prefix']['pt-pt'] = "Introduza um número de prefixo para adicionar ao início do número de fax de destino."; +$text['description-fax_prefix']['fr-fr'] = "Entrez un numéro de préfixe à ajouter au début du numéro de destination de FAX."; +$text['description-fax_prefix']['pt-br'] = "Introduza um número de prefixo para adicionar ao início do número de fax de destino."; +$text['description-fax_prefix']['pl'] = "Wprowadź prefiks , aby dodać do początku numer faksu."; +$text['description-fax_prefix']['sv-se'] = "Ange ett prefix för att lägga till i början av FAX destinationsnumret."; + $text['description-caller-id-number']['en-us'] = "Enter the Caller ID number here."; $text['description-caller-id-number']['es-cl'] = "Ingrese el número de Caller ID aquí."; $text['description-caller-id-number']['pt-pt'] = "Introduza aqui o número do originador."; diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index e4895cfd07..d57348d925 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -106,6 +106,7 @@ else { $fax_extension = check_str($_POST["fax_extension"]); $fax_accountcode = check_str($_POST["accountcode"]); $fax_destination_number = check_str($_POST["fax_destination_number"]); + $fax_prefix = check_str($_POST["fax_prefix"]); $fax_email = check_str($_POST["fax_email"]); $fax_email_connection_type = check_str($_POST["fax_email_connection_type"]); $fax_email_connection_host = check_str($_POST["fax_email_connection_host"]); @@ -130,9 +131,9 @@ else { $fax_forward_number = str_replace("-", "", $fax_forward_number); } if (strripos($fax_forward_number, '$1') === false) { - $fax_prefix = ''; //not found + $forward_prefix = ''; //not found } else { - $fax_prefix = $fax_forward_number.'#'; //found + $forward_prefix = $forward_prefix.$fax_forward_number.'#'; //found } $fax_description = check_str($_POST["fax_description"]); } @@ -251,6 +252,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "fax_extension, "; $sql .= "accountcode, "; $sql .= "fax_destination_number, "; + $sql .= "fax_prefix, "; $sql .= "fax_name, "; $sql .= "fax_email, "; if (permission_exists('fax_extension_advanced') && function_exists("imap_open") && file_exists("fax_files_remote.php")) { @@ -281,6 +283,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'$fax_extension', "; $sql .= "'$fax_accountcode', "; $sql .= "'$fax_destination_number', "; + if (strlen($fax_prefix) > 0) { + $sql .= "'$fax_prefix', "; + } $sql .= "'$fax_name', "; $sql .= "'$fax_email', "; if (permission_exists('fax_extension_advanced') && function_exists("imap_open") && file_exists("fax_files_remote.php")) { @@ -320,6 +325,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "fax_extension = '$fax_extension', "; $sql .= "accountcode = '$fax_accountcode', "; $sql .= "fax_destination_number = '$fax_destination_number', "; + if (strlen($fax_prefix) > 0) { + $sql .= "fax_prefix = '$fax_prefix', "; + } $sql .= "fax_name = '$fax_name', "; $sql .= "fax_email = '$fax_email', "; if (permission_exists('fax_extension_advanced') && function_exists("imap_open") && file_exists("fax_files_remote.php")) { @@ -439,10 +447,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $dialplan_detail_tag = 'action'; //condition, action, antiaction $dialplan_detail_type = 'rxfax'; if (count($_SESSION["domains"]) > 1) { - $dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'].'/'.$fax_extension.'/inbox/'.$fax_prefix.'${last_fax}.tif'; + $dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'].'/'.$fax_extension.'/inbox/'.$forward_prefix.'${last_fax}.tif'; } else { - $dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$fax_extension.'/inbox/'.$fax_prefix.'${last_fax}.tif'; + $dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$fax_extension.'/inbox/'.$forward_prefix.'${last_fax}.tif'; } $dialplan_detail_order = '090'; dialplan_detail_add($_SESSION['domain_uuid'], $dialplan_uuid, $dialplan_detail_tag, $dialplan_detail_order, $dialplan_detail_group, $dialplan_detail_type, $dialplan_detail_data); @@ -481,10 +489,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //update dialplan detail action if (count($_SESSION["domains"]) > 1) { - $dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'].'/'.$fax_extension.'/inbox/'.$fax_prefix.'${last_fax}.tif'; + $dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'].'/'.$fax_extension.'/inbox/'.$forward_prefix.'${last_fax}.tif'; } else { - $dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$fax_extension.'/inbox/'.$fax_prefix.'${last_fax}.tif'; + $dialplan_detail_data = $_SESSION['switch']['storage']['dir'].'/fax/'.$fax_extension.'/inbox/'.$forward_prefix.'${last_fax}.tif'; } $sql = "update v_dialplan_details set "; $sql .= "dialplan_detail_data = '".$dialplan_detail_data."' "; @@ -549,6 +557,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $fax_extension = $row["fax_extension"]; $fax_accountcode = $row["accountcode"]; $fax_destination_number = $row["fax_destination_number"]; + $fax_prefix = $row["fax_prefix"]; $fax_name = $row["fax_name"]; $fax_email = $row["fax_email"]; $fax_email_connection_type = $row["fax_email_connection_type"]; @@ -601,7 +610,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
| ".$text['header-fax_server_settings']." | \n";
+ echo " ".$text['header-fax_server_settings']." | \n";
echo " \n"; echo " \n"; if ((if_group("admin") || if_group("superadmin")) && $action == "update") { @@ -614,7 +623,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (if_group("user")) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-email']."\n"; echo " | \n"; echo "\n"; @@ -628,7 +637,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { else { //admin, superadmin, etc echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-name']."\n"; echo " | \n"; echo "\n"; @@ -639,7 +648,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-extension']."\n"; echo " | \n"; echo "\n"; @@ -651,7 +660,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (if_group("superadmin") || (if_group("admin") && $billing_app_exists)) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-accountcode']."\n"; echo " | \n"; echo "\n"; @@ -686,7 +695,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-destination-number']."\n"; echo " | \n"; echo "\n"; @@ -697,7 +706,18 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | |
| \n"; + echo " | \n"; + echo " ".$text['label-fax_prefix']."\n"; + echo " | \n"; + echo "\n";
+ echo " \n";
+ echo " \n"; + echo " ".$text['description-fax_prefix']."\n"; + echo " | \n";
+ echo "|
| \n"; echo " ".$text['label-email']."\n"; echo " | \n"; echo "\n"; @@ -711,7 +731,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | ||
| \n"; + echo " | \n"; echo " ".$text['label-caller-id-name']."\n"; echo " | \n"; echo "\n"; @@ -722,7 +742,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-caller-id-number']."\n"; echo " | \n"; echo "\n"; @@ -733,7 +753,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-forward']."\n"; echo " | \n"; echo "\n"; @@ -797,7 +817,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { } echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-description']."\n"; echo " | \n"; echo "\n"; @@ -851,7 +871,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-email_connection_type']."\n"; echo " | \n"; echo "\n"; @@ -865,10 +885,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-email_connection_server']."\n"; echo " | \n"; - echo "\n"; + echo " | \n";
echo " : ";
echo "\n";
echo " \n"; @@ -877,7 +897,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " |
| \n"; + echo " | \n"; echo " ".$text['label-email_connection_security']."\n"; echo " | \n"; echo "\n"; @@ -892,7 +912,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-email_connection_validate']."\n"; echo " | \n"; echo "\n"; @@ -906,7 +926,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-email_connection_username']."\n"; echo " | \n"; echo "\n"; @@ -917,7 +937,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-email_connection_password']."\n"; echo " | \n"; echo "\n"; @@ -928,7 +948,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " | |
| \n"; + echo " | \n"; echo " ".$text['label-email_connection_mailbox']."\n"; echo " | \n"; echo "\n"; @@ -941,7 +961,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " |
| \n"; + echo " | \n"; echo " ".$text['label-email_inbound_subject_tag']."\n"; echo " | \n"; echo "\n"; @@ -973,7 +993,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " |
| \n"; + echo " | \n"; echo " ".$text['label-email_outbound_subject_tag']."\n"; echo " | \n"; echo "\n"; @@ -984,7 +1004,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " |
| \n"; + echo " | \n"; echo " ".$text['label-email_outbound_authorized_senders']."\n"; echo " | \n"; echo "\n"; diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index 4a238afb31..8945231095 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -508,11 +508,12 @@ if (!$included) { //get some more info to send the fax $mailfrom_address = (isset($_SESSION['fax']['smtp_from']['var'])) ? $_SESSION['fax']['smtp_from']['var'] : $_SESSION['email']['smtp_from']['var']; - $sql = "select fax_email from v_fax where fax_uuid = '".$fax_uuid."'; "; + $sql = "select * from v_fax where fax_uuid = '".$fax_uuid."'; "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetch(PDO::FETCH_NAMED); $mailto_address_fax = $result["fax_email"]; + $fax_prefix = $result["fax_prefix"]; if (!$included) { $sql = "select contact_uuid from v_users where user_uuid = '".$_SESSION['user_uuid']."'; "; @@ -542,7 +543,7 @@ if (!$included) { $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if ($fp) { //prepare the fax command - $route_array = outbound_route_to_bridge($_SESSION['domain_uuid'], $_SESSION['fax']['prefix']['text'].$fax_number); + $route_array = outbound_route_to_bridge($_SESSION['domain_uuid'], $fax_prefix.$fax_number); $fax_file = $dir_fax_temp."/".$fax_instance_uuid.".tif"; if (count($route_array) == 0) { //send the internal call to the registered extension |