diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-02-05 09:11:57 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-02-05 09:25:46 +0000 |
commit | 6edf79cb0ecd150ea0f054c8faa7be0b055fc2d0 (patch) | |
tree | edca9b26dde0dcec565a8677282e67122471bcde | |
parent | 7c7e9ba678a1785b34593e0295b124f2da89c101 (diff) |
Upgrade Number::Phone.
This brings in my new format_for_country function which allows
for nicer display of phone numbers to people.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | cpanfile | 2 | ||||
-rw-r--r-- | cpanfile.snapshot | 505 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 3 | ||||
-rw-r--r-- | t/app/controller/report_new_text.t | 4 | ||||
-rw-r--r-- | t/app/controller/report_update_text.t | 2 | ||||
-rw-r--r-- | templates/web/base/auth/change_phone.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/_inspect.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/new/form_user_loggedin.html | 4 | ||||
-rw-r--r-- | templates/web/fixamingata/report/new/form_user_loggedout.html | 2 |
10 files changed, 266 insertions, 261 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index e0ae5ceed..dbc96e04c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Zoom out as much as necessary on body map page, even on mobile. #1958 - Show loading message on initial /around map load #1976 - Ask for current password/send email on password change. #1974 + - Nicer display of national phone numbers. - Bugfixes: - Fix bug specifying category in URL on /around. #1950 - Fix bug with multiple select-multiples on a page. #1951 @@ -81,7 +81,7 @@ requires 'Net::Domain::TLD', '1.75'; requires 'Net::Facebook::Oauth2', '0.10'; requires 'Net::OAuth'; requires 'Net::Twitter::Lite::WithAPIv1_1', '0.12008'; -requires 'Number::Phone'; +requires 'Number::Phone', '3.4003'; requires 'Path::Class'; requires 'POSIX'; requires 'Readonly'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index c5e5b2a46..d222dc9b0 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -4494,15 +4494,18 @@ DISTRIBUTIONS Carp 0 ExtUtils::MakeMaker 0 POSIX 0 - Number-Phone-3.4002 - pathname: D/DC/DCANTRELL/Number-Phone-3.4002.tar.gz + Number-Phone-3.4003 + pathname: D/DC/DCANTRELL/Number-Phone-3.4003.tar.gz provides: - Number::Phone 3.4002 + Number::Phone 3.4003 Number::Phone::Country 1.93 Number::Phone::Country::Data 1.6 + Number::Phone::Formatter 1.0 + Number::Phone::Formatter::National 1.0 + Number::Phone::Formatter::NationallyPreferredIntl 1.0 Number::Phone::Formatter::Raw undef Number::Phone::Lib 1.0 - Number::Phone::NANP 1.5 + Number::Phone::NANP 1.6000 Number::Phone::NANP::AG 1.1 Number::Phone::NANP::AI 1.1 Number::Phone::NANP::AS 1.1 @@ -4512,7 +4515,7 @@ DISTRIBUTIONS Number::Phone::NANP::CA 1.1 Number::Phone::NANP::DM 1.1 Number::Phone::NANP::DO 1.1 - Number::Phone::NANP::Data 1.20170908113144 + Number::Phone::NANP::Data 1.20180203200229 Number::Phone::NANP::GD 1.1 Number::Phone::NANP::GU 1.1 Number::Phone::NANP::JM 1.1 @@ -4529,252 +4532,252 @@ DISTRIBUTIONS Number::Phone::NANP::VC 1.1 Number::Phone::NANP::VG 1.1 Number::Phone::NANP::VI 1.1 - Number::Phone::StubCountry 1.3 - Number::Phone::StubCountry::AC 1.20170908113147 - Number::Phone::StubCountry::AD 1.20170908113147 - Number::Phone::StubCountry::AE 1.20170908113147 - Number::Phone::StubCountry::AF 1.20170908113147 - Number::Phone::StubCountry::AG 1.20170908113147 - Number::Phone::StubCountry::AI 1.20170908113147 - Number::Phone::StubCountry::AL 1.20170908113147 - Number::Phone::StubCountry::AM 1.20170908113147 - Number::Phone::StubCountry::AO 1.20170908113147 - Number::Phone::StubCountry::AR 1.20170908113147 - Number::Phone::StubCountry::AS 1.20170908113147 - Number::Phone::StubCountry::AT 1.20170908113147 - Number::Phone::StubCountry::AU 1.20170908113147 - Number::Phone::StubCountry::AW 1.20170908113147 - Number::Phone::StubCountry::AX 1.20170908113147 - Number::Phone::StubCountry::AZ 1.20170908113147 - Number::Phone::StubCountry::BA 1.20170908113147 - Number::Phone::StubCountry::BB 1.20170908113147 - Number::Phone::StubCountry::BD 1.20170908113147 - Number::Phone::StubCountry::BE 1.20170908113147 - Number::Phone::StubCountry::BF 1.20170908113147 - Number::Phone::StubCountry::BG 1.20170908113147 - Number::Phone::StubCountry::BH 1.20170908113147 - Number::Phone::StubCountry::BI 1.20170908113147 - Number::Phone::StubCountry::BJ 1.20170908113147 - Number::Phone::StubCountry::BL 1.20170908113147 - Number::Phone::StubCountry::BM 1.20170908113147 - Number::Phone::StubCountry::BN 1.20170908113147 - Number::Phone::StubCountry::BO 1.20170908113147 - Number::Phone::StubCountry::BQ 1.20170908113147 - Number::Phone::StubCountry::BR 1.20170908113147 - Number::Phone::StubCountry::BS 1.20170908113147 - Number::Phone::StubCountry::BT 1.20170908113147 - Number::Phone::StubCountry::BW 1.20170908113147 - Number::Phone::StubCountry::BY 1.20170908113147 - Number::Phone::StubCountry::BZ 1.20170908113147 - Number::Phone::StubCountry::CA 1.20170908113147 - Number::Phone::StubCountry::CC 1.20170908113147 - Number::Phone::StubCountry::CD 1.20170908113147 - Number::Phone::StubCountry::CF 1.20170908113147 - Number::Phone::StubCountry::CG 1.20170908113147 - Number::Phone::StubCountry::CH 1.20170908113147 - Number::Phone::StubCountry::CI 1.20170908113147 - Number::Phone::StubCountry::CK 1.20170908113147 - Number::Phone::StubCountry::CL 1.20170908113147 - Number::Phone::StubCountry::CM 1.20170908113147 - Number::Phone::StubCountry::CN 1.20170908113147 - Number::Phone::StubCountry::CO 1.20170908113148 - Number::Phone::StubCountry::CR 1.20170908113148 - Number::Phone::StubCountry::CU 1.20170908113148 - Number::Phone::StubCountry::CV 1.20170908113148 - Number::Phone::StubCountry::CW 1.20170908113148 - Number::Phone::StubCountry::CX 1.20170908113148 - Number::Phone::StubCountry::CY 1.20170908113148 - Number::Phone::StubCountry::CZ 1.20170908113148 - Number::Phone::StubCountry::DE 1.20170908113148 - Number::Phone::StubCountry::DJ 1.20170908113148 - Number::Phone::StubCountry::DK 1.20170908113148 - Number::Phone::StubCountry::DM 1.20170908113148 - Number::Phone::StubCountry::DO 1.20170908113148 - Number::Phone::StubCountry::DZ 1.20170908113148 - Number::Phone::StubCountry::EC 1.20170908113148 - Number::Phone::StubCountry::EE 1.20170908113148 - Number::Phone::StubCountry::EG 1.20170908113148 - Number::Phone::StubCountry::EH 1.20170908113148 - Number::Phone::StubCountry::ER 1.20170908113148 - Number::Phone::StubCountry::ES 1.20170908113148 - Number::Phone::StubCountry::ET 1.20170908113148 - Number::Phone::StubCountry::FI 1.20170908113148 - Number::Phone::StubCountry::FJ 1.20170908113148 - Number::Phone::StubCountry::FK 1.20170908113148 - Number::Phone::StubCountry::FM 1.20170908113148 - Number::Phone::StubCountry::FO 1.20170908113148 - Number::Phone::StubCountry::FR 1.20170908113148 - Number::Phone::StubCountry::GA 1.20170908113148 - Number::Phone::StubCountry::GB 1.20170908113148 - Number::Phone::StubCountry::GD 1.20170908113148 - Number::Phone::StubCountry::GE 1.20170908113148 - Number::Phone::StubCountry::GF 1.20170908113148 - Number::Phone::StubCountry::GG 1.20170908113148 - Number::Phone::StubCountry::GH 1.20170908113148 - Number::Phone::StubCountry::GI 1.20170908113148 - Number::Phone::StubCountry::GL 1.20170908113148 - Number::Phone::StubCountry::GM 1.20170908113148 - Number::Phone::StubCountry::GN 1.20170908113148 - Number::Phone::StubCountry::GP 1.20170908113148 - Number::Phone::StubCountry::GQ 1.20170908113148 - Number::Phone::StubCountry::GR 1.20170908113148 - Number::Phone::StubCountry::GT 1.20170908113148 - Number::Phone::StubCountry::GU 1.20170908113148 - Number::Phone::StubCountry::GW 1.20170908113148 - Number::Phone::StubCountry::GY 1.20170908113148 - Number::Phone::StubCountry::HK 1.20170908113148 - Number::Phone::StubCountry::HN 1.20170908113148 - Number::Phone::StubCountry::HR 1.20170908113148 - Number::Phone::StubCountry::HT 1.20170908113148 - Number::Phone::StubCountry::HU 1.20170908113148 - Number::Phone::StubCountry::ID 1.20170908113148 - Number::Phone::StubCountry::IE 1.20170908113148 - Number::Phone::StubCountry::IL 1.20170908113148 - Number::Phone::StubCountry::IM 1.20170908113148 - Number::Phone::StubCountry::IN 1.20170908113148 - Number::Phone::StubCountry::IO 1.20170908113148 - Number::Phone::StubCountry::IQ 1.20170908113148 - Number::Phone::StubCountry::IR 1.20170908113148 - Number::Phone::StubCountry::IS 1.20170908113148 - Number::Phone::StubCountry::IT 1.20170908113148 - Number::Phone::StubCountry::JE 1.20170908113148 - Number::Phone::StubCountry::JM 1.20170908113148 - Number::Phone::StubCountry::JO 1.20170908113148 - Number::Phone::StubCountry::JP 1.20170908113148 - Number::Phone::StubCountry::KE 1.20170908113148 - Number::Phone::StubCountry::KG 1.20170908113148 - Number::Phone::StubCountry::KH 1.20170908113148 - Number::Phone::StubCountry::KI 1.20170908113148 - Number::Phone::StubCountry::KM 1.20170908113148 - Number::Phone::StubCountry::KN 1.20170908113148 - Number::Phone::StubCountry::KP 1.20170908113148 - Number::Phone::StubCountry::KR 1.20170908113148 - Number::Phone::StubCountry::KW 1.20170908113148 - Number::Phone::StubCountry::KY 1.20170908113148 - Number::Phone::StubCountry::KZ 1.20170908113148 - Number::Phone::StubCountry::LA 1.20170908113148 - Number::Phone::StubCountry::LB 1.20170908113148 - Number::Phone::StubCountry::LC 1.20170908113148 - Number::Phone::StubCountry::LI 1.20170908113148 - Number::Phone::StubCountry::LK 1.20170908113148 - Number::Phone::StubCountry::LR 1.20170908113148 - Number::Phone::StubCountry::LS 1.20170908113148 - Number::Phone::StubCountry::LT 1.20170908113148 - Number::Phone::StubCountry::LU 1.20170908113148 - Number::Phone::StubCountry::LV 1.20170908113148 - Number::Phone::StubCountry::LY 1.20170908113148 - Number::Phone::StubCountry::MA 1.20170908113148 - Number::Phone::StubCountry::MC 1.20170908113148 - Number::Phone::StubCountry::MD 1.20170908113148 - Number::Phone::StubCountry::ME 1.20170908113148 - Number::Phone::StubCountry::MF 1.20170908113148 - Number::Phone::StubCountry::MG 1.20170908113148 - Number::Phone::StubCountry::MH 1.20170908113148 - Number::Phone::StubCountry::MK 1.20170908113148 - Number::Phone::StubCountry::ML 1.20170908113148 - Number::Phone::StubCountry::MM 1.20170908113148 - Number::Phone::StubCountry::MN 1.20170908113148 - Number::Phone::StubCountry::MO 1.20170908113148 - Number::Phone::StubCountry::MP 1.20170908113148 - Number::Phone::StubCountry::MQ 1.20170908113148 - Number::Phone::StubCountry::MR 1.20170908113148 - Number::Phone::StubCountry::MS 1.20170908113148 - Number::Phone::StubCountry::MT 1.20170908113148 - Number::Phone::StubCountry::MU 1.20170908113148 - Number::Phone::StubCountry::MV 1.20170908113148 - Number::Phone::StubCountry::MW 1.20170908113148 - Number::Phone::StubCountry::MX 1.20170908113148 - Number::Phone::StubCountry::MY 1.20170908113148 - Number::Phone::StubCountry::MZ 1.20170908113148 - Number::Phone::StubCountry::NA 1.20170908113148 - Number::Phone::StubCountry::NC 1.20170908113148 - Number::Phone::StubCountry::NE 1.20170908113148 - Number::Phone::StubCountry::NF 1.20170908113148 - Number::Phone::StubCountry::NG 1.20170908113148 - Number::Phone::StubCountry::NI 1.20170908113148 - Number::Phone::StubCountry::NL 1.20170908113148 - Number::Phone::StubCountry::NO 1.20170908113148 - Number::Phone::StubCountry::NP 1.20170908113148 - Number::Phone::StubCountry::NR 1.20170908113148 - Number::Phone::StubCountry::NU 1.20170908113148 - Number::Phone::StubCountry::NZ 1.20170908113148 - Number::Phone::StubCountry::OM 1.20170908113148 - Number::Phone::StubCountry::PA 1.20170908113148 - Number::Phone::StubCountry::PE 1.20170908113148 - Number::Phone::StubCountry::PF 1.20170908113148 - Number::Phone::StubCountry::PG 1.20170908113148 - Number::Phone::StubCountry::PH 1.20170908113148 - Number::Phone::StubCountry::PK 1.20170908113148 - Number::Phone::StubCountry::PL 1.20170908113148 - Number::Phone::StubCountry::PM 1.20170908113148 - Number::Phone::StubCountry::PR 1.20170908113149 - Number::Phone::StubCountry::PS 1.20170908113149 - Number::Phone::StubCountry::PT 1.20170908113149 - Number::Phone::StubCountry::PW 1.20170908113149 - Number::Phone::StubCountry::PY 1.20170908113149 - Number::Phone::StubCountry::QA 1.20170908113149 - Number::Phone::StubCountry::RE 1.20170908113149 - Number::Phone::StubCountry::RO 1.20170908113149 - Number::Phone::StubCountry::RS 1.20170908113149 - Number::Phone::StubCountry::RU 1.20170908113149 - Number::Phone::StubCountry::RW 1.20170908113149 - Number::Phone::StubCountry::SA 1.20170908113149 - Number::Phone::StubCountry::SB 1.20170908113149 - Number::Phone::StubCountry::SC 1.20170908113149 - Number::Phone::StubCountry::SD 1.20170908113149 - Number::Phone::StubCountry::SE 1.20170908113149 - Number::Phone::StubCountry::SG 1.20170908113149 - Number::Phone::StubCountry::SH 1.20170908113149 - Number::Phone::StubCountry::SI 1.20170908113149 - Number::Phone::StubCountry::SJ 1.20170908113149 - Number::Phone::StubCountry::SK 1.20170908113149 - Number::Phone::StubCountry::SL 1.20170908113149 - Number::Phone::StubCountry::SM 1.20170908113149 - Number::Phone::StubCountry::SN 1.20170908113149 - Number::Phone::StubCountry::SO 1.20170908113149 - Number::Phone::StubCountry::SR 1.20170908113149 - Number::Phone::StubCountry::SS 1.20170908113149 - Number::Phone::StubCountry::ST 1.20170908113149 - Number::Phone::StubCountry::SV 1.20170908113149 - Number::Phone::StubCountry::SX 1.20170908113149 - Number::Phone::StubCountry::SY 1.20170908113149 - Number::Phone::StubCountry::SZ 1.20170908113149 - Number::Phone::StubCountry::TA 1.20170908113149 - Number::Phone::StubCountry::TC 1.20170908113149 - Number::Phone::StubCountry::TD 1.20170908113149 - Number::Phone::StubCountry::TG 1.20170908113149 - Number::Phone::StubCountry::TH 1.20170908113149 - Number::Phone::StubCountry::TJ 1.20170908113149 - Number::Phone::StubCountry::TK 1.20170908113149 - Number::Phone::StubCountry::TL 1.20170908113149 - Number::Phone::StubCountry::TM 1.20170908113149 - Number::Phone::StubCountry::TN 1.20170908113149 - Number::Phone::StubCountry::TO 1.20170908113149 - Number::Phone::StubCountry::TR 1.20170908113149 - Number::Phone::StubCountry::TT 1.20170908113149 - Number::Phone::StubCountry::TV 1.20170908113149 - Number::Phone::StubCountry::TW 1.20170908113149 - Number::Phone::StubCountry::TZ 1.20170908113149 - Number::Phone::StubCountry::UA 1.20170908113149 - Number::Phone::StubCountry::UG 1.20170908113149 - Number::Phone::StubCountry::US 1.20170908113149 - Number::Phone::StubCountry::UY 1.20170908113149 - Number::Phone::StubCountry::UZ 1.20170908113149 - Number::Phone::StubCountry::VA 1.20170908113149 - Number::Phone::StubCountry::VC 1.20170908113149 - Number::Phone::StubCountry::VE 1.20170908113149 - Number::Phone::StubCountry::VG 1.20170908113149 - Number::Phone::StubCountry::VI 1.20170908113149 - Number::Phone::StubCountry::VN 1.20170908113149 - Number::Phone::StubCountry::VU 1.20170908113149 - Number::Phone::StubCountry::WF 1.20170908113149 - Number::Phone::StubCountry::WS 1.20170908113149 - Number::Phone::StubCountry::YE 1.20170908113149 - Number::Phone::StubCountry::YT 1.20170908113149 - Number::Phone::StubCountry::ZA 1.20170908113149 - Number::Phone::StubCountry::ZM 1.20170908113149 - Number::Phone::StubCountry::ZW 1.20170908113149 - Number::Phone::UK 1.67 + Number::Phone::StubCountry 1.4000 + Number::Phone::StubCountry::AC 1.20180203200231 + Number::Phone::StubCountry::AD 1.20180203200231 + Number::Phone::StubCountry::AE 1.20180203200232 + Number::Phone::StubCountry::AF 1.20180203200232 + Number::Phone::StubCountry::AG 1.20180203200232 + Number::Phone::StubCountry::AI 1.20180203200232 + Number::Phone::StubCountry::AL 1.20180203200232 + Number::Phone::StubCountry::AM 1.20180203200232 + Number::Phone::StubCountry::AO 1.20180203200232 + Number::Phone::StubCountry::AR 1.20180203200232 + Number::Phone::StubCountry::AS 1.20180203200232 + Number::Phone::StubCountry::AT 1.20180203200232 + Number::Phone::StubCountry::AU 1.20180203200232 + Number::Phone::StubCountry::AW 1.20180203200232 + Number::Phone::StubCountry::AX 1.20180203200232 + Number::Phone::StubCountry::AZ 1.20180203200232 + Number::Phone::StubCountry::BA 1.20180203200232 + Number::Phone::StubCountry::BB 1.20180203200232 + Number::Phone::StubCountry::BD 1.20180203200232 + Number::Phone::StubCountry::BE 1.20180203200232 + Number::Phone::StubCountry::BF 1.20180203200232 + Number::Phone::StubCountry::BG 1.20180203200232 + Number::Phone::StubCountry::BH 1.20180203200232 + Number::Phone::StubCountry::BI 1.20180203200232 + Number::Phone::StubCountry::BJ 1.20180203200232 + Number::Phone::StubCountry::BL 1.20180203200232 + Number::Phone::StubCountry::BM 1.20180203200232 + Number::Phone::StubCountry::BN 1.20180203200232 + Number::Phone::StubCountry::BO 1.20180203200232 + Number::Phone::StubCountry::BQ 1.20180203200232 + Number::Phone::StubCountry::BR 1.20180203200232 + Number::Phone::StubCountry::BS 1.20180203200232 + Number::Phone::StubCountry::BT 1.20180203200232 + Number::Phone::StubCountry::BW 1.20180203200232 + Number::Phone::StubCountry::BY 1.20180203200232 + Number::Phone::StubCountry::BZ 1.20180203200232 + Number::Phone::StubCountry::CA 1.20180203200232 + Number::Phone::StubCountry::CC 1.20180203200232 + Number::Phone::StubCountry::CD 1.20180203200233 + Number::Phone::StubCountry::CF 1.20180203200233 + Number::Phone::StubCountry::CG 1.20180203200233 + Number::Phone::StubCountry::CH 1.20180203200233 + Number::Phone::StubCountry::CI 1.20180203200233 + Number::Phone::StubCountry::CK 1.20180203200233 + Number::Phone::StubCountry::CL 1.20180203200233 + Number::Phone::StubCountry::CM 1.20180203200233 + Number::Phone::StubCountry::CN 1.20180203200233 + Number::Phone::StubCountry::CO 1.20180203200234 + Number::Phone::StubCountry::CR 1.20180203200234 + Number::Phone::StubCountry::CU 1.20180203200234 + Number::Phone::StubCountry::CV 1.20180203200234 + Number::Phone::StubCountry::CW 1.20180203200234 + Number::Phone::StubCountry::CX 1.20180203200234 + Number::Phone::StubCountry::CY 1.20180203200234 + Number::Phone::StubCountry::CZ 1.20180203200234 + Number::Phone::StubCountry::DE 1.20180203200234 + Number::Phone::StubCountry::DJ 1.20180203200234 + Number::Phone::StubCountry::DK 1.20180203200234 + Number::Phone::StubCountry::DM 1.20180203200234 + Number::Phone::StubCountry::DO 1.20180203200234 + Number::Phone::StubCountry::DZ 1.20180203200234 + Number::Phone::StubCountry::EC 1.20180203200234 + Number::Phone::StubCountry::EE 1.20180203200234 + Number::Phone::StubCountry::EG 1.20180203200234 + Number::Phone::StubCountry::EH 1.20180203200234 + Number::Phone::StubCountry::ER 1.20180203200234 + Number::Phone::StubCountry::ES 1.20180203200234 + Number::Phone::StubCountry::ET 1.20180203200234 + Number::Phone::StubCountry::FI 1.20180203200234 + Number::Phone::StubCountry::FJ 1.20180203200234 + Number::Phone::StubCountry::FK 1.20180203200234 + Number::Phone::StubCountry::FM 1.20180203200234 + Number::Phone::StubCountry::FO 1.20180203200234 + Number::Phone::StubCountry::FR 1.20180203200234 + Number::Phone::StubCountry::GA 1.20180203200234 + Number::Phone::StubCountry::GB 1.20180203200234 + Number::Phone::StubCountry::GD 1.20180203200234 + Number::Phone::StubCountry::GE 1.20180203200234 + Number::Phone::StubCountry::GF 1.20180203200234 + Number::Phone::StubCountry::GG 1.20180203200234 + Number::Phone::StubCountry::GH 1.20180203200234 + Number::Phone::StubCountry::GI 1.20180203200234 + Number::Phone::StubCountry::GL 1.20180203200234 + Number::Phone::StubCountry::GM 1.20180203200234 + Number::Phone::StubCountry::GN 1.20180203200234 + Number::Phone::StubCountry::GP 1.20180203200234 + Number::Phone::StubCountry::GQ 1.20180203200234 + Number::Phone::StubCountry::GR 1.20180203200234 + Number::Phone::StubCountry::GT 1.20180203200234 + Number::Phone::StubCountry::GU 1.20180203200234 + Number::Phone::StubCountry::GW 1.20180203200234 + Number::Phone::StubCountry::GY 1.20180203200234 + Number::Phone::StubCountry::HK 1.20180203200234 + Number::Phone::StubCountry::HN 1.20180203200234 + Number::Phone::StubCountry::HR 1.20180203200234 + Number::Phone::StubCountry::HT 1.20180203200234 + Number::Phone::StubCountry::HU 1.20180203200234 + Number::Phone::StubCountry::ID 1.20180203200234 + Number::Phone::StubCountry::IE 1.20180203200235 + Number::Phone::StubCountry::IL 1.20180203200235 + Number::Phone::StubCountry::IM 1.20180203200235 + Number::Phone::StubCountry::IN 1.20180203200235 + Number::Phone::StubCountry::IO 1.20180203200235 + Number::Phone::StubCountry::IQ 1.20180203200235 + Number::Phone::StubCountry::IR 1.20180203200235 + Number::Phone::StubCountry::IS 1.20180203200235 + Number::Phone::StubCountry::IT 1.20180203200235 + Number::Phone::StubCountry::JE 1.20180203200235 + Number::Phone::StubCountry::JM 1.20180203200235 + Number::Phone::StubCountry::JO 1.20180203200235 + Number::Phone::StubCountry::JP 1.20180203200235 + Number::Phone::StubCountry::KE 1.20180203200235 + Number::Phone::StubCountry::KG 1.20180203200235 + Number::Phone::StubCountry::KH 1.20180203200235 + Number::Phone::StubCountry::KI 1.20180203200235 + Number::Phone::StubCountry::KM 1.20180203200235 + Number::Phone::StubCountry::KN 1.20180203200235 + Number::Phone::StubCountry::KP 1.20180203200235 + Number::Phone::StubCountry::KR 1.20180203200235 + Number::Phone::StubCountry::KW 1.20180203200235 + Number::Phone::StubCountry::KY 1.20180203200235 + Number::Phone::StubCountry::KZ 1.20180203200235 + Number::Phone::StubCountry::LA 1.20180203200235 + Number::Phone::StubCountry::LB 1.20180203200235 + Number::Phone::StubCountry::LC 1.20180203200235 + Number::Phone::StubCountry::LI 1.20180203200235 + Number::Phone::StubCountry::LK 1.20180203200235 + Number::Phone::StubCountry::LR 1.20180203200235 + Number::Phone::StubCountry::LS 1.20180203200235 + Number::Phone::StubCountry::LT 1.20180203200235 + Number::Phone::StubCountry::LU 1.20180203200235 + Number::Phone::StubCountry::LV 1.20180203200235 + Number::Phone::StubCountry::LY 1.20180203200235 + Number::Phone::StubCountry::MA 1.20180203200235 + Number::Phone::StubCountry::MC 1.20180203200235 + Number::Phone::StubCountry::MD 1.20180203200235 + Number::Phone::StubCountry::ME 1.20180203200235 + Number::Phone::StubCountry::MF 1.20180203200235 + Number::Phone::StubCountry::MG 1.20180203200235 + Number::Phone::StubCountry::MH 1.20180203200235 + Number::Phone::StubCountry::MK 1.20180203200235 + Number::Phone::StubCountry::ML 1.20180203200235 + Number::Phone::StubCountry::MM 1.20180203200235 + Number::Phone::StubCountry::MN 1.20180203200235 + Number::Phone::StubCountry::MO 1.20180203200235 + Number::Phone::StubCountry::MP 1.20180203200235 + Number::Phone::StubCountry::MQ 1.20180203200235 + Number::Phone::StubCountry::MR 1.20180203200235 + Number::Phone::StubCountry::MS 1.20180203200235 + Number::Phone::StubCountry::MT 1.20180203200235 + Number::Phone::StubCountry::MU 1.20180203200235 + Number::Phone::StubCountry::MV 1.20180203200235 + Number::Phone::StubCountry::MW 1.20180203200235 + Number::Phone::StubCountry::MX 1.20180203200235 + Number::Phone::StubCountry::MY 1.20180203200235 + Number::Phone::StubCountry::MZ 1.20180203200235 + Number::Phone::StubCountry::NA 1.20180203200235 + Number::Phone::StubCountry::NC 1.20180203200235 + Number::Phone::StubCountry::NE 1.20180203200235 + Number::Phone::StubCountry::NF 1.20180203200235 + Number::Phone::StubCountry::NG 1.20180203200235 + Number::Phone::StubCountry::NI 1.20180203200235 + Number::Phone::StubCountry::NL 1.20180203200235 + Number::Phone::StubCountry::NO 1.20180203200235 + Number::Phone::StubCountry::NP 1.20180203200235 + Number::Phone::StubCountry::NR 1.20180203200235 + Number::Phone::StubCountry::NU 1.20180203200235 + Number::Phone::StubCountry::NZ 1.20180203200235 + Number::Phone::StubCountry::OM 1.20180203200235 + Number::Phone::StubCountry::PA 1.20180203200235 + Number::Phone::StubCountry::PE 1.20180203200235 + Number::Phone::StubCountry::PF 1.20180203200235 + Number::Phone::StubCountry::PG 1.20180203200235 + Number::Phone::StubCountry::PH 1.20180203200235 + Number::Phone::StubCountry::PK 1.20180203200235 + Number::Phone::StubCountry::PL 1.20180203200235 + Number::Phone::StubCountry::PM 1.20180203200235 + Number::Phone::StubCountry::PR 1.20180203200235 + Number::Phone::StubCountry::PS 1.20180203200235 + Number::Phone::StubCountry::PT 1.20180203200235 + Number::Phone::StubCountry::PW 1.20180203200235 + Number::Phone::StubCountry::PY 1.20180203200235 + Number::Phone::StubCountry::QA 1.20180203200235 + Number::Phone::StubCountry::RE 1.20180203200235 + Number::Phone::StubCountry::RO 1.20180203200235 + Number::Phone::StubCountry::RS 1.20180203200235 + Number::Phone::StubCountry::RU 1.20180203200235 + Number::Phone::StubCountry::RW 1.20180203200235 + Number::Phone::StubCountry::SA 1.20180203200236 + Number::Phone::StubCountry::SB 1.20180203200236 + Number::Phone::StubCountry::SC 1.20180203200236 + Number::Phone::StubCountry::SD 1.20180203200236 + Number::Phone::StubCountry::SE 1.20180203200236 + Number::Phone::StubCountry::SG 1.20180203200236 + Number::Phone::StubCountry::SH 1.20180203200236 + Number::Phone::StubCountry::SI 1.20180203200236 + Number::Phone::StubCountry::SJ 1.20180203200236 + Number::Phone::StubCountry::SK 1.20180203200236 + Number::Phone::StubCountry::SL 1.20180203200236 + Number::Phone::StubCountry::SM 1.20180203200236 + Number::Phone::StubCountry::SN 1.20180203200236 + Number::Phone::StubCountry::SO 1.20180203200236 + Number::Phone::StubCountry::SR 1.20180203200236 + Number::Phone::StubCountry::SS 1.20180203200236 + Number::Phone::StubCountry::ST 1.20180203200236 + Number::Phone::StubCountry::SV 1.20180203200236 + Number::Phone::StubCountry::SX 1.20180203200236 + Number::Phone::StubCountry::SY 1.20180203200236 + Number::Phone::StubCountry::SZ 1.20180203200236 + Number::Phone::StubCountry::TA 1.20180203200236 + Number::Phone::StubCountry::TC 1.20180203200236 + Number::Phone::StubCountry::TD 1.20180203200236 + Number::Phone::StubCountry::TG 1.20180203200236 + Number::Phone::StubCountry::TH 1.20180203200236 + Number::Phone::StubCountry::TJ 1.20180203200236 + Number::Phone::StubCountry::TK 1.20180203200236 + Number::Phone::StubCountry::TL 1.20180203200236 + Number::Phone::StubCountry::TM 1.20180203200236 + Number::Phone::StubCountry::TN 1.20180203200236 + Number::Phone::StubCountry::TO 1.20180203200236 + Number::Phone::StubCountry::TR 1.20180203200236 + Number::Phone::StubCountry::TT 1.20180203200236 + Number::Phone::StubCountry::TV 1.20180203200236 + Number::Phone::StubCountry::TW 1.20180203200236 + Number::Phone::StubCountry::TZ 1.20180203200236 + Number::Phone::StubCountry::UA 1.20180203200236 + Number::Phone::StubCountry::UG 1.20180203200236 + Number::Phone::StubCountry::US 1.20180203200236 + Number::Phone::StubCountry::UY 1.20180203200236 + Number::Phone::StubCountry::UZ 1.20180203200236 + Number::Phone::StubCountry::VA 1.20180203200236 + Number::Phone::StubCountry::VC 1.20180203200236 + Number::Phone::StubCountry::VE 1.20180203200236 + Number::Phone::StubCountry::VG 1.20180203200236 + Number::Phone::StubCountry::VI 1.20180203200236 + Number::Phone::StubCountry::VN 1.20180203200236 + Number::Phone::StubCountry::VU 1.20180203200236 + Number::Phone::StubCountry::WF 1.20180203200236 + Number::Phone::StubCountry::WS 1.20180203200236 + Number::Phone::StubCountry::YE 1.20180203200236 + Number::Phone::StubCountry::YT 1.20180203200236 + Number::Phone::StubCountry::ZA 1.20180203200236 + Number::Phone::StubCountry::ZM 1.20180203200236 + Number::Phone::StubCountry::ZW 1.20180203200236 + Number::Phone::UK 1.68 Number::Phone::UK::Data 2.0 Number::Phone::UK::Exchanges 1.20060823121334 Number::Phone::UK::GG 1 diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 27ba9f0e3..97f2132b1 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -154,8 +154,9 @@ sub username { sub phone_display { my $self = shift; return $self->phone unless $self->phone; + my $country = FixMyStreet->config('PHONE_COUNTRY'); my $parsed = FixMyStreet::SMS->parse_username($self->phone); - return $parsed->{phone} ? $parsed->{phone}->format : $self->phone; + return $parsed->{phone} ? $parsed->{phone}->format_for_country($country) : $self->phone; } sub latest_anonymity { diff --git a/t/app/controller/report_new_text.t b/t/app/controller/report_new_text.t index 734b9dbb4..cb07e57ee 100644 --- a/t/app/controller/report_new_text.t +++ b/t/app/controller/report_new_text.t @@ -45,8 +45,8 @@ foreach my $test ( password_register => '', password_sign_in => '', }, changes => { - username => '+44 121 496 0000', - phone => '+44 121 496 0000', + username => '0121 496 0000', + phone => '0121 496 0000', }, errors => [ 'Please enter a mobile number', ], }, diff --git a/t/app/controller/report_update_text.t b/t/app/controller/report_update_text.t index 45b4e78c2..a3b767221 100644 --- a/t/app/controller/report_update_text.t +++ b/t/app/controller/report_update_text.t @@ -95,7 +95,7 @@ for my $test ( password_sign_in => '', }, changes => { - username => '+44 121 496 0000', + username => '0121 496 0000', }, field_errors => [ 'Please enter a mobile number' ] }, diff --git a/templates/web/base/auth/change_phone.html b/templates/web/base/auth/change_phone.html index 27a2f63dd..62e9fa6d6 100644 --- a/templates/web/base/auth/change_phone.html +++ b/templates/web/base/auth/change_phone.html @@ -18,7 +18,7 @@ END [% IF c.user.phone_verified OR (c.user.phone AND NOT verifying) %] [% loc('Your phone number') %]: [% c.user.phone_display %] [% ELSIF c.user.phone %] -[% DEFAULT username = c.user.phone %] +[% DEFAULT username = c.user.phone_display %] [% END %] <form method="post" name="change_phone"> diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html index 5088332ce..eb2564157 100644 --- a/templates/web/base/report/_inspect.html +++ b/templates/web/base/report/_inspect.html @@ -17,7 +17,7 @@ [% IF permissions.report_inspect AND problem.user.phone %] <p> <strong>[% loc('Phone Reporter:') %]</strong> - <a href="tel:[% problem.user.phone | html %]">[% problem.user.phone | html %]</a> + <a href="tel:[% problem.user.phone | html %]">[% problem.user.phone_display | html %]</a> </p> [% END %] <p> diff --git a/templates/web/base/report/new/form_user_loggedin.html b/templates/web/base/report/new/form_user_loggedin.html index bd4ce1cf7..04a93ef74 100644 --- a/templates/web/base/report/new/form_user_loggedin.html +++ b/templates/web/base/report/new/form_user_loggedin.html @@ -31,7 +31,7 @@ [% IF c.user.phone_verified %] <label for="form_phone">[% loc('Phone number') %]</label> - <input class="form-control" id="form_phone" name="phone" disabled type="text" value="[% c.user.phone | html %]"> + <input class="form-control" id="form_phone" name="phone" disabled type="text" value="[% c.user.phone_display | html %]"> [% END %] [% IF c.user.email_verified %] @@ -65,7 +65,7 @@ [% IF NOT c.user.phone_verified %] <label for="form_phone">[% loc('Phone number (optional)') %]</label> - <input class="form-control" type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone"> + <input class="form-control" type="text" value="[% report.user.phone_display | html %]" name="phone" id="form_phone"> [% END %] [% IF NOT c.user.email_verified %] <label for="form_username">[% loc('Email address (optional)') %]</label> diff --git a/templates/web/fixamingata/report/new/form_user_loggedout.html b/templates/web/fixamingata/report/new/form_user_loggedout.html index 1f7cf2aeb..a324bbeb4 100644 --- a/templates/web/fixamingata/report/new/form_user_loggedout.html +++ b/templates/web/fixamingata/report/new/form_user_loggedout.html @@ -27,7 +27,7 @@ </div> <label for="form_phone">[% loc('Phone number (optional)') %]</label> - <input type="text" class="form-control" value="[% report.user.phone | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]"> + <input type="text" class="form-control" value="[% report.user.phone_display | html %]" name="phone" id="form_phone" placeholder="[% loc('Your phone number') %]"> <div class="general-notes form-focus-hidden"> <p>[% loc('We never show your email address or phone number.') %]</p> |