From 7a486dea647f735a9a1d0381443218ad6affe6e1 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 16 Sep 2014 21:38:07 -0700 Subject: improve unsuspend behavior for packages on hold, #28508 --- httemplate/misc/cust_main-unsuspend.cgi | 10 +++++++++- httemplate/misc/unsuspend_cust.html | 26 ++++++++++++++++++++++++-- httemplate/view/cust_main/packages/status.html | 3 ++- 3 files changed, 35 insertions(+), 4 deletions(-) (limited to 'httemplate') diff --git a/httemplate/misc/cust_main-unsuspend.cgi b/httemplate/misc/cust_main-unsuspend.cgi index eb4a2c8..e8ac8d3 100755 --- a/httemplate/misc/cust_main-unsuspend.cgi +++ b/httemplate/misc/cust_main-unsuspend.cgi @@ -34,6 +34,10 @@ if($cgi->param('now_or_later')) { if($resume) { #warn "setting resume dates on custnum#$custnum\n"; my @pkgs = $cust_main->suspended_pkgs; + if (!$cgi->param('release_hold')) { + # then avoid packages that are on hold + @pkgs = grep { $_->get('setup') } @pkgs; + } @errors = grep {$_} map { $_->unsuspend( 'date' => $resume, ) } @pkgs; @@ -42,9 +46,13 @@ if($cgi->param('now_or_later')) { @errors = ("error parsing adjourn date: ".$cgi->param('adjourn')); } } -else { +else { # unsuspending now warn "unsuspending $cust_main"; @errors = $cust_main->unsuspend; + + if ( $cgi->param('release_hold') ) { + push @errors, $cust_main->release_hold; + } } my $error = join(' / ', @errors) if scalar(@errors); diff --git a/httemplate/misc/unsuspend_cust.html b/httemplate/misc/unsuspend_cust.html index 600eb26..4555a58 100644 --- a/httemplate/misc/unsuspend_cust.html +++ b/httemplate/misc/unsuspend_cust.html @@ -7,8 +7,7 @@

<% mt('Unsuspend this customer?') |h %> - +
+% if ( $on_hold_pkgs > 0 ) { + + + + +% } +% if ( $susp_pkgs == 0 ) { # then always release holds, or this will do nothing + +% }
@@ -26,6 +25,21 @@ STYLE="margin-left:auto; margin-right:auto"> } &>
+ /> + + + <% emt('Activate [quant,_1,on-hold package,on-hold packages]', $on_hold_pkgs) %> +