X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Faddr_block.cgi;h=1bbcdcbc1daf7fa6c17215c95026c82c68ac6214;hb=9f2280fbce022ab9bcfc46fe94483730b0aeb0f8;hp=d597ee17e73dbad354a2fc508acf013507273791;hpb=2eda79fb265b3acdde85881f1160f6daa73f2d84;p=freeside.git diff --git a/httemplate/browse/addr_block.cgi b/httemplate/browse/addr_block.cgi index d597ee17e..1bbcdcbc1 100644 --- a/httemplate/browse/addr_block.cgi +++ b/httemplate/browse/addr_block.cgi @@ -2,17 +2,18 @@ 'title' => 'Address Blocks', 'name' => 'address block', 'html_init' => $html_init, - 'html_form' => $html_form, + 'html_foot' => $html_foot, 'query' => { 'table' => 'addr_block', 'hashref' => {}, 'extra_sql' => $extra_sql, 'order_by' => $order_by, }, - 'count_query' => "SELECT count(*) from addr_block $extra_sql", + 'count_query' => "SELECT count(*) from addr_block $count_sql", 'header' => [ 'Address Block', 'Router', 'Action(s)', '', + '', ], 'fields' => [ 'NetAddr', sub { my $block = shift; @@ -26,11 +27,13 @@ }, $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' => [ '', '', @@ -42,17 +45,26 @@ 'border-right:none;', 'border-left:none;', ], + 'agent_virt' => 1, + 'agent_null_right' => 'Broadband global configuration', + 'agent_pos' => 1, ) %> <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + 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"; -my $extra_sql = " "; +my $extra_sql = ""; + +my $count_sql = "WHERE ". $FS::CurrentUser::CurrentUser->agentnums_sql( + 'null_right' => 'Broadband global configuration', +); + my $order_by = "ORDER BY "; $order_by .= "inet(ip_gateway), " if driver_name =~ /^Pg/i; $order_by .= "inet_aton(ip_gateway), " if driver_name =~ /^mysql/i; @@ -74,10 +86,15 @@ my $confirm = sub { "javascript:addr_block_areyousure('$path/$verb.cgi?blocknum=$num', '$verb')"; }; -my $html_form = qq( +my $html_foot = qq(
Gateway/Netmask: / +); +$html_foot .= include( '/elements/select-agent.html', + 'agent_null_right' => 'Broadband global configuration', + ); +$html_foot .= qq(
); @@ -118,4 +135,11 @@ my $split_link = sub { $ref; }; +my $autoassign_link = sub { + my $block = shift; + my $url = "$path/manual_flag.cgi?manual_flag="; + $url .= $block->manual_flag ? '' : 'Y'; + [ "$url;blocknum=", 'blocknum' ]; +}; +