[open-ils-commits] r7766 - in branches/rel_1_2/Open-ILS: examples
src/perlmods/OpenILS/Application/Storage/CDBI
src/perlmods/OpenILS/Application/Storage/Publisher src/sql/Pg
src/support-scripts
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 12 12:14:52 EDT 2007
Author: miker
Date: 2007-09-12 12:07:01 -0400 (Wed, 12 Sep 2007)
New Revision: 7766
Added:
branches/rel_1_2/Open-ILS/src/support-scripts/thaw_expired_frozen_holds.srfsh
Modified:
branches/rel_1_2/Open-ILS/examples/fm_IDL.xml
branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm
branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
branches/rel_1_2/Open-ILS/src/sql/Pg/090.schema.action.sql
Log:
backporting frozen hold auto-thaw support before 1.2.0 ... should have been there all along
Modified: branches/rel_1_2/Open-ILS/examples/fm_IDL.xml
===================================================================
--- branches/rel_1_2/Open-ILS/examples/fm_IDL.xml 2007-09-12 16:02:55 UTC (rev 7765)
+++ branches/rel_1_2/Open-ILS/examples/fm_IDL.xml 2007-09-12 16:07:01 UTC (rev 7766)
@@ -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: branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm
===================================================================
--- branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm 2007-09-12 16:02:55 UTC (rev 7765)
+++ branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm 2007-09-12 16:07:01 UTC (rev 7766)
@@ -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: branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm 2007-09-12 16:02:55 UTC (rev 7765)
+++ branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm 2007-09-12 16:07:01 UTC (rev 7766)
@@ -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: branches/rel_1_2/Open-ILS/src/sql/Pg/090.schema.action.sql
===================================================================
--- branches/rel_1_2/Open-ILS/src/sql/Pg/090.schema.action.sql 2007-09-12 16:02:55 UTC (rev 7765)
+++ branches/rel_1_2/Open-ILS/src/sql/Pg/090.schema.action.sql 2007-09-12 16:07:01 UTC (rev 7766)
@@ -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);
Added: branches/rel_1_2/Open-ILS/src/support-scripts/thaw_expired_frozen_holds.srfsh
===================================================================
--- branches/rel_1_2/Open-ILS/src/support-scripts/thaw_expired_frozen_holds.srfsh (rev 0)
+++ branches/rel_1_2/Open-ILS/src/support-scripts/thaw_expired_frozen_holds.srfsh 2007-09-12 16:07:01 UTC (rev 7766)
@@ -0,0 +1,2 @@
+#!/openils/bin/srfsh
+request open-ils.storage open-ils.storage.action.hold_request.thaw_expired_frozen
Property changes on: branches/rel_1_2/Open-ILS/src/support-scripts/thaw_expired_frozen_holds.srfsh
___________________________________________________________________
Name: svn:executable
+ *
More information about the open-ils-commits
mailing list