koha.git
8 months agoBug 34136: (QA follow-up) Perltidy
Katrin Fischer [Mon, 23 Oct 2023 21:42:01 +0000 (21:42 +0000)]
Bug 34136: (QA follow-up) Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 months agoBug 34136: (QA follow-up) Change Report to Reports as category in notices and slips
Katrin Fischer [Mon, 23 Oct 2023 21:38:14 +0000 (21:38 +0000)]
Bug 34136: (QA follow-up) Change Report to Reports as category in notices and slips

Looking at the other entries for the module in notices we most often
use the actual module name: patrons, suggestions, holds, etc.

So I updated "Report" to "Reports" to match that pattern.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 months agoBug 34136: Add ability to render a report using a notice template
Kyle M Hall [Tue, 27 Jun 2023 16:44:18 +0000 (12:44 -0400)]
Bug 34136: Add ability to render a report using a notice template

Sometimes it is useful to display the results of a report in a non-table format. We should be able to create notice templates to render reports.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Create a new notice template using the new "Report" option from the
   "New notice" pulldown.
4) In the "Print" area, paste the following template:

[% FOREACH b IN data %]
<div class="panel panel-default">
  <div class="panel-heading">[% b.surname %], [% b.firstname %]</div>
  <div class="panel-body">Expiration: [% b.dateexpiry %]</div>
  <div class="panel-footer">ID: [% b.borrowernumber %]</div>
</div>
[% END %]

5) Create a report with the query: SELECT * FROM borrowers
6) Once the report is saved, use the new "Run with template" option to
   select the template you just created.
7) Note that instead of the results being a paged table, you instead
   see the results rendered as cards!

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 months agoBug 35043: Do not have \n or \t appear in PO files
Jonathan Druart [Thu, 12 Oct 2023 10:35:12 +0000 (12:35 +0200)]
Bug 35043: Do not have \n or \t appear in PO files

This is a trick, so that we won't have to deal with \t in PO files.
\n is not a problem, but it seems consistent to use the same method for
both.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 months agoBug 35043: Use Locale::PO->quote
Jonathan Druart [Thu, 12 Oct 2023 09:44:16 +0000 (11:44 +0200)]
Bug 35043: Use Locale::PO->quote

We have our own "quote_po" sub that is stating that Locale::PO::quote
is buggy because it does not deal with quoting new lines correctly.
However it seems that it is fixed now.

Ideally we could use Locale::PO::quote everywhere, but it does not
escape tab characters:
  $string =~ s/\\(?!t)/\\\\/g;           # \t is a tab

This means the following:
msgid "Tabulation (\\t)"
msgstr "Tabulation (\\t)"
become:
-msgid "Tabulation (\t)"
-msgstr "Tabulation (\t)"

And we are seeing the following on Weblate:
https://snipboard.io/BjQmDC.jpg

Note that Locale::PO has not been updated since 2014...

The real problem behind this is that we have 2 methods to quote strings.
At first glance it seems that Locale::PO::quote was not used before, but
with the introduction of the koha-i18n project we will have scripts that
will use Locale::PO->save_file_fromarray, which uses Locale::PO->quote
=> Those scripts will be used on the translation server for post
processing (security reason, marking potential XSS strings as fuzzy).

Test plan:
0. Do not apply the patch
1. gulp po:update --lang LANG # Replace LANG with your favorite language
   code
2. git commit -a -m"init PO files"
3. Apply this patch
4. Repeate 1.
5. git diff
   => The change is about the "Tabulation" and "New line" strings from
      tools/csv-profiles.tt
6. Translate them (replace the \t and \n with %s) and remove the fuzzy
   flag
7. install the template: cd misc/translator && perl translate install
   LANG
8. Enable the language, use it and go to the "Nouveau profil CSV" view
   => Notice that the \t and \n are correctly displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 months agoBug 35141: (QA follow-up) Increment the bad count
Marcel de Rooy [Fri, 27 Oct 2023 07:21:03 +0000 (07:21 +0000)]
Bug 35141: (QA follow-up) Increment the bad count

Also move earlier print to warn for consistency.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 months agoBug 35141: Prevent link_bibs_to_authorities from dying on invalid metadata
Nick Clemens [Tue, 24 Oct 2023 12:01:09 +0000 (12:01 +0000)]
Bug 35141: Prevent link_bibs_to_authorities from dying on invalid metadata

When fetching the record we need to eval in case of exception

To test:
1 - Apply first patch
2 - perl misc/link_bibs_to_authorities.pl
3 - Note it dies on parser error at record 369
4 - Apply this patch
5 - perl misc/link_bibs_to_authorities.pl
6 - The process completes - with warning thrown on record 369

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 months agoBug 35141: Catch ES search exceptions in link_bibs_to_authorities, warn, and continue
Nick Clemens [Tue, 24 Oct 2023 11:51:29 +0000 (11:51 +0000)]
Bug 35141: Catch ES search exceptions in link_bibs_to_authorities, warn, and continue

This patch simplay adds an eval and a warning to link_bibs_to_authorities to catch any errors while searching and continue linking.

To test:
1 - edit /etc/kohia/sites/kohadev/koha-conf.xml and add to elasticsearch stanza
    <request_timeout>0</request_timeout>
2 - perl misc/link_bibs_to_authorities.pl
3 - It dies immediately
4 - Apply patch
5 - perl misc/link_bibs_to_authorities.pl
6 - Now it tries every record, throwing warnings along the way, but completes

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 months agoBug 34678: Allow new entries to overwrite hold_fill_targets
Nick Clemens [Wed, 13 Sep 2023 17:03:32 +0000 (17:03 +0000)]
Bug 34678: Allow new entries to overwrite hold_fill_targets

