]> git.koha-community.org Git - koha.git/log
koha.git
8 days agoBug 35659: (follow-up) Make OAI repositories edition comply with CSRF
Matthias Meusburger [Wed, 20 Mar 2024 10:32:51 +0000 (10:32 +0000)]
Bug 35659: (follow-up) Make OAI repositories edition comply with CSRF

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
8 days agoBug 35659: (follow-up) Better handling of accented characters
Andreas Roussos [Wed, 28 Feb 2024 07:06:33 +0000 (07:06 +0000)]
Bug 35659: (follow-up) Better handling of accented characters

If you try to harvest bibliographic records from a UNIMARC OAI
repository (using oai_dc data format) in a MARC21 Koha instance
and run the OAI harvester script in verbose mode, you may get
lines similar to the following in the output:

no mapping found for [0xC9] at position 0 in Économie politique g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.
no mapping found for [0xC9] at position 0 in Église et société g0=ASCII_DEFAULT g1=EXTENDED_LATIN at /usr/share/perl5/MARC/Charset.pm line 308.

When looking at the imported records' biblio details page in
the OPAC, most words containing accented characters will not
appear correctly.

The fix is to apply Franck Theeten's solution from Bug 16488
(https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16488#c24)
and modify the value of the MARC leader's 10th character
to 'a' in the XSLT that transforms the UNIMARC OAI records
into MARC21 XML. Then, the accented characters get imported
properly and the records appear correctly in the OPAC.

Test plan:

0) Without this patch, running the OAI harvesting script in
   verbose mode produces many warnings, and garbled characters
   appear in the OPAC biblio details page wherever accented
   characters are in use.

1) Apply this patch.

2) Re-run the OAI harvesting script in verbose + force mode
   (force mode is required to ignore record datestamps from
   previous runs):

   misc/cronjobs/harvest_oai.pl -v -r <OAI_REPO_ID> -f

   This time there should be no warnings printed on your
   screen, and any characters with accents in the updated
   records should look OK in the OPAC.

Thanks-to: Franck Theeten <franck.theeten@africamuseum.be>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
8 days agoBug 35659: OAI Harvester
Matthias Meusburger [Thu, 20 Jul 2023 14:29:49 +0000 (16:29 +0200)]
Bug 35659: OAI Harvester

Test plan:

 - Run updatedatabase.pl

 - Apply the DBIC update patch

 - Setup an OAI repository in Administration -> OAI repositories (admin/oaiservers.pl)

   If the repository dataformat is in oai_dc, you can use the sample XSLT files:
   For Unimarc:
   OAIDCtoUNIMARCXML.xsl for bibliographic records
   AuthOAIDCtoUNIMARCXML.xsl for authorities

   For Marc21:
   OAIDCtoMARC21XML.xsl for bibliographic records
   AuthOAIDCtoMARC21XML.xsl for authorities

   If the repository dataformat is in marc-xml, you can use
   OAIMarcxml2KohaMarcxml.xsl for both Unimarc and Marc21.

 - Some repositories to test with:

   Bibliographic records, oai_dc:
   Endpoint: http://staroai.theses.fr/OAIHandler
   Set: ddc:260
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIDCtoMARC21XML.xsl

   Authorities, oai_dc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoUNIMARCXML.xsl
   or
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/AuthOAIDCtoMARC21XML.xsl

   Authorities, marc-xml, Unimarc:
   Endpoint: https://www.idref.fr/OAI/oai.jsp
   Set: a
   XSLT: <path_to_src>/koha-tmpl/intranet-tmpl/prog/en/xslt/OAIMarcxml2KohaMarcxml.xsl

 - Note: marc-xml harvesting will not work with HTTP::OAI::Harvester version 3.xx
   Version 4.xx is needed.
   See Bug 17704 for updating Koha default version to 4.xx

 - If you want to receive a report email, fill the OAI-PMH:HarvestEmailReport
   syspref. The model used (OAI_HARVEST_REPORT) can be edited in tools -> Notices and slips.

 - start a harvest with the following command:
   misc/cronjobs/harvest_oai.pl

    This script starts an OAI Harvest

    This script has the following parameters :
        -h --help: this message
        -v --verbose (enable output to stdout)
        -r --repository: id of the OAI repository
        -d --days: number of days to harvest from (optional)
        -l --list: list the OAI repositories
        -f --force: force harvesting (ignore records datestamps) (optional)

    Example: misc/cronjobs/harvest_oai.pl -r 1 -d 10 -v -f

 - Check the logs in the Log Viewer (tools/viewlog.pl)
   (CronjobLog syspref must be activated)

Sponsored-by: KohaLa
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Sponsored-by: Association KohaLa - https://koha-fr.org/
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 14007: Filter search result values to remove OpacHiddenItems values
David Cook [Thu, 24 Oct 2024 01:33:44 +0000 (01:33 +0000)]
Bug 14007: Filter search result values to remove OpacHiddenItems values

This change filters the values from the OpacHiddenItems syspref
out of their corresponding search results facets.

Note: This does not mean that all values from hidden items are filtered out of facets.
Rather, it just means that facet data that matches OpacHiddenItems is filtered out. This is
an imperfect fix, but it is a practical fix that has been requested by more than one library.

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
2. Add an item with an item type of "Maps"
3. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItems
4. Fill in OpacHiddenItems with the following:
itype: ['MP']
5. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
6. Note that "Maps" does not appear in the "Item types" facet
7. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test
8. Note that "Maps" does appear in the "Item types" facet

9. ***Repeat this test plan using both Elasticsearch and Zebra indexing***

10. prove -v t/Koha/SearchEngine/Search.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38085: Pick multiple_sortable options for translation
Jonathan Druart [Mon, 7 Oct 2024 09:31:36 +0000 (11:31 +0200)]
Bug 38085: Pick multiple_sortable options for translation

Bug 29948 added a "multiple_sortable" type for sysprefs, to have the
options sortable. But the options were not picked for translation.

