diff options
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/misc/email-customers.html | 17 | ||||
-rw-r--r-- | httemplate/search/cust_msg.html | 10 | ||||
-rwxr-xr-x | httemplate/view/cust_main.cgi | 11 |
3 files changed, 27 insertions, 11 deletions
diff --git a/httemplate/misc/email-customers.html b/httemplate/misc/email-customers.html index 97ad8d8d4..d981aeae9 100644 --- a/httemplate/misc/email-customers.html +++ b/httemplate/misc/email-customers.html @@ -76,7 +76,7 @@ <SCRIPT> function areyousure(href) { - return confirm("Send this notice to <% $num_cust %> customers?"); + return confirm("Send this notice to <% ($num_cust > 1) ? "$num_cust customers" : '1 customer' %> ?"); } </SCRIPT> @@ -107,18 +107,22 @@ Template: <% include('/elements/tr-input-text.html', 'field' => 'from', 'label' => 'From:', + 'size' => 50, ) %> <% include('/elements/tr-input-text.html', 'field' => 'subject', 'label' => 'Subject:', + 'size' => 50, ) %> <TR> - <TD ALIGN="right" VALIGN="top">Message: </TD> - <TD><% include('/elements/htmlarea.html', 'field'=>'html_body') %></TD> + <TD ALIGN="right" VALIGN="top" STYLE="padding-top:3px">Message: </TD> + <TD><& '/elements/htmlarea.html', + 'field' => 'html_body', + 'width' => 600 &></TD> </TR> </TABLE> @@ -160,7 +164,7 @@ else { @search{keys %search} = map { /\0/ ? [ split /\0/, $_ ] : $_ } values %search; } -my $title = 'Send bulk customer notices'; +my $title = 'Send customer notices'; my $num_cust; my $from = $cgi->param('from') || ''; @@ -185,8 +189,9 @@ if ( $cgi->param('action') eq 'preview' ) { or die "template not found: ".$cgi->param('msgnum'); $sql_query->{'extra_sql'} .= ' LIMIT 1'; $sql_query->{'order_by'} = ''; - my $cust = qsearchs($sql_query)->cust_main; - my %message = $msg_template->prepare( 'cust_main' => $cust, 'preview' => 1 ); + my $object = qsearchs($sql_query); + my $cust = $object->cust_main; + my %message = $msg_template->prepare( 'cust_main' => $cust ); ($from, $subject, $html_body) = @message{'from', 'subject', 'html_body'}; } } diff --git a/httemplate/search/cust_msg.html b/httemplate/search/cust_msg.html index 7932ab3a2..64fae30bd 100644 --- a/httemplate/search/cust_msg.html +++ b/httemplate/search/cust_msg.html @@ -16,7 +16,9 @@ $date ? time2str('%Y-%m-%d %T',$_[0]->_date) : '' }, 'msgname', - 'env_to', + sub { + join('<BR>', split(/,\s*/, $_[0]->env_to) ) + }, 'status', sub { encode_entities($_[0]->error) }, ], @@ -83,7 +85,6 @@ my $sub_popup_link = sub { }; my %color = ( - 'prepared' => '0000FF', 'failed' => 'FF0000', 'sent' => '', ); @@ -104,11 +105,10 @@ include('/elements/input-date-field.html', include('/elements/select.html', 'field' => 'status', 'curr_value' => $cgi->param('status') || '', - 'options' => [ '', 'failed', 'sent', 'prepared' ], + 'options' => [ '', 'failed', 'sent', ], 'labels' => { '' => '(any)', 'failed' => 'failed', - 'sent' => 'sent', - 'prepared'=> 'prepared' }, + 'sent' => 'sent', }, ) . '</TD> <TD><INPUT type="submit" value="Search"></TD></TR> diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index a6c917f20..dcadf9912 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -97,6 +97,17 @@ function areyousure(href, message) { % $br=1; <A HREF="<% $p %>search/cust_event.html?custnum=<% $custnum %>"><% mt('View billing events for this customer') |h %></A> % } +% +% my $email_link = ($cust_main->invoicing_list_emailonly) && +% include('/elements/email-link.html', +% 'table' => 'cust_main', +% 'search_hash' => { 'custnum' => $custnum }, +% 'label' => 'Email a notice to this customer', +% ); +% if ( $email_link and $br ) { + | +% } +<% $email_link || '' %> % if ( $conf->config('cust_main-external_links') ) { <% $br++ ? ' | ' : '' %> |