[open-ils-commits] r10557 - branches/rel_1_2_3/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Sep 8 14:06:14 EDT 2008


Author: miker
Date: 2008-09-08 14:06:11 -0400 (Mon, 08 Sep 2008)
New Revision: 10557

Modified:
   branches/rel_1_2_3/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
Log:
backporting status filter for pull list method from trunk (carrying expire-time check along with it, just because)

Modified: branches/rel_1_2_3/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- branches/rel_1_2_3/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2008-09-08 18:04:45 UTC (rev 10556)
+++ branches/rel_1_2_3/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2008-09-08 18:06:11 UTC (rev 10557)
@@ -94,11 +94,11 @@
 
 	my $c_t = action::circulation->table;
 
-    if ($grace) {
-        $grace = " - ($grace * (fine_interval))" if ($grace);
-    } else {
-        $grace = '';
-    }
+	if ($grace) {
+		$grace = " - ($grace * (fine_interval))" if ($grace);
+	} else {
+		$grace = '';
+	}
 
 	my $sql = <<"	SQL";
 		SELECT	*
@@ -362,6 +362,9 @@
 
 	my $idlist = 1 if ($self->api_name =~/id_list/o);
 
+        my $status_filter = '';
+        $status_filter = 'AND a.status IN (0,7)' if ($self->api_name =~/status_filtered/o);
+
 	my $select = <<"	SQL";
 		SELECT	h.*
 		  FROM	$h_table h
@@ -369,6 +372,8 @@
 		  WHERE	a.circ_lib = ?
 		  	AND h.capture_time IS NULL
 		  	AND h.cancel_time IS NULL
+			AND (h.expire_time IS NULL OR h.expire_time > NOW())
+			$status_filter
 		  ORDER BY h.request_time ASC
 		  LIMIT $limit
 		  OFFSET $offset
@@ -413,6 +418,34 @@
 	],
 	method          => 'hold_pull_list',
 );
+__PACKAGE__->register_method(
+        api_name        => 'open-ils.storage.direct.action.hold_request.pull_list.id_list.current_copy_circ_lib.status_filtered',
+        api_level       => 1,
+        stream          => 1,
+        signature       => [
+                "Returns the hold ids for a specific library's pull list that are definitely in that library, based on status.",
+                [ [org_unit => "The library's org id", "number"],
+                  [limit => 'An optional page size, defaults to 10', 'number'],
+                  [offset => 'Offset for paging, defaults to 0, 0 based', 'number'],
+                ],
+                ['A list of holds for the stated library to pull for', 'array']
+        ],
+        method          => 'hold_pull_list',
+);
+__PACKAGE__->register_method(
+        api_name        => 'open-ils.storage.direct.action.hold_request.pull_list.search.current_copy_circ_lib.status_filtered',
+        api_level       => 1,
+        stream          => 1,
+        signature       => [
+                "Returns the holds for a specific library's pull list that are definitely in that library, based on status.",
+                [ [org_unit => "The library's org id", "number"],
+                  [limit => 'An optional page size, defaults to 10', 'number'],
+                  [offset => 'Offset for paging, defaults to 0, 0 based', 'number'],
+                ],
+                ['A list of holds for the stated library to pull for', 'array']
+        ],
+        method          => 'hold_pull_list',
+);
 
 sub find_optional_surveys {
 	my $self = shift;



More information about the open-ils-commits mailing list