Main Koha release repository https://koha-community.org
Find a file
Tomas Cohen Arazi 2250cf0293 Bug 24254: Add Koha::Items->filter_by_visible_in_opac
This patch adds a method based on the original idea from Nick, but on
Koha::Items.

The idea is to build a proper filter, based on the current rules for
hiding things, directly on the DBIC query. The caller takes care of
knowing if the filtering should apply (i.e. checking the patron category
exceptions) and then it would do something like:

    my @items;
    if ( <patron_category_does_not_have_exception> ) {
        @items = $biblio->items->filter_by_visible_in_opac(
            {
                rules => $rules
            }
        );
    }
    else {
        # still want to enforce 'hidelostitems'
        @items = $biblio->items->filter_by_visible_in_opac;
    }

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. Look at the use cases on the tests, read the code
=> SUCCESS: It all makes sense
4. Compare with Koha::Item->hidden_in_opac
=> SUCCESS: It all makes sense
5. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-14 14:03:49 +01:00
acqui Bug 24470: Mark a batch as 'imported' if all the bib has been imported 2021-01-11 10:28:02 +01:00
admin Bug 27416: Make "Modify tag" and "Add tag" translatable 2021-01-13 17:17:00 +01:00
api Bug 27015: Make pickup locations searchable 2021-01-04 16:33:15 +01:00
authorities Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
basket Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
bin Bug 20582: Turn Koha into a Mojolicious application 2020-10-06 12:00:04 +02:00
C4 Bug 25306: Remove framework paramter from ModBiblioMarc 2021-01-12 16:13:50 +01:00
catalogue Bug 26707: Split cart and lists button on bibliographic detail pages 2021-01-04 16:31:29 +01:00
cataloguing Bug 26605: Correctly URI-encode query string in call number browse plugin 2020-11-02 11:03:09 +01:00
circ Bug 24083: Add support for unseen_renewals 2020-11-11 16:09:58 +01:00
clubs Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
course_reserves Bug 25898: Fix new occurrences 2020-10-15 13:56:41 +02:00
debian Bug 26947: Remove AUTO_INCREMENT 2021-01-12 12:31:58 +01:00
docs Bug 27108: Add 21.05 release team to teams.yaml 2020-11-27 16:35:09 +01:00
errors Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
etc Bug 25548: (follow-up) Remove those rewrite redirects in koha-httpd.conf 2020-11-20 14:23:52 +01:00
ill Bug 22818: Add generation and sending of notices 2020-11-11 08:35:10 +01:00
installer Bug 26947: Remove AUTO_INCREMENT 2021-01-12 12:31:58 +01:00
Koha Bug 24254: Add Koha::Items->filter_by_visible_in_opac 2021-01-14 14:03:49 +01:00
koha-tmpl Bug 25775: Compiled CSS 2021-01-14 14:03:49 +01:00
labels Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
members Bug 27144: Fix syntax error that prevents deleting patrons 2020-12-04 15:26:49 +01:00
misc Bug 25306: (QA follow-up) Remove framework from bulkmarcimport 2021-01-12 16:13:50 +01:00
offline_circ Bug 24083: Add support for unseen_renewals 2020-11-11 16:09:58 +01:00
opac Bug 26123: Add message notification to patron dashboard 2021-01-12 16:40:41 +01:00
patron_lists Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
patroncards Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
plugins Bug 24633: Add support for gitlab searching of plugins 2020-11-06 15:55:17 +01:00
pos Bug 24786: Update point of sale to use session register 2020-11-06 15:39:59 +01:00
reports Bug 24665: Add support for filtering by cash register 2020-11-06 15:55:17 +01:00
reserve Bug 26963: (QA follow-up) Fix cases where we expected a list 2020-11-13 14:20:11 +01:00
reviews Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
rotating_collections Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
serials Bug 26992: Fix serial issue and related items deletion on serial collection page 2020-11-20 08:16:02 +01:00
services Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
skel
suggestion Bug 26738: (bug 24819 follow-up) Fix manager selection 2020-11-04 12:59:32 +01:00
svc Bug 27306: Add subtitle to return-claims-table 2021-01-12 16:29:57 +01:00
t Bug 24254: Unit tests 2021-01-14 14:03:49 +01:00
tags Bug 24663: Remove authnotrequired if set to 0 2020-09-03 10:40:35 +02:00
tmp/modified_authorities
tools Bug 26854: Remove log of STDERR 2020-11-20 08:16:02 +01:00
virtualshelves Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
xt Bug 26971: Remove obsolete test file translatable-templates.t 2020-11-09 11:20:43 +01:00
.editorconfig Bug 24774: Set JSON indentation of 2 spaces in .editorconfig 2020-03-19 09:24:52 +00:00
.eslintrc.json Bug 23834: Add default ESLint configuration 2019-11-03 08:02:39 +00:00
.gitignore Bug 20427: Convert OPAC LESS to SCSS 2018-08-09 15:17:07 +00:00
.htaccess
.mailmap Bug 26621: Adjust .mailmap to reduce the number of invalid authors 2020-10-15 12:56:30 +02:00
.perlcriticrc Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
.scss-lint.yml Bug 21237: Clean up staff client SCSS 2018-08-24 16:23:25 +00:00
about.pl Bug 27252: Add deprecation warning, cross_fields pref, and add version to ES info 2021-01-07 15:32:20 +01:00
app.psgi Bug 20582: Fix PSGI file when behind a reverse proxy 2020-10-06 12:00:04 +02:00
changelanguage.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
cpanfile Bug 26848: Fix Readonly dependency in cpanfile 2021-01-12 11:17:35 +01:00
fix-perl-path.PL Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
gulpfile.js Bug 27072: Don't process staff interface CSS with rtlcss 2020-11-24 21:27:59 +01:00
help.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
INSTALL Bug 26617: Update INSTALL file to include koha-testing-docker and Gitlab links 2020-10-15 12:56:30 +02:00
Koha.pm Bug 27349: DBRev 20.12.00.003 2021-01-11 10:25:46 +01:00
koha_perl_deps.pl Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
kohaversion.pl Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
LICENSE
mainpage.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Makefile.PL Bug 20582: Map app.psgi file and bin directory in Makefile.PL 2020-10-06 18:14:30 +02:00
MANIFEST.SKIP Bug 9546 : Updating make manifest tardist 2013-02-06 23:54:46 -05:00
package.json Bug 25067: Move PO file manipulation code into gulp tasks 2020-11-06 09:46:11 +01:00
README
README.md Bug 27092: Remove note about "synced repo" from README.md 2020-11-25 16:31:58 +01:00
README.robots
rewrite-config.PL Bug 26290: Make Makefile.PL aware of SMTP configs 2020-10-02 15:27:18 +02:00
yarn.lock Bug 25067: Move PO file manipulation code into gulp tasks 2020-11-06 09:46:11 +01:00

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo