diff options
Diffstat (limited to 'httemplate')
| -rwxr-xr-x | httemplate/browse/part_pkg-fcc.html | 9 | ||||
| -rw-r--r-- | httemplate/edit/process/bulk-part_pkg-fcc.html | 12 | ||||
| -rw-r--r-- | httemplate/elements/change_history_common.html | 5 | ||||
| -rw-r--r-- | httemplate/elements/popup_link_onclick.html | 8 | ||||
| -rw-r--r-- | httemplate/misc/email-customers.html | 16 | ||||
| -rw-r--r-- | httemplate/search/elements/checkbox-foot.html | 9 | ||||
| -rw-r--r-- | httemplate/search/elements/cust_main_dayranges.html | 53 | ||||
| -rwxr-xr-x | httemplate/search/report_receivables.cgi | 1 | ||||
| -rw-r--r-- | httemplate/view/cust_main/packages/status.html | 12 |
9 files changed, 105 insertions, 20 deletions
diff --git a/httemplate/browse/part_pkg-fcc.html b/httemplate/browse/part_pkg-fcc.html index bdfb99a59..69e7d8f31 100755 --- a/httemplate/browse/part_pkg-fcc.html +++ b/httemplate/browse/part_pkg-fcc.html @@ -197,6 +197,13 @@ my $html_form = qq!<FORM ACTION="${p}edit/process/bulk-part_pkg-fcc.html" METHOD ' ) <BR><BR>'; +# pass the page selection through so we can jump back to the current spot +if ( $cgi->param('maxrecords') =~ /^(\d+)$/ ) { + $html_form .= qq!<INPUT TYPE="hidden" NAME="maxrecords" VALUE="$1">!; +} +if ( $cgi->param('offset') =~ /^(\d+)$/ ) { + $html_form .= qq!<INPUT TYPE="hidden" NAME="offset" VALUE="$1">!; +} # restore this only after creating $html_form $cgi->param('classnum', $classnum) if length($classnum); @@ -228,7 +235,7 @@ my @menubar = } function filter_change() { - window.location = '! . $cgi->self_url . qq!?classnum=' + window.location = '<% $cgi->self_url %>?classnum=' + document.getElementById('classnum').value; } </script> diff --git a/httemplate/edit/process/bulk-part_pkg-fcc.html b/httemplate/edit/process/bulk-part_pkg-fcc.html index 8ef330829..d060a242e 100644 --- a/httemplate/edit/process/bulk-part_pkg-fcc.html +++ b/httemplate/edit/process/bulk-part_pkg-fcc.html @@ -17,7 +17,7 @@ % } <% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?redirect='.$session) %> % } else { -<% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?classnum='.$classnum.$jump) %> +<% $cgi->redirect($dest) %> % } <%init> my $curuser = $FS::CurrentUser::CurrentUser; @@ -38,10 +38,14 @@ foreach my $param ($cgi->param) { $error{$pkgpart} = $error if $error; } -my $classnum = $cgi->param('classnum'); +my $dest = $fsurl.'browse/part_pkg-fcc.html?'; +foreach (qw(classnum maxrecords offset)) { + if ( $cgi->param($_) =~ /^(\d+)$/ ) { + $dest .= "$_=$1;"; + } +} -my $jump = ''; if ( $cgi->param('jump') =~ /^pkgpart(\d+)$/ ) { - $jump = '#'.$1; + $dest .= "#$1"; } </%init> diff --git a/httemplate/elements/change_history_common.html b/httemplate/elements/change_history_common.html index 9fc85aa53..2d2c4c0be 100644 --- a/httemplate/elements/change_history_common.html +++ b/httemplate/elements/change_history_common.html @@ -191,7 +191,10 @@ my %h_table_labelsub = ( my $discounts = {}; my $discount_descripsub = sub { my($item) = @_; - $pkgpart{$item->pkgpart} ||= $item->part_pkg->pkg; + $pkgpart{$item->pkgpart} ||= qsearchs({ + 'table' => 'part_pkg', + 'hashref' => {'pkgpart' => $item->pkgpart} + })->pkg; my $dnum = $item->discountnum; $discounts->{$dnum} ||= qsearchs({ 'table'=>'discount', diff --git a/httemplate/elements/popup_link_onclick.html b/httemplate/elements/popup_link_onclick.html index 961f62336..5173115a5 100644 --- a/httemplate/elements/popup_link_onclick.html +++ b/httemplate/elements/popup_link_onclick.html @@ -8,6 +8,9 @@ Example: #required 'action' => 'content.html', # uri for content of popup + + #alternately, use instead of action + 'js_action' => 'url', # javascript variable or expression #strongly recommended 'actionlabel => 'You clicked', # popup title @@ -47,7 +50,8 @@ if (ref($_[0]) eq 'HASH') { $params = { @_ }; } -$action = $params->{'action'} if exists $params->{'action'}; +$action = q(') . $params->{'action'} . q(') if exists $params->{'action'}; +$action = $params->{'js_action'} if exists $params->{'js_action'}; $actionlabel = $params->{'actionlabel'} if exists $params->{'actionlabel'}; $width = $params->{'width'} if exists $params->{'width'}; $height = $params->{'height'} if exists $params->{'height'}; @@ -61,7 +65,7 @@ $scrolling = $params->{'scrolling'} if exists $params->{'scrolling'}; my $popup_name = 'popup-'.time. "-$$-". rand() * 2**32; my $onclick = - "overlib( OLiframeContent('$action', $width, $height, '$popup_name', 0, '$scrolling' ), ". + "overlib( OLiframeContent($action, $width, $height, '$popup_name', 0, '$scrolling' ), ". "CAPTION, '$actionlabel', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, ". "DRAGGABLE, CLOSECLICK, ". "BGCOLOR, '$color', CGCOLOR, '$color', CLOSETEXT, '$closetext'". diff --git a/httemplate/misc/email-customers.html b/httemplate/misc/email-customers.html index c74c15b1e..83e86158f 100644 --- a/httemplate/misc/email-customers.html +++ b/httemplate/misc/email-customers.html @@ -1,4 +1,9 @@ +% if ($popup) { +<% include('/elements/header-popup.html', $title) %> +% } else { <% include('/elements/header.html', $title) %> +% } + <FORM NAME="OneTrueForm" ACTION="email-customers.html" METHOD="POST"> <INPUT TYPE="hidden" NAME="table" VALUE="<% $table %>"> @@ -7,6 +12,8 @@ %# multi-valued search params. We are no longer in search context, so we %# pack the search into a Storable string for later use. <INPUT TYPE="hidden" NAME="search" VALUE="<% encode_base64(nfreeze(\%search)) %>"> +<INPUT TYPE="hidden" NAME="popup" VALUE="<% $popup %>"> +<INPUT TYPE="hidden" NAME="url" VALUE="<% $url | h %>"> % if ( $cgi->param('action') eq 'send' ) { @@ -16,7 +23,7 @@ 'OneTrueForm', [ qw( search table from subject html_body text_body msgnum ) ], 'process/email-customers.html', - { 'message' => "Notice sent" }, #would be nice to show #, but.. + $pdest, ) %> @@ -159,13 +166,18 @@ my $conf = FS::Conf->new; my $table = $cgi->param('table') or die "'table' required"; my $agent_virt_agentnum = $cgi->param('agent_virt_agentnum') || ''; +my $popup = $cgi->param('popup'); +my $url = $cgi->param('url'); +my $pdest = { 'message' => "Notice sent" }; +$pdest->{'url'} = $cgi->param('url') if $url; + my %search; if ( $cgi->param('search') ) { %search = %{ thaw(decode_base64($cgi->param('search'))) }; } else { %search = $cgi->Vars; - delete $search{$_} for qw( action table from subject html_body text_body ); + delete $search{$_} for qw( action table from subject html_body text_body popup url ); # FS::$table->search is expected to know which parameters might be # multi-valued, and to accept scalar values for them also. No good # solution to this since CGI can't tell whether a parameter _might_ diff --git a/httemplate/search/elements/checkbox-foot.html b/httemplate/search/elements/checkbox-foot.html index cc4bac69b..c47009425 100644 --- a/httemplate/search/elements/checkbox-foot.html +++ b/httemplate/search/elements/checkbox-foot.html @@ -75,6 +75,15 @@ function setAll(setTo) { checkboxes[i].checked = setTo; } } +function toCGIString() { + var out = ''; + for (var i = 0; i < checkboxes.length; i++) { + if (checkboxes[i].checked) { + out += '&' + checkboxes[i].name + '=' + checkboxes[i].value; + } + } + return out; +} </SCRIPT> <%init> my %opt = @_; diff --git a/httemplate/search/elements/cust_main_dayranges.html b/httemplate/search/elements/cust_main_dayranges.html index 5dbece861..e5b1f478c 100644 --- a/httemplate/search/elements/cust_main_dayranges.html +++ b/httemplate/search/elements/cust_main_dayranges.html @@ -5,6 +5,7 @@ Example: <& elements/cust_main_dayranges.html, 'title' => 'Accounts Receivable Aging Summary', 'range_sub' => $mysub, + 'email_link' => 1, #adds an action column with an email link if true &> my $mysub = sub { @@ -20,6 +21,7 @@ Example: 'query' => $sql_query, 'count_query' => $count_sql, 'header' => [ + @act_blank, @cust_header, '0-30', '30-60', @@ -29,6 +31,7 @@ Example: @pay_head, ], 'footer' => [ + @act_blank, 'Total', ( map '',( 1 .. $#cust_header ),), sprintf( $money_char.'%.2f', @@ -44,6 +47,7 @@ Example: ('') x @pay_labels, ], 'fields' => [ + @act_fields, FS::UI::Web::cust_fields_subs(), format_rangecol('0_30'), format_rangecol('30_60'), @@ -53,6 +57,7 @@ Example: @pay_labels, ], 'links' => [ + @act_blank, ( map { $_ ne 'Cust. Status' ? $clink : '' } @cust_header ), @@ -63,32 +68,40 @@ Example: '', @pay_links, ], - 'align' => FS::UI::Web::cust_aligns(). + 'align' => $act_align. + FS::UI::Web::cust_aligns(). 'rrrrr'. ('c' x @pay_labels), - 'size' => [ ( map '', @cust_header ), + 'size' => [ + @act_blank, + ( map '', @cust_header ), #'-1', '', '', '', '', '', ], - '', '', '', '', '', '', + '', '', '', '', '', ( map '', @pay_labels ), - ], - 'style' => [ FS::UI::Web::cust_styles(), + ], + 'style' => [ + @act_blank, + FS::UI::Web::cust_styles(), #'b', '', '', '', '', 'b', ], '', '', '', '', 'b', ( map '', @pay_labels ), ], - 'xls_format' => [ (map '', FS::UI::Web::cust_styles), + 'xls_format' => [ + @act_blank, + (map '', FS::UI::Web::cust_styles), '', '', '', '', { bold => 1 }, ], 'color' => [ + @act_blank, FS::UI::Web::cust_colors(), '', '', '', '', '', - '', ( map '', @pay_labels ), ], + 'html_foot' => $html_foot, %opt, &> <%init> @@ -235,6 +248,32 @@ if($opt{'payment_links'} && $curuser->access_right('Process payment') && @payby) @payby ); } +my (@act_blank, @act_fields, $act_align, $html_foot); +if (delete($opt{'email_checkboxes'})) { + my $email_link = q!var url = toCGIString(); !; + $email_link .= q/if (!url) { alert('No customers selected'); return false; }; /; + $email_link .= q!url = '!; + $email_link .= "${p}misc/email-customers.html?table=cust_main"; + $email_link .= q!' + url + '&popup=1&url=javascript%3Awindow.top.location.reload%28%29%3B'; !; + $email_link .= include('/elements/popup_link_onclick.html', + 'js_action' => 'url', + 'actionlabel' => 'Send Customer Email', + 'width' => '900', + 'height' => '500', + ); + $html_foot = include('checkbox-foot.html', + label => 'Email selected customers', + onclick => $email_link, + ); + push @act_fields, sub { + my $row = shift; + my $custnum = $row->custnum; + qq!<input type="checkbox" name="custnum" value="$custnum">!; + }; + $act_align = 'l'; + push @act_blank, ''; +} + </%init> <%once> diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi index 9c5c0e2d9..adbbc859c 100755 --- a/httemplate/search/report_receivables.cgi +++ b/httemplate/search/report_receivables.cgi @@ -2,6 +2,7 @@ 'title' => emt('Accounts Receivable Aging Summary'), 'range_sub' => \&balance, 'payment_links' => 1, + 'email_checkboxes' => 1, &> <%init> diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index f760d6fcc..36419646c 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -54,9 +54,15 @@ <% pkg_status_row( $cust_pkg, emt('On Hold'), '', 'color'=>'7E0079', %opt ) %> % } else { #status: suspended - - <% pkg_status_row( $cust_pkg, emt('Suspended'), 'susp', 'color'=>'FF9900', %opt ) %> -% my $cpr = $cust_pkg->last_cust_pkg_reason('susp'); +% my ($cpr,$susplabel); +% if ($cust_pkg->is_status_delay_cancel) { +% $cpr = $cust_pkg->last_cust_pkg_reason('expire'); +% $susplabel = 'Suspended (Cancelled)'; +% } else { +% $cpr = $cust_pkg->last_cust_pkg_reason('susp'); +% $susplabel = 'Suspended'; +% } + <% pkg_status_row( $cust_pkg, emt($susplabel), 'susp', 'color'=>'FF9900', %opt ) %> <% pkg_reason_row( $cust_pkg, $cpr, 'color' => 'FF9900', %opt ) %> % } |