This patch fixes it.

Test plan:
Run `cd misc/translator && perl translate update LANG` before and after
this patch. Notice that with this patch you see the different options of
OPACAuthorIdentifiersAndInformation in the LANG-pref.po file (eg.
"Associated group (373$a$s$t$u$v$0)")
Translate the options
Install the translated version of the templates and confirm that the
strings appear translated on the interface.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: (QA follow-up) Fix translation and capitalization issues
Katrin Fischer [Fri, 25 Oct 2024 14:30:12 +0000 (14:30 +0000)]
Bug 38222: (QA follow-up) Fix translation and capitalization issues

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: DBRev 24.06.00.046
Katrin Fischer [Fri, 25 Oct 2024 14:29:10 +0000 (14:29 +0000)]
Bug 38222: DBRev 24.06.00.046

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: (QA follow-up) Limit combobox input in cancel booking modal to db field...
Paul Derscheid [Fri, 25 Oct 2024 10:09:11 +0000 (10:09 +0000)]
Bug 38222: (QA follow-up) Limit combobox input in cancel booking modal to db field length

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: (QA follow-up) Show cancellation reason where applicable, appropriately...
Paul Derscheid [Fri, 25 Oct 2024 09:03:43 +0000 (09:03 +0000)]
Bug 38222: (QA follow-up) Show cancellation reason where applicable, appropriately handle statuses

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: (QA follow-up) DRY event listener setup for combobox resets on modal close
Paul Derscheid [Fri, 25 Oct 2024 07:41:07 +0000 (07:41 +0000)]
Bug 38222: (QA follow-up) DRY event listener setup for combobox resets on modal close

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: (QA follow-up) Add av category update
Martin Renvoize [Fri, 25 Oct 2024 07:19:08 +0000 (08:19 +0100)]
Bug 38222: (QA follow-up) Add av category update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: (follow-up) Include cancellation reason in sample notice for booking cance...
Paul Derscheid [Thu, 24 Oct 2024 12:58:33 +0000 (12:58 +0000)]
Bug 38222: (follow-up) Include cancellation reason in sample notice for booking cancellation

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: (follow-up) Only replace first numerical match in bookings count containers
Paul Derscheid [Thu, 24 Oct 2024 14:57:04 +0000 (14:57 +0000)]
Bug 38222: (follow-up) Only replace first numerical match in bookings count containers

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: (follow-up) Minimally initialize combobox if passed no data via constructo...
Paul Derscheid [Thu, 24 Oct 2024 14:41:39 +0000 (14:41 +0000)]
Bug 38222: (follow-up) Minimally initialize combobox if passed no data via constructor or referenced elements

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: (follow-up) Remove residual inline styles from example for combobox usage
Paul Derscheid [Thu, 24 Oct 2024 14:40:06 +0000 (14:40 +0000)]
Bug 38222: (follow-up) Remove residual inline styles from example for combobox usage

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: (follow-up) Reset overflow property of modal-body to prevent clipping...
Paul Derscheid [Thu, 24 Oct 2024 12:18:40 +0000 (12:18 +0000)]
Bug 38222: (follow-up) Reset overflow property of modal-body to prevent clipping of combobox options instead of position: fixed

Also remove the inlined styles on the unordered list. Bootstrap's dropdown handles all of this.

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: Use comboboxes in circ/circulation.pl, bookings/list.pl, members/moremember.pl
Paul Derscheid [Wed, 23 Oct 2024 16:44:47 +0000 (16:44 +0000)]
Bug 38222: Use comboboxes in circ/circulation.pl, bookings/list.pl, members/moremember.pl

To test:
1) Apply dependencies and this patch
2) Maybe update class files w/ update_dbix_class_files.pl
3) Build a new bundle w/ yarn api:bundle
4) Restart plack
5) Add a couple bookings to a patron
6) Go to any of the above modules
7) Cancel the booking and note
    7.1) That the value you input is correctly received by the backend for cancellation_reason
    7.2) Do it for the other 2 modules
8) Configure some authorised values under category BOOKING_CANCELLATION
9) Repeat 7 and note that you can select them in the combobox
10) Sign off or leave your feedback

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: Add handling for cancellation reasons to cancel booking modal template...
Paul Derscheid [Wed, 23 Oct 2024 16:43:16 +0000 (16:43 +0000)]
Bug 38222: Add handling for cancellation reasons to cancel booking modal template, associated script

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: Add cancellation reason to bookings patch definition; reformat bookings...
Paul Derscheid [Wed, 23 Oct 2024 16:41:22 +0000 (16:41 +0000)]
Bug 38222: Add cancellation reason to bookings patch definition; reformat bookings definition

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38222: Add combobox component
Paul Derscheid [Wed, 23 Oct 2024 16:40:11 +0000 (16:40 +0000)]
Bug 38222: Add combobox component

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 36560: (QA follow-up) Tidy code
Kyle M Hall [Fri, 25 Oct 2024 11:45:32 +0000 (11:45 +0000)]
Bug 36560: (QA follow-up) Tidy code

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 36560: Add a CSRF exception for ILS-DI API
David Cook [Tue, 22 Oct 2024 02:06:18 +0000 (02:06 +0000)]
Bug 36560: Add a CSRF exception for ILS-DI API

This change adds an exception for the ILS-DI API for CSRF prevention since there is no way to acquire a CSRF token
for the ILS-DI API.

1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI
2. Enable "ILS-DI"
3. curl -v localhost:8080/cgi-bin/koha/ilsdi.pl -d "service=AuthenticatePatron&username=REALUSER&password=REALPASSWORD"
4. Note the 403 response

5. Apply the patch
6. sudo koha-plack --restart kohadev

