X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fservices.html;h=fa193d636305847b0857848b57f0ae036570aaad;hp=4151e0649227ffd0003d844c7f1cff9b688d9957;hb=0b425dc3033774ab661a348d8ac729a70be7f794;hpb=512ea5070953363ee2c90ecef5cf937aeaee0906 diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html index 4151e0649..fa193d636 100644 --- a/httemplate/view/cust_main/packages/services.html +++ b/httemplate/view/cust_main/packages/services.html @@ -3,25 +3,30 @@ % ### - +
-% 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'} <= $num_cust_svc ) { -% # summarize +% $opt{'cust_pkg-large_pkg_size'} <= $num_cust_svc ) { # summarize +% % } #$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,16 +76,43 @@ function clearhint_search_cust_svc(obj, str) { @@ -98,9 +131,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) = @_; @@ -117,6 +150,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, @@ -130,14 +169,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; }
% 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]", $num_cust_svc) |h %>) @@ -42,8 +47,9 @@ 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' ) { +% && $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 { +% if ( +% qsearch({ +% 'table' => 'did_order', +% 'hashref' => { 'custnum' => $cust_pkg->custnum }, +% 'extra_sql' => ' LIMIT 1' +% }) +% || +% qsearch({ +% 'table' => 'did_order_item', +% 'hashref' => { 'custnum' => $cust_pkg->custnum }, +% 'addl_from' => ' INNER JOIN did_order ON did_order_item.ordernum = did_order.ordernum', +% 'extra_sql' => ' LIMIT 1' +% }) +% ) {
<% mt('Browse Received DID Inventory') |h %> -% #} +% } % }