[open-ils-commits] [GIT] Evergreen ILS branch master updated. 65f9f8c408bd554beb139f3d5b6ee85bb06372c9

Evergreen Git git at git.evergreen-ils.org
Thu Mar 29 13:30:43 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  65f9f8c408bd554beb139f3d5b6ee85bb06372c9 (commit)
       via  99e8fc893a8bf0abc4e1c3b85db06da0742dbbf0 (commit)
      from  9982302a1c8007876bfb98642c9e1dc5d2165b40 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 65f9f8c408bd554beb139f3d5b6ee85bb06372c9
Author: Mike Rylander <mrylander at gmail.com>
Date:   Thu Mar 29 13:36:46 2012 -0400

    Stamping upgrade script for currently unfillable holds
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index c2fc9a0..ce488be 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0696', :eg_version); -- tsbere
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0697', :eg_version); -- tsbere/miker
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0697.data.place_currently_unfillable_hold.sql b/Open-ILS/src/sql/Pg/upgrade/0697.data.place_currently_unfillable_hold.sql
new file mode 100644
index 0000000..9ecad24
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0697.data.place_currently_unfillable_hold.sql
@@ -0,0 +1,17 @@
+-- Evergreen DB patch 0697.data.place_currently_unfillable_hold.sql
+--
+-- FIXME: insert description of change, if needed
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0697', :eg_version);
+
+-- FIXME: add/check SQL statements to perform the upgrade
+INSERT INTO permission.perm_list ( id, code, description ) VALUES
+ ( 524, 'PLACE_UNFILLABLE_HOLD', oils_i18n_gettext( 524,
+    'Allows a user to place a hold that cannot currently be filled.', 'ppl', 'description' ));
+
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.place_unfillable_hold.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.place_unfillable_hold.sql
deleted file mode 100644
index 559510e..0000000
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.place_unfillable_hold.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT INTO permission.perm_list ( id, code, description ) VALUES
- ( 524, 'PLACE_UNFILLABLE_HOLD', oils_i18n_gettext( 524,
-    'Allows a user to place a hold that cannot currently be filled.', 'ppl', 'description' ));
diff --git a/Open-ILS/web/opac/locale/en-US/opac.dtd b/Open-ILS/web/opac/locale/en-US/opac.dtd
index 6ac79e6..9b31b21 100644
--- a/Open-ILS/web/opac/locale/en-US/opac.dtd
+++ b/Open-ILS/web/opac/locale/en-US/opac.dtd
@@ -620,7 +620,7 @@ We recommend that you remove this title from any bookbags it may have been added
 <!ENTITY common.hold.exists "A hold already exists on the requested item.">
 <!ENTITY common.hold.exists.override "A hold already exists on the requested item. Would you like to create the hold anyway?">
 <!ENTITY common.hold.age_protect.override "This hold may take extra time to fill due to library policies. Would you like to create the hold anyway?">
-<!ENTITY common.hold.place_unfillable.override "The requested hold cannot currently be filled. You have permission to place the hold regardless, but should only do so if you know the hold will eventually be fillable. Would you like to create the hold anyway?">
+<!ENTITY common.hold.place_unfillable.override "The requested hold cannot currently be filled. You have permission to place the hold regardless, but should only do so if you believe the hold will eventually be filled. Would you like to create the hold anyway?">
 <!ENTITY common.hold.barred 'PATRON BARRED. Please see any notes in the
 "Staff Notes" section of your "My Account" page or contact your local library.'>
 <!ENTITY common.hold.item.invalid "This hold is no longer valid. It's likely that the

commit 99e8fc893a8bf0abc4e1c3b85db06da0742dbbf0
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Sat Jan 14 09:58:33 2012 -0500

    Add PLACE_UNFILLABLE_HOLD permission
    
    And hook it up in JSPac and TPac.
    
    General idea: If you have the permission you can place holds that will not
    fill right now, in general, for any reason.
    
    In TPac, I replaced the previous "check the last failure code" line. The
    new permission basically accomplishes the same thing for now, and is less
    likely to return different results from placement attempt to placement
    attempt. Also, only checking one failure code of potential hundreds didn't
    make a lot of sense.
    
    In the event of age protected copies the age protected prompt wins out.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
