[open-ils-commits] r7767 - in trunk/Open-ILS: examples
src/perlmods/OpenILS/Application/Storage/CDBI
src/perlmods/OpenILS/Application/Storage/Publisher src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 12 12:20:10 EDT 2007
Author: miker
Date: 2007-09-12 12:12:19 -0400 (Wed, 12 Sep 2007)
New Revision: 7767
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
trunk/Open-ILS/src/sql/Pg/090.schema.action.sql
Log:
frozen hold auto-thaw support ... should have been there all along
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2007-09-12 16:07:01 UTC (rev 7766)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2007-09-12 16:12:19 UTC (rev 7767)
@@ -1248,6 +1248,7 @@
<field reporter:label="Bib Record link" name="bib_rec" oils_obj:array_position="29" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Eligible Copies" name="eligible_copies" oils_obj:array_position="30" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Currently Frozen" name="frozen" oils_obj:array_position="31" oils_persist:virtual="false" reporter:datatype="bool"/>
+ <field reporter:label="Thaw Date (if frozen)" name="thaw_date" oils_obj:array_position="32" oils_persist:virtual="false" reporter:datatype="timestamp"/>
</fields>
<links>
<link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm 2007-09-12 16:07:01 UTC (rev 7766)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm 2007-09-12 16:12:19 UTC (rev 7767)
@@ -96,7 +96,7 @@
prev_check_time expire_time requestor usr
hold_type holdable_formats target cancel_time
phone_notify email_notify selection_depth
- pickup_lib current_copy request_lib frozen
+ pickup_lib current_copy request_lib frozen thaw_date
fulfillment_staff fulfillment_lib selection_ou/);
#-------------------------------------------------------------------------------
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm 2007-09-12 16:07:01 UTC (rev 7766)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm 2007-09-12 16:12:19 UTC (rev 7767)
@@ -160,6 +160,30 @@
method => 'complete_reshelving',
);
+sub auto_thaw_frozen_holds {
+ my $self = shift;
+ my $client = shift;
+
+ local $OpenILS::Application::Storage::WRITE = 1;
+
+ my $holds = action::hold_request->table;
+
+ my $sql = "UPDATE $holds SET frozen = FALSE WHERE frozen IS TRUE AND thaw_date < NOW();";
+
+ my $sth = action::hold_request->db_Main->prepare_cached($sql);
+ $sth->execute();
+
+ return $sth->rows;
+
+}
+__PACKAGE__->register_method(
+ api_name => 'open-ils.storage.action.hold_request.thaw_expired_frozen',
+ api_level => 1,
+ stream => 0,
+ argc => 0,
+ method => 'auto_thaw_frozen_holds',
+);
+
sub grab_overdue {
my $self = shift;
my $client = shift;
Modified: trunk/Open-ILS/src/sql/Pg/090.schema.action.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/090.schema.action.sql 2007-09-12 16:07:01 UTC (rev 7766)
+++ trunk/Open-ILS/src/sql/Pg/090.schema.action.sql 2007-09-12 16:12:19 UTC (rev 7767)
@@ -179,7 +179,8 @@
holdable_formats TEXT,
phone_notify TEXT,
email_notify BOOL NOT NULL DEFAULT TRUE,
- frozen BOOL NOT NULL DEFAULT FALSE
+ frozen BOOL NOT NULL DEFAULT FALSE,
+ thaw_date TIMESTAMP WITH TIME ZONE
);
CREATE INDEX hold_request_target_idx ON action.hold_request (target);
More information about the open-ils-commits
mailing list