summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2011-09-27 23:01:24 +0000
committerivan <ivan>2011-09-27 23:01:24 +0000
commit70bffe41ccf43a9d25c2b54679f1e9310f50c1c4 (patch)
treee6463405b3fc3c0ccab69bab11766b67551df277 /FS
parent95bb9cf9a687ee98c985bd399addc6bdc8cc6b94 (diff)
add cust_main.mobile and ship_mobile to support uniserve portal, RT#13656
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Schema.pm6
-rw-r--r--FS/FS/cust_main.pm34
2 files changed, 28 insertions, 12 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 124b1ffa6..c0bbd0ae4 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -839,6 +839,7 @@ sub tables_hashref {
'daytime', 'varchar', 'NULL', 20, '', '',
'night', 'varchar', 'NULL', 20, '', '',
'fax', 'varchar', 'NULL', 12, '', '',
+ 'mobile', 'varchar', 'NULL', 12, '', '',
'ship_last', 'varchar', 'NULL', 2*$char_d, '', '',
# 'ship_middle', 'varchar', 'NULL', $char_d, '', '',
'ship_first', 'varchar', 'NULL', $char_d, '', '',
@@ -853,6 +854,7 @@ sub tables_hashref {
'ship_daytime', 'varchar', 'NULL', 20, '', '',
'ship_night', 'varchar', 'NULL', 20, '', '',
'ship_fax', 'varchar', 'NULL', 12, '', '',
+ 'ship_mobile', 'varchar', 'NULL', 12, '', '',
'payby', 'char', '', 4, '', '',
'payinfo', 'varchar', 'NULL', 512, '', '',
'paycvv', 'varchar', 'NULL', 512, '', '',
@@ -899,12 +901,12 @@ sub tables_hashref {
[ 'last' ], [ 'company' ],
[ 'county' ], [ 'state' ], [ 'country' ],
[ 'zip' ],
- [ 'daytime' ], [ 'night' ], [ 'fax' ],
+ [ 'daytime' ], [ 'night' ], [ 'fax' ], [ 'mobile' ],
#shipping
[ 'ship_last' ], [ 'ship_company' ],
[ 'ship_county' ], [ 'ship_state' ], [ 'ship_country' ],
[ 'ship_zip' ],
- [ 'ship_daytime' ], [ 'ship_night' ], [ 'ship_fax' ],
+ [ 'ship_daytime' ], [ 'ship_night' ], [ 'ship_fax' ], [ 'ship_mobile' ]
],
},
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index dd0fd7428..765987e93 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -211,6 +211,10 @@ phone (optional)
phone (optional)
+=item mobile
+
+phone (optional)
+
=item ship_first
Shipping first name
@@ -257,6 +261,10 @@ phone (optional)
phone (optional)
+=item ship_mobile
+
+phone (optional)
+
=item payby
Payment Type (See L<FS::payinfo_Mixin> for valid payby values)
@@ -1747,9 +1755,10 @@ sub check {
}
$error =
- $self->ut_phonen('daytime', $self->country)
- || $self->ut_phonen('night', $self->country)
- || $self->ut_phonen('fax', $self->country)
+ $self->ut_phonen('daytime', $self->country)
+ || $self->ut_phonen('night', $self->country)
+ || $self->ut_phonen('fax', $self->country)
+ || $self->ut_phonen('mobile', $self->country)
;
return $error if $error;
@@ -1759,7 +1768,7 @@ sub check {
}
if ( $conf->exists('cust_main-require_phone')
- && ! length($self->daytime) && ! length($self->night)
+ && ! length($self->daytime) && ! length($self->night) && ! length($self->mobile)
) {
my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
@@ -1768,8 +1777,12 @@ sub check {
my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/
? 'Night Phone'
: FS::Msgcat::_gettext('night');
-
- return "$daytime_label or $night_label is required"
+
+ my $mobile_label = FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
+ ? 'Mobile Phone'
+ : FS::Msgcat::_gettext('mobile');
+
+ return "$daytime_label, $night_label or $mobile_label is required"
}
@@ -1807,9 +1820,10 @@ sub check {
#eofalse
$error =
- $self->ut_phonen('ship_daytime', $self->ship_country)
- || $self->ut_phonen('ship_night', $self->ship_country)
- || $self->ut_phonen('ship_fax', $self->ship_country)
+ $self->ut_phonen('ship_daytime', $self->ship_country)
+ || $self->ut_phonen('ship_night', $self->ship_country)
+ || $self->ut_phonen('ship_fax', $self->ship_country)
+ || $self->ut_phonen('ship_mobile', $self->ship_country)
;
return $error if $error;
@@ -2062,7 +2076,7 @@ Returns a list of fields which have ship_ duplicates.
sub addr_fields {
qw( last first company
address1 address2 city county state zip country
- daytime night fax
+ daytime night fax mobile
);
}