7. curl -v localhost:8080/cgi-bin/koha/ilsdi.pl -d "service=AuthenticatePatron&username=REALUSER&password=REALPASSWORD"
8. Note the 200 response

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: (QA follow-up) Add AFTER to database update
Katrin Fischer [Fri, 25 Oct 2024 13:41:50 +0000 (13:41 +0000)]
Bug 35906: (QA follow-up) Add AFTER to database update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: DBIC schema update
Katrin Fischer [Fri, 25 Oct 2024 13:25:52 +0000 (13:25 +0000)]
Bug 35906: DBIC schema update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: DBRev 24.06.00.045
Katrin Fischer [Fri, 25 Oct 2024 13:21:24 +0000 (13:21 +0000)]
Bug 35906: DBRev 24.06.00.045

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: (QA follow-up) Unit tests for effective_bookable
Martin Renvoize [Fri, 18 Oct 2024 10:40:45 +0000 (11:40 +0100)]
Bug 35906: (QA follow-up) Unit tests for effective_bookable

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: (QA follow-up) Correct type on added bookable column
Paul Derscheid [Fri, 18 Oct 2024 10:33:38 +0000 (10:33 +0000)]
Bug 35906: (QA follow-up) Correct type on added bookable column

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: (QA follow-up) Tidy block in TestBuilder.pm
Paul Derscheid [Fri, 18 Oct 2024 10:23:30 +0000 (10:23 +0000)]
Bug 35906: (QA follow-up) Tidy block in TestBuilder.pm

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: (QA follow-up) Refactor (slightly) to reduce complexity in Koha/Item(s...
Paul Derscheid [Fri, 18 Oct 2024 09:58:19 +0000 (09:58 +0000)]
Bug 35906: (QA follow-up) Refactor (slightly) to reduce complexity in Koha/Item(s).pm, catalogue/updateitem

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: (QA follow-up) Tidy admin/itemtypes.pl, Items.t
Paul Derscheid [Fri, 18 Oct 2024 09:56:50 +0000 (09:56 +0000)]
Bug 35906: (QA follow-up) Tidy admin/itemtypes.pl, Items.t

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: (QA follow-up) Ensure we return effective_bookable
Martin Renvoize [Fri, 18 Oct 2024 08:10:00 +0000 (09:10 +0100)]
Bug 35906: (QA follow-up) Ensure we return effective_bookable

The API wasn't including the effective_bookable value in responses

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: (QA follow-up) Add bookable option for API
Thibaud Guillot [Fri, 27 Sep 2024 15:04:48 +0000 (15:04 +0000)]
Bug 35906: (QA follow-up) Add bookable option for API

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: (QA follow-up) Fix item-type schema
Martin Renvoize [Mon, 26 Feb 2024 19:28:03 +0000 (19:28 +0000)]
Bug 35906: (QA follow-up) Fix item-type schema

Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: Remove preference and add override handling
Martin Renvoize [Mon, 26 Feb 2024 16:14:28 +0000 (16:14 +0000)]
Bug 35906: Remove preference and add override handling

This patch updates the bookable nature of items to allow setting at the
itemtype level and then overriding that setting at item level should you
so wish to do so.

We also now properly handle the item_level-itypes preference such that
we look at item or biblioitem level appropriately.

Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: Add unit test
Thibaud Guillot [Fri, 23 Feb 2024 09:00:01 +0000 (10:00 +0100)]
Bug 35906: Add unit test

Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 35906: Add bookable option on itemtype
Thibaud Guillot [Thu, 25 Jan 2024 13:14:07 +0000 (14:14 +0100)]
Bug 35906: Add bookable option on itemtype

Actually new "booking" feature can be set on an item but no directly on
an itemtype. This patch adds this possibility.

Test plan:
1) Test this new feature on an item as it were currently working.
2) Apply this patch
3) Run updatedatabase.pl
4) Reload Schema by running update_dbix_class_files.pl
5) Change new syspref 'item-level_booking' to 'itemtype'
6) Edit an itemtype, there is a new checkbox to add 'bookable' option
7) Test it with item with this itemtype, if there is 1 item at least you
   will see 'Booking' tab.
8) You can change syspref to 'item' to see the current behavior

Note: When item-level_booking is set on 'itemtype' you can change
dropdown option to 'No' on item bookable option.

Sponsored by: Association de Gestion des Œuvres Sociales d'Inria (AGOS)
Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38175: (QA follow-up) Add cancelled handling to find_booking
Martin Renvoize [Fri, 25 Oct 2024 11:04:24 +0000 (12:04 +0100)]
Bug 38175: (QA follow-up) Add cancelled handling to find_booking

We need to also exclude cancelled bookings from the find_booking routine
used at checkout.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 37742: Fix error display
David Cook [Tue, 27 Aug 2024 03:50:44 +0000 (03:50 +0000)]
Bug 37742: Fix error display

This change fixes the display of the error message on "My virtual card"
on the OPAC.

Test plan:
0. Apply the patch and enable syspref "OPACVirtualCard"
1. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl
?op=edit_form&destination=circ&borrowernumber=51
2. Add an asterisk (*) to the end of the card number
3. Go to http://localhost:8080/cgi-bin/koha/opac-virtual-card.pl
4. Note that the error message appears as follows:
Code 39 must contain only digits, capital letters, spaces and the symbols -.$/+%

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38192: Fix restoration of table state for suggestion tables
Jonathan Druart [Thu, 17 Oct 2024 10:09:23 +0000 (12:09 +0200)]
Bug 38192: Fix restoration of table state for suggestion tables

There is one table per tab, the id of the table is table_N.

