diff options
author | Mark Wells <mark@freeside.biz> | 2015-12-21 14:41:40 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-12-21 14:45:17 -0800 |
commit | 796750496ab90b7e10823e2a3a008b600ab8f090 (patch) | |
tree | 25817c61ebbe5a2322357c7ac641ef3dea695b70 /httemplate/search | |
parent | b2394238aa56b29ede1f7f46c023ac580e32d758 (diff) |
svc_fiber, #35260
Diffstat (limited to 'httemplate/search')
-rwxr-xr-x | httemplate/search/report_svc_fiber.html | 47 | ||||
-rw-r--r-- | httemplate/search/svc_fiber.html | 69 |
2 files changed, 116 insertions, 0 deletions
diff --git a/httemplate/search/report_svc_fiber.html b/httemplate/search/report_svc_fiber.html new file mode 100755 index 000000000..d563c5339 --- /dev/null +++ b/httemplate/search/report_svc_fiber.html @@ -0,0 +1,47 @@ +<& /elements/header.html, $title &> + +<FORM ACTION="svc_fiber.html" METHOD="GET"> + + <TABLE BGCOLOR="#cccccc" CELLSPACING=0> + <TR> + <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH> + </TR> + + <& /elements/tr-select-table.html, + label => 'OLT', + table => 'fiber_olt', + name_col => 'oltname', + &> + <& /elements/tr-input-text.html, field => 'shelf', label => 'Shelf' &> + <& /elements/tr-input-text.html, field => 'card', label => 'Card' &> + <& /elements/tr-input-text.html, field => 'olt_port', label => 'Port' &> + + <& /elements/tr-td-label.html, label => 'ONT model' &> + <TD> + <& /elements/select-hardware_type.html, + 'empty_label' => '(all)' + &> + </TD> + </TR> + + <& /elements/tr-input-text.html, field => 'ont_serial', label => 'Serial number' &> + <& /elements/tr-input-text.html, field => 'vlan', label => 'VLAN' &> + </TABLE> + +<BR> +<INPUT TYPE="submit" VALUE="Search"> + +</FORM> + +<& /elements/footer.html &> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Services: Fiber'); + +my $title = 'Search Fiber Services'; + +my @olts = qsearch('fiber_olt', {}); + +</%init> + diff --git a/httemplate/search/svc_fiber.html b/httemplate/search/svc_fiber.html new file mode 100644 index 000000000..0cb735c96 --- /dev/null +++ b/httemplate/search/svc_fiber.html @@ -0,0 +1,69 @@ +<& elements/svc_Common.html, + 'title' => 'Fiber Search Results', + 'name' => 'fiber services', + 'query' => $query, + 'count_query' => $query->{'count_query'}, + 'redirect' => $link, + 'header' => [ '#', + 'OLT', + 'Shelf/Card/Port', + 'ONT', + 'Model', + 'Serial', + FS::UI::Web::cust_header($cgi->param('cust_fields')), + ], + 'fields' => [ 'svcnum', + 'oltname', + sub { my $svc = shift; + join('-', $svc->shelf, $svc->card, $svc->olt_port) + }, + 'ont_id', + 'ont_description', + 'ont_serial', + \&FS::UI::Web::cust_fields, + ], + 'links' => [ $link, + '', + '', + $link, + $link, + $link, + FS::UI::Web::cust_links($cgi->param('cust_fields')), + ], + 'align' => 'rlllll'. FS::UI::Web::cust_aligns(), + 'color' => [ + ('') x 6, + FS::UI::Web::cust_colors(), + ], + 'style' => [ + ('') x 6, + FS::UI::Web::cust_styles(), + ], + +&> +<%init> + +die "access denied" unless + $FS::CurrentUser::CurrentUser->access_right([ 'Services: Fiber', + 'List services' + ]); + +my $conf = new FS::Conf; + +my %search_hash; +if ( $cgi->param('magic') eq 'unlinked' ) { + %search_hash = ( 'unlinked' => 1 ); +} else { + foreach (qw( custnum agentnum svcpart cust_fields + ont_typenum oltnum shelf olt_port card vlan )) { + $search_hash{$_} = $cgi->param($_) if defined($cgi->param($_)); + } +} + +my $query = FS::svc_fiber->search(\%search_hash); +$query->{addl_from} .= ' LEFT JOIN fiber_olt USING (oltnum) '; +$query->{select} .= ', oltname'; + +my $link = [ $p.'view/svc_fiber.cgi?', 'svcnum' ]; + +</%init> |