From 7e76706a0b34f87797f09b9b3218bce476c067dc Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sun, 1 Oct 2017 12:03:26 -0400 Subject: [PATCH] LP 1694058: Final OPAC Changes for Multiple Hold Placement MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add JavaScript code to disable the number of copies selection when a part is chosen for a record that has both parts and non parts holds available. If a part is chosen, the number of copies select should be disabled and reset to 1. It should be enabled again if the All Parts option is chosen. It does not appear if the hold requires a part. Test Plan for the OPAC changes: 1. Set circ.holds.max_duplicate_holds to 5 for BR1. 2. Login to the OPAC as any patron from BR1. 3. Perform any search. 4. Select a title and click Place Hold. 5. See that the selection box for placing multiple holds does not appear on the place holds screen. 6. Place the hold to see that hold placement still works as expected. 8. Go to the patron’s list of holds in My Opac to see that the hold appears. 9. Cancel the hold so it doesn’t interfere with later testing. 10. Logout. 11. Login to the OPAC as any patron from BR2 or any branch other than BR1. 12. Perform any search. 13. Select a title and click Place Hold. 14. See that the selection box for placing multiple holds does not appear on the place holds screen. 15. Place the hold to see that hold placement still works as expected. 16. Go to the patron’s list of holds in My Opac to see that the hold appears. 17. Cancel the hold so it doesn’t interfere with later testing. 18. Logout. 19. Login to the web staff client as a circulator for BR1 at BR1. 20. Select a patron barcode for any BR1 patron. 21. Perform any search. 22. Choose a title without parts and click place holds. 23. See that the selection box for placing multiple holds appears with 1 as the default. 24. Click the selection box to see that the values go from 1 to 5. 25. Place any number of holds for the patron whose barcode was chosen in step 15. 26. Open the patron in the staff client and check the patron’s holds list to see that they have the correct number of holds for this title listed. 27. Repeat steps 21 – 26 with metarecord holds on one of the metarecord titles. 28. Perform a search and select a title. 29. Choose an item to place a copy hold for the same patron. 30. Notice that the multiple hold number selection box does not appear. 31. Place the hold as normal (if you like) to test that copy hold placement still works. 32. Search for a title with parts. 33. Select a part in the parts drop down or radio button. 34. Notice that the number of copies select box is reset to 1 and disabled when a part is selected. 35. Repeat the above steps for a BR2 circulation account logged in at BR2 (or any other branch staff). 36. Notice that the selection box never appears when placing holds where the org. unit setting does not apply. 37. Clear the org. unit setting for BR1 and repeat the above steps, if desired. The web staff client tests should work in the XUL staff client as well. Signed-off-by: Jason Stephenson Signed-off-by: Kathy Lussier --- Open-ILS/src/templates/opac/parts/place_hold.tt2 | 28 +++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/place_hold.tt2 b/Open-ILS/src/templates/opac/parts/place_hold.tt2 index b40c34c5d0..099208c950 100644 --- a/Open-ILS/src/templates/opac/parts/place_hold.tt2 +++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2 @@ -24,6 +24,28 @@ function toggleActivationDate() { // Prevent the href from being followed, thus overriding the CSS. return false; } + +// Maybe enable or disable the num_copies select when the user selects +// or deselects a part. +function maybeToggleNumCopies(obj) { + var numCopies = document.getElementById("num_copies"); + // Only if numCopies exists. + if (numCopies) { + var objValue; + if (obj.type == 'radio') { + if (obj.checked) objValue = obj.value; + else return; + } else { + objValue = obj.value; + } + if (objValue && objValue != '') { + if (numCopies.value != '1') numCopies.value = '1'; + if (!numCopies.disabled) numCopies.disabled = true; + } else { + if (numCopies.disabled) numCopies.disabled = false; + } + } +}

[% l('Place Hold') %]

@@ -132,10 +154,10 @@ function toggleActivationDate() {
[% IF !hdata.part_required %] - [% l('All Parts') %] + [% l('All Parts') %] [% END %] [% FOR part IN hdata.parts %] - + [% END %]
@@ -143,7 +165,7 @@ function toggleActivationDate() { - [% IF !hdata.part_required %] [% END %] -- 2.11.0