Make new opac holds notes mandatory under conditions controlled by syspref and depending on record status. To illustrate: we examine MARC21 300$a; if it contains multiple parts/volumes, but there is only one item, we ask the user to specify a part in the notes. In this case we could implement by: call this situation reason 1, add it in code and template, and specify reason 1 in the syspref. The syspref may contain a number of such reasons like: 1,2&3,4 meaning check successively 1, or 2 and 3, or 4 for new hold requests. This allows for future extension and flexible configuration. When extending this further, we should probably add a small interface on top of the syspref instead of typing 1,2&3 etc. but imo this may be sufficient to start with. This development is part of bug 9721 (umbrella report for hold changes to meet special library needs). The patch builds on bug 9722 which allows opac users to add hold notes.
Created attachment 15842 [details] [review] Bug 9743: Mandatory opac hold notes under specified conditions Description: Adds a new preference OPACMandatoryHoldNotes controlling when hold notes are mandatory for opac users placing a hold. In this initial implementation four reasons for a mandatory hold are added: 1) MARC21 300$a contains a reference to multiple volumes/parts 2) Biblio has one item (used in combination with 1) 3) UNIMARC 200$a contains the word test (for testing purposes only) 4) MARC21 leader pos 7 is collection A new file is added to describe the use of this pref. The opac preferences form shows a link to that file. Test plan: 1) Enable OPACShowHoldNotes. 2) Enter 1&2,4 into OPACMandatoryHoldNotes (for MARC21 testing). For UNIMARC, you could use 3. 3) Change two biblios: one with leader 7==c and one with 1 item and 300a==2 v. For UNIMARC, you could add the word test to 200$a. 4) Place a hold in opac on these two books separately. Just verify if the hold notes display the reason for mandatory notes. Do not place the holds. Test if you can place a hold if the notes are empty. You should not be allowed to do so. 5) Enable DisplayMultiPlaceHold. Place hold on both books simultaneously. Verify if you see both reasons for mandatory notes. Place the holds. Check them in staff.
Created attachment 15843 [details] [review] Bug 9743: dbrev for mandatory hold notes Adds pref OPACMandatoryHoldNotes. Test plan: Run [your server]/cgi-bin/koha/installer/install.pl?step=3&op=updatestructure Optionally, run a new install to test sysprefs.sql. Or: Edit sysprefs.sql, leave at least the last few lines including the new one. And run from command line: mysql -p [yourdatabase] < [your-clone]/installer/data/mysql/sysprefs.sql
Created attachment 15910 [details] [review] Bug 9743: Unit test for mandatory hold notes Test plan: Export PERL5LIB and KOHA_CONF to your test database. Run t/db_dependent/Reserves.t. You should have 7 tests running ok.
git am -3 /tmp/Bug-9743-Mandatory-opac-hold-notes-under-specified-AtsBqs.patch Applying: Bug 9743: Mandatory opac hold notes under specified conditions fatal: sha1 information is lacking or useless (koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 9743: Mandatory opac hold notes under specified conditions
Created attachment 17720 [details] [review] Bug 9743: Mandatory opac hold notes under specified conditions Description: Adds a new preference OPACMandatoryHoldNotes controlling when hold notes are mandatory for opac users placing a hold. In this initial implementation four reasons for a mandatory hold are added: 1) MARC21 300$a contains a reference to multiple volumes/parts 2) Biblio has one item (used in combination with 1) 3) UNIMARC 200$a contains the word test (for testing purposes only) 4) MARC21 leader pos 7 is collection A new file is added to describe the use of this pref. The opac preferences form shows a link to that file. Test plan: 1) Enable OPACShowHoldNotes. 2) Enter 1&2,4 into OPACMandatoryHoldNotes (for MARC21 testing). For UNIMARC, you could use 3. 3) Change two biblios: one with leader 7==c and one with 1 item and 300a==2 v. For UNIMARC, you could add the word test to 200$a. 4) Place a hold in opac on these two books separately. Just verify if the hold notes display the reason for mandatory notes. Do not place the holds. Test if you can place a hold if the notes are empty. You should not be allowed to do so. 5) Enable DisplayMultiPlaceHold. Place hold on both books simultaneously. Verify if you see both reasons for mandatory notes. Place the holds. Check them in staff.
Created attachment 17721 [details] [review] Bug 9743: dbrev for mandatory hold notes Adds pref OPACMandatoryHoldNotes. Test plan: Run [your server]/cgi-bin/koha/installer/install.pl?step=3&op=updatestructure Optionally, run a new install to test sysprefs.sql. Or: Edit sysprefs.sql, leave at least the last few lines including the new one. And run from command line: mysql -p [yourdatabase] < [your-clone]/installer/data/mysql/sysprefs.sql
Created attachment 17722 [details] [review] Bug 9743: Unit test for mandatory hold notes Test plan: Export PERL5LIB and KOHA_CONF to your test database. Run t/db_dependent/Reserves.t. You should have 7 tests running ok.
(In reply to comment #4) > Patch failed at 0001 Bug 9743: Mandatory opac hold notes under specified > conditions Rebased patches. Please build upon the three patches of 9722 (in signed off state). Thanks for testing.
Needs a rebase. Plus adaptation to renamed syspref :)
Created attachment 19561 [details] [review] Bug 9743: Mandatory opac hold notes under specified conditions Description: Adds a new preference OPACMandatoryHoldNotes controlling when hold notes are mandatory for opac users placing a hold. In this initial implementation four reasons for a mandatory hold are added: 1) MARC21 300$a contains a reference to multiple volumes/parts 2) Biblio has one item (used in combination with 1) 3) UNIMARC 200$a contains the word test (for testing purposes only) 4) MARC21 leader pos 7 is collection A new file is added to describe the use of this pref. The opac preferences form shows a link to that file. Test plan: 1) Enable OPACHoldNotes. 2) Enter 1&2,4 into OPACMandatoryHoldNotes (for MARC21 testing). For UNIMARC, you could use 3. 3) Change two biblios: one with leader 7==c and one with 1 item and 300a==2 v. For UNIMARC, you could add the word test to 200$a. 4) Place a hold in opac on these two books separately. Just verify if the hold notes display the reason for mandatory notes. Do not place the holds. Test if you can place a hold if the notes are empty. You should not be allowed to do so. 5) Enable DisplayMultiPlaceHold. Place hold on both books simultaneously. Verify if you see both reasons for mandatory notes. Place the holds. Check them in staff.
Created attachment 19562 [details] [review] Bug 9743: dbrev for mandatory hold notes Adds pref OPACMandatoryHoldNotes. Test plan: Run [your server]/cgi-bin/koha/installer/install.pl?step=3&op=updatestructure Optionally, run a new install to test sysprefs.sql. Or: Edit sysprefs.sql, leave at least the last few lines including the new one. And run from command line: mysql -p [yourdatabase] < [your-clone]/installer/data/mysql/sysprefs.sql
Created attachment 19563 [details] [review] Bug 9743: Unit test for mandatory hold notes Test plan: Export PERL5LIB and KOHA_CONF to your test database. Run t/db_dependent/Reserves.t.
Applying: Bug 9743: Mandatory opac hold notes under specified conditions Using index info to reconstruct a base tree... M C4/Reserves.pm M koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref M koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt M opac/opac-reserve.pl Falling back to patching base and 3-way merge... Auto-merging opac/opac-reserve.pl Auto-merging koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref Auto-merging C4/Reserves.pm CONFLICT (content): Merge conflict in C4/Reserves.pm Patch failed at 0001 Bug 9743: Mandatory opac hold notes under specified conditions The copy of the patch that failed is found in: /home/christopher/git/koha/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Created attachment 21233 [details] [review] Bug 9743: Mandatory opac hold notes under specified conditions Description: Adds a new preference OPACMandatoryHoldNotes controlling when hold notes are mandatory for opac users placing a hold. In this initial implementation four reasons for a mandatory hold are added: 1) MARC21 300$a contains a reference to multiple volumes/parts 2) Biblio has one item (used in combination with 1) 3) UNIMARC 200$a contains the word test (for testing purposes only) 4) MARC21 leader pos 7 is collection A new file is added to describe the use of this pref. The opac preferences form shows a link to that file. Test plan: 1) Enable OPACHoldNotes. 2) Enter 1&2,4 into OPACMandatoryHoldNotes (for MARC21 testing). For UNIMARC, you could use 3. 3) Change two biblios: one with leader 7==c and one with 1 item and 300a==2 v. For UNIMARC, you could add the word test to 200$a. 4) Place a hold in opac on these two books separately. Just verify if the hold notes display the reason for mandatory notes. Do not place the holds. Test if you can place a hold if the notes are empty. You should not be allowed to do so. 5) Enable DisplayMultiPlaceHold. Place hold on both books simultaneously. Verify if you see both reasons for mandatory notes. Place the holds. Check them in staff.
Trivial rebase. Too bad that gitbot cannot do that too :)
Trying a new title for this amazing report! Please test.
Created attachment 21236 [details] [review] Bug 9743: dbrev for mandatory hold notes Adds pref OPACMandatoryHoldNotes. Test plan: Run [your server]/cgi-bin/koha/installer/install.pl?step=3&op=updatestructure Optionally, run a new install to test sysprefs.sql. Or: Edit sysprefs.sql, leave at least the last few lines including the new one. And run from command line: mysql -p [yourdatabase] < [your-clone]/installer/data/mysql/sysprefs.sql
Yet another rebase: updatedatabase, and sysprefs.sql. Really, gitbot you can do it..
Created attachment 21240 [details] [review] Bug 9743: Unit test for mandatory hold notes Note: I remove the lines dealing testing existence of CPL branch. I have submitted a patch under report 9761 dealing with that situation. Test plan: Export PERL5LIB and KOHA_CONF to your test database. Run t/db_dependent/Reserves.t.
And even the unit test did not miss a rebase..
Patch applied cleanly, go forth and signoff
Created attachment 21741 [details] [review] Bug 9743: Mandatory opac hold notes under specified conditions Description: Adds a new preference OPACMandatoryHoldNotes controlling when hold notes are mandatory for opac users placing a hold. In this initial implementation four reasons for a mandatory hold are added: 1) MARC21 300$a contains a reference to multiple volumes/parts 2) Biblio has one item (used in combination with 1) 3) UNIMARC 200$a contains the word test (for testing purposes only) 4) MARC21 leader pos 7 is collection A new file is added to describe the use of this pref. The opac preferences form shows a link to that file. Test plan: 1) Enable OPACHoldNotes. 2) Enter 1&2,4 into OPACMandatoryHoldNotes (for MARC21 testing). For UNIMARC, you could use 3. 3) Change two biblios: one with leader 7==c and one with 1 item and 300a==2 v. For UNIMARC, you could add the word test to 200$a. 4) Place a hold in opac on these two books separately. Just verify if the hold notes display the reason for mandatory notes. Do not place the holds. Test if you can place a hold if the notes are empty. You should not be allowed to do so. 5) Enable DisplayMultiPlaceHold. Place hold on both books simultaneously. Verify if you see both reasons for mandatory notes. Place the holds. Check them in staff.
Created attachment 21742 [details] [review] Bug 9743: dbrev for mandatory hold notes Adds pref OPACMandatoryHoldNotes. Test plan: Run [your server]/cgi-bin/koha/installer/install.pl?step=3&op=updatestructure Optionally, run a new install to test sysprefs.sql. Or: Edit sysprefs.sql, leave at least the last few lines including the new one. And run from command line: mysql -p [yourdatabase] < [your-clone]/installer/data/mysql/sysprefs.sql
Created attachment 21743 [details] [review] Bug 9743: Unit test for mandatory hold notes Adds three unit tests to Reserves.t Test plan: Run t/db_dependent/Reserves.t.
Created attachment 21744 [details] [review] Bug 9743: Unit test for mandatory hold notes Adds three unit tests to Reserves.t Test plan: Run t/db_dependent/Reserves.t.
Rebased three patches, mainly due to new layout of opac-reserve. Note that the design for the line with the reason for a mandatory hold note still needs improvement. I asked Owen for a suggestion there.
Obsoleting the patches for this report. Will probably come up with a new approach to get this moving. Back to Assigned for the moment.
Created attachment 34422 [details] [review] Bug 9743: Allow customization for making hold notes required This patch removes some unused code in the reserves template for mandatory hold notes reasons. It adds a simpler approach: if you define a custom routine for required hold notes, the textarea in the template may turn into a required field, otherwise it will not. Test plan: [1] Without adding a routine in opac-reserve: Place a hold on one and on more biblio numbers. Verify that hold notes are not required in any case. [2] Add the following simple routine to opac-reserve: sub _reqholdnotes { 1; } Verify that hold notes are always required now.
Please enable pref OpacHoldNotes to have meaningful test results :)
This still needs a follow-up for a deselected biblio with notes in case of multiple holds.
Created attachment 34526 [details] [review] Bug 9743: Allow customization for making hold notes required This patch removes some unused code in the reserves template for mandatory hold notes reasons. It adds a simpler approach: if you define a custom routine for required hold notes, the textarea is required under the conditions you specified. Test plan: [1] Without adding a routine in opac-reserve: Place a hold on one and on more biblio numbers. Verify that hold notes are not required in any case. [2] Add the following simple routine to opac-reserve: sub _reqholdnotes { 1; } Verify that hold notes are always required now. [3] Place a multiple hold request and check the following: If you hide the hold notes (and leave them blank), the additional options (incl. hold notes) should expand again for the first biblio with required hold notes when submitting the form.
What does it mean when a MARC21 300$a field contains a reference to multiple volumes/parts?
(In reply to Joonas Kylmälä from comment #33) > What does it mean when a MARC21 300$a field contains a reference to multiple > volumes/parts? This biblio describes for example a work in three parts, but it has been catalogued as one (in our case we still have these ones only having one item too that comprises all parts; we split the items when labeling.)
Closing this report; revised under a new report.