When using background jobs, there is a possibility of a race condition where two jobs will be updating the holds queue for the same biblio. We should try to minimize those cases (see bug 34596)

In the meantime though, we should prevent jobs possibly dying, and allow the most recent update to succeed.

There is a possibility two updates wil assign different items to the same reserve, and that a reserve could end up in the queue twice, however, whichever one is filled first will delete both entries. as filling the hold deletes by reserve id (see bug 24359)

This patch adds a transaction to delete and then inset the new row

To test:
1 - prove -v t/db_dependent/Reserves.t
2 - It fails
3 - Apply patch
4 - t/db_dependent/Reserves.t
5 - It succeeds!

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 months agoBug 34678: Unit test
Nick Clemens [Wed, 13 Sep 2023 17:01:09 +0000 (17:01 +0000)]
Bug 34678: Unit test

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 months agoBug 35167: Make 'effective_not_for_loan_status' fallback to 0 if itype has it undef
Tomas Cohen Arazi [Thu, 26 Oct 2023 17:58:40 +0000 (14:58 -0300)]
Bug 35167: Make 'effective_not_for_loan_status' fallback to 0 if itype has it undef

This patch makes the effective not for loan status be set the item value
if not defined at itype level.

To test:
1. Apply the regressions tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/items.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 months agoBug 35167: Regression tests
Tomas Cohen Arazi [Thu, 26 Oct 2023 17:56:35 +0000 (14:56 -0300)]
Bug 35167: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 months agoBug 35119: Add back classes used for selenium tests
Martin Renvoize [Fri, 27 Oct 2023 14:46:13 +0000 (15:46 +0100)]
Bug 35119: Add back classes used for selenium tests

This patch re-instates the classes used for the selenium tests.. I
checked we weren't using them for javascript or css, but didn't think
about tests before.

8 months agoBug 29523: (follow-up) Adding documentation to swagger.yaml
Martin Renvoize [Mon, 23 Oct 2023 15:19:18 +0000 (16:19 +0100)]
Bug 29523: (follow-up) Adding documentation to swagger.yaml

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: (follow-up) Comprehensive tests for redaction
Martin Renvoize [Mon, 23 Oct 2023 15:19:18 +0000 (16:19 +0100)]
Bug 29523: (follow-up) Comprehensive tests for redaction

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: Add redaction for inaccessible objects
Martin Renvoize [Thu, 31 Aug 2023 12:13:54 +0000 (14:13 +0200)]
Bug 29523: Add redaction for inaccessible objects

This patch switches from removing inaccessible items from the responses
to instead redacting fields in innaccessible responses.

This allows for embed traversal and keeps counts etc correct but also
hides the data we want to hide.

We add support for an 'unredact_list' method at the Koha::* class level
allowing for individual classes to specify which fields they wish to
expose to restricted users regardless of their restriction.

It is to be used in combination with the is_accessible method introduced
earlier in this patchset which is used to denote whether the current
user should be allowed to see the full record or only a subset of it as
defined in the unredacted_list.

We undefine any fields not listed in the unredact_list for the API
response. This has the effect of still returning the full object of
keys, but setting most fields to a JSON null.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: Remove no longer required methods
Martin Renvoize [Wed, 29 Jun 2022 11:25:35 +0000 (12:25 +0100)]
Bug 29523: Remove no longer required methods

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: Remove the FIXME
Martin Renvoize [Tue, 28 Jun 2022 15:50:29 +0000 (16:50 +0100)]
Bug 29523: Remove the FIXME

This patch works through the unit tests and existing code to allow
removal of the FIXME I introduced earlier in the patchset.

We now require the `user` parameter be passed to `is_accessible` which
in turn makes `user` a required parameter for `to_api` in the
`Koha::Patron` case.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: Cache the restricted branches list
Martin Renvoize [Thu, 3 Mar 2022 14:40:20 +0000 (14:40 +0000)]
Bug 29523: Cache the restricted branches list

This patch introduces a very localised cache of the restricted branches
list in the logged in patron object.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: Pass the logged user around and use for validating
Martin Renvoize [Fri, 26 Nov 2021 15:35:05 +0000 (15:35 +0000)]
Bug 29523: Pass the logged user around and use for validating

In this patch I add 'user', containing the Koha::Patron object for the
logged in user in the params hash we pass around in to_api. I then use
that in a new 'is_accessible' method added to Koha::Patron.

The new method is really the equivilent of 'search_limited' in the plural
class and could perhaps be renamed 'is_limited' or something clearer for
the singular form 'is_filtered' or 'fitler_for_api' or something?

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: (QA follow-up) Fix failing test in club holds
Martin Renvoize [Fri, 26 Nov 2021 14:47:12 +0000 (14:47 +0000)]
Bug 29523: (QA follow-up) Fix failing test in club holds

With this patch series, all singular objects need to 'use' their plural
counterparts.. otherwise the parent can't find search_related.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: (QA follow-up) Catch remaining SUPER::to_api cases
Martin Renvoize [Fri, 26 Nov 2021 13:40:15 +0000 (13:40 +0000)]
Bug 29523: (QA follow-up) Catch remaining SUPER::to_api cases

Koha::Object->to_api can now return undefined.. we should be catching
that cases in all post manipulation cases.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: Make Koha::Object->to_api respect accessibility
Tomas Cohen Arazi [Fri, 19 Nov 2021 16:13:59 +0000 (13:13 -0300)]
Bug 29523: Make Koha::Object->to_api respect accessibility

