summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorjeff <jeff>2008-05-09 21:51:59 +0000
committerjeff <jeff>2008-05-09 21:51:59 +0000
commit96b10cf810e5766ff0b27aff01af235f99668b9b (patch)
treef64da1db262ef72de48698bc5a6bad6f0ff85595 /httemplate/edit
parentd14d966d6932a7dcbe34ab684342a5892609a574 (diff)
re-drag address and router even farther into the century
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/elements/edit.html4
-rwxr-xr-xhttemplate/edit/process/addr_block/allocate.cgi38
2 files changed, 17 insertions, 25 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 926b84e48..b45163254 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -199,6 +199,10 @@ Example:
% 'html_between' => $f->{'html_between'},
% );
%
+% #select-table
+% $include_common{$_} = $f->{$_}
+% foreach grep exists($f->{$_}), qw( table name_col );
+%
% my $layer_prefix_on = '';
%
% my $include_sub = sub {
diff --git a/httemplate/edit/process/addr_block/allocate.cgi b/httemplate/edit/process/addr_block/allocate.cgi
index fb361b05c..e8451b170 100755
--- a/httemplate/edit/process/addr_block/allocate.cgi
+++ b/httemplate/edit/process/addr_block/allocate.cgi
@@ -1,29 +1,17 @@
-%
-%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>
<%init>
my $conf = new FS::Conf;