Say you have:
Pending (#table_1), Accepted (#table_2), Rejected (#table_3)
The state will be stored in localStorage with the following key:
DataTables_table_1_/cgi-bin/koha/suggestion/suggestion.pl
DataTables_table_2_/cgi-bin/koha/suggestion/suggestion.pl
DataTables_table_3_/cgi-bin/koha/suggestion/suggestion.pl

If you move all the suggestions from Accepted to Rejected, a shift will
give: Pending (#table_1), Rejected (#table_2) And the previous state
from the "Accepted" tab will be used for "Rejected"

Test plan:
Confirm the above, have several tabs then remove one by moving the
all suggestions to an other tab.

Test the other features on the edit and list views:
change status, update manager, etc.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38191: Restore collapse/expand of filters on the suggestions page
Jonathan Druart [Thu, 17 Oct 2024 09:20:20 +0000 (11:20 +0200)]
Bug 38191: Restore collapse/expand of filters on the suggestions page

Test plan:
Go to http://localhost:8081/cgi-bin/koha/suggestion/suggestion.pl
Confirm that you can expand the filters blocks on the left

Filter by:
 Bibliographic information
 Suggestion information
 Acquisition information

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38272: Additionally fix typo in condition for acquisition orders permission
Paul Derscheid [Fri, 25 Oct 2024 12:27:40 +0000 (12:27 +0000)]
Bug 38272: Additionally fix typo in condition for acquisition orders permission

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 38272: Add permission check for erm permission to additional-fields.tt
Paul Derscheid [Fri, 25 Oct 2024 12:25:40 +0000 (12:25 +0000)]
Bug 38272: Add permission check for erm permission to additional-fields.tt

To test:

1) Create a user with just erm and catalogue permissions.
2) Open additional-fields.pl
3) Notice that nothing is displayed
4) Change the permission of the user to just manage aquisition orders and catalogue
5) Navigate back to additional-fields.pl
6) Notice that nothing is displayed
7) Apply patch
8) Repeat 1-6 but notice this time that the respective entries are displayed
9) Sign off

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: (QA follow-up) Wrap more title strings for translation
Katrin Fischer [Fri, 25 Oct 2024 09:05:47 +0000 (09:05 +0000)]
Bug 33736: (QA follow-up) Wrap more title strings for translation

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: (follow-up) Rebase fix for changed api date handling
Martin Renvoize [Thu, 24 Oct 2024 16:13:34 +0000 (17:13 +0100)]
Bug 33736: (follow-up) Rebase fix for changed api date handling

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: (QA follow-up) Wrap title strings for translation
Martin Renvoize [Thu, 24 Oct 2024 16:00:40 +0000 (17:00 +0100)]
Bug 33736: (QA follow-up) Wrap title strings for translation

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: (QA follow-up) Holds & Bookings > Holds and bookings
Martin Renvoize [Thu, 24 Oct 2024 15:52:39 +0000 (16:52 +0100)]
Bug 33736: (QA follow-up) Holds & Bookings > Holds and bookings

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: Don't allow sorting on Location
Martin Renvoize [Wed, 16 Oct 2024 15:00:29 +0000 (16:00 +0100)]
Bug 33736: Don't allow sorting on Location

We need some special handling to sort on Location as it's got both a
custom renderer and relies on _strings so the ordering and search won't
return expected results without some custom function building.

Sponsored-by: PTFS Europe Ltd
Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: Add column settings definition for bookings report
Martin Renvoize [Wed, 16 Oct 2024 10:22:20 +0000 (11:22 +0100)]
Bug 33736: Add column settings definition for bookings report

Sponsored-by: PTFS Europe Ltd
Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: Don't search on start_date if no date filter is defined
Martin Renvoize [Wed, 16 Oct 2024 09:52:10 +0000 (10:52 +0100)]
Bug 33736: Don't search on start_date if no date filter is defined

Sponsored-by: PTFS Europe Ltd
Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: Ensure datatable filter row takes visible into account
Martin Renvoize [Wed, 16 Oct 2024 09:38:32 +0000 (10:38 +0100)]
Bug 33736: Ensure datatable filter row takes visible into account

We clone the header row, and then iterate it assuming the iterator index
lines up with the column definition index of the datatables settings.

However, if a column is hidden, this is not the case. Said column will
not appear in the header row that's cloned and as such your iterator
will no longer line up with the column settings index number of the
settings array.

Sponsored-by: PTFS Europe Ltd
Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: (follow-up) Remove top-level embed in bookings.yaml
Paul Derscheid [Tue, 15 Oct 2024 08:13:51 +0000 (08:13 +0000)]
Bug 33736: (follow-up) Remove top-level embed in bookings.yaml

For reference, see: bug 30536.

Sponsored-by: PTFS Europe Ltd
Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: Bootstrap 5 update
Martin Renvoize [Mon, 14 Oct 2024 13:58:04 +0000 (14:58 +0100)]
Bug 33736: Bootstrap 5 update

Sponsored-by: PTFS Europe Ltd
Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: Add item location and filter by library to bookings to collect report
Martin Renvoize [Fri, 16 Aug 2024 15:18:41 +0000 (16:18 +0100)]
Bug 33736: Add item location and filter by library to bookings to collect report

This patch adds a new 'Location' field to the bookings to collect
report. We display with the current item location or an onloan status
with the due date.

