X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fservices.html;h=d7644b7de7c2424b75d3e225440a79eb6010dde5;hb=730a14abf09f1ed8854cfded6f432fee832ea7d8;hp=bb676e8ab27d627bcbe5c7b2390889f18fb50368;hpb=71b86f3f89e8fdeb7142fa82cdbe3e3afce7a903;p=freeside.git diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html index bb676e8ab..d7644b7de 100644 --- a/httemplate/view/cust_main/packages/services.html +++ b/httemplate/view/cust_main/packages/services.html @@ -93,11 +93,13 @@ function clearhint_search_cust_svc(obj, str) { % { % 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 (browse_received_did_inventory($cust_pkg->custnum)) {
<% mt('Browse Received DID Inventory') |h %> -% #} +% } % } @@ -116,6 +118,8 @@ my %opt = @_; my $bgcolor = $opt{'bgcolor'}; my $cust_pkg = $opt{'cust_pkg'}; my $part_pkg = $opt{'part_pkg'}; +my $svc_phone_bulk_provision_simple = $opt{'svc_phone-bulk_provision_simple'}; + my $curuser = $FS::CurrentUser::CurrentUser; sub svc_provision_link { @@ -133,6 +137,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, @@ -146,17 +156,35 @@ 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; } +sub browse_received_did_inventory { + local($FS::Record::qsearch_qualify_columns) = 1; + qsearch({ + 'table' => 'did_order', + 'hashref' => { 'custnum' => $_[0] }, + 'extra_sql' => ' LIMIT 1' + }) || + qsearch({ + 'table' => 'did_order_item', + 'hashref' => { 'custnum' => $_[0] }, + 'addl_from' => ' INNER JOIN did_order ON did_order_item.ordernum = did_order.ordernum', + 'extra_sql' => ' LIMIT 1' + }); +} + my %hints = ( svc_acct => emt('(user or email)'), svc_domain => emt('(domain)'),