This development aims to enhance the AdvancedSearchTypes to support more than a single type at a time, so libraries can search collection codes AND itemtypes AND shelving locations AND other items fields in the future. By replacing the choice of AdvancedSearchTypes with free text, we can allow the library to specify multiple fields, and in their preferred order. Each field can then be put into it's own tab in the search interface, allowing for a more dense storage of values while not sacrificing functionality. This enhancement obsoletes bug 4329, as it covers more than just Shelving Locations, and also in the staff client (and is syspref controlled).
*** Bug 4329 has been marked as a duplicate of this bug. ***
Created attachment 5896 [details] Screenshot of proposed change: OPAC advanced search Shows tabs for different search limit fields
Created attachment 5897 [details] Screenshot of proposed changes: staff search Shows tabs in staff search
Created attachment 5898 [details] Screenshot of proposed changes: system preference change Shows change in system preference display
Created attachment 5899 [details] [review] Proposed Patch Adds the ability to perform advanced searches in both the OPAC and staff client on more than a single AdvancedSearchType at a time. Support included for Itemtype, Collection Code and Shelving Location, but other item fields are also possible. AdvancedSearchTypes syspref preference is repurposed; no longer a single value, it can now take multiple item code fields separated by "|". The order of these fields will determine the order of the tabs in the OPAC and staff client advanced search screens. Values within the search type are OR'ed together, while each different search type is AND'ed together in the query limits. The current stored values are supported without any required modification. Each set of advanced search fields are displayed in tabs in both the OPAC and staff client. The first value in the AdvancedSearchTypes syspref is the selected tab; if no values are present, "itemtypes" is used. For non-itemtype values, the value in AdvancedSearchTypes must match the Authorised Value name, and must be indexed with 'mc-' prefixing that name. <li> elements in tab are assigned unique IDs, so the text of the tab can be altered to match the library's needs (using JQuery). Unsupported search values have the same default text, but still get unique IDs based on their search index. The logic to handle the 5 element row limit has been moved from the Perl to the templates, since Template::Toolkit has a simple method for extracting the count of an element in a loop and performing 'modulus' on it.
Updating Version : This ENH will be for Koha 3.8
Bug versionned for master. entries will be made against rel_3_8 once the patch has been applied (see thread about that on koha-devel yesterday)
I'm really glad to see this in the works. Some superficial comments: - The new <script> block in opac-advsearch.tt should be inside <head> - The markup in catalogue/advsearch.tt has a missing </div> somewhere which breaks the display of the language-chooser - The description of the system preference needs to be much clearer, including saying what kind of input is allowed. It says: Show checkboxes for the [ ] item fields on the OPAC and staff advanced search pages, in the order listed. 'itemtypes', 'ccode' and 'loc' supported at this time. ...but it doesn't say what those terms mean or that they must be pipe-delimited. Maybe beyond the scope of this bug, maybe not: If we're working on this feature why not take the time now to split it into staff-specific and OPAC-specific preferences? For a library like mine which uses itemtype as a circ-policy code it doesn't make much sense to expose it to the patrons, but it does make sense for the staff.
Owen, <script> blocked moved up a line, inside <head>. I cannot find a <div> breaking my language display... Firebug isn't picking it up. Can you give me a more pointy pointer? Description in system preferences updated to be more explicit and clear. Splitting the system preference into two would be very easy to do, but it's outside the scope of this project, and would introduce a database update where one is not strictly necessary.
Created attachment 6910 [details] [review] Updated patch Enh 7031: More options for Advanced Search Adds the ability to perform advanced searches in both the OPAC and staff client on more than a single AdvancedSearchType at a time. Support included for Itemtype, Collection Code and Shelving Location. AdvancedSearchTypes syspref preference is repurposed; no longer a single value, it can now take multiple item code fields separated by "|". The order of these fields will determine the order of the tabs in the OPAC and staff client advanced search screens. Values within the search type are OR'ed together, while each different search type is AND'ed together in the query limits. The current stored values are supported without any required modification. Each set of advanced search fields are displayed in tabs in both the OPAC and staff client. The first value in the AdvancedSearchTypes syspref is the selected tab; if no values are present, "itemtypes" is used. For non-itemtype values, the value in AdvancedSearchTypes must match the Authorised Value name, and must be indexed with 'mc-' prefixing that name. <li> elements in tab are assigned unique IDs, so the text of the tab can be altered to match the library's needs (using JQuery) The logic to handle the 5 element row limit has been moved from the Perl to the templates, since Template::Toolkit has a simple method for extracting the count of an element in a loop and performing 'modulus' on it. 2011-12-21: Incorporated changes recommend by Owen Leonard on bug report.
Created attachment 6932 [details] [review] Follow-up patch with markup corrections This follow-up patch (to be applied on top of attachment 6910 [details] [review]) corrects some markup errors and removes some markup which I think is superfluous: - Using template FILTER command to remove invalid punctuation from ID attributes (to quiet the HTML validator) - Removing <fieldset> since options are bordered by the tab box now - Correcting the conditional which controls the table markup to prevent extra/missing </tr> - Adding missing ID attribute in the OPAC template
Created attachment 6938 [details] screenshot of advanced search I tested this and have some questions/notes: 1) I was searching for a special combination of itemtype A, location B, and collection code C. The search turned up a record where no item had this combination. There was one item with my itemtype A, while the other item had itemtype D, location B, and collection code C. Is it possible to make the search more specific here? 2) Why use phrase for itype, but not for ccode or loc? No results match your search with limit(s): 'mc-itype,phr:BK or mc-itype,phr:CF or mc-itype,phr:CR mc-ccode:"NFIC" mc-loc:"CART" or mc-loc:"CHILD"'. 3) I wonder if it's a bit confusing to show the heading as a link when only one limit is in use. 4) The "box" is a bit bigger than the other search options on the advanced search page. Perhaps a minor CSS glitch? 5) I agree with owen that this should be slit into separate preferences for staff and OPAC. 6) Staff search displays OPAC description instead of the normal description for the authorized values (loc and ccode). Failing QA for 6). 1) should be documented or improved if possible.
Katrin, (In reply to comment #12) > Created attachment 6938 [details] > screenshot of advanced search > > I tested this and have some questions/notes: > > 1) I was searching for a special combination of itemtype A, location B, and > collection code C. The search turned up a record where no item had this > combination. There was one item with my itemtype A, while the other item had > itemtype D, location B, and collection code C. > Is it possible to make the search more specific here? Not with GRS-1 indexing. DOM indexing would make it possible. > 2) Why use phrase for itype, but not for ccode or loc? > No results match your search with limit(s): 'mc-itype,phr:BK or > mc-itype,phr:CF or mc-itype,phr:CR mc-ccode:"NFIC" mc-loc:"CART" or > mc-loc:"CHILD"'. I'm not sure, but I would think that adding a phrase index and using that would be preferable here (however, I wouldn't hold up the QA process for it if I were the one signing off). Of course, while we're using GRS-1 indexing, it probably doesn't really matter all that much anyway.
Created attachment 7855 [details] [review] Bug 7031 Follow-up: Staff search displays OPAC description instead of the normal description for the authorized values
(In reply to comment #10) > Created attachment 6910 [details] [review] > Updated patch This patch no longer applies.
Created attachment 7857 [details] [review] Enh 7031: More options for Advanced Search Adds the ability to perform advanced searches in both the OPAC and staff client on more than a single AdvancedSearchType at a time. Support included for Itemtype, Collection Code and Shelving Location. AdvancedSearchTypes syspref preference is repurposed; no longer a single value, it can now take multiple item code fields separated by "|". The order of these fields will determine the order of the tabs in the OPAC and staff client advanced search screens. Values within the search type are OR'ed together, while each different search type is AND'ed together in the query limits. The current stored values are supported without any required modification. Each set of advanced search fields are displayed in tabs in both the OPAC and staff client. The first value in the AdvancedSearchTypes syspref is the selected tab; if no values are present, "itemtypes" is used. For non-itemtype values, the value in AdvancedSearchTypes must match the Authorised Value name, and must be indexed with 'mc-' prefixing that name. <li> elements in tab are assigned unique IDs, so the text of the tab can be altered to match the library's needs (using JQuery) The logic to handle the 5 element row limit has been moved from the Perl to the templates, since Template::Toolkit has a simple method for extracting the count of an element in a loop and performing 'modulus' on it. 2011-12-21: Incorporated changes recommend by Owen Leonard on bug report.
Created attachment 7859 [details] [review] [SIGNED-OFF] Enh 7031: More options for Advanced Search
Created attachment 7860 [details] [review] Follow-up patch with markup corrections
Created attachment 7861 [details] [review] [SIGNED-OFF] Follow-up: Staff search displays OPAC description instead of the normal description for the authorized values
I have signed off on the patches not written by me and re-attached everything in the order they need to be applied.
Created attachment 7864 [details] [review] [SIGNED-OFF] Bug 7031 Follow-up, More options for AdvancedSearchTypes This follow-up patch corrects some markup errors and removes some markup which I think is superfluous: - Using template FILTER command to remove invalid punctuation from ID attributes (to quiet the HTML validator) - Removing <fieldset> since options are bordered by the tab box now - Correcting the conditional which controls the table markup to prevent extra/missing </tr> - Adding missing ID attribute in the OPAC template Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 8127 [details] [review] Bug 7031: Followup for typo in catalogue search Trivial patch
QA Comment: Nice feature, introduced quite economically. Code looks good (especially noting the buildQuery environment and the search scripts;). Clear changes. Remember a trivial merge conflict in css file while applying. Added a followup for a simple typo in catalogue/search.pl (making no real difference but for the record) Tested it "diagonally". Marking as Passed QA.
QA comment: After applying the 4 patches, I get: "my" variable $total masks earlier declaration in same scope at catalogue/search.pl line 706. that was here before the patch (perl -wc catalogue/search.pl) so it's OK staff-global.css says: +.adsearch { isn't there a typo here ? shouldn't it be advsearch (add a v), as it's everywhere else ? I've grepped "adsearch", and it appears nowhere except in staff-global.css, so I think it's a typo. If you confirm it is, just switch back to "passed QA", i'll do the fix & push this (great) feature, as everything seems to work well. Note : I tested with my UNIMARC setup, and everything worked out of the box, well done !
Patch pushed, with a follow-up: * replaced adsearch by advsearch in css (typo fix) * replaced some tabs in .css by 4 spaces
*** Bug 5538 has been marked as a duplicate of this bug. ***
*** Bug 4481 has been marked as a duplicate of this bug. ***