X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fservices.html;h=4151e0649227ffd0003d844c7f1cff9b688d9957;hb=e6f70733037e9295be95cd27791356ba94177968;hp=512efccc435b8362e79f4b8ccb973cd430e9b61d;hpb=0a51b87d75f8c93de863f729ef1ca568ca227e32;p=freeside.git diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html index 512efccc4..4151e0649 100644 --- a/httemplate/view/cust_main/packages/services.html +++ b/httemplate/view/cust_main/packages/services.html @@ -10,21 +10,28 @@ function clearhint_search_cust_svc(obj, str) { } -% #foreach my $svcpart (sort {$a->{svcpart} <=> $b->{svcpart}} @{$pkg->{svcparts}}) { % foreach my $part_svc ( $cust_pkg->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 ) { +% $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 %> + + + (<% mt("view all [_1]", $num_cust_svc) |h %>) + + % my $hint = $hints{$part_svc->svcdb}; % if ( $hint ) { -
+ + +
@@ -32,70 +39,30 @@ function clearhint_search_cust_svc(obj, str) {
-% } #$hint +% } #$hint % } -% else { +% else { # don't summarize % foreach my $cust_svc ( @{ $part_svc->cust_pkg_svc } ) { - - - <% FS::UI::Web::svc_link($m, $part_svc, $cust_svc) %> - <% FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) %> - <% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %> - - - - - - <% $cust_svc->overlimit ? "Overlimit: ". time2str('%b %o %Y' . ($opt{'cust_pkg-display_times'} ? ' %l:%M %P' : ''), $cust_svc->overlimit) : '' %> - - - - - - -% if ( $curuser->access_right('Recharge customer service') -% && $part_svc->svcdb eq 'svc_acct' -% && ( $cust_svc->svc_x->seconds ne '' -% || $cust_svc->svc_x->upbytes ne '' -% || $cust_svc->svc_x->downbytes ne '' -% || $cust_svc->svc_x->totalbytes ne '' -% ) -% ) { - ( <%svc_recharge_link($cust_svc)%> ) -% } - - - - -% my $ip_addr = $cust_svc->svc_x->ip_addr; - -% if ( $part_svc->svcdb eq 'svc_broadband' ) { - ( <% include('/elements/popup_link-ping.html', 'ip'=> $ip_addr ) %> ) - -% } - -% my $manage_link = $opt{'svc_broadband-manage_link'}; -% if ( $manage_link && $part_svc->svcdb eq 'svc_broadband' ) { -% my $svc_manage_link = eval(qq("$manage_link")); - Manage Device ) - -% } - -% if ( $curuser->access_right('Unprovision customer service') ) { - ( <%svc_unprovision_link($cust_svc)%> ) -% } - -% if ( $part_svc->svcdb eq 'svc_pbx' && $opt{'maestro-status_test'} ){ - Test maestro status ) -% } - - - +% if ( $cust_pkg->getfield('cancel') > 0 ) { + <& /elements/tr-cust_svc_cancel.html, + %opt, + 'part_svc' => $part_svc, + 'cust_svc' => $cust_svc, + 'cust_pkg' => $cust_pkg, + &> +% } +% else { + <& /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 % if ( ! $cust_pkg->get('cancel') % && $curuser->access_right('Provision customer service') % && $part_svc->num_avail @@ -104,6 +71,16 @@ 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' ) { +% 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 %> +% #} +% } @@ -127,52 +104,50 @@ 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 $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, ); - #$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') ) { $link .= '
'. - qq!!. - "Link to legacy $svc_nbsp ($num_avail)"; + qq!!. + emt("Link to legacy [_1] ([_2])",$svc_nbsp,$num_avail).''; } $link; } -sub svc_unprovision_link { - my $cust_svc = shift or return ''; - qq!Unprovision!; -} - 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)'), );