This patch makes the *to_api* method honour the accessibility check for
the object. This is relevant in the context of embedding single objects.

The Koha::Patron->to_api method is adjusted to reflect this behavior as
well (it does some manipulation after the ->to_api call and we need to
prevent it).

To test:
1. Apply up to the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t
=> FAIL: A patron, that shouldn't be accessed, is returned by ->to_api
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
6. Pick Henry Acevedo from the sample data, assign him 'catalogue'
   permissions and a know user/password combination
7. Enable basic authentication
8. Point your favourite tool (Postman?) to
   GET http://kohadev-intra.myDNSname.org:8081/api/v1/biblio/245/checkouts
   Set the following header: x-koha-embed: patron
   Pick whatever biblio you want, actually.
=> SUCCESS: No checkouts
9. Perform a couple checkouts on the chosen biblio. Make sure one
   checkout is for a patron on the same library as Henry, and the other
   on a different one.
10. Repeat 8
=> SUCCESS: You see two checkouts. One of them has an attribute 'patron'
   containing the patron from Henry's library. The other, has the
   attribute set to 'null'.
11. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: Regression tests
Tomas Cohen Arazi [Fri, 19 Nov 2021 16:12:14 +0000 (13:12 -0300)]
Bug 29523: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: Add Koha::Object->accessible
Tomas Cohen Arazi [Fri, 19 Nov 2021 12:55:15 +0000 (09:55 -0300)]
Bug 29523: Add Koha::Object->accessible

This patch introduces a method for checking if an object can be
retrieved by the current user. It depends on the plural class
implementation of the ->search_limited method.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 29523: Add Koha::Objects->search_limited stub method
Tomas Cohen Arazi [Fri, 19 Nov 2021 12:37:38 +0000 (09:37 -0300)]
Bug 29523: Add Koha::Objects->search_limited stub method

This method is just a passthru to the search method. It is defined here
to avoid the need to check if each class implements it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33662: Add link to acq advanced search to acq navigation
Katrin Fischer [Fri, 15 Sep 2023 15:11:21 +0000 (15:11 +0000)]
Bug 33662: Add link to acq advanced search to acq navigation

Right now 3 clicks are needed to open the advanced search page
in the acquisitions module.

This adds a link to the advanced search to the left hand
module navigation.

To test:
* Go to acquisitions
* Verify the way is long to advanced search:
  At the top: Orders search > config icon > advanced search link
* Apply patch
* Notice new 'Order search' link on the left
* Verify it's way shorter now :)

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
  Renamed link from 'Advanced search' to 'Order search'
  Adjusted test plan

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34908: Sort item types alphabetically by description when adding a new empty...
Aleisha Amohia [Tue, 26 Sep 2023 22:40:01 +0000 (22:40 +0000)]
Bug 34908: Sort item types alphabetically by description when adding a new empty record as an order to a basket

To test:

1. Go to Koha administration -> Item types. Add a new item type "B" with the description "Test" so it will be obvious if it is sorted by the code "B" instead of the description "Test".
2. Go to Acquisitions. Add to a basket from a new empty record
3. In the Catalog details section, note the Item type dropdown. Confirm your "Test" item type, is showing near the top of the list, indicating it has been sorted based on the code "B"
4. Apply patch and restart services. Refresh the page.
5. Open the Item type dropdown again and confirm your "Test" item type is showing in the expected alphabetical order.

NC amended patch - tidied

Sponsored-by: South Taranaki District Council
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33887: DBRev 23.06.00.054
Tomas Cohen Arazi [Wed, 25 Oct 2023 14:43:32 +0000 (11:43 -0300)]
Bug 33887: DBRev 23.06.00.054

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33887: (QA follow-up) Perltidy and fix some formatting issues
Katrin Fischer [Sat, 21 Oct 2023 08:56:31 +0000 (08:56 +0000)]
Bug 33887: (QA follow-up) Perltidy and fix some formatting issues

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33887: (follow-up) Update the system preference description
David Nind [Sun, 27 Aug 2023 18:24:41 +0000 (18:24 +0000)]
Bug 33887: (follow-up) Update the system preference description

Remove duplicate word, use singular for the note text.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33887: Add the ability to optionally fill the next hold when an item is automatic...
Sam Lau [Mon, 12 Jun 2023 17:58:15 +0000 (17:58 +0000)]
Bug 33887: Add the ability to optionally fill the next hold when an item is automatically checked in.

When an item is automatically checked in, Koha should be able to trap that item for the next patron and send a notification to that patron that a hold is waiting for them.

To test:
1. Apply patches
2. restart_all and updatedatabase
3. Go to administration -> item types and edit an item type
4. Make sure the checkbox that is labeled ‘Automatic checkin:’ is checked. At the bottom of the page click save changes.
5. In Administration -> system preferences, search for ‘AutomaticCheckinAutoFill’ and set it to ‘Do’.
6. Check out an item to a patron and make it overdue (.ie set due date to yesterday). Also make sure that the item type you are checking out matches the item type edited in step 4.
7. Place a hold on the item. Make the pickup location the same as the library it is checked out from.
8. Run cronjob at misc/cronjobs/automatic_checkin.pl
9. On the item details page, notice that the item was checked in and now the hold is waiting for pickup.
10. Visit the patron’s page who placed the hold.
11. Click on the notices tab and see that there is a ‘Hold available for pickup’ notice.
12. Repeat steps 6-8, but this time make the hold pickup location different than the library the item is currently checked out to.
13. Notice that this time, the item was checked in, the hold is waiting, and the item is in transit to the other library.
14. If you visit the patron’s page, this time there should be no new notice because the item is still in transit.
15. Sign-Off :)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33887: Unit tests
Sam Lau [Thu, 15 Jun 2023 18:19:50 +0000 (18:19 +0000)]
Bug 33887: Unit tests

