Merge pull request #21754 from SylvainLegrand/PR_improve_phone_number_settings_for_madagascar

Improve settings for phone number (Madagascar)
This commit is contained in:
Laurent Destailleur 2022-08-16 19:54:28 +02:00 committed by GitHub
commit 3431b6ffc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3310,8 +3310,8 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
$newphone = substr($newphone, 0, 5).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4);
}
} elseif (strtoupper($countrycode) == "MG") {//Madagascar
if (dol_strlen($phone) == 13) {//ex: +261_AB_CD_EF_GHI
$newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 3);
if (dol_strlen($phone) == 13) {//ex: +261_AB_CD_EFG_HI
$newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3).$separ.substr($newphone, 11, 2);
}
} elseif (strtoupper($countrycode) == "GB") {//Royaume uni
if (dol_strlen($phone) == 13) {//ex: +44_ABCD_EFG_HIJ