projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f975ff9
)
RT# 73421 Add allow messages flag message_dest to contact_email
author
Mitch Jackson
<mitch@freeside.biz>
Sun, 28 Jan 2018 03:21:59 +0000
(21:21 -0600)
committer
Mitch Jackson
<mitch@freeside.biz>
Sun, 28 Jan 2018 03:21:59 +0000
(21:21 -0600)
FS/FS/Schema.pm
patch
|
blob
|
history
FS/FS/contact.pm
patch
|
blob
|
history
FS/FS/cust_contact.pm
patch
|
blob
|
history
httemplate/edit/process/cust_main-contacts.html
patch
|
blob
|
history
httemplate/elements/contact.html
patch
|
blob
|
history
httemplate/view/cust_main/contacts_new.html
patch
|
blob
|
history
diff --git
a/FS/FS/Schema.pm
b/FS/FS/Schema.pm
index
f7ac973
..
65eadad
100644
(file)
--- a/
FS/FS/Schema.pm
+++ b/
FS/FS/Schema.pm
@@
-1793,7
+1793,8
@@
sub tables_hashref {
'classnum', 'int', 'NULL', '', '', '',
'comment', 'varchar', 'NULL', 255, '', '',
'selfservice_access', 'char', 'NULL', 1, '', '',
'classnum', 'int', 'NULL', '', '', '',
'comment', 'varchar', 'NULL', 255, '', '',
'selfservice_access', 'char', 'NULL', 1, '', '',
- 'invoice_dest', 'char', 'NULL', 1, '', '',
+ 'invoice_dest', 'char', 'NULL', 1, '', '', # Y or NULL
+ 'message_dest', 'char', 'NULL', 1, '', '', # Y or NULL
],
'primary_key' => 'custcontactnum',
'unique' => [ [ 'custnum', 'contactnum' ], ],
],
'primary_key' => 'custcontactnum',
'unique' => [ [ 'custnum', 'contactnum' ], ],
diff --git
a/FS/FS/contact.pm
b/FS/FS/contact.pm
index
44c5388
..
fa047f5
100644
(file)
--- a/
FS/FS/contact.pm
+++ b/
FS/FS/contact.pm
@@
-155,7
+155,7
@@
sub insert {
$self->custnum('');
my %link_hash = ();
$self->custnum('');
my %link_hash = ();
- for (qw( classnum comment selfservice_access invoice_dest )) {
+ for (qw( classnum comment selfservice_access invoice_dest
message_dest
)) {
$link_hash{$_} = $self->get($_);
$self->$_('');
}
$link_hash{$_} = $self->get($_);
$self->$_('');
}
@@
-430,7
+430,7
@@
sub replace {
$self->custnum('');
my %link_hash = ();
$self->custnum('');
my %link_hash = ();
- for (qw( classnum comment selfservice_access invoice_dest )) {
+ for (qw( classnum comment selfservice_access invoice_dest
message_dest
)) {
$link_hash{$_} = $self->get($_);
$self->$_('');
}
$link_hash{$_} = $self->get($_);
$self->$_('');
}
@@
-955,7
+955,7
@@
sub cgi_contact_fields {
my @contact_fields = qw(
classnum first last title comment emailaddress selfservice_access
my @contact_fields = qw(
classnum first last title comment emailaddress selfservice_access
- invoice_dest password
+ invoice_dest
message_dest
password
);
push @contact_fields, 'phonetypenum'. $_->phonetypenum
);
push @contact_fields, 'phonetypenum'. $_->phonetypenum
@@
-1028,4
+1028,3
@@
L<FS::Record>, schema.html from the base documentation.
=cut
1;
=cut
1;
-
diff --git
a/FS/FS/cust_contact.pm
b/FS/FS/cust_contact.pm
index
118a9e0
..
adad46e
100644
(file)
--- a/
FS/FS/cust_contact.pm
+++ b/
FS/FS/cust_contact.pm
@@
-59,6
+59,11
@@
empty or Y
'Y' if the customer should get invoices sent to this address, null if not
'Y' if the customer should get invoices sent to this address, null if not
+=item message_dest
+
+'Y' if contact should get non-invoice email messages sent to this address,
+NULL if not
+
=back
=head1 METHODS
=back
=head1 METHODS
@@
-119,6
+124,7
@@
sub check {
|| $self->ut_textn('comment')
|| $self->ut_enum('selfservice_access', [ '', 'Y' ])
|| $self->ut_flag('invoice_dest')
|| $self->ut_textn('comment')
|| $self->ut_enum('selfservice_access', [ '', 'Y' ])
|| $self->ut_flag('invoice_dest')
+ || $self->ut_flag('message_dest')
;
return $error if $error;
;
return $error if $error;
@@
-148,4
+154,3
@@
L<FS::contact>, L<FS::cust_main>, L<FS::Record>
=cut
1;
=cut
1;
-
diff --git
a/httemplate/edit/process/cust_main-contacts.html
b/httemplate/edit/process/cust_main-contacts.html
index
2a7185b
..
5b8319f
100644
(file)
--- a/
httemplate/edit/process/cust_main-contacts.html
+++ b/
httemplate/edit/process/cust_main-contacts.html
@@
-1,3
+1,11
@@
+<%doc>
+
+ This form works indirectly with the tables contact_email and
+ contact_phone. The columns are updated against an FS::contact
+ object. The insert/update methods of FS::contact will make the
+ necessary inserts/updates to contact_email and contact_phone.
+
+</%doc>
<% include('elements/process.html',
'table' => 'cust_main',
'error_redirect' => popurl(3). 'edit/cust_main-contacts.html?',
<% include('elements/process.html',
'table' => 'cust_main',
'error_redirect' => popurl(3). 'edit/cust_main-contacts.html?',
diff --git
a/httemplate/elements/contact.html
b/httemplate/elements/contact.html
index
faee7ea
..
43e5201
100644
(file)
--- a/
httemplate/elements/contact.html
+++ b/
httemplate/elements/contact.html
@@
-42,7
+42,8
@@
% $value = join(', ', map $_->emailaddress, $contact->contact_email);
% } elsif ( $field eq 'selfservice_access'
% or $field eq 'comment'
% $value = join(', ', map $_->emailaddress, $contact->contact_email);
% } elsif ( $field eq 'selfservice_access'
% or $field eq 'comment'
-% or $field eq 'invoice_dest' ) {
+% or $field eq 'invoice_dest'
+% or $field eq 'message_dest' ) {
% $value = $X_contact->get($field);
% } else {
% $value = $contact->get($field);
% $value = $X_contact->get($field);
% } else {
% $value = $contact->get($field);
@@
-78,7
+79,7
@@
return false
}
</SCRIPT>
return false
}
</SCRIPT>
-% } elsif ( $field eq 'invoice_dest' ) {
+% } elsif ( $field eq 'invoice_dest'
|| $field eq 'message_dest'
) {
% my $curr_value = $cgi->param($name . '_' . $field);
% $curr_value = $value if !defined($curr_value);
<& select.html,
% my $curr_value = $cgi->param($name . '_' . $field);
% $curr_value = $value if !defined($curr_value);
<& select.html,
@@
-168,6
+169,7
@@
tie my %label, 'Tie::IxHash',
unless ($opt{'for_prospect'}) {
$label{'invoice_dest'} = 'Send invoices';
unless ($opt{'for_prospect'}) {
$label{'invoice_dest'} = 'Send invoices';
+ $label{'message_dest'} = 'Send messages';
$label{'selfservice_access'} = 'Self-service';
}
$label{'selfservice_access'} = 'Self-service';
}
diff --git
a/httemplate/view/cust_main/contacts_new.html
b/httemplate/view/cust_main/contacts_new.html
index
9448867
..
a28b449
100644
(file)
--- a/
httemplate/view/cust_main/contacts_new.html
+++ b/
httemplate/view/cust_main/contacts_new.html
@@
-11,6
+11,7
@@
<%$th%>Email</TH>
<%$th%>Send invoices</TH>
<%$th%>Self-service</TH>
<%$th%>Email</TH>
<%$th%>Send invoices</TH>
<%$th%>Self-service</TH>
+ <%$th%>Send messages</TH>
% foreach my $phone_type (@phone_type) {
<%$th%><% $phone_type->typename |h %></TH>
% }
% foreach my $phone_type (@phone_type) {
<%$th%><% $phone_type->typename |h %></TH>
% }
@@
-32,6
+33,7
@@
% my @contact_email = $contact->contact_email;
<%$td%><% join(', ', map $_->emailaddress, @contact_email) %></TD>
<%$td%><% $cust_contact->invoice_dest eq 'Y' ? 'Yes' : 'No' %></TD>
% my @contact_email = $contact->contact_email;
<%$td%><% join(', ', map $_->emailaddress, @contact_email) %></TD>
<%$td%><% $cust_contact->invoice_dest eq 'Y' ? 'Yes' : 'No' %></TD>
+ <%$td%><% $cust_contact->message_dest eq 'Y' ? 'Yes' : 'No' %></TD>
<%$td%>
% if ( $cust_contact->selfservice_access ) {
Enabled
<%$td%>
% if ( $cust_contact->selfservice_access ) {
Enabled