prove -v t/db_dependent/Koha/Checkouts.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34497: (QA follow-up):Fix required text field
Pedro Amorim [Fri, 20 Oct 2023 14:35:26 +0000 (14:35 +0000)]
Bug 34497: (QA follow-up):Fix required text field

input.value can be either null (if flatpickr date field empty) or '' (if simple text input empty),
so account for both situations.
Add missing 'required' attribute to text inputs.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34497: Dialog component should allow for optional input options on confirmation...
Pedro Amorim [Tue, 8 Aug 2023 11:14:11 +0000 (11:14 +0000)]
Bug 34497: Dialog component should allow for optional input options on confirmation modal

Currently supports 'Text' or 'Date' inputs

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34468: Update how we call updateProgress in stage-marc-import.tt
Pedro Amorim [Thu, 3 Aug 2023 10:12:17 +0000 (10:12 +0000)]
Bug 34468: Update how we call updateProgress in stage-marc-import.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34468: Add progress callback to job_progress.js
Pedro Amorim [Thu, 3 Aug 2023 10:11:39 +0000 (10:11 +0000)]
Bug 34468: Add progress callback to job_progress.js

These patches change the current updateProgress function to accept a
progress callback (a function that is called every time the bar
progresses) in addition to the already existing callback that is called
when the progress bar finishes.

It's not expected to change any current behavior in master because
updateProgress is only used once in the stage marc import tool using
the already existing callback, and these patches aim to keep that.

Test Plan:
1) Apply this patch
2) Stage a marc batch ( preferrably a large one to show the progress
   updating )
3) Note the new progess bar, verify it functions correctly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33970: DBRev 23.06.00.053
Tomas Cohen Arazi [Wed, 25 Oct 2023 14:37:41 +0000 (11:37 -0300)]
Bug 33970: DBRev 23.06.00.053

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33970: DBIC schema
Tomas Cohen Arazi [Wed, 25 Oct 2023 14:36:18 +0000 (11:36 -0300)]
Bug 33970: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33970: Compatability schim
Martin Renvoize [Thu, 19 Oct 2023 13:32:28 +0000 (14:32 +0100)]
Bug 33970: Compatability schim

This adds a compatability option to allow older backends not passing
their backend code through to the attributes on store.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33970: Fix tests
Pedro Amorim [Tue, 29 Aug 2023 15:16:53 +0000 (15:16 +0000)]
Bug 33970: Fix tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33970: Update DB
Pedro Amorim [Fri, 9 Jun 2023 14:14:05 +0000 (14:14 +0000)]
Bug 33970: Update DB

Signed-off-by: Chris Walton <C.J.Walton@lboro.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 10762: DBIC schema
Tomas Cohen Arazi [Wed, 25 Oct 2023 14:34:46 +0000 (11:34 -0300)]
Bug 10762: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34940: Highlight logged-in library in facets
Fridolin Somers [Wed, 27 Sep 2023 21:26:15 +0000 (11:26 -1000)]
Bug 34940: Highlight logged-in library in facets

Like in patron searches Bug 10902, use class 'currentlibrary' to highlight logged-in library in facets

Test plan :
1) Set system preference 'DisplayLibraryFacets' to 'both home and holding libraries'
2) Perform a seach that will find items of your logged-in library.
   In KTD, search for 'branch:CPL'
3) Check the facet (home and holding libraries) of your logged-in library is highlighted

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 35148: before_send_messages plugin hook does not pass the --where option
Kyle M Hall [Wed, 25 Oct 2023 13:34:53 +0000 (09:34 -0400)]
Bug 35148: before_send_messages plugin hook does not pass the --where option

The before_send_messages plugin hook currently sends all the non-smtp related options with the exception of the --where option. This should be added.

Test Plan:
1) Install the latest version of the kitchen sink plugin (
   https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases
   )
2) Apply this patch
3) Run process_message_queue.pl with a --where option
4) Run the command: ./misc/cronjobs/process_message_queue.pl --where "letter_code='test'"
5) Note the output looks like:
Plugin hook before_send_message called with the params: $VAR1 = {
          'verbose' => 0,
          'where' => 'letter_code=\'test\'',
          'letter_code' => [],
          'type' => [],
          'limit' => undef
        };

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 35069: Fix hold ratios items needed column sorting
Lucas Gass [Mon, 16 Oct 2023 23:03:03 +0000 (23:03 +0000)]
Bug 35069: Fix hold ratios items needed column sorting

This patch adds the data-sort attribute to the "Items needed" column to
ensure proper sorting.

To test:
1. Make a lot of holds.
2. On some holds have a high enough holds/copies ratio so the "Items
   needed" has values greater than 10.
3. Sort by that column. Notice the copies with an "Items needed" higher
   than 10 do not get sorted correctly.
4. APPLY PATCH
5. Try steps 1 -3 again. Everything should sort properly.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 35119: (follow-up) Adapt advanced editor message
Martin Renvoize [Mon, 23 Oct 2023 09:54:33 +0000 (10:54 +0100)]
Bug 35119: (follow-up) Adapt advanced editor message

