diff options
author | jeff <jeff> | 2007-06-26 15:37:19 +0000 |
---|---|---|
committer | jeff <jeff> | 2007-06-26 15:37:19 +0000 |
commit | c8f56207c0c8ee26b62824064e59d5952c20f70b (patch) | |
tree | fb0ebf505a870db499ae7517a1beae6c72febe23 /httemplate | |
parent | bd8582f48b90a63c17a568e4a395a82fe4f9277e (diff) |
suspend later just like expire (#1487)
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/edit/REAL_cust_pkg.cgi | 11 | ||||
-rwxr-xr-x | httemplate/edit/process/REAL_cust_pkg.cgi | 1 | ||||
-rwxr-xr-x | httemplate/misc/cancel_pkg.html | 9 | ||||
-rwxr-xr-x | httemplate/misc/process/cancel_pkg.html | 9 | ||||
-rwxr-xr-x | httemplate/search/cust_pkg.cgi | 7 | ||||
-rwxr-xr-x | httemplate/search/report_cust_pkg.html | 7 | ||||
-rwxr-xr-x | httemplate/view/cust_main/packages.html | 20 |
7 files changed, 49 insertions, 15 deletions
diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi index 69bbb9b22..7a9e030e9 100755 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ b/httemplate/edit/REAL_cust_pkg.cgi @@ -50,8 +50,9 @@ % % %#print info -%my($susp,$cancel,$expire)=( +%my($susp,$adjourn,$cancel,$expire)=( % $cust_pkg->getfield('susp'), +% $cust_pkg->getfield('adjourn'), % $cust_pkg->getfield('cancel'), % $cust_pkg->getfield('expire'), %); @@ -134,6 +135,14 @@ <IMG SRC="../images/calendar.png" ID="bill_button" STYLE="cursor: pointer" TITLE="Select date"> </TD> </TR> + <TR> + <TD ALIGN="right">Adjournment date</TD> + <TD> + <INPUT TYPE="text" NAME="adjourn" SIZE=32 ID="adjourn_text" VALUE="<% ( $adjourn ? time2str($format, $adjourn) : "" ) %>"> + <IMG SRC="../images/calendar.png" ID="adjourn_button" STYLE="cursor: pointer" TITLE="Select date"> + <BR><FONT SIZE=-1>(will <b>suspend</b> this package when the date is reached)</FONT> + </TD> + </TR> % if ( $susp ) { <TR> diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi index 26e234fb0..9255672c0 100755 --- a/httemplate/edit/process/REAL_cust_pkg.cgi +++ b/httemplate/edit/process/REAL_cust_pkg.cgi @@ -7,6 +7,7 @@ %$hash{'bill'} = $cgi->param('bill') ? str2time($cgi->param('bill')) : ''; %$hash{'last_bill'} = % $cgi->param('last_bill') ? str2time($cgi->param('last_bill')) : ''; +%$hash{'adjourn'} = $cgi->param('adjourn') ? str2time($cgi->param('adjourn')) : ''; %$hash{'expire'} = $cgi->param('expire') ? str2time($cgi->param('expire')) : ''; % %my $new; diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html index e61000618..b085d2281 100755 --- a/httemplate/misc/cancel_pkg.html +++ b/httemplate/misc/cancel_pkg.html @@ -23,9 +23,9 @@ <% ucfirst($method) . " $pkgnum: " .$part_pkg->pkg. ' - ' .$part_pkg->comment %> <% ntable("#cccccc", 2) %> -% if ($method eq 'expire') { +% if ($method eq 'expire' || $method eq 'adjourn') { <TR> - <TD>Cancel package on </TD> + <TD><% $submit =~ /^(\w*)\s/ %> package on </TD> <TD><INPUT TYPE="text" NAME="date" ID="expire_date" VALUE="<% $date %>"> <IMG SRC="<% $p %>images/calendar.png" ID="expire_button" STYLE="cursor:pointer" TITLE="Select date"> <BR><I>m/d/y</I> @@ -77,7 +77,10 @@ if ($method eq 'cancel') { $submit = "Cancel Later"; }elsif ($method eq 'suspend') { $class = 'S'; - $submit = "Suspend"; + $submit = "Suspend Now"; +}elsif ($method eq 'adjourn') { + $class = 'S'; + $submit = "Suspend Later"; }else{ die "illegal query ". $cgi->keywords; } diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html index cd533be10..50b111093 100755 --- a/httemplate/misc/process/cancel_pkg.html +++ b/httemplate/misc/process/cancel_pkg.html @@ -1,7 +1,7 @@ <%init> #untaint method my $method = $cgi->param('method'); -$method =~ /^(cancel|expire|suspend)$/ || die "Illegal method"; +$method =~ /^(cancel|expire|suspend|adjourn)$/ || die "Illegal method"; $method = $1; #untaint pkgnum @@ -15,7 +15,7 @@ $reasonnum =~ /^(-?\d+)$/ || die "Illegal reasonnum"; $reasonnum = $1; my $date = time; -if ($method eq 'expire'){ +if ($method eq 'expire' || $method eq 'adjourn'){ #untaint date $date = $cgi->param('date'); str2time($cgi->param('date')) =~ /^(\d+)$/ || die "Illegal date"; @@ -47,9 +47,9 @@ if ($reasonnum == -1) { } unless ($error) { - if ($method eq 'expire'){ + if ($method eq 'expire' || $method eq 'adjourn'){ my %hash = $cust_pkg->hash; - $hash{'expire'}=$date; + $hash{$method}=$date; my $new = new FS::cust_pkg (\%hash); $error = $new->replace($cust_pkg, 'reason' => $reasonnum); }else{ @@ -68,6 +68,7 @@ $dbh->commit or die $dbh->errstr if $oldAutoCommit; my %past = ( 'cancel' => 'cancelled', 'expire' => 'expired', 'suspend' => 'suspended', + 'adjourn' => 'adjourned', ); </%init> <% header("Package $past{$method}") %> diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index 4fd5e9d45..941a2e76c 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -12,6 +12,7 @@ 'Setup', 'Last bill', 'Next bill', + 'Adjourn', 'Susp.', 'Expire', 'Cancel', @@ -43,7 +44,7 @@ #sub { time2str('%b %d %Y', shift->expire); }, #sub { time2str('%b %d %Y', shift->get('cancel')); }, ( map { time_or_blank($_) } - qw( setup last_bill bill susp expire cancel ) ), + qw( setup last_bill bill adjourn susp expire cancel ) ), \&FS::UI::Web::cust_fields, #sub { '<table border=0 cellspacing=0 cellpadding=0 STYLE="border:none">'. @@ -210,14 +211,14 @@ my $orderby = ''; #false laziness w/report_cust_pkg.html my %disable = ( 'all' => {}, - 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, }, + 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, }, 'active' => { 'susp'=>1, 'cancel'=>1 }, 'suspended' => { 'cancel' => 1 }, 'cancelled' => {}, '' => {}, ); -foreach my $field (qw( setup last_bill bill susp expire cancel )) { +foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) { my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field); diff --git a/httemplate/search/report_cust_pkg.html b/httemplate/search/report_cust_pkg.html index 1412816c9..57180c18e 100755 --- a/httemplate/search/report_cust_pkg.html +++ b/httemplate/search/report_cust_pkg.html @@ -26,7 +26,7 @@ if ( what.options[what.selectedIndex].value == '<% $status %>' ) { -% foreach my $field (qw( setup last_bill bill susp expire cancel )) { +% foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) { % if ( $disable{$status}->{$field} ) { what.form.<% $field %>_beginning_text.disabled = true; @@ -68,7 +68,7 @@ ) %> -% foreach my $field (qw( setup last_bill bill susp expire cancel )) { +% foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) { <TR> <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD> @@ -116,6 +116,7 @@ my %label = ( 'setup' => 'Setup', 'last_bill' => 'Last bill', 'bill' => 'Next bill', + 'adjourn' => 'Adjourns', 'susp' => 'Suspended', 'expire' => 'Expires', 'cancel' => 'Cancelled', @@ -124,7 +125,7 @@ my %label = ( #false laziness w/cust_pkg.cgi my %disable = ( 'all' => {}, - 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, }, + 'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, }, 'active' => { 'susp'=>1, 'cancel'=>1 }, 'suspended' => { 'cancel' => 1 }, 'cancelled' => {}, diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 98acb8685..5890726ae 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -299,6 +299,13 @@ Current packages <% pkg_datestr($cust_pkg, 'bill', $conf) %> </TR> % } +% if ( $cust_pkg->get('adjourn') ) { + + <TR> + <TD WIDTH="<%$width%>" ALIGN="right">Adjourns </TD> + <% pkg_datestr($cust_pkg, 'adjourn', $conf) %> + </TR> +% } % if ( $cust_pkg->get('expire') ) { <TR> @@ -315,6 +322,10 @@ Current packages ( <% pkg_suspend_link($cust_pkg) %> ) % } +% if ( $curuser->access_right('Suspend customer package later') ) { + + ( <% pkg_adjourn_link($cust_pkg) %> ) +% } % if ( $curuser->access_right('Cancel customer package immediately') ) { ( <% pkg_cancel_link($cust_pkg) %> ) @@ -489,7 +500,7 @@ Current packages %sub pkg_change_link { pkg_link('misc/change_pkg', 'Change package', @_ ); } % %sub pkg_suspend_link { pkg_popup_link( 'misc/cancel_pkg.html?method=suspend', -% 'Suspend', +% 'Suspend now', % 'Suspend', % @_ % ); @@ -505,6 +516,13 @@ Current packages % @_ % ); % } +%sub pkg_adjourn_link { pkg_popup_link( 'misc/cancel_pkg.html?method=adjourn', +% 'Suspend later', +% 'Adjourn', +% @_ +% ); +% } +% %sub pkg_expire_link { pkg_popup_link( 'misc/cancel_pkg.html?method=expire', % 'Cancel later', % 'Expire', #"Cancel package $num later" |