[open-ils-commits] r10692 - trunk/Open-ILS/src/perlmods/OpenILS/Application

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Sep 23 17:48:25 EDT 2008


Author: erickson
Date: 2008-09-23 17:48:20 -0400 (Tue, 23 Sep 2008)
New Revision: 10692

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
Log:
added filter options for owner queue retrievel.  added method to turn a record into html for display

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm	2008-09-23 21:47:36 UTC (rev 10691)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm	2008-09-23 21:48:20 UTC (rev 10692)
@@ -631,17 +631,21 @@
 );
 
 sub owner_queue_retrieve {
-    my($self, $conn, $auth, $owner_id) = @_;
+    my($self, $conn, $auth, $owner_id, $filters) = @_;
     my $e = new_editor(authtoken => $auth);
     return $e->die_event unless $e->checkauth;
     $owner_id = $e->requestor->id; # XXX add support for viewing other's queues?
     my $queues;
+    $filters ||= {};
+    my $search = {owner => $owner_id};
+    $search->{$_} = $filters->{$_} for keys %$filters;
+
     if($self->{record_type} eq 'bib') {
         $queues = $e->search_vandelay_bib_queue(
-            {complete => 'f', owner => $owner_id});
+            [$search, {order_by => {vbq => 'lower(name)'}}]);
     } else {
         $queues = $e->search_vandelay_authority_queue(
-            {complete => 'f', owner => $owner_id});
+            [$search, {order_by => {vaq => 'lower(name)'}}]);
     }
     $conn->respond($_) for @$queues;
     return undef;
@@ -683,4 +687,41 @@
     return 1;
 }
 
+
+__PACKAGE__->register_method(  
+	api_name	=> "open-ils.vandelay.queued_bib_record.html",
+	method		=> 'queued_record_html',
+	api_level	=> 1,
+	argc		=> 2,
+    stream      => 1,
+	record_type	=> 'bib'
+);
+__PACKAGE__->register_method(  
+	api_name	=> "open-ils.vandelay.queued_authority_record.html",
+	method		=> 'queued_record_html',
+	api_level	=> 1,
+	argc		=> 2,
+    stream      => 1,
+	record_type	=> 'auth'
+);
+
+sub queued_record_html {
+    my($self, $conn, $auth, $rec_id) = @_;
+    my $e = new_editor(authtoken => $auth);
+    return $e->event unless $e->checkauth;
+    my $rec;
+    if($self->{record_type} eq 'bib') {
+        $rec = $e->retrieve_vandelay_queued_bib_record($rec_id)
+            or return $e->event;
+    } else {
+        $rec = $e->retrieve_vandelay_queued_authority_record($rec_id)
+            or return $e->event;
+    }
+
+    return $U->simplereq(
+        'open-ils.search',
+        'open-ils.search.biblio.record.html', undef, 1, $rec->marc);
+}
+
+
 1;



More information about the open-ils-commits mailing list