From 424ae31847c4fd44e6ed55ec275c8e668c7d2b51 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 10 Aug 2011 05:22:32 +0000 Subject: multiple DID provisioning, RT#13721 --- httemplate/view/cust_main/packages/services.html | 27 +++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html index 0c18f584e..8f3a028dd 100644 --- a/httemplate/view/cust_main/packages/services.html +++ b/httemplate/view/cust_main/packages/services.html @@ -73,7 +73,13 @@ function clearhint_search_cust_svc(obj, str) { <% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %> % if ( $curuser->access_right('Bulk provision customer service') % && $part_svc->svcdb eq 'svc_phone' ) { -
<% mt('Browse Received DID Inventory') |h %> +% if ( $part_svc->num_avail > 5 ) { +% $opt{'bulk'} = 1; +
<% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %> +% } +% #XXX if there's orders for this customer { +
<% mt('Browse Received DID Inventory') |h %> +% #} % } @@ -98,33 +104,38 @@ my $conf = new FS::Conf; sub svc_provision_link { my ($cust_pkg, $part_svc, $opt, $curuser) = @_; + ( my $svc_nbsp = $part_svc->svc ) =~ s/\s+/ /g; my $num_avail = $part_svc->num_avail; - my $pkgnum_svcpart = "pkgnum=". $cust_pkg->pkgnum. ';'. - "svcpart=". $part_svc->svcpart; + + my $query = "pkgnum=". $cust_pkg->pkgnum. ';'. + "svcpart=". $part_svc->svcpart; + $query .= ';bulk=1' if $opt->{bulk}; + my $url; if ( $part_svc->svcdb eq 'svc_external' #could be generalized && $opt->{'svc_external-skip_manual'} ) { - $url = "${p}edit/process/". $part_svc->svcdb. ".cgi?$pkgnum_svcpart"; + $url = "${p}edit/process/". $part_svc->svcdb. ".cgi?$query"; } else { $url = svc_url( 'm' => $m, 'action' => 'edit', 'part_svc' => $part_svc, - 'query' => $pkgnum_svcpart, + 'query' => $query, ); } + my $action = $opt->{bulk} ? 'Bulk provision' : 'Provision'; + my $link = qq!!. - emt("Provision [_1] ([_2])",$svc_nbsp,$num_avail).''; + emt("$action [_1] ([_2])",$svc_nbsp,$num_avail).''; if ( $opt->{'legacy_link'} && $curuser->access_right('View/link unlinked services') ) { $link .= '
'. - qq!!. + qq!!. emt("Link to legacy [_1] ([_2])",$svc_nbsp,$num_avail).''; } $link; -- cgit v1.2.1