From 6361e71971a84c4f798c2f4eef89bbd454a3cb0d Mon Sep 17 00:00:00 2001 From: levinse Date: Fri, 10 Jun 2011 05:16:54 +0000 Subject: svc_broadband add/edit: configurable require co-ordinates in NW quadrant, RT12925 --- FS/FS/Conf.pm | 7 +++++++ FS/FS/svc_broadband.pm | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'FS') diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 2499f4e54..1a05aaee9 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4445,6 +4445,13 @@ and customer address. Include units.', 'type' => 'checkbox', }, + { + 'key' => 'svc_broadband-require-nw-coordinates', + 'section' => 'UI', + 'description' => 'On svc_broadband add/edit, require latitude and longitude in the North Western quadrant', + 'type' => 'checkbox', + }, + { 'key' => 'cust-email-high-visibility', 'section' => 'UI', diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm index 2b794aa4b..f1a233b40 100755 --- a/FS/FS/svc_broadband.pm +++ b/FS/FS/svc_broadband.pm @@ -334,6 +334,10 @@ sub check { return $x unless ref($x); + my $nw_coords = $conf->exists('svc_broadband-require-nw-coordinates'); + my $lat_lower = $nw_coords ? 1 : -90; + my $lon_upper = $nw_coords ? -1 : 180; + my $error = $self->ut_numbern('svcnum') || $self->ut_numbern('blocknum') @@ -343,8 +347,8 @@ sub check { || $self->ut_ipn('ip_addr') || $self->ut_hexn('mac_addr') || $self->ut_hexn('auth_key') - || $self->ut_coordn('latitude', -90, 90) - || $self->ut_coordn('longitude', -180, 180) + || $self->ut_coordn('latitude', $lat_lower, 90) + || $self->ut_coordn('longitude', -180, $lon_upper) || $self->ut_sfloatn('altitude') || $self->ut_textn('vlan_profile') || $self->ut_textn('plan_id') -- cgit v1.2.1