diff options
Diffstat (limited to 'httemplate/browse/router.cgi')
-rw-r--r-- | httemplate/browse/router.cgi | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/httemplate/browse/router.cgi b/httemplate/browse/router.cgi new file mode 100644 index 000000000..acddf5677 --- /dev/null +++ b/httemplate/browse/router.cgi @@ -0,0 +1,59 @@ +<% include('/elements/header.html', 'Routers') %> + +<% include('/elements/error.html') %> + +%my $hidecustomerrouters = 0; +%my $hideurl = ''; +%if ($cgi->param('hidecustomerrouters') eq '1') { +% $hidecustomerrouters = 1; +% $cgi->param('hidecustomerrouters', 0); +% $hideurl = '<A HREF="' . $cgi->self_url() . '">Show customer routers</A>'; +%} else { +% $hidecustomerrouters = 0; +% $cgi->param('hidecustomerrouters', 1); +% $hideurl = '<A HREF="' . $cgi->self_url() . '">Hide customer routers</A>'; +%} + +<A HREF="<%$p2%>edit/router.cgi">Add a new router</A> | <%$hideurl%> + +<%table()%> + <TR> + <TD><B>Router name</B></TD> + <TD><B>Address block(s)</B></TD> + </TR> +% foreach my $router (sort {$a->routernum <=> $b->routernum} @router) { +% next if $hidecustomerrouters && $router->svcnum; +% my @addr_block = $router->addr_block; +% if (scalar(@addr_block) == 0) { +% push @addr_block, ' '; +% } +% + + <TR> + <TD ROWSPAN="<%scalar(@addr_block)+1%>"> + <A HREF="<%$p2%>edit/router.cgi?<%$router->routernum%>"><%$router->routername%></A> + </TD> + </TR> +% foreach my $block ( @addr_block ) { + + <TR> + <TD><%UNIVERSAL::isa($block, 'FS::addr_block') ? $block->NetAddr : ' '%></TD> + </TR> +% } + + </TR> +% } + +</TABLE> + +<% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my @router = qsearch('router', {}); +my $p2 = popurl(2); + +</%init> |