added a method to return a list of workstations objects by owning lib
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 6 Aug 2007 23:30:26 +0000 (23:30 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 6 Aug 2007 23:30:26 +0000 (23:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7623 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index d0e5bea..35a8c5c 100644 (file)
@@ -2485,6 +2485,35 @@ sub register_workstation {
        return $ws->id; # note: editor sets the id on the new object for us
 }
 
+__PACKAGE__->register_method (
+       method          => 'workstation_list',
+       api_name                => 'open-ils.actor.workstation.list',
+       signature       => q/
+               Returns a list of workstations registered at the given location
+               @param authtoken The login session key
+               @param ids A list of org_unit.id's for the workstation owners
+       /);
+
+sub workstation_list {
+       my( $self, $conn, $authtoken, @orgs ) = @_;
+
+       my $e = new_editor(authtoken=>$authtoken);
+       return $e->event unless $e->checkauth;
+    my %results;
+
+    for my $o (@orgs) {
+           return $e->event 
+            unless $e->allowed('REGISTER_WORKSTATION', $o);
+        $results{$o} = $e->search_actor_workstation({owning_lib=>$o});
+    }
+    return \%results;
+}
+
+
+
+
+
+
 
 __PACKAGE__->register_method (
        method          => 'fetch_patron_note',