X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Frouter.cgi;h=354111875af333d9daa285adaba303e913df9a1f;hb=d2a42bce5c5557966cc0f0966e4b9d14fff576a0;hp=149db49031d08fc05367cd8838644e73289e6748;hpb=f7fd2a3e34da751cbc02bbf215e99c6dc89adc15;p=freeside.git
diff --git a/httemplate/browse/router.cgi b/httemplate/browse/router.cgi
index 149db4903..354111875 100644
--- a/httemplate/browse/router.cgi
+++ b/httemplate/browse/router.cgi
@@ -1,57 +1,66 @@
-<%= header('Routers', menubar('Main Menu' => $p)) %>
-<%
+<% include('elements/browse.html',
+ 'title' => 'Routers',
+ 'menubar' => [ @menubar ],
+ 'name_singular' => 'router',
+ 'query' => { 'table' => 'router',
+ 'hashref' => {},
+ 'extra_sql' => $extra_sql,
+ },
+ 'count_query' => "SELECT count(*) from router $count_sql",
+ 'header' => [ @header_fields ],
+ 'fields' => [ @fields ],
+ 'links' => [ @links ],
+ 'agent_virt' => 1,
+ 'agent_null_right'=> "Broadband global configuration",
+ 'agent_pos' => 1,
+ )
+%>
+<%init>
-my @router = qsearch('router', {});
-my $p2 = popurl(2);
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Broadband configuration')
+ || $FS::CurrentUser::CurrentUser->access_right('Broadband global configuration');
-%>
+my $p2 = popurl(2);
+my $extra_sql = '';
-<% if ($cgi->param('error')) { %>
- Error: <%=$cgi->param('error')%>
-
-<% } %>
+my @menubar = ( 'Add a new router', "${p2}edit/router.cgi" );
-<%
-my $hidecustomerrouters = 0;
-my $hideurl = '';
if ($cgi->param('hidecustomerrouters') eq '1') {
- $hidecustomerrouters = 1;
- $cgi->param('hidecustomerrouters', 0);
- $hideurl = 'Show customer routers';
+ $extra_sql = 'WHERE svcnum > 0';
+ $cgi->delete('hidecustomerrouters');
+ push @menubar, 'Show customer routers', $cgi->self_url();
+ $cgi->param('hidecustomerrouters', 1);
} else {
- $hidecustomerrouters = 0;
$cgi->param('hidecustomerrouters', 1);
- $hideurl = 'Hide customer routers';
+ push @menubar, 'Hide customer routers', $cgi->self_url();
+ $cgi->delete('hidecustomerrouters');
}
-%>
-Add a new router | <%=$hideurl%>
-
-<%=table()%>
-