X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fservices.html;h=5fe41a38cc803eb37aa48115b20bdd79b77fb942;hb=b7cf1606a66cca95e3540f803ffa66d223f23a40;hp=1e636ad4ef36c3afdba91f7602b739b28b9b35d0;hpb=b65b8096089410001dfbcd35f9a56f9405b9f5f1;p=freeside.git
diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html
index 1e636ad4e..5fe41a38c 100644
--- a/httemplate/view/cust_main/packages/services.html
+++ b/httemplate/view/cust_main/packages/services.html
@@ -3,27 +3,40 @@
% ###
-
+
-% foreach my $part_svc ( $cust_pkg->part_svc ) {
-
+% 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'} <= $cust_pkg->num_svcs ) {
-% # 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 %>
- (view all <% $cust_pkg->num_svcs %>)
+ <% $part_svc->svc |h %>
+ |
+
+ (<% mt("view all [_1]", $num_cust_svc) |h %>)
+ |
+
% my $hint = $hints{$part_svc->svcdb};
% if ( $hint ) {
-
+
+ |
+
-% } #$hint
|
-% }
-% else { # don't summarize
+% } #$hint
+%
+% } else { # don't summarize
+%
% foreach my $cust_svc ( @{ $part_svc->cust_pkg_svc } ) {
% if ( $cust_pkg->getfield('cancel') > 0 ) {
- <% include('/elements/tr-cust_svc_cancel.html',
+ <& /elements/tr-cust_svc_cancel.html,
%opt,
'part_svc' => $part_svc,
'cust_svc' => $cust_svc,
'cust_pkg' => $cust_pkg,
- ) %>
+ &>
% }
% else {
- <% include('/elements/tr-cust_svc.html',
+ <& /elements/tr-cust_svc.html,
%opt,
'part_svc' => $part_svc,
'cust_svc' => $cust_svc,
'cust_pkg' => $cust_pkg,
- ) %>
+ &>
% } #if cancel > 0
% } #foreach $cust_svc
% } #if summarizing
@@ -62,7 +76,31 @@ 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'
+% && ! $opt{no_links}
+% )
+% {
+% 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 {
+ <% mt('Browse Received DID Inventory') |h %>
+% #}
+% }
|
@@ -80,52 +118,65 @@ 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) = @_;
- ( my $svc_nbsp = $part_svc->svc ) =~ s/\s+/ /g;
+
+ ( 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";
+ } 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,
'action' => 'edit',
'part_svc' => $part_svc,
- 'query' => $pkgnum_svcpart,
+ 'query' => $query,
);
- #$url = "${p}edit/$svcpart->{svcdb}.cgi?$pkgnum_svcpart";
}
+ my $action = $opt->{bulk} ? 'Bulk provision' : 'Provision';
+
my $link = qq!!.
- "Provision $svc_nbsp ($num_avail)";
+ emt("$action [_1] ([_2])",$svc_nbsp,$num_avail).'';
+
if ( $opt->{'legacy_link'}
&& $curuser->access_right('View/link unlinked services')
+ && ! $opt{bulk}
)
{
$link .= ' '.
- qq!!.
- "Link to legacy $svc_nbsp ($num_avail)";
+ qq!!.
+ emt("Link to legacy [_1] ([_2])",$svc_nbsp,$num_avail).'';
}
+
$link;
}
my %hints = (
-svc_acct => '(user or email)',
-svc_domain => '(domain)',
-svc_broadband => '(ip or mac)',
-svc_forward => '(email)',
-svc_phone => '(phone)',
-svc_pbx => '(phone)',
+svc_acct => emt('(user or email)'),
+svc_domain => emt('(domain)'),
+svc_broadband => emt('(ip or mac)'),
+svc_forward => emt('(email)'),
+svc_phone => emt('(phone)'),
+svc_pbx => emt('(phone)'),
);
%init>
|