I'd love to have included the error details within the message popup,
but that alluded me so this patch just updates the message to hint that
details can be seen on the basic editor screen.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 35119: (follow-up) Same treatment for editor page
Martin Renvoize [Fri, 20 Oct 2023 18:18:43 +0000 (19:18 +0100)]
Bug 35119: (follow-up) Same treatment for editor page

We pushed 34014 before I thought about these changes.. I think this is a
solid follow-up to add the same styling to the catalogue editor page..
swapping the existing dialog alert with a page-section bg-danger and
thus allowing more space to 'pre' wrap the encoding error itself to ease
the spotting of errant characters.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 35119: Use page-section and bg-danger on biblio errors
Martin Renvoize [Fri, 20 Oct 2023 14:35:12 +0000 (15:35 +0100)]
Bug 35119: Use page-section and bg-danger on biblio errors

This patch uses the page-section and bg-danger classes to increase the
prominence of bibliographic record errors in the staff client to
encourage staff to fix such issues as soon as possible.

We also output the actual encoding error in a <pre> block to maintain
the proper whitespacing of the errors themselves.. this makes it much
clearer which characters are the issues.

Test plan
1) Using ktd navigate to record 369
2) Note the display of an encoding warning at the top of the page
3) Apply the patch
4) Refresh the above page and note the stronger visual prominence of the
   error

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34377: (follow-up) Use patron-title include
Martin Renvoize [Fri, 8 Sep 2023 08:48:40 +0000 (09:48 +0100)]
Bug 34377: (follow-up) Use patron-title include

This switched the existing manual handling of patron title construction
to use the accepted include method.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34377: Add managing librarain
Lucas Gass [Thu, 7 Sep 2023 22:52:00 +0000 (22:52 +0000)]
Bug 34377: Add managing librarain

1. From the patron Accounting tab > "Create manual credit".
2. From the patron Accounting tab > "Create manua
3. Go to the Transaction tab (members/boraccount.pl) and click the 'Details' button.
4. Do this for  both a debit and a credit.
5. No info. about which librarain administered the credit/debit.
6. Apply patch
7. Try 3 -6 again, notice the table now shows which librarian administed the credit/debit.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33608: (QA follow-up) Remove ->insert method
Marcel de Rooy [Thu, 19 Oct 2023 13:50:59 +0000 (13:50 +0000)]
Bug 33608: (QA follow-up) Remove ->insert method

Might come back on the subject when resuming with bug 33636.

Test plan:
Run t/db_dependent/Koha/Statistics.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Tidy Koha/Item.pm bit further. Ordered hash keys too.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33608: (QA follow-up) Restore older gt zero tests
Marcel de Rooy [Thu, 20 Jul 2023 06:04:46 +0000 (06:04 +0000)]
Bug 33608: (QA follow-up) Restore older gt zero tests

See the Bugzilla report. I have been asked to restore the former
tests although I definitely think that they are wrong. Will address
that on bug 34308 separately.

This currently has the side-effect of negative lost values being
interpreted as 'found'. (Do not use negative lost values!)
The added subtest still reflects that now. Added a few TODOs.

Test plan:
[1] Prove t/db_dependent/Koha/Items.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33608: (follow-up) Default value for interface column
Marcel de Rooy [Thu, 1 Jun 2023 11:41:54 +0000 (11:41 +0000)]
Bug 33608: (follow-up) Default value for interface column

We should default to C4::Context->interface.

Test plan:
Login via intranet (see Bugzilla report).
Edit an item. Set to lost.
Check entry in statistics table on interface value.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33608: Move older Stats tests to Koha/Statistics.t
Marcel de Rooy [Mon, 8 May 2023 12:54:48 +0000 (12:54 +0000)]
Bug 33608: Move older Stats tests to Koha/Statistics.t

Test plan:
Run t/db_dependent/Koha/Statistics.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
[EDIT} Tidied inline.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33608: Polish Koha::Statistic further
Marcel de Rooy [Mon, 8 May 2023 09:17:32 +0000 (09:17 +0000)]
Bug 33608: Polish Koha::Statistic further

Adding exceptions, removing croaks.
No exception in new for unknown hash keys, store will catch that.
Prepare switching amount parameter to value (db column name).

Test plan:
Run t/db_dependent/Stats.t
Run t/db_dependent/Koha/Items.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
[EDIT] Fixed the mandatory check in Stats.t. Removed key_or_default.
       Additional tidy.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33608: Redirect UpdateStats to Koha namespace
Marcel de Rooy [Wed, 26 Apr 2023 13:58:13 +0000 (15:58 +0200)]
Bug 33608: Redirect UpdateStats to Koha namespace

Moving code to Koha::Statistic->new and ->insert.
Polishing code a bit further in next patch.

Test plan:
Run t/db_dependent/Stats.t
Run t/db_dependent/Koha/Statistics.t
Run t/db_dependent/Koha/Pseudonymization.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
[EDIT] POD headers, use plural module and tidy Koha::Statistic

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33608: Correct indentation in Stats.t
Marcel de Rooy [Thu, 11 May 2023 05:59:42 +0000 (05:59 +0000)]
Bug 33608: Correct indentation in Stats.t

Test plan:
Run t/db_dependent/Stats.t
Run git diff -w HEAD~1.. t/db_dependent/Stats.t, proving that we
only did whitespace changes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33608: Rearranging Stats.t, removing useless t version
Marcel de Rooy [Wed, 26 Apr 2023 12:08:18 +0000 (14:08 +0200)]
Bug 33608: Rearranging Stats.t, removing useless t version

