Go to file
Tomas Cohen Arazi 11bdc847a3 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: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-01-29 18:42:30 +00:00
C4 Bug 26957: Don't remove words that are also operators from search terms 2021-01-29 14:25:23 +00:00
Koha Bug 24254: Add Koha::Items->filter_by_visible_in_opac 2021-01-29 18:42:30 +00:00
acqui Bug 24470: Mark a batch as 'imported' if all the bib has been imported 2021-01-20 01:19:01 +00:00
admin Bug 25826: Forbid changing the hidden attributes for biblionumber 2021-01-13 21:59:41 +00:00
api/v1 Bug 27117: Only place_holds permission is needed to adjust pickup locations 2020-12-28 15:25:04 +00:00
authorities Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
basket Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
catalogue Bug 23475: Use localStorage to preserve simple search values 2020-12-15 20:00:00 +00:00
cataloguing Bug 26605: Correctly URI-encode query string in call number browse plugin 2020-11-16 18:43:41 +00:00
circ Bug 23485: Show barcode in holds to pull 2020-10-20 14:18:38 +00:00
clubs Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
course_reserves Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
debian Bug 14564: Set permissions on configuration backups 2020-12-28 21:32:04 +00:00
docs Bug 27108: Add 21.05 release team to teams.yaml 2020-12-17 14:28:22 +00: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-12-10 22:07:34 +00:00
ill Bug 23173: (follow-up) Small improvements in efficiency 2020-04-06 11:05:09 +01:00
installer Increment version for 20.05.08 release 2021-01-22 21:39:24 +00:00
koha-tmpl Bug 27297: Add required and blank options to av-build-dropbox.inc 2021-01-29 18:26:03 +00:00
labels Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
members Bug 27420: Use object accessor for $attr_type->class() 2021-01-22 14:05:14 +00:00
misc Update release notes for 20.05.08 release 2021-01-22 22:07:32 +00:00
offline_circ Bug 26675: (bug 23463 follow-up) Fix typo onloadn vs onloan 2020-11-10 22:49:05 +00:00
opac Bug 27230: Display OPAC description for OPAC_SUG 2021-01-04 21:58:14 +00:00
patron_lists Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
patroncards Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
plugins Bug 24633: Add support for gitlab searching of plugins 2020-11-16 22:21:01 +00:00
pos Bug 26023: Properly secure the cashup and refund actions 2020-09-04 17:43:21 +00:00
reports Bug 17801: Use issuedate for limits in Most Circulated Items 2020-09-14 21:43:59 +00:00
reserve Bug 26698: Use is_at_destination to determine if hold is at destination 2021-01-13 21:50:48 +00:00
reviews Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
rotating_collections Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
serials Bug 26992: Fix serial issue and related items deletion on serial collection page 2020-12-09 21:30:40 +00:00
services Bug 20019: use Modern::Perl in misc perl scripts 2018-02-05 09:47:08 -03:00
skel
…
suggestion Bug 26738: [20.05.x] (bug 24819 follow-up) Fix manager selection 2020-11-17 17:46:48 +00:00
svc Bug 27306: Add subtitle to return-claims-table 2021-01-29 14:52:19 +00:00
t Bug 24254: Unit tests 2021-01-29 18:42:30 +00:00
tags Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
tmp/modified_authorities
…
tools Bug 27413: Restore debarred and debarredcomment to batch patron mod tools 2021-01-22 17:40:00 +00:00
virtualshelves Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
xt Bug 26265: add a plan for tests 2020-09-02 14:32:44 +00: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 Update mailmap - Jonathan Druart 2017-06-21 12:42:19 -03:00
.perlcriticrc Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
.scss-lint.yml Bug 21237: Clean up staff client SCSS 2018-08-24 16:23:25 +00:00
INSTALL
…
Koha.pm Increment version for 20.05.08 release 2021-01-22 21:39:24 +00:00
LICENSE
…
MANIFEST.SKIP
…
Makefile.PL Bug 26265: Add missing xt dir 2020-09-02 14:32:13 +00:00
README
…
README.md Bug 27092: Remove note about "synced repo" from README.md 2020-12-14 15:32:15 +00:00
README.robots
…
about.pl Bug 25826: Add a warning to the about page 2021-01-13 21:59:36 +00:00
changelanguage.pl Bug 21299: (QA follow-up) Rename module and subroutine 2018-11-07 21:52:17 +00:00
cpanfile Bug 26848: Fix Readonly dependency in cpanfile 2021-01-20 01:54:26 +00:00
fix-perl-path.PL Bug 21395: Make perlcritic happy 2020-07-13 16:44:43 +00:00
gulpfile.js Bug 26228: Update gulpfile to work with Node.js v12 2020-09-03 14:49:31 +00:00
help.pl Bug 19817: Use the language from the interface if valid 2018-09-06 17:32:28 +00:00
koha_perl_deps.pl Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
kohaversion.pl
…
mainpage.pl Bug 24663: Remove authnotrequired if set to 0 2020-08-31 20:03:22 +00:00
package.json Bug 26228: Update gulpfile to work with Node.js v12 2020-09-03 14:49:31 +00:00
rewrite-config.PL Bug 25792: Rename 'ttf-dejavu' package to 'fonts-dejavu' for Debian 11 2020-07-28 14:46:44 +00:00
yarn.lock Bug 26228: Update gulpfile to work with Node.js v12 2020-09-03 14:49:31 +00:00

README.md

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