From: Bill Erickson Date: Tue, 28 Jun 2011 18:51:43 +0000 (-0400) Subject: Suggest parts selection on failed parts-capable hold X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=451cd1bae88d256575d9b6ed0352799d8d47dfa7;p=evergreen%2Ftadl.git Suggest parts selection on failed parts-capable hold When a title has copy parts and the user does not select a specific part for the hold, treat it as a regular title hold. If the title hold fails, suggest to the user that he/she should select a specific part, since that opens the door to a new set of potentially capturable copies, which allow the hold to be successfully placed. Signed-off-by: Bill Erickson Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/web/opac/locale/en-US/opac.dtd b/Open-ILS/web/opac/locale/en-US/opac.dtd index 8203ce489e..bdaf91caf3 100644 --- a/Open-ILS/web/opac/locale/en-US/opac.dtd +++ b/Open-ILS/web/opac/locale/en-US/opac.dtd @@ -450,6 +450,7 @@ Please see a librarian to renew your account."> + diff --git a/Open-ILS/web/opac/skin/default/js/holds.js b/Open-ILS/web/opac/skin/default/js/holds.js index 73514c1243..9b09f68369 100644 --- a/Open-ILS/web/opac/skin/default/js/holds.js +++ b/Open-ILS/web/opac/skin/default/js/holds.js @@ -109,6 +109,9 @@ function holdsDrawEditor(args) { if(holdArgs.editHold) // flesh the args with the existing hold holdArgsFromHold(holdArgs.editHold, holdArgs); + $('holds_parts_selector').style.border = 'auto'; + holdArgs.partsSuggestionMade = false; + holdsDrawWindow(); } @@ -998,7 +1001,17 @@ function holdHandleCreateResponse(r, recurse) { var res = r.getResultObject(); if(checkILSEvent(res) || res.success != 1) { if(res.success != 1) { - alert($('hold_not_allowed').innerHTML); + + if(!holdArgs.partsSuggestionMade && holdArgs.recordParts && + holdArgs.recordParts.length && holdArgs.type == 'T') { + // T holds on records that have parts are OK, but if the record has no non-part + // copies, the hold will ultimately fail. Suggest selecting a part to the user. + $('holds_parts_selector').style.border = '2px solid red'; + holdArgs.partsSuggestionMade = true; + alert($('hold_has_parts').innerHTML); + } else { + alert($('hold_not_allowed').innerHTML); + } } else { if( res.textcode == 'PATRON_BARRED' ) { alertId('hold_failed_patron_barred'); 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 7d8712d235..4930ab73ec 100644 --- a/Open-ILS/web/opac/skin/default/xml/common/holds.xml +++ b/Open-ILS/web/opac/skin/default/xml/common/holds.xml @@ -219,6 +219,7 @@ &common.hold.failed; + &opac.hold.has_parts;