We also add filtering for status != 'waiting' to the base query to rule
out items marked as ready for collection already (however, we don't yet
have a way of marking such a status so this won't have any effect yet).

Sponsored-by: PTFS Europe Ltd
Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: Add filter for holding library
Martin Renvoize [Thu, 15 Aug 2024 16:04:01 +0000 (17:04 +0100)]
Bug 33736: Add filter for holding library

This patch adds the option to filter the pending bookings to collect report by
items current holding library and defaults to the users logged in library.

We also add the 'Pickup library' column to the report output so staff
know whether the item needs collecting for sending to another library or
for their own.

Sponsored-by: PTFS Europe Ltd
Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: Set default window to 1 week
Martin Renvoize [Mon, 22 Apr 2024 12:51:40 +0000 (13:51 +0100)]
Bug 33736: Set default window to 1 week

This update the default display from today + 1 to today + 7 days.

Sponsored-by: PTFS Europe Ltd
Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 33736: Add pendingbookings report
Martin Renvoize [Tue, 19 Oct 2021 12:57:00 +0000 (13:57 +0100)]
Bug 33736: Add pendingbookings report

This patch adds a 'Bookings to collect' page to circulation that allows
for a workflow similar to 'Holds to pull', but for bookings.

Sponsored-by: PTFS Europe Ltd
Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 28833: DBRev 24.06.00.044
Katrin Fischer [Fri, 25 Oct 2024 09:05:04 +0000 (09:05 +0000)]
Bug 28833: DBRev 24.06.00.044

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 28833: Speed up holds queue builder via parallel processing
Kyle M Hall [Mon, 9 Aug 2021 17:46:00 +0000 (13:46 -0400)]
Bug 28833: Speed up holds queue builder via parallel processing

The holds queue builder can take a very long time to run on systems with many holds. For example, a partner with 124,784 unfilled ( not found ) holds, is taking about 64 minutes to run. If we run that same number of holds in 5 parallel chunks ( splitting the number of records as evenly as possible, but *not* taking into account the holds per bib ), it takes 21.5 minutes. If we use 10 loops, it takes less then 14 minutes.

Test Plan:
0) Install the Perl library Parallel::ForkManager
1) Generate a huge number of holds ( a few thousand at the minimum )
2) Run the holds queue builder, use the `time` utility to track how much
   time it took to run
3) Set HoldsQueueParallelLoopsCount to 10
4) Repeat step 2, note the improvement in speed
5) Experiment with other values for HoldsQueueParallelLoopsCount
6) prove t/db_dependent/HoldsQueue.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 30661: Allow to update more hold parameters via REST API
Johanna Raisa [Tue, 3 May 2022 07:39:56 +0000 (10:39 +0300)]
Bug 30661: Allow to update more hold parameters via REST API

This patch adds hold_date and expiration_date to holds edit endpoint

Test plan:

1) prove t/db_dependent/api/v1/holds.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 36064: (QA follow-up) Simplify and tidy
Tomas Cohen Arazi [Tue, 22 Oct 2024 14:17:34 +0000 (11:17 -0300)]
Bug 36064: (QA follow-up) Simplify and tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 36064: (follow-up) Activate correct tab
Owen Leonard [Tue, 13 Feb 2024 11:48:35 +0000 (11:48 +0000)]
Bug 36064: (follow-up) Activate correct tab

This patch makes a change to the JavaScript on waitingreserves.pl so
that the correct tab is activated if you follow the "Holds with
cancellation requests" link on the home page.

The page has code to activate the last viewed tab, but I've modified it
so that if there is a location hash ('waitingreserves.pl#tab') the tab
specified in the hash is selected instead of the last used tab.

If there is no location hash the last active tab will be activated.

I've also corrected the location hash in the link on the home page.

To test, apply the patch and follow the "Holds with cancellation
requests" link. The "Holds with cancellation requests" tab should be
active.

Click a different tab, e.g. "Holds waiting." Go the the circulation home
page, then click the link for "Holds awaiting pickup." The tab you
selected should be active.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 36064: Add holds with cancellation request info to staff interface main page
Lucas Gass [Mon, 29 Apr 2024 20:55:11 +0000 (20:55 +0000)]
Bug 36064: Add holds with cancellation request info to staff interface main page

To Test:
1. APPLY PATCH, restart_all
2. Make some holds
3. Make sure there is a Default waiting hold cancellation policy.
4. Make the holds watiing by checking them in.
5. Go to the OPAC and request to cancel.
6. Go to the staff interface home page, you should see 'Holds with
   cancellation requests: X'.
7. Cancel the hold.
8. Back on the main page it should not be counted again the number for
   'Holds with cancellation requests: X'
9. Log in as a staff member with Staff access but without
   circulate_remaining_permissions.
10. You should not see the 'Holds with cancellation requests: X' line.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 30660: Add cancellation reason to holds delete endpoint
Johanna Raisa [Mon, 2 May 2022 08:49:11 +0000 (11:49 +0300)]
Bug 30660: Add cancellation reason to holds delete endpoint

This patch adds cancellation reason to holds delete endpoint.

Test plan:
1) prove t/db_dependent/api/v1/holds.t

PA amended: tidy

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
11 days agoBug 37253: Enhance POST /checkouts endpoint to accept barcode or item_id
Jan Kissig [Thu, 4 Jul 2024 11:37:47 +0000 (13:37 +0200)]
Bug 37253: Enhance POST /checkouts endpoint to accept barcode or item_id

This patch adds external_id as a body param in POST /checkouts which acts as the items barcode.
This enhances the checkouts route to checkout items directly via barcode which could be useful for external
tools like Koha Offline Circulation Tool

Test plan:

a) apply patch
b) enable system preference RESTBasicAuth
c) check out an item via an API testing tool. Be sure that item is not checked out already.

   Auth: username: koha  &  password: koha
   Body JSON:
   {
     "external_id" : "39999000011418",
     "library_id": "CPL",
     "patron_id": 5
   }
   POST http://localhost:8081/api/v1/checkouts
d) check response code 201 and response content

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38193: DBIC schema update
Katrin Fischer [Thu, 24 Oct 2024 16:23:28 +0000 (16:23 +0000)]
Bug 38193: DBIC schema update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38193: DBRev 24.06.00.043
Katrin Fischer [Thu, 24 Oct 2024 16:21:57 +0000 (16:21 +0000)]
Bug 38193: DBRev 24.06.00.043

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38193: Add cancellation_reason field to bookings table
Paul Derscheid [Thu, 17 Oct 2024 11:52:28 +0000 (11:52 +0000)]
Bug 38193: Add cancellation_reason field to bookings table

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: Thibaud Guillot <thibaud.guillot@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 35287: (Follow-up) Fix tests
Pedro Amorim [Thu, 24 Oct 2024 16:00:20 +0000 (16:00 +0000)]
Bug 35287: (Follow-up) Fix tests

Have a single point go get_license to be used by both Licenses_spec.ts and AdditionalFields_spec.ts