Subtest, modules, license.
The t/Stats.t is as good as empty, can be removed.

Test plan:
Run t/db_dependent/Stats.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33608: Add UpdateStats to item->store
Marcel de Rooy [Mon, 8 May 2023 07:52:04 +0000 (07:52 +0000)]
Bug 33608: Add UpdateStats to item->store

Test plan:
Run t/db_dependent/Koha/Item.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 33608: Add two new circulation types in Statistics module
Marcel de Rooy [Tue, 25 Apr 2023 14:51:55 +0000 (16:51 +0200)]
Bug 33608: Add two new circulation types in Statistics module

These are: item_lost and item_found. Speak for themself.

Test plan:
Run t/db_dependent/Stats.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34964: (follow-up) Add descriptions of new staff html customization regions
Owen Leonard [Thu, 19 Oct 2023 17:38:30 +0000 (17:38 +0000)]
Bug 34964: (follow-up) Add descriptions of new staff html customization regions

Bug 6419 added several regions in the staff interface for adding html
customizations. This patch adds descriptions of those.

The patch also makes a correction to the grouping of OPAC and staff
interface customization regions in the "Display location" dropdown.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34964: Add descriptions for different HTML customization regions
Owen Leonard [Fri, 29 Sep 2023 17:33:38 +0000 (17:33 +0000)]
Bug 34964: Add descriptions for different HTML customization regions

This patch adds dynamically-shown hints on the HTML customization form
when the user selects a display location. The hint describes where the
content will be found.

Much of the descriptive text in this patch is adapted from the original
options' system preference descriptions.

To test, apply the patch and go to Tools -> HTML customizations -> New
entry.

- The page loads with the first display location preselected, so you
  should see a hint for the "ArticleRequestsDisclaimerText" option.
- Test the process of selecting each different display location option,
  confirming each time that the correct description is shown.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 8838: DBRev 23.06.00.052
Tomas Cohen Arazi [Wed, 25 Oct 2023 13:43:51 +0000 (10:43 -0300)]
Bug 8838: DBRev 23.06.00.052

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 8838: (QA follow-up) one more typo fix
Emily Lamancusa [Thu, 19 Oct 2023 13:35:27 +0000 (09:35 -0400)]
Bug 8838: (QA follow-up) one more typo fix

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 8838: Add SMS default/sample notices
Lucas Gass [Wed, 18 Oct 2023 22:31:13 +0000 (22:31 +0000)]
Bug 8838: Add SMS default/sample notices

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 8838: (follow-up) Rebase, fix typos, and tidy.
Lucas Gass [Wed, 18 Oct 2023 21:03:19 +0000 (21:03 +0000)]
Bug 8838: (follow-up) Rebase, fix typos, and tidy.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 8838: Replace the atomic update boilerplate
Kyle M Hall [Mon, 11 Sep 2023 17:44:00 +0000 (13:44 -0400)]
Bug 8838: Replace the atomic update boilerplate

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 8838: Make db update idempotent
Kyle M Hall [Fri, 8 Sep 2023 13:35:21 +0000 (09:35 -0400)]
Bug 8838: Make db update idempotent

Signed-off-by: Laura ONeil <laura@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 8838: Add digest option for HOLD notice
Kyle M Hall [Wed, 30 Aug 2023 11:06:31 +0000 (07:06 -0400)]
Bug 8838: Add digest option for HOLD notice

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Restart all the things!
4) Enable the new digest option for "Hold filled" messages
5) Trap multiple holds for a patron
6) Note a single notices is generated for all the trapped holds!

Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Laura ONeil <laura@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34020: (QA follow-up) Indentation fix
Martin Renvoize [Wed, 18 Oct 2023 13:25:08 +0000 (14:25 +0100)]
Bug 34020: (QA follow-up) Indentation fix

The middle 'if' block was indented a level deeper than expected.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34020: Add spans to subfields
Nick Clemens [Wed, 18 Oct 2023 12:21:30 +0000 (12:21 +0000)]
Bug 34020: Add spans to subfields

The 260 field has spans for each subfield, we should provide the same
for 264

To test:
1 - Apply patch
2 - Inspect the record 264 display on staff and opac, results and
    details
3 - Confirm spans are constructed correctly and named sensibly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 34020: Preserve order of subfields in 264 display
Nick Clemens [Wed, 18 Oct 2023 12:00:05 +0000 (12:00 +0000)]
Bug 34020: Preserve order of subfields in 264 display

When ordered $a$b$a$b$c in the MARC object, 264 subfields are displayed
$a$a$b$b$c.  This goes against the standard.

This patch preserves the order.

1) Edit a record and add/update a 264 fields to have subfields a, b, a,
   b, c in that order
1) Search for record in staff and opac, see subfields displayed in
   order "aabbc" in results
2) View the details page for the record in staff and opac, note same
   order
3) Apply the patch, restart all
4) Confirm staff and opac, results and details now follow the order of
   the subfields in the record's field

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 35059: Display item location on item details (catalogue/moredetail.pl)
Owen Leonard [Mon, 16 Oct 2023 14:43:44 +0000 (14:43 +0000)]
Bug 35059: Display item location on item details (catalogue/moredetail.pl)

This patch updates the item details template so that item location is
displayed along with information like collection and call number.

The template has also been modified to correct the label "Item
callnumber" to "Item call number."

To test, apply the patch and update an item, if necessary, to add a
shelving location.

