X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fservices.html;h=7dfc0049efa5f79dedae856a47522140c6f3d0fb;hb=5c6ae08373b08615c7ab9ffbb98eada0cfd2878f;hp=b66869174aaa6b06811cbd95b673825ad8a63545;hpb=cd5f247013247672191ddeb7c5b7345804e63146;p=freeside.git
diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html
index b66869174..7dfc0049e 100644
--- a/httemplate/view/cust_main/packages/services.html
+++ b/httemplate/view/cust_main/packages/services.html
@@ -3,28 +3,31 @@
% ###
-
+
-% foreach my $part_svc ( $cust_pkg->part_svc ) {
+% foreach my $part_svc ( $cust_pkg->part_svc(
+% 'summarize_size' => $opt{'cust_pkg-large_pkg_size'}
+% ) )
+% {
% 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
+% $opt{'cust_pkg-large_pkg_size'} <= $num_cust_svc ) { # summarize
+%
% my $href="${p}search/cust_pkg_svc.html?svcpart=".$part_svc->svcpart.
% ";pkgnum=".$cust_pkg->pkgnum;
- <% $part_svc->svc %>
+ <% $part_svc->svc |h %>
|
- (<% mt("view all [_1]", $cust_pkg->num_svcs) |h %>)
+ (<% mt("view all [_1]", $num_cust_svc) |h %>)
|
% my $hint = $hints{$part_svc->svcdb};
@@ -42,8 +45,9 @@ function clearhint_search_cust_svc(obj, str) {
% } #$hint
-% }
-% else { # don't summarize
+%
+% } else { # don't summarize
+%
% foreach my $cust_svc ( @{ $part_svc->cust_pkg_svc } ) {
% if ( $cust_pkg->getfield('cancel') > 0 ) {
<& /elements/tr-cust_svc_cancel.html,
@@ -70,10 +74,28 @@ function clearhint_search_cust_svc(obj, str) {
- <% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %>
+
+
+% if ( $opt{no_links} ) {
+ <% $part_svc->svc |h %>: <% $part_svc->num_avail %>
+ <% mt('Available') |h %>
+% } else {
+ <% 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 %>
+% && $part_svc->svcdb eq 'svc_phone'
+% && ! $opt{no_links}
+% )
+% {
+% if ( $part_svc->num_avail > 5 ) {
+% local $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 +120,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;
|