movin on, adding exceptions, more more more
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 22 Jul 2005 20:11:51 +0000 (20:11 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 22 Jul 2005 20:11:51 +0000 (20:11 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1363 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
Open-ILS/src/perlmods/OpenILS/EX.pm
Open-ILS/src/templates/strings/ex.ttk

index 92fdc05..956ebd0 100644 (file)
@@ -43,6 +43,10 @@ sub update_patron {
 
        my $new_patron;
 
+       if(ref($patron->card)) { $patron->card( $patron->card->id ); }
+       if(ref($patron->billing_address)) { $patron->billing_address( $patron->billing_address->id ); }
+       if(ref($patron->mailing_address)) { $patron->mailing_address( $patron->mailing_address->id ); }
+
        # create/update the patron first so we can use his id
        if($patron->isnew()) {
 
@@ -113,6 +117,11 @@ __PACKAGE__->register_method(
 sub user_retrieve_fleshed_by_id {
        my( $self, $client, $user_session, $user_id ) = @_;
        my $user_obj = $apputils->check_user_session( $user_session ); 
+
+       if($apputils->check_user_perms($user_obj->id, $user_obj->home_ou, "VIEW_USER")) {
+               return OpenILS::Perm->new("VIEW_USER");
+       }
+
        return flesh_user($user_id);
 }
 
@@ -379,6 +388,7 @@ sub _add_update_cards {
                                return $card;
                        }
 
+                       #if(ref($patron->card)) { $patron->card($patron->card->id); }
                        if($patron->card() == $virtual_id) {
                                $new_patron->card($card->id());
                                $new_patron->ischanged(1);
@@ -456,14 +466,19 @@ sub _add_survey_responses {
        warn "updating responses for user " . $new_patron->id . "\n";
 
        my $responses = $patron->survey_responses;
-       for my $resp( @$responses ) {
-               $resp->usr($new_patron->id);
-       }
 
-       my $status = $apputils->simple_scalar_request(
-               "open-ils.circ", 
-               "open-ils.circ.survey.submit.user_id",
-               $responses );
+       if($responses) {
+
+               for my $resp( @$responses ) {
+                       $resp->usr($new_patron->id);
+               }
+
+               my $status = $apputils->simple_scalar_request(
+                       "open-ils.circ", 
+                       "open-ils.circ.survey.submit.user_id",
+                       $responses );
+
+       }
 
        return $new_patron;
 }
index 6d3c700..ecae5e0 100644 (file)
@@ -6,6 +6,7 @@ use OpenILS::Application::Circ::Rules;
 use OpenILS::Application::Circ::Survey;
 use OpenILS::Application::Circ::StatCat;
 use OpenILS::Application::Circ::Holds;
+use OpenILS::Application::Circ::Money;
 
 use OpenILS::Application::AppUtils;
 my $apputils = "OpenILS::Application::AppUtils";
index 276f517..be8ac12 100644 (file)
@@ -20,6 +20,7 @@ my %ex_types = (
        MAX_RENEWALS_REACHED                                    => 9,
        COPY_NEEDED_FOR_HOLD                                    => 10,
        NO_HOLD_FOUND                                                   => 11,
+       NO_TRANSACTION_FOUND                                    => 12,
 );
 
 use overload ( '""' => sub { $_[0]->ex()->err_msg(); } );
index b2c606a..b41820e 100644 (file)
@@ -45,6 +45,9 @@
        IF type == ex_types.NO_HOLD_FOUND;
                ret("The requested hold could not be found"); END;
 
+       IF type == ex_types.NO_TRANSACTION_FOUND;
+               ret("The requested transaction could not be found"); END;
+
        ret("Unknown exception occured");
 
 -%]