index 5c840c5..70325f9 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
@@ -2254,6 +2254,9 @@ sub check_title_hold {
         @status = do_possibility_checks($e, $patron, $request_lib, $params{depth}, %params);
     }
 
+    my $place_unfillable = 0;
+    $place_unfillable = 1 if $e->allowed('PLACE_UNFILLABLE_HOLD', $e->requestor->ws_ou);
+
     if ($status[0]) {
         return {
             "success" => 1,
@@ -2262,9 +2265,9 @@ sub check_title_hold {
         };
     } elsif ($status[2]) {
         my $n = scalar @{$status[2]};
-        return {"success" => 0, "last_event" => $status[2]->[$n - 1], "age_protected_copy" => $status[3]};
+        return {"success" => 0, "last_event" => $status[2]->[$n - 1], "age_protected_copy" => $status[3], "place_unfillable" => $place_unfillable};
     } else {
-        return {"success" => 0, "age_protected_copy" => $status[3]};
+        return {"success" => 0, "age_protected_copy" => $status[3], "place_unfillable" => $place_unfillable};
     }
 }
 
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index 8e1e931..72f4601 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -904,7 +904,7 @@ sub attempt_hold_placement {
                             $hdata->{could_override} = 1;
                             $hdata->{age_protect} = 1;
                         } else {
-                            $hdata->{could_override} = $self->test_could_override($hdata->{hold_failed_event});
+                            $hdata->{could_override} = $result->{place_unfillable};
                         }
                     } elsif (ref $result eq 'ARRAY') {
                         $hdata->{hold_failed_event} = $result->[0];
@@ -913,7 +913,7 @@ sub attempt_hold_placement {
                             $hdata->{could_override} = 1;
                             $hdata->{age_protect} = 1;
                         } else {
-                            $hdata->{could_override} = $self->test_could_override($hdata->{hold_failed_event});
+                            $hdata->{could_override} = $result->[4]; # place_unfillable
                         }
                     }
                 }
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index b6b88d4..bd9fc24 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -1535,7 +1535,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
  ( 522, 'IMPORT_AUTHORITY_MARC', oils_i18n_gettext( 522,
     'Allows a user to create new authority records', 'ppl', 'description' )),
  ( 523, 'ADMIN_TOOLBAR', oils_i18n_gettext( 523,
-    'Allows a user to create, edit, and delete custom toolbars', 'ppl', 'description' ));
+    'Allows a user to create, edit, and delete custom toolbars', 'ppl', 'description' )),
+ ( 524, 'PLACE_UNFILLABLE_HOLD', oils_i18n_gettext( 524,
+    'Allows a user to place a hold that cannot currently be filled.', 'ppl', 'description' ));
 
 SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000);
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.place_unfillable_hold.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.place_unfillable_hold.sql
new file mode 100644
index 0000000..559510e
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.place_unfillable_hold.sql
@@ -0,0 +1,3 @@
+INSERT INTO permission.perm_list ( id, code, description ) VALUES
+ ( 524, 'PLACE_UNFILLABLE_HOLD', oils_i18n_gettext( 524,
+    'Allows a user to place a hold that cannot currently be filled.', 'ppl', 'description' ));
diff --git a/Open-ILS/web/opac/locale/en-US/opac.dtd b/Open-ILS/web/opac/locale/en-US/opac.dtd
index ef17a45..6ac79e6 100644
--- a/Open-ILS/web/opac/locale/en-US/opac.dtd
+++ b/Open-ILS/web/opac/locale/en-US/opac.dtd
@@ -620,6 +620,7 @@ We recommend that you remove this title from any bookbags it may have been added
 <!ENTITY common.hold.exists "A hold already exists on the requested item.">
 <!ENTITY common.hold.exists.override "A hold already exists on the requested item. Would you like to create the hold anyway?">
 <!ENTITY common.hold.age_protect.override "This hold may take extra time to fill due to library policies. Would you like to create the hold anyway?">
