added utility method for fethching a single org unit
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 20 Jan 2006 20:16:40 +0000 (20:16 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 20 Jan 2006 20:16:40 +0000 (20:16 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2769 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/extras/ils_events.xml
Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm

index d706385..338aec7 100644 (file)
                </desc>
        </event>
 
+       <event code='1507' textcode='ORG_UNIT_NOT_FOUND'>
+               <desc>
+                       Someone attempted to retrieve an org unit object from the 
+                       system and the object was not found.
+               </desc>
+       </event>
+
+
 
 
        <!-- ================================================================ -->
index bbb3c2a..aa8489d 100644 (file)
@@ -610,4 +610,17 @@ sub fetch_callnumber {
        return ( $cn, $evt );
 }
 
+sub fetch_org_unit {
+       my( $self, $id ) = @_;
+       $logger->debug("Fetching org unit $id");
+       my $evt = undef;
+
+       my $org = $self->simplereq(
+               'open-ils.storage', 
+               'open-ils.storage.direct.actor.org_unit.retrieve', $id );
+       $evt = OpenILS::Event->new( 'ORG_UNIT_NOT_FOUND', id => $id ) unless $org;
+
+       return ($org, $evt);
+}
+
 1;