Summary: | Add Staff Collection status for items in C4::XSLT | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | OPAC | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | CLOSED WONTFIX | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | josef.moravec, lisettepalouse+koha |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 17624: Hide not-for-loan items on search results' availability
Bug 17624: [Follow-up] Consistency between Availability and Location Bug 17624: Separate XSLT item status for Staff Collection Bug 17624: [Follow-up] Consistency between Availability and Location |
Description
Marcel de Rooy
2016-11-14 14:15:07 UTC
Created attachment 57540 [details] [review] Bug 17624: Hide not-for-loan items on search results' availability Currently, not for loan items are listed as copies for reference on the OPAC XSLT search results. This reports add a preference to hide or show these not-for-loan items on the OPAC XSLT results view. It is: OPACXSLTResultsHideNFL. By default, it will still show them. So, no behavior change here. Note: This patch also removed a double line in the pref file that resulted in a small empty table row at the end of the Appearance section for OPAC preferences. Test plan: [1] Run the dbrev via the web installer. Verify that the pref is still off. This means that not-for-loans should be listed on the Availability line as "Copies available for reference". [2] Set the pref to Hide. [3] Verify that the not-for-loans are not shown in the search results. Note that you still see them in the details view (no problem: they are listed just as what they are: not for loan). [4] Set OpacItemLocation to Location. Look at the search results again. Created attachment 57541 [details] [review] Bug 17624: [Follow-up] Consistency between Availability and Location If OpacItemLocation is set to location, the opac results xslt shows something like: Availability: Copies available for loan: Library(1). Copies available for reference: Library(1). Location(s): Location_1 callnumber_1 Note that the reference item is not listed under Location, since the logic for that section is different. Simply stated: Available is created by two separate if statements, but Location is one if-else statement. This patch changes the Location logic to two if statements. In this process some single choose/when's are replaced by simple if's. Actually, the change is quite minimal. Test plan: [1] Set OPACXSLTResultsHideNFL to Show. Set OpacItemLocation to Location. [2] Use a biblio with two items. Put data in callnumber and location. Mark one item as not for loan. [3] Verify that you now see both items in the Location line of the search results. Hmm Still looking little bit at another approach What about hiding Staff collection only? (In reply to Marcel de Rooy from comment #4) > What about hiding Staff collection only? +1 It does make more sense to me I think we should not start hardcode special behaviour to configurable sample values. A lot of people use them differently or change them, which is something we never have discouraged. It would be safer to make this a configuration option, as we have in other cases. (In reply to Katrin Fischer from comment #6) > I think we should not start hardcode special behaviour to configurable > sample values. A lot of people use them differently or change them, which is > something we never have discouraged. It would be safer to make this a > configuration option, as we have in other cases. I agree. As you know, notforloan<0, notforloan==0 and notforloan>0 are tested already. It seems that we do not test ==1 though. Hm, but all positive values show a specific behaviour already - you can't put a hold on them and you can't check them out without override. (notforloan>0) Created attachment 57833 [details] [review] Bug 17624: Separate XSLT item status for Staff Collection In order to differentiate a regular not for loan with a not-for-loan that has the status "Staff Collection", this patch slightly adjusts the status in C4::XSLT::buildKohaItemsNamespace. This status is used in the OPAC results XSLT. If you do not have items with notforloan>=2, there will be no change in behavior. If you use notforloan=2 and did not change its authorised value description, a count for Staff Collection will be added in the Availability line. The items with notforloan==2 will no longer be viewed as "for reference". Higher values for notforloan will no longer be listed too as "for reference". (Same for a modified notforloan==2.) Note: I also considered using a plugin here or a specific preference. This solution is by far the simplest. Currently, we are presenting the item status in various places on various ways. A better solution would depend on consolidating the item status code in Koha::Item. Test plan: [1] Pick a biblio with three items: one should be for loan, set the other two to Not for loan and Staff Collection. [2] Look for this biblio on OPAC search results. Check Availability. Created attachment 57834 [details] [review] Bug 17624: [Follow-up] Consistency between Availability and Location If OpacItemLocation is set to location, the opac results xslt shows something like: Availability: Copies available for loan: Library(1). Copies available for reference: Library(1). Location(s): Location_1 callnumber_1 Note that the reference item is not listed under Location, since the logic for that section is different. Simply stated: Available is created by two separate if statements, but Location is one if-else statement. This patch changes the Location logic to two if statements. In this process some single choose/when's are replaced by simple if's. Actually, the change is quite minimal. NOTE: A conditional <br> tag is removed from the XSLT between the reference section and the status counts. Test plan: [1] Set OpacItemLocation to Location. [2] Use a biblio with two items. Put data in callnumber and location. Mark one item as not for loan. [3] Verify that you now see both items in the Location line of the search results. Apart from consolidating item status code, we also should take into account the relation between Not-for-loan and Use-restrictions on the item record when resolving this more globally. I am no fan of this approach. I think hardcoding behaviour for numeric values will break behaviour for libraries. I am still in favor of this being a configuration option. (In reply to Katrin Fischer from comment #12) > I am no fan of this approach. I think hardcoding behaviour for numeric > values will break behaviour for libraries. I am still in favor of this being > a configuration option. I have spent hours on other options. I will leave it at this point for now. Blocking this patch until a marvel(l)ous idea comes up.. |