holding on to editor object created by script code so
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 14 Sep 2006 12:38:52 +0000 (12:38 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 14 Sep 2006 12:38:52 +0000 (12:38 +0000)
we can just use it for our xact

git-svn-id: svn://svn.open-ils.org/ILS/trunk@6091 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Penalty.pm

index 4df24dc..3b25452 100644 (file)
@@ -84,8 +84,9 @@ sub patron_penalty {
        $args->{fetch_patron_circ_info} = 1;
        $args->{fetch_patron_money_info} = 1;
        $args->{ignore_user_status} = 1;
        $args->{fetch_patron_circ_info} = 1;
        $args->{fetch_patron_money_info} = 1;
        $args->{ignore_user_status} = 1;
-       my $runner = OpenILS::Application::Circ::ScriptBuilder->build($args);
 
 
+       my $runner = OpenILS::Application::Circ::ScriptBuilder->build($args);
+       
        # - Load up the script and run it
        $runner->add_path($_) for @$path;
 
        # - Load up the script and run it
        $runner->add_path($_) for @$path;
 
@@ -106,7 +107,9 @@ sub patron_penalty {
 
        $evt = update_patron_penalties( 
                patron    => $args->{patron}, 
 
        $evt = update_patron_penalties( 
                patron    => $args->{patron}, 
-               penalties => $all ) if $$args{update};
+               penalties => $all,
+               editor          => $args->{editor},
+               ) if $$args{update};
 
        # - The caller won't know it failed, so log it
        $logger->error("penalty: Error updating the patron ".
 
        # - The caller won't know it failed, so log it
        $logger->error("penalty: Error updating the patron ".
@@ -126,11 +129,10 @@ sub update_patron_penalties {
        my %args      = @_;
        my $patron    = $args{patron};
        my $penalties = $args{penalties};
        my %args      = @_;
        my $patron    = $args{patron};
        my $penalties = $args{penalties};
+       my $editor              = $args{editor} || new_editor(xact=>1);
        my $pid = $patron->id;
 
        my $pid = $patron->id;
 
-
        $logger->debug("updating penalties for patron $pid => @$penalties");
        $logger->debug("updating penalties for patron $pid => @$penalties");
-       my $editor = new_editor(xact =>1);
 
 
        # - fetch the current penalties
 
 
        # - fetch the current penalties