[freeside-commits] freeside/httemplate/edit/process router.cgi, 1.6, 1.7 svc_acct_pop.cgi, 1.6, 1.7 svc_broadband.cgi, 1.7, 1.8

Jeff Finucane,420,, jeff at wavetail.420.am
Sat Jun 28 12:25:26 PDT 2008


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv20117/httemplate/edit/process

Modified Files:
	router.cgi svc_acct_pop.cgi svc_broadband.cgi 
Log Message:
agent virtualize address blocks and routers

Index: router.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/router.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- router.cgi	13 Jan 2008 21:35:53 -0000	1.6
+++ router.cgi	28 Jun 2008 19:25:24 -0000	1.7
@@ -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>

Index: svc_acct_pop.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_acct_pop.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- svc_acct_pop.cgi	13 Jan 2008 21:35:53 -0000	1.6
+++ svc_acct_pop.cgi	28 Jun 2008 19:25:24 -0000	1.7
@@ -6,8 +6,11 @@
 %}
 <%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');
 
 my $popnum = $cgi->param('popnum');
 

Index: svc_broadband.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_broadband.cgi,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- svc_broadband.cgi	13 Jan 2008 21:35:53 -0000	1.7
+++ svc_broadband.cgi	28 Jun 2008 19:25:24 -0000	1.8
@@ -1,38 +1,8 @@
-%if ( $error ) {
-%  $cgi->param('error', $error);
-%  $cgi->param('ip_addr', $new->ip_addr);
-<% $cgi->redirect(popurl(2). "svc_broadband.cgi?". $cgi->query_string ) %>
-%} else {
-<% $cgi->redirect(popurl(3). "view/svc_broadband.cgi?" . $svcnum ) %>
-%}
+<% include('elements/svc_Common.html', 'table' => 'svc_broadband') %>
 <%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
 
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
-
-$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
-my $svcnum = $1;
-
-my $old;
-if ( $svcnum ) {
-  $old = qsearchs('svc_broadband', { 'svcnum' => $svcnum } )
-    or die "fatal: can't find broadband service (svcnum $svcnum)!";
-} else {
-  $old = '';
-}
-
-my $new = new FS::svc_broadband ( {
-  map {
-    ($_, scalar($cgi->param($_)));
-  } ( fields('svc_broadband'), qw( pkgnum svcpart ) )
-} );
-
-my $error;
-if ( $svcnum ) {
-  $error = $new->replace($old);
-} else {
-  $error = $new->insert;
-  $svcnum = $new->svcnum;
-}
+  unless $curuser->access_right('Provision customer service'); #something else more specific?
 
 </%init>



More information about the freeside-commits mailing list