koha.git
2 months agoBug 33237: (QA follow-up) Clarify tests and Mock
Martin Renvoize [Tue, 23 Apr 2024 12:42:46 +0000 (13:42 +0100)]
Bug 33237: (QA follow-up) Clarify tests and Mock

This patch tries to clarify the tests a little and expand their
coverage whilst also adding some defualt translated includes to the test
area and mocking the config to allow the tests to run without installing
translations.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 33237: (follow-up) Restore final fallback
Martin Renvoize [Tue, 23 Apr 2024 12:42:08 +0000 (13:42 +0100)]
Bug 33237: (follow-up) Restore final fallback

This restores the final fallback to 'en' as mentioned by Jonathan

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 33237: (follow-up) Unit tests
Hammat Wele [Mon, 8 Apr 2024 16:43:06 +0000 (16:43 +0000)]
Bug 33237: (follow-up) Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 33237: (follow-up) Tidy
Nick Clemens [Tue, 26 Mar 2024 17:54:19 +0000 (17:54 +0000)]
Bug 33237: (follow-up) Tidy

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 33237: If TranslateNotices is off, use the interface language includes in slips
Hammat Wele [Mon, 27 Mar 2023 21:05:29 +0000 (21:05 +0000)]
Bug 33237: If TranslateNotices is off, use the interface language includes in slips

This patch set the language used in slips folloinw this logic:
   --> uses patron's preferred language
   --> if patron's preferred language is 'default', use the interface language
   --> if there is no interface (for overdue_notices for example), use the first language in 'language' system preference

To Test:
1. Install the other language (i used fr-CA here)
     1.1.

     gulp po:update fr-CA

     ./misc/translator/translate install fr-CA

     1.2. In Administration > Global system preferences, search for language and check the added language

2. Create a manual invoice in a patron's account and pay it

3. From the Transactions tab, click 'Print' next to the payment line
   --> On the printed slip, there's the word 'Payment' in English (OK)

4. Switch interface to other language

5. Redo step 3
   --> On the printed slip, the word 'Payment' is still in English (not ok)

6. In Administration > Global system preferences, enable TranslateNotices

7. Go to Tools > Notices and slips > ACCOUNT_CREDIT and copy the content of the letter into all the languages

8. Redo step 3 (you should still be in the other language interface)
   --> On the printed slip, the word 'Payment' is still in English (not ok)

9. Edit the patron's account and change the preferred language to the other language

10. Redo step 3
   --> On the printed slip, the word 'Payment' is in the other language (Paiement) (OK)

11. Apply the patch

12. Reset config
    12.1. Edit the patron's account and change back the preferred language to 'default'
    12.2. In Administration > Global system preferences, disable TranslateNotices

13. Redo step 3 (you should still be in the other language interface)
   --> On the printed slip, the word 'Payment' is in the other language (Paiement)

14. Switch interface to the english language

15. Redo step 3
   --> On the printed slip, the word 'Payment' is in English

16. In Administration > Global system preferences, enable TranslateNotices

17. Edit the patron's account and change the preferred language to the other language

18. Redo step 3
   --> On the printed slip, the word 'Payment' is in the other language (Paiement)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36546: Deploy swagger_bundle.json via make
David Cook [Mon, 29 Apr 2024 23:43:40 +0000 (23:43 +0000)]
Bug 36546: Deploy swagger_bundle.json via make

To test:
0. Apply patch
1a. perl Makefile.PL
1b. Choose "single" Installation mode
1c. Specify /opt/koha directory
2. make
2b. ls blib/API_CGI_DIR/v1/swagger/swagger_bundle.json
3. Ensure you're running as root or make koha user own /opt
4. make install
5. ls /opt/koha/api/v1/swagger/swagger_bundle.json

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36546: Use JSON instead
Tomas Cohen Arazi [Thu, 25 Apr 2024 14:09:32 +0000 (11:09 -0300)]
Bug 36546: Use JSON instead

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36546: Fix js-yaml dependency in package.json
David Cook [Wed, 24 Apr 2024 03:19:33 +0000 (03:19 +0000)]
Bug 36546: Fix js-yaml dependency in package.json

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36546: Add a bundled version of the API spec
Tomas Cohen Arazi [Tue, 23 Apr 2024 14:52:37 +0000 (11:52 -0300)]
Bug 36546: Add a bundled version of the API spec

This patch makes the Koha::REST::V1 class use a bundled version of the
API spec.

For that to happen, this patch also adds:

* a `yarn api:bundle` task for generating the `swagger_bundle.yaml`
  file
* the bundle file to `.gitignore`
* @redocly/cli to the packages.json dependencies (yarn add @redocly/cli)
* `api:bundle` is added to the `yarn build` general command

NOTE: A new workflow is introduced by this patch as developers will need
to call the `yarn api:bundle` command on each API spec change they make.

To test:
1. Have KTD running
2. Verify the API works as usual
=> SUCCESS: The API just works
3. Apply this patch
4. Run:
   $ ktd --shell
  k$ yarn api:bundle
