1 <& elements/svc_Common.html,
2 'title' => 'Fiber Search Results',
3 'name' => 'fiber services',
5 'count_query' => $query->{'count_query'},
14 FS::UI::Web::cust_header($cgi->param('cust_fields')),
16 'fields' => [ 'svcnum',
18 sub { my $svc = shift;
19 join('-', $svc->shelf, $svc->card, $svc->olt_port)
25 $cust_pkg_cache{$_[0]->svcnum} ||= $_[0]->cust_svc->cust_pkg;
26 return '' unless $cust_pkg_cache{$_[0]->svcnum};
27 $cust_pkg_cache{$_[0]->svcnum}->ucfirst_status
29 \&FS::UI::Web::cust_fields,
38 FS::UI::Web::cust_links($cgi->param('cust_fields')),
40 'align' => 'rlllllr'. FS::UI::Web::cust_aligns(),
44 $cust_pkg_cache{$_[0]->svcnum} ||= $_[0]->cust_svc->cust_pkg;
45 return '' unless $cust_pkg_cache{$_[0]->svcnum};
46 my $c = FS::cust_pkg::statuscolors;
47 $c->{$cust_pkg_cache{$_[0]->svcnum}->status };
49 FS::UI::Web::cust_colors(),
54 FS::UI::Web::cust_styles(),
60 die "access denied" unless
61 $FS::CurrentUser::CurrentUser->access_right([ 'Services: Fiber',
67 my $conf = new FS::Conf;
70 if ( $cgi->param('magic') eq 'unlinked' ) {
71 %search_hash = ( 'unlinked' => 1 );
73 foreach (qw( custnum agentnum svcpart cust_fields
74 ont_typenum oltnum shelf olt_port card vlan )) {
75 $search_hash{$_} = $cgi->param($_) if defined($cgi->param($_));
77 if ( defined($cgi->param('cancelled')) ) {
78 $search_hash{'cancelled'} = $cgi->param('cancelled') ? 1 : 0;
82 my $query = FS::svc_fiber->search(\%search_hash);
83 $query->{addl_from} .= ' LEFT JOIN fiber_olt USING (oltnum) ';
84 $query->{select} .= ', oltname';
86 my $link = [ $p.'view/svc_fiber.cgi?', 'svcnum' ];