+<!ENTITY common.hold.place_unfillable.override "The requested hold cannot currently be filled. You have permission to place the hold regardless, but should only do so if you know the hold will eventually be fillable. Would you like to create the hold anyway?">
 <!ENTITY common.hold.barred 'PATRON BARRED. Please see any notes in the
 "Staff Notes" section of your "My Account" page or contact your local library.'>
 <!ENTITY common.hold.item.invalid "This hold is no longer valid. It's likely that the
diff --git a/Open-ILS/web/opac/skin/default/js/holds.js b/Open-ILS/web/opac/skin/default/js/holds.js
index 15e7bc2..5c4a324 100644
--- a/Open-ILS/web/opac/skin/default/js/holds.js
+++ b/Open-ILS/web/opac/skin/default/js/holds.js
@@ -1022,18 +1022,27 @@ function holdHandleCreateResponse(r, recurse) {
 
 	if(!recurse) {
 		var res = r.getResultObject();
-        var age_protect_override = false;;
+        var place_anyway = false;
 		if(checkILSEvent(res) || res.success != 1) {
-            if(res.success != 1 && res.age_protected_copy == 1) {
-                // There is at least one copy that *could* fill the hold, if it were not age-protected.
-                if( confirm($('hold_age_protected_override').innerHTML) ) {
-                    age_protect_override = true;
-                } else {
-    		    	swapCanvas($('holds_box'));
-	    		    return;
+            if(res.success != 1) {
+                if(res.age_protected_copy == 1) {
+                    // There is at least one copy that *could* fill the hold, if it were not age-protected.
+                    if( confirm($('hold_age_protected_override').innerHTML) ) {
+                        place_anyway = true;
+                    } else {
+    		        	swapCanvas($('holds_box'));
+	    		        return;
+                    }
+                } else if(res.place_unfillable == 1) {
+                    if( confirm($('hold_place_unfillable_override').innerHTML) ) {
+                        place_anyway = true;
+                    } else {
+    		        	swapCanvas($('holds_box'));
+	    		        return;
+                    }
                 }
             }
-            if(!age_protect_override) {
+            if(!place_anyway) {
     			if(res.success != 1) {
 
                     if(!holdArgs.partsSuggestionMade && holdArgs.recordParts && 
diff --git a/Open-ILS/web/opac/skin/default/xml/common/holds.xml b/Open-ILS/web/opac/skin/default/xml/common/holds.xml
index 3b091b6..ff72572 100644
--- a/Open-ILS/web/opac/skin/default/xml/common/holds.xml
+++ b/Open-ILS/web/opac/skin/default/xml/common/holds.xml
@@ -242,6 +242,7 @@
 	<span class='hide_me' id='hold_dup_exists_override'>&common.hold.exists.override;</span>
 	<span class='hide_me' id='hold_checked_out_override'>&common.hold.checked_out.override;</span>
 	<span class='hide_me' id='hold_age_protected_override'>&common.hold.age_protect.override;</span>
+	<span class='hide_me' id='hold_place_unfillable_override'>&common.hold.place_unfillable.override;</span>
 
 	<span id='hold_failed_patron_barred' class='hide_me'>&common.hold.barred;</span>
 

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Circ/Holds.pm |    7 +++-
 .../lib/OpenILS/WWW/EGCatLoader/Account.pm         |    4 +-
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |    4 ++-
 .../0697.data.place_currently_unfillable_hold.sql  |   17 ++++++++++++
 Open-ILS/web/opac/locale/en-US/opac.dtd            |    1 +
 Open-ILS/web/opac/skin/default/js/holds.js         |   27 +++++++++++++------
 .../web/opac/skin/default/xml/common/holds.xml     |    1 +
 8 files changed, 48 insertions(+), 15 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0697.data.place_currently_unfillable_hold.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list