5. Restart plack:
  k$ koha-plack --restart kohadev ; tail -f /var/log/koha/kohadev/*.log
=> SUCCESS: The API loads correctly
6. Repeat 2
=> SUCCESS: Nothing changed
7. Sign off :-D

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 5920: (QA follow-up) Switch to use existing dependancy
Martin Renvoize [Tue, 30 Apr 2024 08:59:23 +0000 (09:59 +0100)]
Bug 5920: (QA follow-up) Switch to use existing dependancy

We already have a scrubber module we can use; This patch switches us
from the newly introduced dependancy to using the existing and well
respected Scrubber we already have.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 5920: Add HTML::Restrict to cpanfile
Martin Renvoize [Tue, 23 Jan 2024 14:01:41 +0000 (14:01 +0000)]
Bug 5920: Add HTML::Restrict to cpanfile

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 5920: Strip HTML from report exports
Martin Renvoize [Mon, 10 Jan 2022 09:45:54 +0000 (10:45 +0100)]
Bug 5920: Strip HTML from report exports

This patch uses HTML::Restrict to strip out HTML tags from the CSV
download of reports.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32565: (follow-up) Tidy
Nick Clemens [Fri, 19 Apr 2024 11:25:58 +0000 (11:25 +0000)]
Bug 32565: (follow-up) Tidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32565: (QA follow-up) Fix tests
Pedro Amorim [Mon, 19 Feb 2024 10:45:50 +0000 (10:45 +0000)]
Bug 32565: (QA follow-up) Fix tests

Apply original tests patch + this follow-up. Run:
prove t/db_dependent/HoldsQueue.t
Notice tests fail.
Apply fix patch, run the above prove command again.
Notice tests pass.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32565: Unit tests
Nick Clemens [Thu, 25 Jan 2024 12:31:46 +0000 (12:31 +0000)]
Bug 32565: Unit tests

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32565: Add unallocated option to holds queue
Nick Clemens [Thu, 2 Mar 2023 17:01:07 +0000 (17:01 +0000)]
Bug 32565: Add unallocated option to holds queue

Add an unallocated option to CreateQueue and pass through as needed
Avoid deletion of the tmp_holdsqueue, and only check holds
and items that are not currently matched

A future hold with a higher priority will still fail here - because the
item may already be assigned, but on next change to the biblio it would
be corrected

To test:
1) Apply both patches
2) Enable RealTimeHoldsQueue and set HoldsQueueSkipClosed to "open"
3) Add a holiday to the calendar for all libraries for today, visit:
/cgi-bin/koha/tools/holidays.pl
-- Click today's day on the calendar and pick "Holiday repeated every same day of the week"
-- Click "Copy to all libraries". Hit "Save.
4) Place a biblio-level hold on a biblio record and set the pickup location to a library that has available copies, visit:
-- /cgi-bin/koha/reserve/request.pl?biblionumber=76&borrowernumber=51
-- Click the first "Place hold" button to place the biblio-level hold.
5) Verify that that hold got added to the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
6) Place a biblio-level hold on a biblio record where there are no other holds and copies are available at another location, but not the pickup location, visit:
-- /cgi-bin/koha/reserve/request.pl?biblionumber=437&borrowernumber=51
-- On the "pickup at" dropdown, pick something else other than "Centerville", e.g. "Fairfield".
-- Click the first "Place hold" button to place the biblio-level hold.
7) Check the holds queue again, notice that this 2nd hold was not added to the queue:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
8) Run the updated cronscript:
perl misc/cronjobs/holds/build_holds_queue.pl --force --unallocated
9) Notice nothing changed in the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1
10) Remove the holiday we created previously, visit:
/cgi-bin/koha/tools/holidays.pl
-- Click today's day on the calendar and pick "Delete this holiday"
-- Click "Copy to all libraries". Hit "Save.
11) Run the updated cronscript:
perl misc/cronjobs/holds/build_holds_queue.pl --force --unallocated
12) Confirm the second hold is added to the holds queue, visit:
/cgi-bin/koha/circ/view_holdsqueue.pl?branchlimit=&itemtypeslimit=&ccodeslimit=&locationslimit=&run_report=1

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36508: Refresh patron object when updating category
Nick Clemens [Wed, 3 Apr 2024 20:35:46 +0000 (20:35 +0000)]
Bug 36508: Refresh patron object when updating category

To test:
1 - Find a ptron, I sued #45 in KTD, note their category
2 - Update them from one category to another using finesunder:
    perl misc/cronjobs/update_patrons_category.pl -f ST -t S --finesunder=5.00 --where "me.borrowernumber=45" -v -c
3 - Check their modification log (I told you to enabled BorrowersLog,
    right?)
4 - See many fields reported changed
5 - Apply patch
6 - Repeat, but change the to and from options
    perl misc/cronjobs/update_patrons_category.pl -f S -t ST --finesunder=5.00 --where "me.borrowernumber=45" -v -c
7 - Note only one column changed in the logs
8 - Ask for unit tests

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36508: Unit tests
Nick Clemens [Thu, 25 Apr 2024 16:20:53 +0000 (16:20 +0000)]
Bug 36508: Unit tests

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32435: DBRev 23.12.00.038
Katrin Fischer [Tue, 30 Apr 2024 09:57:46 +0000 (09:57 +0000)]
Bug 32435: DBRev 23.12.00.038

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32435: Unit tests for Ticket/Ticket::Update change
Martin Renvoize [Thu, 25 Apr 2024 15:58:34 +0000 (16:58 +0100)]
Bug 32435: Unit tests for Ticket/Ticket::Update change

We add a fallback to allow TICKET_RESOLUTIONS to be returned in the
strings_map as additional TICKET_STATUS states.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32435: Add resolution states to Catalog concerns
Martin Renvoize [Thu, 21 Dec 2023 15:58:41 +0000 (15:58 +0000)]
Bug 32435: Add resolution states to Catalog concerns

This patch adds resolution types to the catalog concerns feature. It
allows libraries to define a list of 'TICKET_RESOLUTION' authorized
values from which librarians can then pick at the point of resolving a
catalog concern.

To test:
1) Apply the patches and run the database updates
2) Enable catalog concerns (staff or opac will do the trick)
3) Submit a catalog concern
4) Confirm that you can still resolve a concern from the catalog
   concerns management page as before.
5) Add some values to the new TICKET_RESOLUTION authorized values
6) Submit a new catalog concern
7) Confirm that the 'Resolve' button in the management modal is now a
   dropdown containing the list of resolution values defined above.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32435: Add TICKET_RESOLUTION authorized value
Martin Renvoize [Thu, 21 Dec 2023 15:57:41 +0000 (15:57 +0000)]
Bug 32435: Add TICKET_RESOLUTION authorized value

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: DBIC schema update
Katrin Fischer [Tue, 30 Apr 2024 09:13:35 +0000 (09:13 +0000)]
Bug 35628: DBIC schema update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: DBRev 23.12.00.037
Katrin Fischer [Tue, 30 Apr 2024 09:08:43 +0000 (09:08 +0000)]
Bug 35628: DBRev 23.12.00.037

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: Add unit tests for Koha::Ticket::Update addition
Martin Renvoize [Thu, 25 Apr 2024 15:51:09 +0000 (16:51 +0100)]
Bug 35628: Add unit tests for Koha::Ticket::Update addition

We add a strings_map method to Koha::Ticket::Update and thus need
to have corresponding unit tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: Add unit tests for Koha::Ticket addition
Martin Renvoize [Thu, 25 Apr 2024 15:33:25 +0000 (16:33 +0100)]
Bug 35628: Add unit tests for Koha::Ticket addition

We add a strings_map method to Koha::Ticket and thus need to have
corresponding unit tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: Unit tests for addition to tickets API
Martin Renvoize [Thu, 25 Apr 2024 15:10:24 +0000 (16:10 +0100)]
Bug 35628: Unit tests for addition to tickets API

This patch updates the unit test for the ticket_updates api to catch
both the missing test 'state' for the existing state change
functionality and also the new 'status' functionality introduced with
this patchset.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: Add status filters to top bar
Martin Renvoize [Thu, 28 Dec 2023 10:04:36 +0000 (10:04 +0000)]
Bug 35628: Add status filters to top bar

This patch adds status filters to the top toolbar alongside the existing
filter on resolved.

Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: Add current status as a class to table rows
Martin Renvoize [Wed, 27 Dec 2023 11:08:09 +0000 (11:08 +0000)]
Bug 35628: Add current status as a class to table rows

This patch adds the current status, if there is one set, to the table
rows of the concerns interface.

Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: Display status strings instead of codes
Martin Renvoize [Fri, 22 Dec 2023 16:14:40 +0000 (16:14 +0000)]
Bug 35628: Display status strings instead of codes

Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: Add resolution states to Catalog concerns
Martin Renvoize [Thu, 21 Dec 2023 15:58:41 +0000 (15:58 +0000)]
Bug 35628: Add resolution states to Catalog concerns

This patch adds ticket status to the catalog concerns feature. It
allows libraries to define a list of 'TICKET_STATUS' authorized
values from which librarians can then pick at the point of updateing
a catalog concern.

To test:
1) Apply the patches and run the database updates
2) Enable catalog concerns (staff or opac will do the trick)
3) Submit a catalog concern
4) Confirm that you can still update a concern from the catalog
   concerns management page as before.
5) Add some values to the new TICKET_STATUS authorized values
6) Submit a new catalog concern
7) Confirm that the 'Update' button in the management modal is now a
   split button with a dropdown containing the list of status values
   defined above.

Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: Add status to ticket definition
Martin Renvoize [Thu, 21 Dec 2023 15:58:11 +0000 (15:58 +0000)]
Bug 35628: Add status to ticket definition

Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35628: Add status to tickets
Martin Renvoize [Thu, 21 Dec 2023 15:57:41 +0000 (15:57 +0000)]
Bug 35628: Add status to tickets

This patch adds a new TICKET_STATUS authorized value category as well as
adding the new 'status' field to both 'tickets' and 'ticket_updates'
tables.

Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 31652: DBIC schema update
Katrin Fischer [Tue, 30 Apr 2024 09:12:03 +0000 (09:12 +0000)]
Bug 31652: DBIC schema update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35138: Fix typo in error messages
Katrin Fischer [Tue, 30 Apr 2024 08:51:42 +0000 (08:51 +0000)]
Bug 35138: Fix typo in error messages

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35138: DBRev 23.12.00.035
Katrin Fischer [Tue, 30 Apr 2024 08:49:53 +0000 (08:49 +0000)]
Bug 35138: DBRev 23.12.00.035

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35138: Fix delete button for newly added facet
Jonathan Druart [Mon, 29 Apr 2024 21:13:43 +0000 (23:13 +0200)]
Bug 35138: Fix delete button for newly added facet

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35138: Fix Koha_Elasticsearch.t
Jonathan Druart [Mon, 29 Apr 2024 21:06:17 +0000 (23:06 +0200)]
Bug 35138: Fix Koha_Elasticsearch.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35138: (QA follow-up) Tidy update
Nick Clemens [Fri, 12 Apr 2024 09:03:46 +0000 (09:03 +0000)]
Bug 35138: (QA follow-up) Tidy update

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35138: A bit of cleaning - UI
Jonathan Druart [Thu, 21 Mar 2024 13:47:27 +0000 (14:47 +0100)]
Bug 35138: A bit of cleaning - UI

This can be moved to its own bug report, it's only a bit of cleaning
trying to keep the code cleaner after than before.
No behaviour changes expected.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35138: UI changes to add/remove a facet
Jonathan Druart [Thu, 21 Mar 2024 11:42:24 +0000 (12:42 +0100)]
Bug 35138: UI changes to add/remove a facet

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35138: Mark DisplayLibraryFacets as zebra only
Jonathan Druart [Fri, 22 Mar 2024 08:53:47 +0000 (09:53 +0100)]
Bug 35138: Mark DisplayLibraryFacets as zebra only

We can know add/remove homelibrary and holdinglibray from the config
page, this syspref is no longer needed for ES

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35138: Adjust existing data
Jonathan Druart [Thu, 21 Mar 2024 09:15:23 +0000 (10:15 +0100)]
Bug 35138: Adjust existing data

We want the label from the DB displayed on the UI so we are adjusting
the yaml and the DB.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35138: Add the ability to manage ES facets
Jonathan Druart [Thu, 14 Mar 2024 10:41:42 +0000 (11:41 +0100)]
Bug 35138: Add the ability to manage ES facets

This new feature allows to manage facets for Elasticsearch from the
administration page.
Prior to this the facet fields were hardcoded in the codebase.

Librarians can then add/remove facet fields and modify their label.

Test plan:
1. Create a new search field and set it a label different than its name.
2. Save
3. Go the bibliographic mapping tab
4. Add 1+ mapping for this search field (Searchable and facetable must be "Yes")
5. Add, reorder, remove new facets
6. Save and reindex your records
7. Search and notice the new facet list

QA: There are several wrong things in this area (ES + facets code,
everything, pm, pl, tt AND on this administration page). I have done my
best to clean the code as much as I could and keep the code cleaner
after than before. But there are still a lot to do.
There are still inconsistencies on this page (like we need to save to
see the changes applied to the other tables), but this is clearly out of
the scope of this bug report.
Another enhancement would be to move the facet list to a different DB
table, that could bring more flexibility:
  * display or not (could be opac/staff/both/none)
  * define the size per field (number of facet to display)
  * order: move search_field.facet_order to this new table.
But, again, it's a lot more work.

More work is done in this area, please see related bug reports.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26297: (follow-up) Fix specification file
Martin Renvoize [Tue, 30 Apr 2024 06:31:15 +0000 (07:31 +0100)]
Bug 26297: (follow-up) Fix specification file

We had a duplicate 'description' key introduced in the patron category
specification file here which causes errors on bundling the specs.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 31345: Add ability to exit process_message_queue.pl early if any plugin before_se...
Kyle M Hall [Thu, 11 Aug 2022 19:43:15 +0000 (15:43 -0400)]
Bug 31345: Add ability to exit process_message_queue.pl early if any plugin before_send_messages hook fails

Sometimes it would be better for process_message_queue.pl to stop if a plugin hook fails rather than continue processing. It would be nice if that was a command line option.

Test Plan:
1) Install any plugin with a before_send_messages hook
2) Modify the plugin, add a 'die;' statement at the start of the
   before_send_messages method of the plugin.
3) Run process_message_queue.pl as usual
4) Note the exit code is 0
5) Run it again with the new -e setting
6) Note the exit code is 1

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35582: Supress possible warning
Kyle M Hall [Fri, 26 Apr 2024 18:41:42 +0000 (14:41 -0400)]
Bug 35582: Supress possible warning

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35582: Show advanced search languages with selected intranet language description...
lmstrand [Fri, 26 Jan 2024 08:36:00 +0000 (10:36 +0200)]
Bug 35582: Show advanced search languages with selected intranet language descriptions first

To test:

1. Check language dropdowns in advanced search, notice localized
   names of the languages are shown first in the menus, then the
selected ui language translations if available or the english translation
2. Apply patch
3. Check language dropdowns, notice the selected ui language's
   translations are shown first for the languages (if missing, english
translation), then the localized
language's name.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26297: (QA follow-up): Update tests
Pedro Amorim [Wed, 24 Apr 2024 11:01:08 +0000 (11:01 +0000)]
Bug 26297: (QA follow-up): Update tests

prove t/db_dependent/api/v1/patron_categories.t

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26297: (QA follow-up) Spec fixes
Tomas Cohen Arazi [Tue, 23 Apr 2024 13:04:06 +0000 (10:04 -0300)]
Bug 26297: (QA follow-up) Spec fixes

This patch fixes some spec misses. To test:

1. Run:
   $ ktd --shell
  k$ prove xt/api.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26297: Add tests
Pedro Amorim [Tue, 12 Dec 2023 10:57:50 +0000 (10:57 +0000)]
Bug 26297: Add tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26297: API specs
Pedro Amorim [Mon, 11 Dec 2023 17:30:37 +0000 (17:30 +0000)]
Bug 26297: API specs

Test plan, k-t-d:
1) Access /api/v1/patron_categories
2) Verify the patron categories are correctly listed

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Bug 26297: (QA follow-up) Move to REST::V1::Patrons::Categories

Bug 26297: (QA follow-up) Use search_with_library_limits

JD amended-patch: squashed + tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26297: Add patron categories to_api_mapping
Pedro Amorim [Mon, 11 Dec 2023 17:31:09 +0000 (17:31 +0000)]
Bug 26297: Add patron categories to_api_mapping

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 33494: Make filters a toggle
Martin Renvoize [Wed, 27 Dec 2023 16:01:05 +0000 (16:01 +0000)]
Bug 33494: Make filters a toggle

This patch updates the markup to make the 'Filter resolved | Show all' a
toggle filter rather than two buttons.

Test plan
1. Enable the CatalogConcerns system preference.
2. For two records, add a catalog concern (New > New catalog concern).
3. Resolve one of the concerns (Cataloging > Reports > Catalog concerns)
   - click on the 'Details' button then the 'Resolve' button.
4. Note that the filters at the top of the page are labelled: Hide
   resolved | Show all
5. Apply the patch and refresh the page.
6. Note that it is now a 'toggle': 'Include resolved' (default) or
   'Filter resolved'

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35106: CSRF fix
Pedro Amorim [Tue, 2 Apr 2024 11:28:59 +0000 (11:28 +0000)]
Bug 35106: CSRF fix

The removal of 'cud-' from op needs to happen sooner
because ill-requests.tt expects 'edit_action' op,
not 'cud-edit_action'.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35106: Validate entered borrowernumber and biblio_id
Pedro Amorim [Thu, 19 Oct 2023 10:21:04 +0000 (10:21 +0000)]
Bug 35106: Validate entered borrowernumber and biblio_id

Following up from the test plan of the previous patch:
1) Edit the request again, input gibberish in the Patron ID e.g. 'asdasd'
2) Hit 'Submit'
3) Notice you get a 'The Patron ID you entered is invalid.' message.
4) Edit again, try to empty the input on the Patron ID, hit 'Submit'.
5) Notice it saves the patron as null, as expected

Repeat the test plan, but now for the Bibliographic record ID, notice
the message 'The Bibliographic record ID you entered is invalid.' is
shown if a no biblio was found.

Signed-off-by: David Nind <david@davidnind.com>
squash this

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35106: Add patron search autocomplete to Patron ID input
Pedro Amorim [Thu, 19 Oct 2023 09:35:32 +0000 (09:35 +0000)]
Bug 35106: Add patron search autocomplete to Patron ID input

Test plan, k-t-d:
1) Install FreeForm and enable ILLmodule, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) Visit /cgi-bin/koha/ill/ill-requests.pl
3) Create 'New ILL request'
4) Select the request type, input cardnumber '42' and select a library. Hit 'Create'
5) Manage the request created just now: click the request id or 'manage request' button from the table
6) Click "Edit request" from the top actions toolbar
7) Input text in Patron ID e.g. 'koha'. Notice you get patron suggestions.
8) Click one of the suggestions and save the request, notice the patron is saved correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 25682: Style transfers interface to match checkin page
Owen Leonard [Tue, 23 Apr 2024 11:01:26 +0000 (11:01 +0000)]
Bug 25682: Style transfers interface to match checkin page

This patch updates the transfer page to make it better match the style
of the checkin page. The static dialog is converted to a modal for
consistency's sake, with information displaying as similarly as
possible to the checkin page. The library dropdown is now styled with
Select2.

To test, apply the patch and go to Circulation -> Transfers.

- Test some simple transfers: Items which are not checked out, some
  which are checked out.
- Test that the page's handling of items on hold matches current master
  (i.e. broken, see Bug 36686). Description of current behavior:

- Logged in to Branch A.
- Find a barcode for a title which has a biblio-level
  hold (not already in transit) to be sent to Branch B.

  - Submit transfer to Branch C.
    - Three actions are offered:
      1. Transfer to Branch B
      2. Cancel hold and then attempt transfer
      3. Ignore and return to transfers

      Testing each of the three actions:
          1. The page says "Item is now in transit
             to Branch C (not the hold's destination)"
          2. The item is not in transit, and the hold
             has been changed to an item-level hold.
          3. Works correctly. No change to the hold
             and no transfer initiated.

- Logged in to Branch A.
- Find a barcode for a title which has a biblio-level
  hold (not already in transit) to be sent to Branch B.
  - Check in the item, confirm hold and transfer.

  - Submit transfer to Branch C.
    - Two actions are offered:
      1. Cancel hold and then attempt transfer
      2. Ignore and return to transfers

      Testing each of the two actions:
          1. The page says "Reserve cancelled" (sic).
             The original transfer to Branch B is still
             in place.
          2. Works correctly. No change to the hold and
             the original transfer remains.

- Logged in to Branch D.
- Find a barcode for a title which has a biblio-level
  hold (not already in transit) to be held at Branch D.
  - Check in the item, confirm hold.

- Log in to Branch A.
  - Submit a transfer with that barcode to Branch C.
    - Two actions are offered:
      1. Cancel hold and then attempt transfer
      2. Ignore and return to transfer.

      Testing each of the two actions:
          1. The page says "Reserve cancelled" (sic).
             The hold has been cancelled but the item
             has not been transferred.
          2. Works correctly. Hold remains unchanged,
             no transfer initiated.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: DBRev 23.12.035
Katrin Fischer [Mon, 29 Apr 2024 15:35:02 +0000 (15:35 +0000)]
Bug 29393: DBRev 23.12.035

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: (follow-up) Rename notice module to "Patron (custom message)"
Katrin Fischer [Mon, 29 Apr 2024 15:31:35 +0000 (15:31 +0000)]
Bug 29393: (follow-up) Rename notice module to "Patron (custom message)"

Also moved it below the similar entry "Patron (custom slip)".

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: (QA follow-up) Improve modal styling
Martin Renvoize [Thu, 25 Apr 2024 10:54:30 +0000 (11:54 +0100)]
Bug 29393: (QA follow-up) Improve modal styling

The modal still used a lot of older styles, this patch updates the
classes to make it more consistent with other message type modals.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: (QA follow-up) Tidy and make executable the new test
Martin Renvoize [Thu, 25 Apr 2024 09:01:25 +0000 (10:01 +0100)]
Bug 29393: (QA follow-up) Tidy and make executable the new test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: (QA follow-up) Tidy add_message.pl
Martin Renvoize [Thu, 25 Apr 2024 08:59:50 +0000 (09:59 +0100)]
Bug 29393: (QA follow-up) Tidy add_message.pl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: (QA follow-up) Make database update idempotent
Martin Renvoize [Thu, 25 Apr 2024 08:58:19 +0000 (09:58 +0100)]
Bug 29393: (QA follow-up) Make database update idempotent

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: Prevent SQL errors when SQL strict mode is set
Julian Maurice [Tue, 18 Apr 2023 14:28:34 +0000 (16:28 +0200)]
Bug 29393: Prevent SQL errors when SQL strict mode is set

Signed-off-by: Matthias Le Gac <matthias.le-gac@inlibro.com>
Signed-off-by: Phan Tung Bui <phan-tung.bui@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: (follow-up) Explicite use of methods from C4
Fridolin Somers [Tue, 14 Mar 2023 20:33:58 +0000 (10:33 -1000)]
Bug 29393: (follow-up) Explicite use of methods from C4

Signed-off-by: Matthias Le Gac <matthias.le-gac@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: Sort notice templates by name
Alex Arnaud [Wed, 8 Dec 2021 12:56:15 +0000 (13:56 +0100)]
Bug 29393: Sort notice templates by name

Signed-off-by: Matthias Le Gac <matthias.le-gac@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: Don't show notice templates for each language
Alex Arnaud [Fri, 19 Nov 2021 08:59:59 +0000 (09:59 +0100)]
Bug 29393: Don't show notice templates for each language

Signed-off-by: Matthias Le Gac <matthias.le-gac@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: Add send_messages_to_borrowers permission
Alex Arnaud [Wed, 10 Nov 2021 13:45:17 +0000 (14:45 +0100)]
Bug 29393: Add send_messages_to_borrowers permission

Signed-off-by: Matthias Le Gac <matthias.le-gac@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: Add a dedicated letters module for add message
Alex Arnaud [Wed, 10 Nov 2021 10:34:17 +0000 (11:34 +0100)]
Bug 29393: Add a dedicated letters module for add message

Signed-off-by: Matthias Le Gac <matthias.le-gac@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: Use patron language in letters
Alex Arnaud [Mon, 8 Nov 2021 14:16:17 +0000 (15:16 +0100)]
Bug 29393: Use patron language in letters

Signed-off-by: Matthias Le Gac <matthias.le-gac@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 29393: Ability to send emails from patron details page
Alex Arnaud [Tue, 2 Nov 2021 15:16:29 +0000 (16:16 +0100)]
Bug 29393: Ability to send emails from patron details page

Test plan
  - apply Bug 12802
  - go to a patron's details page
  - click on "Add message" in tools bar
  - choose "Email" in "Add a message for"
  - Select a notice (module members) or manualy fill the message
  - Save
  - Check the message is saved in message_queue table

Signed-off-by: Matthias Le Gac <matthias.le-gac@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 12802: DBRev 23.12.00.034
Katrin Fischer [Mon, 29 Apr 2024 14:46:33 +0000 (14:46 +0000)]
Bug 12802: DBRev 23.12.00.034

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 12802: Clarify system preferences
Martin Renvoize [Wed, 20 Dec 2023 11:43:34 +0000 (11:43 +0000)]
Bug 12802: Clarify system preferences

I felt the switch to multi in the EmailFieldPrimary preference was a bit
confusing given that type exposes a 'select all' option which doesn't
make sense with the pre-existing 'first valid' option being an override
in the code.

This patch opts to switch it back to 'Choice', meaning that only one
option can be picked and adds a 'selected addresses' option which
prompts the use of a new 'EmailFieldSelection' preference which allows
for the multi-select as before.

To test:
1) Run though the test plan for 'Update notice_email_address method to
   return a list' but with the following ammendments:

* 2) As aposed to being able to select multiple options under
  EmailFieldPrimary, you should now only be able to select one option at
  a time, but a new 'selected addresses' option should be present.
* 8) Select the 'selected addresses' option for 'EmailFieldPrimary' and
  also select multiple fields for the new 'EmailFieldSelection'
  preference.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Axelle Clarisse <axelle.clarisse@univ-amu.fr>
Signed-off-by: Mathieu Saby <mathsabypro@gmail.com>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 12802: Add note to EmailFieldPrimary system preference
Aleisha Amohia [Wed, 20 Dec 2023 01:19:14 +0000 (01:19 +0000)]
Bug 12802: Add note to EmailFieldPrimary system preference

To clarify that "first valid" should be unchecked for multiple emails to receive notices

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Axelle Clarisse <axelle.clarisse@univ-amu.fr>
Signed-off-by: Mathieu Saby <mathsabypro@gmail.com>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 12802: Update notice_email_address method to return a list
Martin Renvoize [Tue, 19 Dec 2023 17:09:17 +0000 (17:09 +0000)]
Bug 12802: Update notice_email_address method to return a list

This patch updates the notice_email_address method to return a comma
separated list of addresses as expected by Email::Sender if you wish to
send mail to multiple To addresses.

To test:

1. Install database update and restart services
2. Go to Koha Administration -> system preferences. Search for EmailFieldPrimary. Confirm the options show as checkboxes and you can select multiple.
3. Search for a patron. Put different email addresses in each of the possible email fields (i.e. primary email, secondary email, alternate email).
4. Make sure 'first valid' is checked in EmailFieldPrimary.
5. Go to your patron, click the More dropdown and send a welcome email.
6. In your terminal, go into the database to view the message queue.

sudo koha-mysql instance
select * from message_queue\G

7.  Confirm your welcome email is visible, with ONLY the first valid email in
    the to_address field.
8.  Select other combinations of emails in EmailFieldPrimary.
9.  Send another welcome email to the same patron, then run the message_queue
    SQL query again.
10. Confirm your welcome email is visible and shows all selected addresses
    concatenated by , in the to_address field.
11. Enable KTD to send email [1] (without email configured you will not
    be able to confirm the delivery to multiple addresses).
12. Run misc/cronjobs/process_message_queue.pl to trigger sending the
    queued notices from above.
13. Check that the addresses in the to_address all actually recieve the
    notice.

[1] To test sending emails using a Google account:
    - Set up an App password for your Google Account
    - Configure a new 'SMTP Server' under 'Administration > SMTP servers'
      using the following settings where `User name` = your Google email
      address and `Password` = your APP password, not your Google account
      password):

      Host: smtp.gmail.com
      Port: 587
      Timeout: 120
      SSL: STARTTLS
      User name: GOOGLEACCOUNTUSER
      Password: GOOGLEAPPPASSWORD

    - Set this server as default

Sponsored-by: St Luke's Grammar School & Pymble Ladies' College
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Axelle Clarisse <axelle.clarisse@univ-amu.fr>
Signed-off-by: Mathieu Saby <mathsabypro@gmail.com>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 12802: Update system preference
Martin Renvoize [Tue, 19 Dec 2023 17:08:27 +0000 (17:08 +0000)]
Bug 12802: Update system preference

Allow the EmailFieldPrimary preference to accept multiple selections

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Axelle Clarisse <axelle.clarisse@univ-amu.fr>
Signed-off-by: Mathieu Saby <mathsabypro@gmail.com>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36559: (follow-up) Fix To/From z-index
Lucas Gass [Tue, 23 Apr 2024 13:41:22 +0000 (13:41 +0000)]
Bug 36559: (follow-up) Fix To/From z-index

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36559: Add sticky table headers to transport cost matrix
Lucas Gass [Fri, 12 Apr 2024 07:38:23 +0000 (07:38 +0000)]
Bug 36559: Add sticky table headers to transport cost matrix

To test:
1. APPLY patch and regenerate CSS. ( yarn build )
2. Have many, many branches. To test it is good to have more branches than in a standard k-t-d.
3. Go to Admin > Transport cost matrix
4. Scroll down and to the right, the table headers should stay visible.
5. Hover over any cell, a title should appear like 'Branch A / Branch B'
6. Test in Chrome and Firefox.

This uses position: sticky which has recently gained more widespread browser support:
https://caniuse.com/?search=sticky

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36510: Add CircControl and HomeOrHoldingBranch settings to smart-rules
Andrew Fuerste Henry [Thu, 4 Apr 2024 21:28:11 +0000 (21:28 +0000)]
Bug 36510: Add CircControl and HomeOrHoldingBranch settings to smart-rules

To test:
1 - apply patch
2 - restart all
3 - load circ & fines rules, confirm syspref values show in the blue box of rules explanation
4 - change sysprefs and confirm values update on circ rules page

Signed-off-by: Michelle Spinney <mspinney@clamsnet.org>
Signed-off-by: hebah <hebah@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35993: (follow-up) Fix MarcOverlayRules.t too
Marcel de Rooy [Mon, 29 Apr 2024 14:35:41 +0000 (14:35 +0000)]
Bug 35993: (follow-up) Fix MarcOverlayRules.t too

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35993: (follow-up) Fix Merge.t
Marcel de Rooy [Mon, 29 Apr 2024 14:14:20 +0000 (14:14 +0000)]
Bug 35993: (follow-up) Fix Merge.t

The change for 005 makes some field compares fail. We should
exclude 005 in the local compare_fields sub.

We do NOT need the compare_fields from AuthoritiesMarc. Removing.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 31652: DBRev 23.12.00.033
Katrin Fischer [Mon, 29 Apr 2024 12:53:25 +0000 (12:53 +0000)]
Bug 31652: DBRev 23.12.00.033

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 31652: Perltidy
Katrin Fischer [Mon, 29 Apr 2024 12:46:39 +0000 (12:46 +0000)]
Bug 31652: Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 31652: Add geo-search
Mark Hofstetter [Thu, 11 Apr 2024 09:14:06 +0000 (09:14 +0000)]
Bug 31652: Add geo-search

This patch adds geosearch to Koha (using Elasticsearch 7). ElasticSearch
search_mappings get new types to store lat/lon, which can be indexed
from MARC 034$s and 034$t. There is a small change to the DB to allow a
new value in search_field.type ENUM.

The QueryBuilder is extended to allow for building advanced
ElasticSearch Querys (eg geo_distance) that cannot be represented in a
simple string query. The UI for searching (including showing the results
on a OSM/Leaflet map) is implemented in a separate plugin
(https://github.com/HKS3/HKS3GeoSearch)

Test Plan:

* make sure you're running ElasticSearch 7
  (eg via `curl http://es:9200?pretty | grep number`)
* apply patch
* got to a Framework, check Editor for 034$s and 034$t and save
* got to some books (in the correct framework) and enter some lat and lon into 034$s and 034$t (for example lat=48.216, lon=16.395)
* Run the elasticsearch indexer, maybe limited on the books you edited (-bn 123 -bn 456):
  misc/search_tools/rebuild_elasticsearch.pl -b -v
* You can check if the indexing worked by inspecting the document in elasticsearch:
  * get the biblionumber (eg 123)
  * curl http://es:9200/koha_kohadev_biblios/_doc/123?pretty | grep -A5 geolocation
  * You should get back a JSON fragment containing the lat/lon you stored
* You can query elasticsearch directly:
  * Run the following curl command, but adapt the value for lat/lng and/or the distance (in meters)
  * curl -X GET "http://es:9200/koha_kohadev_biblios/_search?pretty" -H 'Content-Type: application/json' -d '{"query": {"bool":{"must":{"match_all":{}},"filter":{"geo_distance":{"distance":100000,"geolocation":{"lat":48.2,"lon":16.4}}}}}}'
* To run the search via Koha, you need to either install and use https://github.com/HKS3/HKS3GeoSearch or create a handcrafted query string:
  * handcrafted query string:
    * /cgi-bin/koha/opac-search.pl?advsearch=1&idx=geolocation&q=lat:48.25+lng:18.35+distance:100km&do=Search
  * HKS3GeoSearch
    * install the plugin and enable it
    * got to OPAC / Advanced Search
    * There is a new input box "Geographic Search" where you can enter lat/long/radius
    * On the search result page a map is shown with pins for each found biblioitem

Sponsored-by: ZAMG - Zentralanstalt für Meterologie und Geodynamik, Austria - https://www.zamg.ac.at/
Sponsored-by: Geosphere - https://www.geosphere.at/
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Additional finetuning:

- Fix update and remove fixed fixme
- Update test count as well
- fix last small issues raised in Comment 23

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36374: Also tidy ticket and concern modals js
Martin Renvoize [Thu, 21 Mar 2024 09:31:38 +0000 (09:31 +0000)]
Bug 36374: Also tidy ticket and concern modals js

This patch does the promised follow-up to tidy the two other recently
added js files for modals. As I'm the main maintainer of those to date
I'm happy to rebase any patches already submitted atop this bug.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36374: Keep tidy files from 'fetch' directory
Jonathan Druart [Thu, 21 Mar 2024 08:07:18 +0000 (09:07 +0100)]
Bug 36374: Keep tidy files from 'fetch' directory

And tidy them

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36374: flag JS files to keep tidy
Jonathan Druart [Thu, 21 Mar 2024 07:45:11 +0000 (08:45 +0100)]
Bug 36374: flag JS files to keep tidy

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36374: Ensure js/modals/*.js files are tidy
Martin Renvoize [Wed, 20 Mar 2024 16:18:14 +0000 (16:18 +0000)]
Bug 36374: Ensure js/modals/*.js files are tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36374: Move modal js under /modals
Martin Renvoize [Wed, 20 Mar 2024 15:28:10 +0000 (15:28 +0000)]
Bug 36374: Move modal js under /modals

I also didn't stick to the more recent switch to putting modal js under
a /modals dirctory.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36374: Tidy place_booking_modal.js according to our prettier config
Martin Renvoize [Wed, 20 Mar 2024 15:24:18 +0000 (15:24 +0000)]
Bug 36374: Tidy place_booking_modal.js according to our prettier config

This was somehow missed when the file was first added.. my mistake.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32392: Fix QA issues
Kevin Carnes [Wed, 6 Dec 2023 13:22:22 +0000 (14:22 +0100)]
Bug 32392: Fix QA issues

Signed-off-by: Stina <stina.hallin@ub.lu.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32392: Tests for changes in C4::Serials::GetNextSeq
Björn Nylén [Thu, 1 Dec 2022 22:32:15 +0000 (23:32 +0100)]
Bug 32392: Tests for changes in C4::Serials::GetNextSeq

Signed-off-by: Marie Hedbom <marie.hedbom@musikverket.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 32392: Enable skipping forward issues when receiving serials.
Björn Nylén [Fri, 1 Apr 2022 14:13:47 +0000 (14:13 +0000)]
Bug 32392: Enable skipping forward issues when receiving serials.

This patch adds the ability to skip forward issues when receiving and generating the next issue
from both the serial receive page and serial collection page.

To test:
1. Apply patch.
2. Set up a subscription for a bib record.
3. Go to Serials -> Search your subscription -> Serial receive
4. Note that below last expected issue there will be checkbox to toggle a field to
   specify how many issues to skip when recieving and generating the next.
5. On serials-collection page there is also a button 'Skip issues and generate next'.
   When pressed will open a modal promting how many issues to skip.
6. Generate issues with different values and make sure the correct issue is generated.

​Sponsored-by: Lund University Library
Sponsored-by: Bibliotek Mellansjö, Sweden
Co-authored-by: Johan Sahlberg <johan.sahlberg@tidaholm.se>
Signed-off-by: Marie Hedbom <marie.hedbom@musikverket.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoUpdate docs/contributors.yaml with new contributor
Katrin Fischer [Mon, 29 Apr 2024 12:05:52 +0000 (12:05 +0000)]
Update docs/contributors.yaml with new contributor

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36341: (follow-up) Fix missing Date_from_syspref
Martin Renvoize [Mon, 29 Apr 2024 08:38:02 +0000 (09:38 +0100)]
Bug 36341: (follow-up) Fix missing Date_from_syspref

It appears this bug introduces the first actual use of this function in
the OPAC and thus exposes that bug 31261 didn't fully port the
Date_from_syspref from the intranet.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35993: Apply new routine to ModBiblioMarc
Marcel de Rooy [Mon, 5 Feb 2024 13:36:21 +0000 (13:36 +0000)]
Bug 35993: Apply new routine to ModBiblioMarc

Now both AddBiblio and ModBiblio will insert 005 if not present.

Test plan:
Run t/db_dependent/Biblio.t
Add biblio record via acquistion order. Check 005 in the table
biblio_metadata.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
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>
2 months agoBug 35993: Add SimpleMarc::update_last_transaction_time
Marcel de Rooy [Mon, 5 Feb 2024 13:09:54 +0000 (13:09 +0000)]
Bug 35993: Add SimpleMarc::update_last_transaction_time

Note: This routine does not check field existence like
ModBiblioMarc does/did (see next patch). So it inserts
a field 005 if it is not present.

Test plan:
Run t/SimpleMARC.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
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>
2 months agoBug 31671: Add print slip button to transfer page
Owen Leonard [Mon, 22 Apr 2024 16:10:46 +0000 (16:10 +0000)]
Bug 31671: Add print slip button to transfer page

This patch reimplements/rebases Lucas' patch and adds a style
modification to the button.

To test:
1. Apply patch
2. Go to Circulation / Transfer
3. Try transfering some items and notice the 'Print slip'
   button
4. Try clicking on it and make sure it generates correctly and with the
   correct information on the slip

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>
2 months agoBug 36671: (follow-up) remove stray anchor tag
Lucas Gass [Mon, 22 Apr 2024 17:46:52 +0000 (17:46 +0000)]
Bug 36671: (follow-up) remove stray anchor tag

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>