diff options
| author | Christopher Burger <burgerc@freeside.biz> | 2018-09-26 08:18:00 -0400 |
|---|---|---|
| committer | Christopher Burger <burgerc@freeside.biz> | 2018-09-26 08:18:00 -0400 |
| commit | ccfb83fa0e77c8248191977e4b9d0195b7b67af7 (patch) | |
| tree | dd75e1911299524ce0d15317fc5f95d8895ab605 /httemplate | |
| parent | 6fad5ab48dccd69412e1003cb659ec27f277c445 (diff) | |
| parent | 3431eb1f893dafd05056eb65276a8e9122f9fd31 (diff) | |
Merge branch 'FREESIDE_4_BRANCH' of ssh://git.freeside.biz/home/git/freeside into FREESIDE_4_BRANCH
Diffstat (limited to 'httemplate')
| -rw-r--r-- | httemplate/edit/process/cust_main-contacts.html | 8 | ||||
| -rw-r--r-- | httemplate/elements/contact.html | 6 | ||||
| -rw-r--r-- | httemplate/misc/email-customers.html | 27 | ||||
| -rwxr-xr-x | httemplate/search/cust_main.html | 8 | ||||
| -rw-r--r-- | httemplate/view/cust_main/contacts_new.html | 2 |
5 files changed, 37 insertions, 14 deletions
diff --git a/httemplate/edit/process/cust_main-contacts.html b/httemplate/edit/process/cust_main-contacts.html index 6e94a290f..6b7f1c2db 100644 --- 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', diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html index 31b4e49cb..909ff7893 100644 --- a/httemplate/elements/contact.html +++ b/httemplate/elements/contact.html @@ -46,7 +46,8 @@ % $value = $contact->get('_password') ? '********' : ''; % } 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); @@ -79,7 +80,7 @@ <SCRIPT> <% $js %> </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, @@ -173,6 +174,7 @@ tie my %label, 'Tie::IxHash', unless ($opt{'for_prospect'}) { $label{'invoice_dest'} = 'Send invoices'; + $label{'message_dest'} = 'Send messages'; $label{'selfservice_access'} = 'Self-service'; $label{'password'} = 'Password'; } diff --git a/httemplate/misc/email-customers.html b/httemplate/misc/email-customers.html index 445ede248..b3a21767c 100644 --- a/httemplate/misc/email-customers.html +++ b/httemplate/misc/email-customers.html @@ -171,16 +171,18 @@ Template: <TD>Send to contacts:</TD> <TD> <div id="contactclassesdiv"> - <& /elements/checkboxes.html, - 'style' => 'display: inline; vertical-align: top', - 'disable_links' => 1, - 'names_list' => \@contact_checkboxes, - 'element_name_prefix' => 'contact_class_', - 'checked_callback' => sub { - my($cgi, $name) = @_; - $name eq 'invoice' #others default to unchecked - }, - &> + <& /elements/checkboxes.html, + 'style' => 'display: inline; vertical-align: top', + 'disable_links' => 1, + 'names_list' => \@contact_checkboxes, + 'element_name_prefix' => 'contact_class_', + 'checked_callback' => sub { + # Called for each checkbox + # Return true to default as checked, false as unchecked + my($cgi, $name) = @_; + $name eq 'message' + }, + &> </div> % if ($send_to_domain) { <div> @@ -424,6 +426,8 @@ if ( !$cgi->param('preview') ) { push @contact_classnum, $1; if ( $1 eq 'invoice' ) { push @contact_classname, 'Invoice recipients'; + } elsif ( $1 eq 'message' ) { + push @contact_classname, 'Message recipients'; } else { my $contact_class = FS::contact_class->by_key($1); push @contact_classname, encode_entities($contact_class->classname); @@ -434,7 +438,8 @@ if ( !$cgi->param('preview') ) { } my @contact_checkboxes = ( - [ 'invoice' => { label => 'Invoice recipients' } ] + [ 'message' => { label => 'Message recipients' } ], + [ 'invoice' => { label => 'Invoice recipients' } ], ); foreach my $class (qsearch('contact_class', { disabled => '' })) { diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index 30162506f..0a43a82dd 100755 --- a/httemplate/search/cust_main.html +++ b/httemplate/search/cust_main.html @@ -140,8 +140,14 @@ my $menubar = []; if ( $FS::CurrentUser::CurrentUser->access_right('Bulk send customer notices') ) { + # URI::query_from does not support hashref + # results in: ...&contacts=HASH(0x55e16cb81da8)&... + my %query_hash = %search_hash; + delete $query_hash{contacts} + if exists $query_hash{contacts} && ref $query_hash{contacts}; + my $uri = new URI; - $uri->query_form( \%search_hash ); + $uri->query_form( \%query_hash ); my $query = $uri->query; push @$menubar, emt('Email a notice to these customers') => diff --git a/httemplate/view/cust_main/contacts_new.html b/httemplate/view/cust_main/contacts_new.html index 2209d30f3..9252b2197 100644 --- a/httemplate/view/cust_main/contacts_new.html +++ b/httemplate/view/cust_main/contacts_new.html @@ -10,6 +10,7 @@ <%$th%>Contact</TH> <%$th%>Email</TH> <%$th%>Send invoices</TH> + <%$th%>Send messages</TH> <%$th%>Self-service</TH> % foreach my $phone_type (@phone_type) { <%$th%><% $phone_type->typename |h %></TH> @@ -33,6 +34,7 @@ % 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 |
