Summary: | Allow hiding branches from the OPAC search pulldowns | ||
---|---|---|---|
Product: | Koha | Reporter: | paxed <pasi.kallinen> |
Component: | OPAC | Assignee: | paxed <pasi.kallinen> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook, magnus, marjorie.barry-vila, martin.renvoize, mtompset, veron |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27360 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31654 |
||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: | Allow hiding branches from the OPAC search pulldowns |
Description
paxed
2014-05-13 11:07:19 UTC
Created attachment 28202 [details] [review] Allow hiding branches from the OPAC search pulldowns Libraries may have branches which are not in actual use, for example our system has a branch where items with errors go during database conversion from our old ILS. These branches should not be shown to the patron. This patch adds a new syspref OpacHideBranches, where you can list branch codes, separated by pipe, to hide from the OPAC. To test: 1) Apply patch 2) Check OPAC where library pulldowns are shown, eg. Advanced Search so that all libraries are listed. 3) Edit syspref OpacHideBranch, set it to some branch codes, separated by pipe. 4) Check OPAC that those libraries do not show up in the pulldowns. Comment on attachment 28202 [details] [review] Allow hiding branches from the OPAC search pulldowns Review of attachment 28202 [details] [review]: ----------------------------------------------------------------- ::: C4/Auth.pm @@ +417,5 @@ > + \@include_branches; > + } else { > + $tmpbranches; > + } > + }, Inline functions like this are difficult to maintain. They are also difficult to write tests for. If you modify C4 or Koha libraries, you need to write a test. This is only possible if you write this as a function. I'm assuming GetBranchesLoop is in C4/Branches, and I think this function would better fit there. This also seems like a convoluted way of doing it, but I could be wrong. ::: installer/data/mysql/sysprefs.sql @@ +235,4 @@ > ('OPACFRBRizeEditions','0','','If ON, the OPAC will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'), > ('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'), > ('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'), > +('OpacHideBranches','',NULL,'Hide these branches from OPAC search branches pull-down. (Use short branch names, separated by pipe-characters.)','Free'), I'm not sure a system preference is the best way to do it, because you also have search groups which could show up in the drop downs. Perhaps modifications to the library and group entry screens? I am failing this because of the lack of tests when modifying a C4 or Koha library. paxed: Will you be using some other functionality to hide the items from searches? What happens if an item connected to your hidden branch turns up in a search? Still valid? ON bug 27360 David Cook suggested to use the OPAC public flag for this. I think this is not a bad idea to extend it's scope. What do others think? *** Bug 31549 has been marked as a duplicate of this bug. *** (In reply to Magnus Enger from comment #4) > paxed: Will you be using some other functionality to hide the items from > searches? What happens if an item connected to your hidden branch turns up > in a search? Yeah, you'd use OpacSuppression or OpacHideItems for that. (In reply to Katrin Fischer from comment #6) > ON bug 27360 David Cook suggested to use the OPAC public flag for this. I > think this is not a bad idea to extend it's scope. What do others think? I think that David Cook is on to something there... ;) *** This bug has been marked as a duplicate of bug 31654 *** |