[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1636] trunk



Revision: 1636
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1636&view=rev
Author:   aurynn_cmd
Date:     2007-09-20 13:06:53 -0700 (Thu, 20 Sep 2007)

Log Message:
-----------
Removal of extra new_user function from admin.pl.
Updates to DBObject.pm to remove treatment of argument list as a hashref.
Update to LedgerSMB.pm to add s bare sub DESTROY so as not to trigger weird behaviour from using AUTOLOAD.

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject.pm
    trunk/LedgerSMB.pm
    trunk/lsmb-request.pl
    trunk/scripts/admin.pl

Modified: trunk/LedgerSMB/DBObject.pm
===================================================================
--- trunk/LedgerSMB/DBObject.pm	2007-09-19 23:52:32 UTC (rev 1635)
+++ trunk/LedgerSMB/DBObject.pm	2007-09-20 20:06:53 UTC (rev 1636)
@@ -60,13 +60,13 @@
 
 sub new {
     my $class = shift @_;
-    my $args  = shift @_;
-    my $base  = $args->{base};
-    my $mode  = $args->{copy};
+    my %args  = @_;
+    my $base  = $args{base};
+    my $mode  = $args{copy};
     my $self  = bless {}, $class;
     my @mergelist;
-    if (defined $args->{merge}){
-        @mergelist = @{$args->{merge}};
+    if ( defined $args{merge} ){
+        @mergelist = @{ $args{merge} };
     } elsif (defined $mode && ( $mode eq 'list')) {
         $self->error('Mergelist not set');
     }
@@ -289,6 +289,7 @@
         $self->{$arg} = $args{$arg};
     }
     return 1;    
+
 }
 
 1;

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2007-09-19 23:52:32 UTC (rev 1635)
+++ trunk/LedgerSMB.pm	2007-09-20 20:06:53 UTC (rev 1636)
@@ -740,5 +740,20 @@
     }
 }
 
+sub type {
+    
+    my $self = shift @_;
+    
+    if (!$ENV{REQUEST_METHOD} or 
+        ( $ENV{REQUEST_METHOD} ne ("HEAD" or "GET" or "POST") ) ) {
+        
+        $self->error("Request method unset or set to unknown value");
+    }
+    
+    return $ENV{REQUEST_METHOD};
+}
+
+sub DESTROY {}
+
 1;
 

Modified: trunk/lsmb-request.pl
===================================================================
--- trunk/lsmb-request.pl	2007-09-19 23:52:32 UTC (rev 1635)
+++ trunk/lsmb-request.pl	2007-09-20 20:06:53 UTC (rev 1636)
@@ -56,5 +56,5 @@
 $script->can($request->{action}) 
   || $request->error($locale->text("Action Not Defined: ") . $request->{action});
 
-$script->can($request->{action})->($request);
+$script->can( $request->{action} )->($request);
 1;

Modified: trunk/scripts/admin.pl
===================================================================
--- trunk/scripts/admin.pl	2007-09-19 23:52:32 UTC (rev 1635)
+++ trunk/scripts/admin.pl	2007-09-20 20:06:53 UTC (rev 1636)
@@ -9,12 +9,14 @@
 sub new_user {
     
     # uses the same page as create_user, only pre-populated.
-    my ($class, $request) = @_;
+    #my ($class, $request) = @_;
+    my $class = shift @_;
+    my $request = shift @_;
     my $admin = LedgerSMB::DBObject::Admin->new(base=>$request, copy=>'all');
     
     my $sal = $admin->get_salutations();
     
-    if ($request->type() == 'POST') {
+    if ($request->type() eq 'POST') {
         
         # do the save stuff
         
@@ -132,17 +134,6 @@
     $template->render($status);
 }
 
-sub new_user {
-    
-    my ($class, $request) = @_;
-    
-    my $template = LedgerSMB::Template->new( user=>$user, 
-        template=>'Admin/edit_user', language=>$user->{language},
-        format=>'HTML', path=>'UI');
-    
-    $template->render();
-}
-
 sub new_group {
     
     my ($class, $request) = @_;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.