X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fservices.html;h=5fe41a38cc803eb37aa48115b20bdd79b77fb942;hb=4d364d506c717b1b73858dd287413d3788ec586d;hp=7dfc0049efa5f79dedae856a47522140c6f3d0fb;hpb=5c6ae08373b08615c7ab9ffbb98eada0cfd2878f;p=freeside.git
diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html
index 7dfc0049e..5fe41a38c 100644
--- a/httemplate/view/cust_main/packages/services.html
+++ b/httemplate/view/cust_main/packages/services.html
@@ -10,13 +10,15 @@ function clearhint_search_cust_svc(obj, str) {
}
-% foreach my $part_svc ( $cust_pkg->part_svc(
-% 'summarize_size' => $opt{'cust_pkg-large_pkg_size'}
-% ) )
-% {
-
+% foreach my $part_svc (
+% $cust_pkg->part_svc(
+% 'summarize_size' => $opt{'cust_pkg-large_pkg_size'},
+% 'hide_discontinued' => $opt{'cust_pkg-hide_discontinued-part_svc'},
+% )
+% ) {
+%
% my $num_cust_svc = $cust_pkg->num_cust_svc( $part_svc->svcpart );
-
+%
% if ( $opt{'cust_pkg-large_pkg_size'} > 0 and
% $opt{'cust_pkg-large_pkg_size'} <= $num_cust_svc ) { # summarize
%
@@ -91,6 +93,8 @@ function clearhint_search_cust_svc(obj, str) {
% {
% if ( $part_svc->num_avail > 5 ) {
% local $opt{'bulk'} = 1;
+% local $opt{'svc_phone_bulk_provision_simple'} = $svc_phone_bulk_provision_simple;
+% local $opt{'num_avail'} = $part_svc->num_avail;
<% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %>
% }
% #XXX if there's orders for this customer {
@@ -114,9 +118,9 @@ my %opt = @_;
my $bgcolor = $opt{'bgcolor'};
my $cust_pkg = $opt{'cust_pkg'};
my $part_pkg = $opt{'part_pkg'};
-my $curuser = $FS::CurrentUser::CurrentUser;
+my $svc_phone_bulk_provision_simple = $opt{'svc_phone-bulk_provision_simple'};
-my $conf = new FS::Conf;
+my $curuser = $FS::CurrentUser::CurrentUser;
sub svc_provision_link {
my ($cust_pkg, $part_svc, $opt, $curuser) = @_;
@@ -133,6 +137,12 @@ sub svc_provision_link {
&& $opt->{'svc_external-skip_manual'}
) {
$url = "${p}edit/process/". $part_svc->svcdb. ".cgi?$query";
+ } elsif ( $part_svc->svcdb eq 'svc_phone' && $opt->{bulk}
+ && $opt->{svc_phone_bulk_provision_simple}
+ )
+ {
+ $query .= ';num_avail='. $opt->{num_avail};
+ $url = "${p}edit/bulk-svc_phone.html?$query";
} else {
$url = svc_url(
'm' => $m,
@@ -146,14 +156,17 @@ sub svc_provision_link {
my $link = qq!!.
emt("$action [_1] ([_2])",$svc_nbsp,$num_avail).'';
+
if ( $opt->{'legacy_link'}
&& $curuser->access_right('View/link unlinked services')
+ && ! $opt{bulk}
)
{
$link .= '
'.
qq!!.
emt("Link to legacy [_1] ([_2])",$svc_nbsp,$num_avail).'';
}
+
$link;
}