summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/router.cgi
diff options
context:
space:
mode:
authorjeff <jeff>2008-06-28 19:25:24 +0000
committerjeff <jeff>2008-06-28 19:25:24 +0000
commita1871d3d13c1dafa93b956762c0d23728d261da7 (patch)
treeecd799ff28ca27d5e2ef07a615bcac49621dd391 /httemplate/edit/process/router.cgi
parent7588be4eb948426b972d0238dcdbb1537dc6a72a (diff)
agent virtualize address blocks and routers
Diffstat (limited to 'httemplate/edit/process/router.cgi')
-rw-r--r--httemplate/edit/process/router.cgi80
1 files changed, 15 insertions, 65 deletions
diff --git a/httemplate/edit/process/router.cgi b/httemplate/edit/process/router.cgi
index 7e0baf782..6e717d19c 100644
--- a/httemplate/edit/process/router.cgi
+++ b/httemplate/edit/process/router.cgi
@@ -1,70 +1,20 @@
-%local $FS::UID::AutoCommit=0;
-%
-%sub check {
-% my $error = shift;
-% if($error) {
-% $cgi->param('error', $error);
-% print $cgi->redirect(popurl(3) . "edit/router.cgi?". $cgi->query_string);
-% dbh->rollback;
-% exit;
-% }
-%}
-%
-%my $error = '';
-%my $routernum = $cgi->param('routernum');
-%my $routername = $cgi->param('routername');
-%my $old = qsearchs('router', { routernum => $routernum });
-%my @old_psr;
-%
-%my $new = new FS::router {
-% map {
-% ($_, scalar($cgi->param($_)));
-% } fields('router')
-%};
-%
-%if($old) {
-% $error = $new->replace($old);
-%} else {
-% $error = $new->insert;
-% $routernum = $new->routernum;
-%}
-%
-%check($error);
-%
-%if ($old) {
-% @old_psr = $old->part_svc_router;
-% foreach my $psr (@old_psr) {
-% if($cgi->param('svcpart_'.$psr->svcpart) eq 'ON') {
-% # do nothing
-% } else {
-% $error = $psr->delete;
-% }
-% }
-% check($error);
-%}
-%
-%foreach($cgi->param) {
-% if($cgi->param($_) eq 'ON' and /^svcpart_(\d+)$/) {
-% my $svcpart = $1;
-% if(grep {$_->svcpart == $svcpart} @old_psr) {
-% # do nothing
-% } else {
-% my $new_psr = new FS::part_svc_router { svcpart => $svcpart,
-% routernum => $routernum };
-% $error = $new_psr->insert;
-% }
-% check($error);
-% }
-%}
-%
-%
-%# Yay, everything worked!
-%dbh->commit or die dbh->errstr;
-%print $cgi->redirect(popurl(3). "browse/router.cgi");
-%
+<% include('elements/process.html',
+ 'table' => 'router',
+ 'viewall_dir' => 'browse',
+ 'viewall_ext' => 'cgi',
+ 'edit_ext' => 'cgi',
+ 'process_m2m' => { 'link_table' => 'part_svc_router',
+ 'target_table' => 'part_svc',
+ },
+ 'agent_virt' => 1,
+ 'agent_null_right' => 'Engineering global configuration',
+ )
+%>
<%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+ unless $curuser->access_right('Engineering configuration')
+ || $curuser->access_right('Engineering global configuration');
</%init>