diff --git a/app/call_block/app_config.php b/app/call_block/app_config.php index 66240bd553..55de7f1379 100644 --- a/app/call_block/app_config.php +++ b/app/call_block/app_config.php @@ -113,11 +113,15 @@ $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name."; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "call_block_country_code"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the country code."; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_number"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_caller_number"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the full phone number."; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the phone number."; $z++; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_count"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_call_count"; diff --git a/app/call_block/app_defaults.php b/app/call_block/app_defaults.php index ad9a9495fb..9160edc51e 100644 --- a/app/call_block/app_defaults.php +++ b/app/call_block/app_defaults.php @@ -30,7 +30,7 @@ if ($domains_processed == 1) { $database = new database; $database->execute("DROP VIEW view_call_block;", null); $sql = "CREATE VIEW view_call_block AS ( \n"; - $sql .= " select c.domain_uuid, call_block_uuid, c.extension_uuid, call_block_name, \n"; + $sql .= " select c.domain_uuid, call_block_uuid, c.extension_uuid, call_block_name, call_block_country_code, \n"; $sql .= " call_block_number, extension, number_alias, call_block_count, call_block_app, call_block_data, date_added, call_block_enabled, call_block_description \n"; $sql .= " from v_call_block as c \n"; $sql .= " left join v_extensions as e \n"; diff --git a/app/call_block/app_languages.php b/app/call_block/app_languages.php index 69c914bac4..d7495285c7 100644 --- a/app/call_block/app_languages.php +++ b/app/call_block/app_languages.php @@ -177,6 +177,27 @@ $text['label-provide-enabled']['ru-ru'] = "Пожалуйста, введите: $text['label-provide-enabled']['sv-se'] = "Ange: Aktiverad"; $text['label-provide-enabled']['uk-ua'] = "Включити/відключити"; +$text['label-country_code']['en-us'] = "Country Code"; +$text['label-country_code']['en-gb'] = "Country Code"; +$text['label-country_code']['ar-eg'] = ""; +$text['label-country_code']['de-at'] = ""; //copied from de-de +$text['label-country_code']['de-ch'] = ""; //copied from de-de +$text['label-country_code']['de-de'] = ""; +$text['label-country_code']['es-cl'] = ""; +$text['label-country_code']['es-mx'] = ""; //copied from es-cl +$text['label-country_code']['fr-ca'] = "Préfixe"; //copied from fr-fr +$text['label-country_code']['fr-fr'] = "Préfixe"; +$text['label-country_code']['he-il'] = ""; +$text['label-country_code']['it-it'] = ""; +$text['label-country_code']['nl-nl'] = "Voorloop"; +$text['label-country_code']['pl-pl'] = ""; +$text['label-country_code']['pt-br'] = "Prefixo"; //copied from pt-pt +$text['label-country_code']['pt-pt'] = ""; +$text['label-country_code']['ro-ro'] = ""; +$text['label-country_code']['ru-ru'] = ""; +$text['label-country_code']['sv-se'] = ""; +$text['label-country_code']['uk-ua'] = ""; + $text['label-number']['en-us'] = "Number"; $text['label-number']['en-gb'] = "Number"; $text['label-number']['ar-eg'] = "رقم"; @@ -595,6 +616,27 @@ $text['description-call_block_name']['ru-ru'] = ""; $text['description-call_block_name']['sv-se'] = ""; $text['description-call_block_name']['uk-ua'] = ""; +$text['description-country_code']['en-us'] = "Enter the Country Code prefix."; +$text['description-country_code']['en-gb'] = "Enter the Country Code prefix."; +$text['description-country_code']['ar-eg'] = ""; +$text['description-country_code']['de-at'] = ""; //copied from de-de +$text['description-country_code']['de-ch'] = ""; //copied from de-de +$text['description-country_code']['de-de'] = ""; +$text['description-country_code']['es-cl'] = ""; +$text['description-country_code']['es-mx'] = ""; //copied from es-cl +$text['description-country_code']['fr-ca'] = "Entrez le préfixe de destination."; //copied from fr-fr +$text['description-country_code']['fr-fr'] = "Entrez le préfixe de destination."; +$text['description-country_code']['he-il'] = ""; +$text['description-country_code']['it-it'] = ""; +$text['description-country_code']['nl-nl'] = "Voer de bestemming prefix in."; +$text['description-country_code']['pl-pl'] = ""; +$text['description-country_code']['pt-br'] = "Insira o prefixo do destino."; +$text['description-country_code']['pt-pt'] = ""; +$text['description-country_code']['ro-ro'] = ""; +$text['description-country_code']['ru-ru'] = ""; +$text['description-country_code']['sv-se'] = ""; +$text['description-country_code']['uk-ua'] = ""; + $text['description-call_block_number']['en-us'] = "Enter the Caller ID Number to block."; $text['description-call_block_number']['en-gb'] = "Enter the Caller ID Number to block."; $text['description-call_block_number']['ar-eg'] = ""; diff --git a/app/call_block/call_block.php b/app/call_block/call_block.php index bba27639d1..c9212fc585 100644 --- a/app/call_block/call_block.php +++ b/app/call_block/call_block.php @@ -83,6 +83,7 @@ if (strlen($search) > 0) { $sql_search = " ("; $sql_search .= "lower(call_block_name) like :search "; + $sql_search .= "or call_block_country_code like :search "; $sql_search .= "or lower(call_block_number) like :search "; $sql_search .= "or lower(call_block_description) like :search "; $sql_search .= ") "; @@ -136,7 +137,7 @@ if (isset($sql_search)) { $sql .= "and ".$sql_search; } - $sql .= order_by($order_by, $order, 'call_block_number'); + $sql .= order_by($order_by, $order, ['call_block_country_code','call_block_number']); $sql .= limit_offset($rows_per_page, $offset); $database = new database; $result = $database->select($sql, $parameters, 'all'); @@ -204,6 +205,7 @@ } echo th_order_by('extension', $text['label-extension'], $order_by, $order); echo th_order_by('call_block_name', $text['label-name'], $order_by, $order); + echo th_order_by('call_block_country_code', $text['label-country_code'], $order_by, $order); echo th_order_by('call_block_number', $text['label-number'], $order_by, $order); echo th_order_by('call_block_count', $text['label-count'], $order_by, $order, '', "class='center hide-sm-dn'"); echo th_order_by('call_block_action', $text['label-action'], $order_by, $order); @@ -238,6 +240,14 @@ echo " \n"; echo "