- View the bibliographic details page of the record.
- Click the "Items" tab in the left-hand sidebar menu.
- Under the "Item information" subheading you should see a line for
  "Shelving location" just after the "Item call number" line.
- Confirm that the correct item location description is shown.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 10762: DBRev 23.06.00.051
Tomas Cohen Arazi [Wed, 25 Oct 2023 13:10:37 +0000 (10:10 -0300)]
Bug 10762: DBRev 23.06.00.051

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 10762: (QA follow-up) Perltidy
Katrin Fischer [Sat, 14 Oct 2023 21:22:31 +0000 (21:22 +0000)]
Bug 10762: (QA follow-up) Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 10762: (follow-up) Add tests
Thibaud Guillot [Wed, 16 Aug 2023 10:07:23 +0000 (10:07 +0000)]
Bug 10762: (follow-up) Add tests

Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 10762: (follow-up) Update test plan, add kohastructure.sql files
Thibaud Guillot [Mon, 2 Jan 2023 14:05:11 +0000 (15:05 +0100)]
Bug 10762: (follow-up) Update test plan, add kohastructure.sql files

I also change the default value for scale_height to '0.01'

Test plan:

1)Home > Cataloguing > Tools: Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.02), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 10762: Change the size of barcodes in label creator
Jérémy Breuillard [Wed, 17 Nov 2021 09:08:49 +0000 (10:08 +0100)]
Bug 10762: Change the size of barcodes in label creator

Test plan:
1)Home > Tools > Label creator > Manage Layout or New Layout
2)Make a new layout or edit an existing one
3)Notice the 2 new fields "Barcode width/Barcode height"
4)Save it like this
5)Create a batch of barcode and export if in PDF
6)Notice the size of barcode
7)Go back to your existing layout
8)Enter some values (Barcode width: 1.6 / Barcode height: 0.04), save
9)Take back your batch of barcode and export it in PDF
10)The barcode should be 2x bigger

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31846: DBRev 23.06.00.050
Tomas Cohen Arazi [Wed, 25 Oct 2023 13:01:34 +0000 (10:01 -0300)]
Bug 31846: DBRev 23.06.00.050

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31846: (QA follow-up) Tidy code to make qa script happy
Kyle M Hall [Fri, 13 Oct 2023 13:56:00 +0000 (09:56 -0400)]
Bug 31846: (QA follow-up) Tidy code to make qa script happy

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31846: Add syspref for serials search results limit
David Gustafsson [Mon, 17 Oct 2022 16:31:38 +0000 (18:31 +0200)]
Bug 31846: Add syspref for serials search results limit

To test:

1) Make sure SerialsSearchResultsLimit syspref is unset or set to 0.
2) Perform an advanced search on serials without any conditions
   and confirm all serials are listed as expected.
3) Set SerialsSearchResultsLimit to a value less the the number
   of total subscriptions, perform the search again, and confirm
   that the number of serials has been limited to the set value.
4) Ensure all tests pass in t/db_dependent/Serials.t

Sponsored-by: Gothenburg University Library
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 35007: Configure self checkout tables consistently
Owen Leonard [Tue, 10 Oct 2023 15:50:08 +0000 (15:50 +0000)]
Bug 35007: Configure self checkout tables consistently

This patch makes some updates to the self checkout page so that
checkouts, holds, and account tabs are consistent with each other, with
the same DataTables configuration.

Included in the DataTables configuration are the same options we use on
the OPAC's user summary page to show controls for copy, CSV, and print.

Also changed: Some extra markup is removed from holds-table.inc, markup
which was used to show table information responsively before we started
using the DataTables responsive plugin.

To test, apply the patch and log into the self checkout system as a user
with checkouts, holds, and present or past charges.

Compare the checkouts, holds, and charges tabs to confirm that the
tables look correct and work correctly. Test that the copy, CSV, and
print controls, and the search and clear filter functions. Test that
each table responds correctly at various browser widths.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 35127: Fix 'Search type' for patron search
Jonathan Druart [Tue, 24 Oct 2023 13:32:53 +0000 (15:32 +0200)]
Bug 35127: Fix 'Search type' for patron search

We need to fallback on the syspref DefaultPatronSearchMethod but keep
the value when one is passed!

Test plan:
Search for patrons, and use the "search type". Set it to different
values than DefaultPatronSearchMethod and confirm that the value is
kept.
Fix is expected when searching for patrons in the header (use the
options to select a different value and run the search)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: DBRev 23.06.00.049
Tomas Cohen Arazi [Wed, 25 Oct 2023 12:49:00 +0000 (09:49 -0300)]
Bug 31503: DBRev 23.06.00.049

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: (QA follow-up) Fix number of tests in rebase
Marcel de Rooy [Wed, 25 Oct 2023 11:27:21 +0000 (11:27 +0000)]
Bug 31503: (QA follow-up) Fix number of tests in rebase

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: (QA follow-up) Improve count of available_types
Marcel de Rooy [Fri, 13 Oct 2023 14:54:47 +0000 (14:54 +0000)]
Bug 31503: (QA follow-up) Improve count of available_types

Tidied one other line.

Test plan:
Run t/db_dependent/Koha/Patron/Consents.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: (follow-up) Remove OPACCustomConsentTypes
Martin Renvoize [Mon, 18 Sep 2023 09:28:06 +0000 (10:28 +0100)]
Bug 31503: (follow-up) Remove OPACCustomConsentTypes

