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 $cust_pkg_cache{$_[0]->svcnum}->ucfirst_status
28 \&FS::UI::Web::cust_fields,
37 FS::UI::Web::cust_links($cgi->param('cust_fields')),
39 'align' => 'rlllllr'. FS::UI::Web::cust_aligns(),
43 my $c = FS::cust_pkg::statuscolors;
44 $c->{$cust_pkg_cache{$_[0]->svcnum}->status };
46 FS::UI::Web::cust_colors(),
51 FS::UI::Web::cust_styles(),
57 die "access denied" unless
58 $FS::CurrentUser::CurrentUser->access_right([ 'Services: Fiber',
64 my $conf = new FS::Conf;
67 if ( $cgi->param('magic') eq 'unlinked' ) {
68 %search_hash = ( 'unlinked' => 1 );
70 foreach (qw( custnum agentnum svcpart cust_fields
71 ont_typenum oltnum shelf olt_port card vlan )) {
72 $search_hash{$_} = $cgi->param($_) if defined($cgi->param($_));
74 if ( defined($cgi->param('cancelled')) ) {
75 $search_hash{'cancelled'} = $cgi->param('cancelled') ? 1 : 0;
79 my $query = FS::svc_fiber->search(\%search_hash);
80 $query->{addl_from} .= ' LEFT JOIN fiber_olt USING (oltnum) ';
81 $query->{select} .= ', oltname';
83 my $link = [ $p.'view/svc_fiber.cgi?', 'svcnum' ];