X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Faddr_block.cgi;h=1bbcdcbc1daf7fa6c17215c95026c82c68ac6214;hb=fdc247b504359ca9e74f63daa771f49393fd70ed;hp=87f46c0e7267787c6add552778aca22c321984fa;hpb=3ce7691203a7737406bf2d4442f7fd84b81f847e;p=freeside.git
diff --git a/httemplate/browse/addr_block.cgi b/httemplate/browse/addr_block.cgi
index 87f46c0e7..1bbcdcbc1 100644
--- a/httemplate/browse/addr_block.cgi
+++ b/httemplate/browse/addr_block.cgi
@@ -1,83 +1,145 @@
-<% include("/elements/header.html",'Address Blocks', menubar('Main Menu' => $p)) %>
-%
-%
-%use NetAddr::IP;
-%
-%my @addr_block = qsearch('addr_block', {});
-%my @router = qsearch('router', {});
-%my $block;
-%my $p2 = popurl(2);
-%my $path = $p2 . "edit/process/addr_block";
-%
-%
-% if ($cgi->param('error')) {
+<% include('elements/browse.html',
+ 'title' => 'Address Blocks',
+ 'name' => 'address block',
+ 'html_init' => $html_init,
+ 'html_foot' => $html_foot,
+ 'query' => { 'table' => 'addr_block',
+ 'hashref' => {},
+ 'extra_sql' => $extra_sql,
+ 'order_by' => $order_by,
+ },
+ 'count_query' => "SELECT count(*) from addr_block $count_sql",
+ 'header' => [ 'Address Block',
+ 'Router',
+ 'Action(s)',
+ '',
+ '',
+ ],
+ 'fields' => [ 'NetAddr',
+ sub { my $block = shift;
+ my $router = $block->router;
+ my $result = '';
+ if ($router) {
+ $result .= $router->routername. ' (';
+ $result .= scalar($block->svc_broadband). ' services)';
+ }
+ $result;
+ },
+ $allocate_text,
+ sub { shift->router ? '' : '(split)' },
+ sub { '('. (shift->manual_flag ? 'allow' : 'prevent'). ' automatic ip assignment)' },
+ ],
+ 'links' => [ '',
+ '',
+ [ 'javascript:void(0)', '' ],
+ $split_link,
+ $autoassign_link,
+ ],
+ 'link_onclicks' => [ '',
+ '',
+ $allocate_link,
+ '',
+ ],
+ 'cell_styles' => [ '',
+ '',
+ 'border-right:none;',
+ 'border-left:none;',
+ ],
+ 'agent_virt' => 1,
+ 'agent_null_right' => 'Broadband global configuration',
+ 'agent_pos' => 1,
+ )
+%>
+<%init>
- Error: <%$cgi->param('error')%>
-
-% }
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Broadband configuration')
+ || $FS::CurrentUser::CurrentUser->access_right('Broadband global configuration');
+my $p2 = popurl(2);
+my $path = $p2 . "edit/process/addr_block";
-<%table()%>
-% foreach $block (sort {$a->NetAddr cmp $b->NetAddr} @addr_block) {
+my $extra_sql = "";
-