diff options
author | jeff <jeff> | 2008-04-18 03:29:59 +0000 |
---|---|---|
committer | jeff <jeff> | 2008-04-18 03:29:59 +0000 |
commit | 2eda79fb265b3acdde85881f1160f6daa73f2d84 (patch) | |
tree | 2fc4f8894906bba0a41e9ad0588ad92a04eaac43 /httemplate/edit | |
parent | 8333462f80da553234ef53076a932e9f417e6ad2 (diff) |
drag address and router even farther into the century
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/allocate.html | 26 | ||||
-rwxr-xr-x | httemplate/edit/process/addr_block/add.cgi | 7 | ||||
-rwxr-xr-x | httemplate/edit/process/addr_block/allocate.cgi | 38 | ||||
-rwxr-xr-x | httemplate/edit/process/addr_block/deallocate.cgi | 7 | ||||
-rwxr-xr-x | httemplate/edit/process/addr_block/split.cgi | 7 |
5 files changed, 60 insertions, 25 deletions
diff --git a/httemplate/edit/allocate.html b/httemplate/edit/allocate.html new file mode 100644 index 000000000..29c16ae6a --- /dev/null +++ b/httemplate/edit/allocate.html @@ -0,0 +1,26 @@ +<% include('elements/edit.html', + 'name' => 'Allocation', + 'table' => 'addr_block', + 'labels' => { 'NetAddr' => 'Block', + 'routernum' => 'Router', + }, + 'fields' => [ { 'field' => 'NetAddr', + 'type' => 'fixed', + }, + { 'field' => 'routernum', + 'type' => 'select-table', + 'table' => 'router', + 'name_col' => 'routername', + 'disable_empty' => 1, + }, + ], + 'post_url' => "process/addr_block/allocate.cgi", + 'popup' => 1, + ) +%> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> diff --git a/httemplate/edit/process/addr_block/add.cgi b/httemplate/edit/process/addr_block/add.cgi index 85780c678..e9f9b9736 100755 --- a/httemplate/edit/process/addr_block/add.cgi +++ b/httemplate/edit/process/addr_block/add.cgi @@ -19,3 +19,10 @@ %} % +<%init> + +my $conf = new FS::Conf; +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> diff --git a/httemplate/edit/process/addr_block/allocate.cgi b/httemplate/edit/process/addr_block/allocate.cgi index a94c0320f..d1bd73f1f 100755 --- a/httemplate/edit/process/addr_block/allocate.cgi +++ b/httemplate/edit/process/addr_block/allocate.cgi @@ -1,26 +1,14 @@ -% -%my $error = ''; -%my $blocknum = $cgi->param('blocknum'); -%my $routernum = $cgi->param('routernum'); -% -%my $addr_block = qsearchs('addr_block', { blocknum => $blocknum }); -%my $router = qsearchs('router', { routernum => $routernum }); -% -%if($addr_block) { -% if ($router) { -% $error = $addr_block->allocate($router); -% } else { -% $error = "Cannot find router with routernum $routernum"; -% } -%} else { -% $error = "Cannot find block with blocknum $blocknum"; -%} -% -%if ( $error ) { -% $cgi->param('error', $error); -% print $cgi->redirect(popurl(4). "browse/addr_block.cgi?" . $cgi->query_string); -%} else { -% print $cgi->redirect(popurl(4). "browse/addr_block.cgi"); -%} -% +<% include( '../elements/process.html', + 'table' => 'addr_block', + 'copy_on_empty' => [ fields 'addr_block' ], + 'error_redirect' => popurl(3). 'allocate.html?', + 'popup_reload' => 'Block allocated', + ) +%> +<%init> +my $conf = new FS::Conf; +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> diff --git a/httemplate/edit/process/addr_block/deallocate.cgi b/httemplate/edit/process/addr_block/deallocate.cgi index 494c19f75..95e1b7e4d 100755 --- a/httemplate/edit/process/addr_block/deallocate.cgi +++ b/httemplate/edit/process/addr_block/deallocate.cgi @@ -23,3 +23,10 @@ %} % +<%init> + +my $conf = new FS::Conf; +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> diff --git a/httemplate/edit/process/addr_block/split.cgi b/httemplate/edit/process/addr_block/split.cgi index 617c3f8ce..b3a33b18a 100755 --- a/httemplate/edit/process/addr_block/split.cgi +++ b/httemplate/edit/process/addr_block/split.cgi @@ -18,3 +18,10 @@ %} % +<%init> + +my $conf = new FS::Conf; +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +</%init> |