Test plan, apply patch:
$ yarn js:build
$ cypress run --spec t/cypress/integration/AdditionalFields_spec.ts
$ cypress run --spec t/cypress/integration/Licenses_spec.ts

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38175: Handle status in item auto-assignment for bookings
Martin Renvoize [Wed, 23 Oct 2024 10:09:06 +0000 (11:09 +0100)]
Bug 38175: Handle status in item auto-assignment for bookings

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38175: Unit tests for assign_item_for_booking
Martin Renvoize [Wed, 23 Oct 2024 10:07:52 +0000 (11:07 +0100)]
Bug 38175: Unit tests for assign_item_for_booking

This patch adds more comprehensive tests to the item autoassignment for
'Any item' handling in bookings.

We check for both random assignment, which was missing before now but
always intended, and that we take cancelled status into account.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38175: (QA follow-up) Unit test for filter_by_active change
Martin Renvoize [Tue, 22 Oct 2024 16:15:01 +0000 (17:15 +0100)]
Bug 38175: (QA follow-up) Unit test for filter_by_active change

We now filter out 'cancelled' and 'completed' bookings in the
filter_by_active method. We need tests for that.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38175: (QA follow-up) Ensure we handle cancelled in clash detection
Martin Renvoize [Tue, 22 Oct 2024 16:09:39 +0000 (17:09 +0100)]
Bug 38175: (QA follow-up) Ensure we handle cancelled in clash detection

We need to ensure we handle the new status tracking cancelled/completed
in our clash detection code too.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38175: (QA follow-up) DRY out PATCH handling
Martin Renvoize [Thu, 17 Oct 2024 11:02:10 +0000 (12:02 +0100)]
Bug 38175: (QA follow-up) DRY out PATCH handling

We were repeating some code for the PATCH endpoint instead of using the
existing update handling code.  This lead to two issues:

1) We weren't catching status updates on standard updates, only the
   patch.
2) We were limiting the PATCH endpoint to just status updates when it
   could happily be used for other fields too.

This patch removes the introduction of the 'edit' method from both the
REST controller and the corresponding object and moves the logic into
the store method of the object where it's easily testable.

We also DRY out the notice sending code a little for re-use.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38175: (QA follow-up) Remove superflous method
Martin Renvoize [Thu, 17 Oct 2024 08:22:41 +0000 (09:22 +0100)]
Bug 38175: (QA follow-up) Remove superflous method

If all we're doing is calling SUPER, then we don't need to wrap ;P

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38175: (follow-up) Refactor staff interface additions to vanilla JS; adjust modul...
Paul Derscheid [Wed, 16 Oct 2024 12:13:42 +0000 (14:13 +0200)]
Bug 38175: (follow-up) Refactor staff interface additions to vanilla JS; adjust modules, controllers for coding guidelines and consistency

In the spirit of the current movement for more modern JS, the refactor tries to limit jQuery usage.

Test plan:
    1) Create a booking on a bookable item
    2) Cancel it and see that it's simply deleted
    3) Apply the patch and run “restart_all”.
    4) Repeat the same cancel operation and see that it's still there, albeit with a different appearance.
    5) Try the filters in the table

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38175: Add tests
Thibaud Guillot [Tue, 15 Oct 2024 12:38:40 +0000 (12:38 +0000)]
Bug 38175: Add tests

Sponsored by: BibLibre
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 38175: Improve Bookings feature with status
Thibaud Guillot [Tue, 15 Oct 2024 12:29:22 +0000 (12:29 +0000)]
Bug 38175: Improve Bookings feature with status

With the integration of the new status column for bookings, it would be preferable to keep the booking in database and simply change its status to 'cancel' when you cancel it via the action button or the timeline.

So I've added partial updating via the API with a new PATCH method to partially edit a booking. It is currently active for status changes.
Graphically, this translates into the disappearance of the action buttons if the booking has already been canceled, although it remains visible in the table and timeline (the style is a proposal for the moment, intended simply to graphically differentiate a canceled booking from others).

I've also added a filter to the filter_by_active method to exclude cancelled bookings.

Test plan:
1) Create a booking on a bookable item
2) Cancel it and see that it's simply deleted
3) Apply the patch and run “restart_all”.
4) Repeat the same cancel operation and see that it's still there, albeit with a different appearance.
5) Try the filters in the table

Sponsored by: BibLibre
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 37803: Add patron notification when a new booking has been created successfully
Paul Derscheid [Mon, 2 Sep 2024 10:42:11 +0000 (12:42 +0200)]
Bug 37803: Add patron notification when a new booking has been created successfully

To test:
1) Apply the patch
2) Include the sample notice, e.g. run 'reset_all' on ktd
3) Create a booking
4) Look into the borrower notifications
5) Confirm the notice has been generated
6) Run t/db_dependent/Koha/Booking.t

Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 37204: (QA follow-up) Consistently pick notice library
Martin Renvoize [Wed, 16 Oct 2024 15:45:18 +0000 (16:45 +0100)]
Bug 37204: (QA follow-up) Consistently pick notice library

We should use the notice from the library that initiated the action that
triggered the notice. This should be available to us always in the
userenv.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 37204: (QA follow-up) Pass old_booking into GetPreparedLetter
Martin Renvoize [Wed, 16 Oct 2024 15:34:58 +0000 (16:34 +0100)]
Bug 37204: (QA follow-up) Pass old_booking into GetPreparedLetter

Thinking about the future, some libraries may wish to use the
old_booking object details in their notice so I opt to pass it into
GetPreparedLetter here to support that.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 37204: Add a booking has changed notice to update a patron should a booking be...
Paul Derscheid [Wed, 28 Aug 2024 11:22:00 +0000 (13:22 +0200)]
Bug 37204: Add a booking has changed notice to update a patron should a booking be updated

This is a first draft. When reading your initial statement again I'm asking myself whether
a changed itemnumber is relevant to the patron.
The way I see it, the relevant fields are:
- pickup_library_id
- start_date
- end_date

