diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index ecf8d82798..cb0ca6b797 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -34,7 +34,7 @@ else { exit; } -if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billings/app_config.php")){ +if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){ require_once "app/billing/resources/functions/currency.php"; require_once "app/billing/resources/functions/rating.php"; } @@ -60,7 +60,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billings/app_config $extension = str_replace(' ','-',check_str($_POST["extension"])); $number_alias = check_str($_POST["number_alias"]); $password = check_str($_POST["password"]); - $accountcode = check_str((if_group("superadmin")?$_POST["accountcode"]:$_SESSION['domain_name'])); + $accountcode = (if_group("superadmin") || if_group("admin"))?$_POST["accountcode"]:$_SESSION['domain_name'])); $effective_caller_id_name = check_str($_POST["effective_caller_id_name"]); $effective_caller_id_number = check_str($_POST["effective_caller_id_number"]); $outbound_caller_id_name = check_str($_POST["outbound_caller_id_name"]); @@ -473,7 +473,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $extension++; } - if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billings/app_config.php")){ + if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){ // Let's bill $j has the number of extensions to bill $db2 = new database; $db2->sql = "SELECT currency, billing_uuid, balance FROM v_billings WHERE type_value='$destination_accountcode'"; @@ -519,7 +519,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "extension = '$extension', "; $sql .= "number_alias = '$number_alias', "; $sql .= "password = '$password', "; - if (if_group("superadmin")) { + if (if_group("superadmin") || if_group("admin")) { $sql .= "accountcode = '$accountcode', "; } $sql .= "effective_caller_id_name = '$effective_caller_id_name', "; @@ -835,7 +835,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; // Billing - if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billings/app_config.php")){ + if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){ if ($action == "add" && permission_exists('extension_add')) { // only when adding echo "\n"; echo "\n"; @@ -1004,6 +1004,33 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo $text['description-accountcode']."\n"; echo "\n"; echo "\n"; + }elseif (if_group("admin") && file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){ + $sql_accountcode = "SELECT type_value FROM v_billings WHERE domain_uuid = '".$_SESSION['domain_uuid']."'"; + + echo "\n"; + echo "\n"; + echo " ".$text['label-accountcode'].":\n"; + echo "\n"; + echo "\n"; + echo " "; + echo "
\n"; + echo $text['description-accountcode']."\n"; + echo "\n"; + echo "\n"; } echo "\n";