This patch removes all trace of the original OPACCustomConsentTypes
preference.  We now use Koha::Plugins->feature_enabled in preference.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: (follow-up) Use KohaPlugins.feature_enabled
Martin Renvoize [Fri, 15 Sep 2023 15:42:25 +0000 (16:42 +0100)]
Bug 31503: (follow-up) Use KohaPlugins.feature_enabled

This patch switches the code from using
Koha.preference('OPACCustomConsentTypes') to using
KohaPlugins.feature_enabled('patron_consent_type').

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: (follow-up) Add 'feature_enabled' to Koha::Plugins
Martin Renvoize [Fri, 15 Sep 2023 15:09:56 +0000 (16:09 +0100)]
Bug 31503: (follow-up) Add 'feature_enabled' to Koha::Plugins

This patch adds a 'feature_enabled' accessor to the Koha::Plugins class.
Passing the plugin method name for the plugin feature you're looking for
will return a boolean denoting whether any enabled plugins carry said
method.

Included in the patch is an addition to the TT KohaPlugins plugin to
enable quick access to this function.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
[EDIT] Tidied t/db_dependent/Koha/Plugins/Plugins.t
[EDIT] Tidied Koha/Template/Plugin/KohaPlugins.pm

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: (follow-up) Styling and pre-selection
Martin Renvoize [Fri, 15 Sep 2023 07:25:57 +0000 (08:25 +0100)]
Bug 31503: (follow-up) Styling and pre-selection

This patch restores some of the wording and styling from the original
GDPR/Privacy policy feature including highlighting in a warning box.

I also remove the jQuery approach for pre-selecting already selected
radio options and rely on standard TT processing instead.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: (follow-up) Update description for system preference
David Nind [Sun, 3 Sep 2023 04:07:16 +0000 (04:07 +0000)]
Bug 31503: (follow-up) Update description for system preference

Update new OPACCustomConsentType system preference description - bold
and capitalize NOTE for consistency, link to PrivacyPolicyConsent
system preference for consistency, and other minor changes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: Make opac-patron-consent more generic
Marcel de Rooy [Thu, 31 Aug 2023 08:40:29 +0000 (08:40 +0000)]
Bug 31503: Make opac-patron-consent more generic

Adds $patron->consent and $consents->available_types.
Incorporates them into script/template.
Provides two unit tests.

Note: A follow-up patch helps you test this with an
example plugin.

Test plan:
Run t/db_dependent/Koha/Patron.t
Run t/db_dependent/Koha/Patron/Consents.t
Toggle the value of pref PrivacyPolicyConsent and look at
OPAC account, tab Consents.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: Change usermenu condition, add preference
Marcel de Rooy [Wed, 30 Aug 2023 14:32:52 +0000 (16:32 +0200)]
Bug 31503: Change usermenu condition, add preference

Adds preference OPACCustomConsentTypes.

Test plan:
Run dbrev.
Toggle value of OPACCustomConsentTypes / PrivacyPolicyConsent.
Check user page for Consents tab.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 31503: Change patron_consent.type
Marcel de Rooy [Tue, 29 Aug 2023 12:09:09 +0000 (14:09 +0200)]
Bug 31503: Change patron_consent.type

Test plan:
Run db rev.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 27153: DBRev 23.06.00.048
Tomas Cohen Arazi [Tue, 24 Oct 2023 18:43:06 +0000 (15:43 -0300)]
Bug 27153: DBRev 23.06.00.048

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 27153: DBIC schema
Tomas Cohen Arazi [Tue, 24 Oct 2023 18:41:45 +0000 (15:41 -0300)]
Bug 27153: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 27153: Adjust kohastructure for new primary key
Nick Clemens [Tue, 5 Sep 2023 17:25:45 +0000 (17:25 +0000)]
Bug 27153: Adjust kohastructure for new primary key

Signed-off-by: Danielle M Elder <danielle.elder@law.utexas.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 27153: Adjust mappings to add title without punctuation
Nick Clemens [Fri, 1 Sep 2023 17:32:35 +0000 (17:32 +0000)]
Bug 27153: Adjust mappings to add title without punctuation

This patch finally adjust the default mappings to add a new field to
the elastic index with the title stripped of punctuation

This method optionally allows the library to place the filtered version in the same
search field, or a new search field. The default mappings will include the filtered version
in a keyword search, but not a targeted search

To test:
1 - Import some affected records via z3950, e.g.:
    Carrie's war
    1,000 Japanese words
2 - Search (using Elasticsearch) for the titles without including punctuation
    Carries war
    1000 Japanese words
3 - No results
4 - Reload mappings and reindex
    perl misc/search_tools/rebuild_elasticsearch.pl -v -r
5 - Search again
6 - Success!
7 - Search title specifically:
    ti:Carries war
8 - No results
9 - Adjust mappings.yaml to add second mapping for 245 to title index:
    - facet: ''
      marc_field: 245abp
      marc_type: marc21
      sort: 1
      suggestible: 1
      filter: punctuation
10 - Reload mappings and reindex
11 - Repeat 7
12 - Success

Signed-off-by: Danielle M Elder <danielle.elder@law.utexas.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 months agoBug 27153: Add filter option to Elasticsearch indexing
Nick Clemens [Fri, 1 Sep 2023 17:30:14 +0000 (17:30 +0000)]
Bug 27153: Add filter option to Elasticsearch indexing

This patch uses the filter option from the mappings to add a value_callback
to reord processing for indexing.

Fields defined with 'punctuation' filter will have all punctuation stripped when
conveted to documents.

Tests are updated.

Signed-off-by: Danielle M Elder <danielle.elder@law.utexas.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>