But maybe I'm not seeing it.

To test:
1) Apply the patch
2) Make an item bookable
3) Add a booking for a given patron
4) Check the patron notices tab, should not contain any notices
5) Change either start date, end date or pickup library and save
6) Check the patron notices tab, should contain a notice with the updated details
7) Run the tests under t/db_dependent/Koha/Booking.t
8) Sign off

Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 37391: Make QR code for bibliographic record in OPAC use canonical link
Michał Kula [Wed, 17 Jul 2024 11:42:36 +0000 (11:42 +0000)]
Bug 37391: Make QR code for bibliographic record in OPAC use canonical link

In /opac-detail.pl page there's an option to show a QR code to open up
said record on your phone or share it with others in such a way.

Currently, it simply uses the current `location.href` of the browser.
This isn't ideal, because such URL can be much longer, resulting in
more complex/harder to scan QR code, plus URL parameters can contain
extra junk, such as our previous search query that led us to current
record, which we might not necessarily want to share.

Thus, now having simple canonical URLs after the "Depends On" patch was
merged in, we can replace these QR codes to link to them instead.

To test:
1. Visit biblio detail page in OPAC
2. Click the button to show QR code in the right pane (preference
   'OPACDetailQRCode' must be enabled)
3. Notice that the QR code is much simpler/less complex now
4. Scan the QR code with your phone and confirm it's in the desired
   format of <URL>/bib/123 and that it opens up properly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 37969: DBRev 24.06.00.042
Katrin Fischer [Thu, 24 Oct 2024 13:19:28 +0000 (13:19 +0000)]
Bug 37969: DBRev 24.06.00.042

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 37969: Add missing language code nor
Lari Taskula [Thu, 19 Sep 2024 21:07:04 +0000 (21:07 +0000)]
Bug 37969: Add missing language code nor

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Test plan:
- Start KTD with Elastic: ktd --es7 up
- Edit a record, e.g. "Dom Casmurro : a novel" and change the language
  code in 008/35-37 from "eng" to "nor":
  Before: 980914s1997    nyu           00011 eng b
  After:  980914s1997    nyu           00011 nor b
- Do a search that finds the edited record and some other records,
  so you can see the list of resulots and the facets, e.g. "dom"
- Verify that "nor" is shown in the languages facet
- Apply this patch and run koha-upgrade-schema kohadev
- Do the search again and verify that "Norwegian" is now shown instead
  of "nor"

Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 30955: (QA follow-up) Move LIST notice to new lists module
Katrin Fischer [Thu, 24 Oct 2024 13:09:37 +0000 (13:09 +0000)]
Bug 30955: (QA follow-up) Move LIST notice to new lists module

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 30955: DBRev 26.04.00.041
Katrin Fischer [Thu, 24 Oct 2024 13:08:01 +0000 (13:08 +0000)]
Bug 30955: DBRev 26.04.00.041

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 30955: (follow-up) Merged related notices into lists
Jake Deery [Thu, 24 Oct 2024 08:12:09 +0000 (08:12 +0000)]
Bug 30955: (follow-up) Merged related notices into lists

This patch merges the SHARE_ACCEPT and SHARE_INVITE notices into the
lists module. This makes a clearer case for introducing the lists module
in the first place.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 30955: (QA follow-up) Reduce database hits and clarify notice
Martin Renvoize [Wed, 23 Oct 2024 13:26:39 +0000 (14:26 +0100)]
Bug 30955: (QA follow-up) Reduce database hits and clarify notice

This patch updates the library selection from using the new owners home
library to using the current sessions library in keeping with the
direction of travel in other bugs of this type in Koha currently.

We also update the default notice text to clarify who sent the notice vs
who previously owned the list.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 30955: Sends notice to new owner at transfer
Jake Deery [Wed, 10 Jul 2024 15:18:26 +0000 (16:18 +0100)]
Bug 30955: Sends notice to new owner at transfer

This patch adds a new notice, TRANSFER_OWNERSHIP, under a new module,
Lists. When a list is transferred to a new owner, this notice is
triggered, containing a short paragraph detailing the list name.

TO TEST:
a)  log in as a koha superlibrarian
b)  go to the lists module, create a public list, and make a note of the
    title used
c)  on the lists module, transfer the list to some other user, and make
    a note of the user used
d)  go to the patron notices page for the user in step c
e)  ensure that a notice has been generated
    1)  check the contents of the notice, it should contain
      - the new owner's name
      - the list's title
      - the old owner's name & (if set) email
f)  under tools > notices, modify the notice for TRANSFER_OWNERSHIP
g)  repeat steps c-e
    1)  ensure the modifications you've made are now visible in the notice

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 37888: Show all jobs, order by "queued", remove last hour filter
Julian Maurice [Fri, 4 Oct 2024 11:41:44 +0000 (13:41 +0200)]
Bug 37888: Show all jobs, order by "queued", remove last hour filter

By default the background jobs page now shows the most recently queued
jobs, whatever their status is.

By doing that, the jobs enqueued less an hour ago are always visible if
there are any (well, the first page at least), so the "last hour" filter
becomes way less useful and it's better to remove it as it caused
problems (see bug 37905) and the "1 hour" duration was arbitrary.

The "current jobs only" filter is still useful as lots of quick
background jobs can push running jobs away from the first page and it's
a common use case to list running jobs

Test plan:
1. Start some background jobs (batch item modification for instance)
2. Make them run and wait for finish
3. Stop the background jobs workers
4. Start some more background jobs
5. You should now have running and non-running background jobs. Go to
   the admin background jobs page
6. Verify that all background jobs are shown and that they ordered by
   queued time (last queued job first)
