[freeside-commits] freeside/httemplate/edit/process/elements process.html, 1.11, 1.12

Ivan,,, ivan at wavetail.420.am
Thu Jan 3 18:42:09 PST 2008


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process/elements
In directory wavetail:/tmp/cvs-serv10501/httemplate/edit/process/elements

Modified Files:
	process.html 
Log Message:
new tax rate editor

Index: process.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/elements/process.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- process.html	1 Aug 2007 22:25:05 -0000	1.11
+++ process.html	4 Jan 2008 02:42:07 -0000	1.12
@@ -17,9 +17,11 @@
    # optional
    ###
 
-   'viewall_dir' => '', #'search' or 'browse', defaults to 'search'
+   'viewall_dir'  => '', #'search' or 'browse', defaults to 'search'
    OR
-   'redirect'    => 'view/table.cgi?', # value of primary key is appended
+   'redirect'     => 'view/table.cgi?', # value of primary key is appended
+   OR
+   'popup_reload' => 'Momentary success message', #will reload parent window
 
    'error_redirect' => popurl(2).'edit/table.cgi?', #query string appended
 
@@ -60,6 +62,54 @@
  )
 
 </%doc>
+%if ( $error ) {
+%
+%  my $edit_ext = $opt{'edit_ext'} || 'html';
+%  my $url = $opt{'error_redirect'} || popurl(2)."$table.$edit_ext";
+%  if ( length($cgi->query_string) > 1920 ) { #stupid IE 2083 URL limit
+% 
+%    my $session = int(rand(4294967296)); #XXX
+%    my $pref = new FS::access_user_pref({
+%      'usernum'    => $FS::CurrentUser::CurrentUser->usernum,
+%      'prefname'   => "redirect$session",
+%      'prefvalue'  => $cgi->query_string,
+%      'expiration' => time + 3600, #1h?  1m?
+%    });
+%    my $pref_error = $pref->insert;
+%    if ( $pref_error ) {
+%      die "FATAL: couldn't even set redirect cookie: $pref_error".
+%          " attempting to set redirect$session to ". $cgi->query_string."\n";
+%    }
+%
+<% $cgi->redirect("$url?redirect=$session") %>
+%
+%  } else {
+%
+<% $cgi->redirect("$url?". $cgi->query_string ) %>
+%
+%  } 
+%
+% #different ways of handling success
+%
+%} elsif ( $opt{'popup_reload'} ) {
+
+  <% include('/elements/header-popup.html', $opt{'popup_reload'} ) %>
+
+  <SCRIPT TYPE="text/javascript">
+    window.top.location.reload();
+  </SCRIPT>
+
+  </BODY>
+  </HTML>
+
+%} elsif ( $opt{'redirect'} ) {
+%
+<% $cgi->redirect( $opt{'redirect'}. $pkeyvalue ) %>
+%
+%} else { 
+%
+<% $cgi->redirect( popurl(3). ($opt{viewall_dir}||'search'). "/$table.html" ) %>
+%}
 <%once>
 
   my $me = 'process.html:';
@@ -162,7 +212,6 @@
                                );
 }
 
-# XXX print?!?!
 
 if ( $error ) {
   $cgi->param('error', $error);
@@ -171,33 +220,6 @@
       $cgi->param($field, '')
     }
   }
-  my $edit_ext = $opt{'edit_ext'} || 'html';
-  my $url = $opt{'error_redirect'} || popurl(2)."$table.$edit_ext";
-  if ( length($cgi->query_string) > 1920 ) { #stupid IE 2083 URL limit
-
-    my $session = int(rand(4294967296)); #XXX
-    my $pref = new FS::access_user_pref({
-      'usernum'    => $FS::CurrentUser::CurrentUser->usernum,
-      'prefname'   => "redirect$session",
-      'prefvalue'  => $cgi->query_string,
-      'expiration' => time + 3600, #1h?  1m?
-    });
-    my $pref_error = $pref->insert;
-    if ( $pref_error ) {
-      die "FATAL: couldn't even set redirect cookie: $pref_error".
-          " attempting to set redirect$session to ". $cgi->query_string."\n";
-    }
-    print $cgi->redirect("$url?redirect=$session");
-  } else {
-    print $cgi->redirect("$url?". $cgi->query_string );
-  } 
-} elsif ( $opt{'redirect'} ) {
-  print $cgi->redirect( $opt{'redirect'}. $pkeyvalue );
-} else { 
-  print $cgi->redirect( popurl(3).
-                        ( $opt{'viewall_dir'} || 'search' ).
-                        "/$table.html"
-                      );
 }
 
 </%init>



More information about the freeside-commits mailing list