7. Verify that "Current jobs only" filter still works

Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 36836: (QA follow-up) Tiny fixes to terminology and capitalization
Katrin Fischer [Thu, 24 Oct 2024 10:03:14 +0000 (10:03 +0000)]
Bug 36836: (QA follow-up) Tiny fixes to terminology and capitalization

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 35287: (QA follow-up): Add v-bind:key
Pedro Amorim [Mon, 21 Oct 2024 10:31:24 +0000 (10:31 +0000)]
Bug 35287: (QA follow-up): Add v-bind:key

Remove more unused imports

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 35287: (QA follow-up): Squash
Pedro Amorim [Fri, 16 Aug 2024 11:01:31 +0000 (11:01 +0000)]
Bug 35287: (QA follow-up): Squash

Remove leftover unused code
Add missing pod
Tidy
Removed redundant commented in AdditionalFields_spec.ts

Run:
qa -c 11 -v 2

Verify everything is green

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 35287: (Follow-up 37389): ExtendedAttributes
Pedro Amorim [Fri, 26 Jul 2024 14:24:44 +0000 (14:24 +0000)]
Bug 35287: (Follow-up 37389): ExtendedAttributes

Apply ExtendedAttributes Mixin to AdditionalFields

To test the ExtendedAttributes mixin search is working:
1) Create 2 or more searchable licenses additional fields
2) Create a new license and enter values in these searchable fields
3) Go to the licenses list, use the column filters to search on more
than one column, verify that the search work as intended (AND operator)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 35287: Vue - Add additional fields support to ERM Licenses
Pedro Amorim [Wed, 8 Nov 2023 12:35:29 +0000 (11:35 -0100)]
Bug 35287: Vue - Add additional fields support to ERM Licenses

Test plan, k-t-d:
1) Add a new additional field for the newly supported 'erm_licenses', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=erm_licenses
2) Create 4 fields by clicking on '+ New field'
2.1) 'text non-repeatable'
2.2) 'text repeatable', check the 'repeatable' box
2.3) 'av non-repeatable', pick an authorised value category
2.4) 'av repeatable', pick an authorised value category and check the 'repeatable' box
3) Add a new ERM license, visit:
/cgi-bin/koha/erm/licenses/add
4) Notice there is now a 'Additional fields' section at the bottom listing the fields we created
5) Fill in the mandatory regular license fields and play around with the additional fields
5.1) Put in some text in the text fields, test out the 'clear' and '+new' buttons
5.2) Select some AV options from the AV fields, deselect them, notice the repeatable one allows for multiple selection, the non-repeatable one does not
6) Save the license. On the list table, click on the license name (to navigate to the show page), or if license id=1, visit:
/cgi-bin/koha/erm/licenses/1
7) Notice the additional fields are listed there, AV fields show their human readable description, not the AV code. Repeatable fields are shown comma separated
8) Edit the license, visit:
/cgi-bin/koha/erm/licenses/edit/1
9) Play around again, do some more inserting and deletion of additional fields. Save. Notice everything is as expected.

Searchable testing:
10) Go back to the additional fields admin panel, visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=erm_licenses
11) Edit one field (AV or not) that you have inserted some data in, in the previous steps, and tick the 'searchable' box
12) Go back to licenses, visit:
/cgi-bin/koha/erm/licenses
13) Notice the searchable additional field now has its own column in the licenses list table
14) If the searchable field is AV, it has a dropdown with the AV values of the same AV category
15) If the searchable field not AV, it has a text input that allows for normal text search
16) If the searchable field is repeatable and has multiple values, its displayed in comma separated

Signed-off-by: Edith Speller <edith.speller@ukhsa.gov.uk>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 35287: Vue preparation - Extend KohaTable to consider searchable additional fields
Pedro Amorim [Wed, 8 Nov 2023 12:34:43 +0000 (11:34 -0100)]
Bug 35287: Vue preparation - Extend KohaTable to consider searchable additional fields

This follows the same pattern as in subscription serials searchable additional fields, i.e. if an additional field is searchable, it is added to the list table - with the corresponding search inputs and functionality

Signed-off-by: Edith Speller <edith.speller@ukhsa.gov.uk>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 35287: Vue preparation - AdditionalFields
Pedro Amorim [Wed, 8 Nov 2023 12:34:19 +0000 (11:34 -0100)]
Bug 35287: Vue preparation - AdditionalFields

New api client: additional-fields-api-client.js to interact with the REST endpoint introduced by bug 35197
2 new components:
- AdditionalFieldsEntry: Component used to extend the FormAdd component including the corresponding additional fields
- AdditionalFieldsDisplay: Component used to display the additional fields associated to a data record implementing it (makes use of strings_map)

Signed-off-by: Edith Speller <edith.speller@ukhsa.gov.uk>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 35287: REST API - Add additional fields support to ERM Licenses
Pedro Amorim [Wed, 8 Nov 2023 12:33:20 +0000 (11:33 -0100)]
Bug 35287: REST API - Add additional fields support to ERM Licenses

Signed-off-by: Edith Speller <edith.speller@ukhsa.gov.uk>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 35287: Admin
Pedro Amorim [Wed, 8 Nov 2023 12:32:49 +0000 (11:32 -0100)]
Bug 35287: Admin

ERM licenses is now a table option in the additional fields admin panel
ERM licenses allows for the 'searchable' option (as well as 'repeatable')

Signed-off-by: Edith Speller <edith.speller@ukhsa.gov.uk>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
12 days agoBug 35287: Preparation: AdditionalFields License Mixin
Pedro Amorim [Wed, 8 Nov 2023 12:32:10 +0000 (11:32 -0100)]
Bug 35287: Preparation: AdditionalFields License Mixin

Koha::Object::Mixin::AdditionalFields needs to come before Koha::Object
in the inheritance so that the strings_map method that is called is
the one from Mixin and not from Koha::Object.
This is only required for Koha classes implementing the AdditionalFields Mixin and expose data through the REST API, because strings_map is implement in both the aforementioned classes

Signed-off-by: Edith Speller <edith.speller@ukhsa.gov.uk>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>