koha.git
13 months agoBug 33335: (QA follow-up) Polishing and comments
Marcel de Rooy [Fri, 12 May 2023 08:33:32 +0000 (08:33 +0000)]
Bug 33335: (QA follow-up) Polishing and comments

Just send the codes and descriptions only to client.
Adding a few comments to the reduce construction.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33335: Use To.json to serialize
Jonathan Druart [Tue, 2 May 2023 14:26:45 +0000 (16:26 +0200)]
Bug 33335: Use To.json to serialize

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33335: Fix JavaScript error on the MARC overlay rules page
Marius Mandrescu [Tue, 28 Mar 2023 16:04:49 +0000 (12:04 -0400)]
Bug 33335: Fix JavaScript error on the MARC overlay rules page

The "MARC overlay rules" page doesn't display or work correctly
if a patron category code contains a "-".

This happens because of the JavaScript function in
"marc-overlay-rules.tt" line 469. This causes an error
"Uncaught SyntaxError: missing : after property id".

Test plan:
1. Go to Administration > Patron categories.
2. Make sure you don't have a patron category code that contains
   a "-".
3. Go to Administration > Record overlay rules.
4. The table should display correctly, and you can add, edit
   and delete rules.
5. Return to Patron categories.
6. Add a new patron category with a "-" in the patron category code.
7. Return to Record overlay rules page:
   => The page doesn't display and load correctly (see the attached
      image) - the normal DataTables header and footer aren't
      displayed, and you can't add, edit or delete overlay rules.
  => If you turn on web developer tools, an error is displayed in the
     console: "Uncaught SyntaxError: missing : after property id".
8. Apply the patch.
9. Repeat the step 7, the Record overlay rules page should now
   display correctly and you should be able to add, edit and
   delete rules.
10. Sign off.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32357: DBRev 22.12.00.039
Tomas Cohen Arazi [Fri, 12 May 2023 20:35:50 +0000 (17:35 -0300)]
Bug 32357: DBRev 22.12.00.039

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32357: DBIC schema
Tomas Cohen Arazi [Fri, 12 May 2023 20:35:14 +0000 (17:35 -0300)]
Bug 32357: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32357: Set borrower_message_preferences.days_in_advance default to NULL
Lari Taskula [Mon, 28 Nov 2022 22:01:37 +0000 (22:01 +0000)]
Bug 32357: Set borrower_message_preferences.days_in_advance default to NULL

To test:
1. prove t/db_dependent/cronjobs/advance_notices_digest.t
2. prove t/db_dependent/Letters/TemplateToolkit.t
3. prove t/db_dependent/Koha/CurbsidePickups.t
4. prove t/db_dependent/Koha/Patrons.t
5. prove t/db_dependent/Patron/Messaging.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33489: DBRev 22.12.00.038
Tomas Cohen Arazi [Fri, 12 May 2023 20:19:55 +0000 (17:19 -0300)]
Bug 33489: DBRev 22.12.00.038

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33489: Add indices to default patron search fields
Nick Clemens [Tue, 11 Apr 2023 17:33:55 +0000 (17:33 +0000)]
Bug 33489: Add indices to default patron search fields

This patch adds indices to the borrowers table to match the default
search fields for patrons.

To test:
1 - Apply patch
2 - Update database
3 - Ensure patron searching works as before

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>
13 months agoBug 32129: (QA follow-up) Avoid duplicate calculation
Tomas Cohen Arazi [Fri, 12 May 2023 18:47:02 +0000 (15:47 -0300)]
Bug 32129: (QA follow-up) Avoid duplicate calculation

This patch stores the output from ->check_recall() (a Koha::Recall
object or undef) and reuses afterwards, on a ternaty operator.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32129: Use patron category when checking if item can fill recall
Aleisha Amohia [Tue, 8 Nov 2022 19:58:22 +0000 (19:58 +0000)]
Bug 32129: Use patron category when checking if item can fill recall

This patch uses the patron category of the patron who requested the most
relevant recall to check for more specific circulation rules relating to
recalls. This ensures that patrons who are allowed to place recalls are
able to fill their recalls, especially when recalls are not generally
available for all patron categories.

To test:
1) Go to Administration -> System preferences and enable UseRecalls
2) Go to Administration -> Circulation and fines rules and set a general
All/All rule and a Category A/Itemtype A rule. All values can be set
however you like except for these recalls rules:

All/All rule:
Recalls allowed: 0
Recalls per record: 0
On shelf recalls allowed: if any unavailable

Category A/Itemtype A rule:
Recalls allowed: 5
Recalls per record: 5
On shelf recalls allowed: if any unavailable

3) Find an item of Itemtype A. Check it out to Patron A (any category).
4) Log into the OPAC as Patron B (of Category A). Find the item and
place a recall on the item.
5) Back in the staff interface, check in the item. This should trigger
the recalls process so you can allocate the item to Patron B's recall,
however the pop-up box to confirm the recall does not show. This is the
bug.

6) Apply the patch and restart services

7) Check in the item again. Confirm the pop-up box to confirm the recall
shows and you are able to allocate the item to Patron B's recall.
8) Confirm tests pass t/db_dependent/Koha/Item.t

Sponsored-by: Auckland University of Technology
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33710: Ignore how-to related files
Jonathan Druart [Wed, 10 May 2023 10:03:09 +0000 (12:03 +0200)]
Bug 33710: Ignore how-to related files

Related to https://gitlab.com/koha-community/koha-testing-docker/-/issues/378

If we merge it we will want to hide how-to.pl and how-to.ptt

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31212: DBRev 22.12.00.037
Tomas Cohen Arazi [Fri, 12 May 2023 18:24:44 +0000 (15:24 -0300)]
Bug 31212: DBRev 22.12.00.037

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31212: DBIC schema
Tomas Cohen Arazi [Fri, 12 May 2023 18:23:08 +0000 (15:23 -0300)]
Bug 31212: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31212: (QA follow-up) Fix unit test, remove unused imports
Kyle M Hall [Fri, 28 Apr 2023 13:33:29 +0000 (09:33 -0400)]
Bug 31212: (QA follow-up) Fix unit test, remove unused imports

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31212: (follow-up) Remove unnessesary changes from Items.pm
Lucas Gass [Wed, 29 Mar 2023 17:52:37 +0000 (17:52 +0000)]
Bug 31212: (follow-up) Remove unnessesary changes from Items.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31212: (follow-up) Fix datelastseen when returning item
Lucas Gass [Wed, 9 Nov 2022 21:40:55 +0000 (21:40 +0000)]
Bug 31212: (follow-up) Fix datelastseen when returning item

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31212: Fix date_from_string and explicitly called output_pref subroutine
Lucas Gass [Thu, 20 Oct 2022 16:29:36 +0000 (16:29 +0000)]
Bug 31212: Fix date_from_string and explicitly called output_pref subroutine

Signed-off-by: Ann Flournoy <aflournoy@cityofkeller.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31212: Add Database update
Lucas Gass [Fri, 19 Aug 2022 17:55:32 +0000 (17:55 +0000)]
Bug 31212: Add Database update

Signed-off-by: Ann Flournoy <aflournoy@cityofkeller.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31212: Change datelastseen from date to datetime field
Lucas Gass [Tue, 7 Feb 2023 23:14:43 +0000 (23:14 +0000)]
Bug 31212: Change datelastseen from date to datetime field

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31735: Optimize OPAC checkouts view
David Gustafsson [Mon, 10 Oct 2022 15:18:03 +0000 (17:18 +0200)]
Bug 31735: Optimize OPAC checkouts view

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31735: Avoid re-fetcing objects from database by passing them directly instead...
David Gustafsson [Tue, 27 Sep 2022 16:23:27 +0000 (18:23 +0200)]
Bug 31735: Avoid re-fetcing objects from database by passing them directly instead of ids to various subroutines

To test:

1) Run the following test and make sure all pass:
  t/db_dependent/api/v1/biblios.t
  t/db_dependent/api/v1/checkouts.t
  t/db_dependent/api/v1/return_claims.t
  t/db_dependent/Circulation/CalcDateDue.t
  t/db_dependent/Circulation/CheckIfIssuedToPatron.t
  t/db_dependent/Circulation/dateexpiry.t
  t/db_dependent/Circulation/GetPendingOnSiteCheckouts.t
  t/db_dependent/Circulation/GetTopIssues.t
  t/db_dependent/Circulation_holdsqueue.t
  t/db_dependent/Circulation/IsItemIssued.t
  t/db_dependent/Circulation/issue.t
  t/db_dependent/Circulation/MarkIssueReturned.t
  t/db_dependent/Circulation/maxsuspensiondays.t
  t/db_dependent/Circulation/ReturnClaims.t
  t/db_dependent/Circulation/Returns.t
  t/db_dependent/Circulation/SwitchOnSiteCheckouts.t
  t/db_dependent/Circulation.t
  t/db_dependent/Circulation/TooMany.t
  t/db_dependent/Circulation/transferbook.t
  t/db_dependent/DecreaseLoanHighHolds.t
  t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
  t/db_dependent/HoldsQueue.t
  t/db_dependent/Holds/RevertWaitingStatus.t
  t/db_dependent/Illrequests.t
  t/db_dependent/ILSDI_Services.t
  t/db_dependent/Items.t
  t/db_dependent/Koha/Account/Line.t
  t/db_dependent/Koha/Acquisition/Order.t
  t/db_dependent/Koha/Biblio.t
  t/db_dependent/Koha/Holds.t
  t/db_dependent/Koha/Items.t
  t/db_dependent/Koha/Item.t
  t/db_dependent/Koha/Object.t
  t/db_dependent/Koha/Patrons.t
  t/db_dependent/Koha/Plugins/Circulation_hooks.t
  t/db_dependent/Koha/Pseudonymization.t
  t/db_dependent/Koha/Recalls.t
  t/db_dependent/Koha/Recall.t
  t/db_dependent/Koha/Template/Plugin/CirculationRules.t
  t/db_dependent/Letters/TemplateToolkit.t
  t/db_dependent/Members/GetAllIssues.t
  t/db_dependent/Members/IssueSlip.t
  t/db_dependent/Patron/Borrower_Discharge.t
  t/db_dependent/Patron/Borrower_PrevCheckout.t
  t/db_dependent/Reserves/GetReserveFee.t
  t/db_dependent/Reserves.t
  t/db_dependent/rollingloans.t
  t/db_dependent/selenium/regressions.t
  t/db_dependent/SIP/ILS.t
  t/db_dependent/Holds.t
  t/db_dependent/Holds/LocalHoldsPriority.t
  t/db_dependent/Holds/HoldFulfillmentPolicy.t
  t/db_dependent/Holds/HoldItemtypeLimit.t
  t/db_dependent/Circulation/transferbook.t
2) Performe one or more checkouts for a patron, making sure
  that the circulation rules allows for renewals (for example by
  setting an earlier due-date).
3) Log in as this patron in OPAC and make sure the list of
  checkouts is displayed correctly, and that renewing an issue
  still works.

Sponsored-by: Gothenburg University Library
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 30687: Allow pickup location to be forced when override is allowed
Nick Clemens [Fri, 23 Dec 2022 15:04:26 +0000 (15:04 +0000)]
Bug 30687: Allow pickup location to be forced when override is allowed

This is Julian's patch with some extra cleanup to reduce repeated code

If AllowHoldPolicyOverride is enabled and only some pickup locations are
available, you still have the possibility to force one of the others
pickup locations.
But when there are zero pickup locations available, that is not
possible.

This patch change that by always displaying the list of pickup locations
when AllowHoldPolicyOverride is enabled.

Test plan:
1. Apply patch
2. Disable AllowHoldPolicyOverride
3. Create a biblio B with an item I at library A.
4. Configure this library A to not be a pickup location
5. Add a "Default holds policy by item type" for item I type where "Hold
   pickup library match" is "item's home library"
6. Try to place a hold on biblio B
   You should not be able to place a hold because there is no valid
   pickup locations
7. Enable AllowHoldPolicyOverride
8. Try to place a hold on biblio B
   You should now see all valid pickup locations in a dropdown list
   (with an exclamation mark in front of each option) with none selected
   by default
9. Verify you can place a title-level hold and an item-level hold

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31557: DBRev 22.12.00.036
Tomas Cohen Arazi [Fri, 12 May 2023 14:18:27 +0000 (11:18 -0300)]
Bug 31557: DBRev 22.12.00.036

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31557: (QA follow-up) Make tests more robust
Tomas Cohen Arazi [Fri, 12 May 2023 14:11:44 +0000 (11:11 -0300)]
Bug 31557: (QA follow-up) Make tests more robust

Tests had a few problems:

- They weren't wrapped in a transaction explicitly
- They called Koha::Biblios->delete!
- They failed if run a couple times

This patch:

- Wraps things in a transaction
- Removes not-required things ($target_rs variable not used)
- Preserves the tests logic, but filters the resultset on the
  biblionumber instead of deleting all the database which can fail
  depending on FK constraints.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31557: (QA follow-up) Fix number of tests
Marcel de Rooy [Fri, 24 Feb 2023 09:22:25 +0000 (09:22 +0000)]
Bug 31557: (QA follow-up) Fix number of tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31557: Add ability for holds queue builder to prioritize either matching a patron...
Kyle Hall [Tue, 18 Oct 2022 16:25:35 +0000 (12:25 -0400)]
Bug 31557: Add ability for holds queue builder to prioritize either matching a patron's home library to the item's home or holding library

Right now the holds queue builder starts filling bib-level holds with
items whose patron's home library matches the item's home library.

It would be good and reasonable to have the option to prioritize
item's whose patron's home library matches the item's holding library
to minimize transfers.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33580: Bring back ability to mark item as seen via SIP2 item information request
Kyle M Hall [Fri, 21 Apr 2023 11:09:34 +0000 (07:09 -0400)]
Bug 33580: Bring back ability to mark item as seen via SIP2 item information request

Prior to Koha 22.05, the SIP2 item information message had a side affect of updating the datelastseen field for items. This bug has been fixed, but was being utilized by inventory tools that used SIP2. We should bring back this affect and formalize it as an optional SIP2 config account setting.

Test Plan:
1) Apply this patch set
2) prove t/db_dependent/SIP/Message.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32993: Holds priority changed incorrectly with dropdown selector
Kyle M Hall [Fri, 28 Apr 2023 18:30:19 +0000 (14:30 -0400)]
Bug 32993: Holds priority changed incorrectly with dropdown selector

Test Plan:
1) Find record with at least 3 holds.
2) Change first holds priority as 2, Priority is changed to 3.
3) Try to change priority back to 1, Priority is changed to 2.
4) Apply this patch
5) Reload the page
2) Change first holds priority as 2, Priority is changed to 2.
3) Try to change priority back to 1, Priority is changed to 1.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33320: Add spacing in Patron modification requests
Jonathan Druart [Thu, 11 May 2023 10:51:46 +0000 (12:51 +0200)]
Bug 33320: Add spacing in Patron modification requests

* Go to the OPAC, log into your account
* Make changes to your personal details and save
* Go to the staff interface and use the link on the start page to
  moderate the change request
* At the top of the list you'll see something like:

Without this patch:
  Ignore|Patron details
With this patch:
  Ignore | Patron details

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33167: Fix TT comment for better translatability
Katrin Fischer [Sat, 22 Apr 2023 10:16:59 +0000 (10:16 +0000)]
Bug 33167: Fix TT comment for better translatability

We just figured out that multi-line TT comments show up
weirdly in translations and fixed it on bug 33332. So
this just follows the newly established pattern.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33167: Cleanup staff detail page
Nick Clemens [Thu, 9 Mar 2023 20:37:28 +0000 (20:37 +0000)]
Bug 33167: Cleanup staff detail page

This patch begins reduing some of the extra things we are doing in
detail.pl that could easily be handled in the templates - fetching
authorised values and branches etc

It also removes a loop to find items that should be hidden, and instead
uses a searh parameter

The template changes either use item object rather than passed
variables, or utilize plugins to fetch authorised valued

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>
13 months agoBug 32766: (QA follow-up) Remove stray p from USE statements
Katrin Fischer [Mon, 8 May 2023 21:36:28 +0000 (21:36 +0000)]
Bug 32766: (QA follow-up) Remove stray p from USE statements

+q[% SET footerjs = 1 %]

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32766: (follow-up) Fix translation function
Thibaud Guillot [Tue, 31 Jan 2023 14:27:09 +0000 (15:27 +0100)]
Bug 32766: (follow-up) Fix translation function

The previous syntax causes a warning during the execution of the translation script

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>
13 months agoBug 32766: Update some labels for better understanding and translation
Thibaud Guillot [Tue, 31 Jan 2023 10:44:09 +0000 (11:44 +0100)]
Bug 32766: Update some labels for better understanding and translation

examples: 'crayon'->'carchoal' or 'camaiu'->'cameo'
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>
13 months agoBug 33567: DBRev 22.12.00.035
Tomas Cohen Arazi [Fri, 12 May 2023 13:31:08 +0000 (10:31 -0300)]
Bug 33567: DBRev 22.12.00.035

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33567: Add a dbrev for installation with empty pref
Marcel de Rooy [Thu, 20 Apr 2023 06:52:50 +0000 (06:52 +0000)]
Bug 33567: Add a dbrev for installation with empty pref

To keep current behavior, we can copy the removed fallback
into the syspref value in case someone might have cleared the pref.

Note: We are not restoring deleted prefs here; that is a data problem
outside the scope of this report. A regular installation should always
have this pref.

Test plan:
Run updatedatabase.pl
Bonus: Clear the pref Reference_NFL_Statuses and run again, verify that
the pref has changed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33567: Remove hardcoded fallback in module
Marcel de Rooy [Thu, 20 Apr 2023 06:46:57 +0000 (06:46 +0000)]
Bug 33567: Remove hardcoded fallback in module

Test plan:
Run t/db_dependent/XSLT.t again
Should pass now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33567: Empty NFL_statuses pref in unit test
Marcel de Rooy [Thu, 20 Apr 2023 06:41:32 +0000 (06:41 +0000)]
Bug 33567: Empty NFL_statuses pref in unit test

This test should fail now, since it would trigger the hardcoded
fallback in the XSLT module.

Test plan:
Run t/db_dependent/XSLT.t
Should fail.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32995: Pass user agent string for OverDrive fulfillment
Nick Clemens [Fri, 17 Feb 2023 13:01:02 +0000 (13:01 +0000)]
Bug 32995: Pass user agent string for OverDrive fulfillment

This patch simply adds the string Koha/VERSION to the fulfillment
request

TO test:
1 - Have OverDrive credentials for testing
2 - Enable all the overdrive options in system preferences
3 - Sign in to opac with an overdrive user and verify you can checkout
  and download titles
4 - Sign off

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Not tested with OverDrive, but change looks harmless enough.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33699: Typo in identity_provider_domains.tt (presedence)
Owen Leonard [Wed, 10 May 2023 13:19:38 +0000 (13:19 +0000)]
Bug 33699: Typo in identity_provider_domains.tt (presedence)

This patch corrects the typo "presedence" with "precedence."

The patch also corrects some grammar:

"so if the 'library.com' domain will take presedence over
'*library.com'"

...changed to...

"so 'library.com' domain will take presedence over '*library.com'"

I also changed the <div>s inside that block of help text to <p> in order
to improve legibility.

To test, apply the patch and go to Administration -> Identity providers
-> Manage domains (on an existing provider) -> Edit, and click the
"More" button under the "Domain" field.

Confirm that the text is correct.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33677: Remove verbose option from koha-worker man
Jonathan Druart [Wed, 10 May 2023 09:04:13 +0000 (11:04 +0200)]
Bug 33677: Remove verbose option from koha-worker man

Signed-off-by: Magnus Enger <magnus@libriotech.no>
No more mention of verbose.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33642: Fix 'No log found.' in viewlog
Jonathan Druart [Wed, 10 May 2023 08:41:30 +0000 (10:41 +0200)]
Bug 33642: Fix 'No log found.' in viewlog

It should ease translatability and remove an extra space.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33445: (follow-up) Allow all search fields to be passed through and returned...
Nick Clemens [Mon, 1 May 2023 18:38:30 +0000 (18:38 +0000)]
Bug 33445: (follow-up) Allow all search fields to be passed through and returned when trying another search

It seems the form didn't populate all fields form data passed in. This patch
corrects that

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33445: (follow-up) Pass form values through when clicking 'Try another search'
Nick Clemens [Mon, 1 May 2023 18:31:30 +0000 (18:31 +0000)]
Bug 33445: (follow-up) Pass form values through when clicking 'Try another search'

We didn't include anything except the authid id in the try again form, this
patch extends to cover all the fields

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33445: Pass through form info if present and use record values otherwise
Nick Clemens [Fri, 28 Apr 2023 12:39:58 +0000 (12:39 +0000)]
Bug 33445: Pass through form info if present and use record values otherwise

This patch updates the form to pass through values formthe form when searching, and
to use record values if nothing is passed in.

TO test:
 1 - Without the patch, edit a personal name authority record
 2 - Replace 100 subfield a (200 subfield a for UNIMARC) with your own name
 3 - Click "Replace record via Z39.50/SRU search"
 4 - Note that prefilled search field contains the original value, not your name.
 5 - Replace the Author (personal) field with your name in the search form
 6 - choose a search target, and click Search.
 7 - Note that the results of the search are for the original value, not your name
 8 - From the details page of a record, click 'Edit -> Replace record via Z3950'
 9 - Note form is prefilled
10 - Change value as in 5 and search
11 - Note original term was searched
12 - Apply patch, restart all
13 - Repeat searches as before
14 - Confirm that form is prefilled with record or the updated value
15 - Confirm your entered search terms are always searched

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33655: z39.50 search no longer shows search in progress
Owen Leonard [Wed, 10 May 2023 10:42:13 +0000 (10:42 +0000)]
Bug 33655: z39.50 search no longer shows search in progress

This patch adds an id to z39.50 search interface submit buttons so that
the JavaScript event for changing the cursor can be linked to that
instead of the obsolete class.

The patch also adds code copied from Bug 33233 in order to make the
"waiting" cursor revert to the default if the user uses the back button
to return to the search form.

To test, apply the patch and go to Cataloging -> New from Z39.50

- Fill in a search term and click the submit button
- Your cursor should change to a "waiting" cursor while the search is
  performed, before you're redirected to the results.
- From the results page, clicking the back button (or right-clicking the
  page and choosing "Back") should return you to the search form and
  your cursor should be a standard pointer.

Perform the same test from:

- Acquisitions -> Vendor -> Basket -> Add to basket -> From an external
  source
- Authorities -> New from Z39.50/SRU

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32937: Make Zebra ignore the copyright symbol in searches
Katrin Fischer [Sun, 16 Apr 2023 11:57:19 +0000 (11:57 +0000)]
Bug 32937: Make Zebra ignore the copyright symbol in searches

It's common to catalog the year with the copyright symbol attached
to it. This creates some issues with search that we can fix by
adding the Â© to the list of characters Zebra ignores in search.

To test:
* Search for any existing publication year with Â©, example: Â©1951
* Verify your record is not found
* Add the copyright symbol to a record, verify it's now found with Â©,
  but not without
* Apply patch
* On ktd:
  * sudo cp -i /kohadevbox/koha/etc/zebradb/etc/word-phrase-utf.chr  /etc/koha/zebradb/etc/word-phrase-utf.chr
  * sudo koha-zebra --restart kohadev
  * sudo koha-mysql kohadev
  * DELETE FROM biblio WHERE biblionumber = 369;
  * The reindex woudl fail for me with this broken record present.
  * sudo koha-rebuild-zebra -f kohadev
* Repeat searches, the records should be found when searching
  with and without Â©.

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>
13 months agoBug 32627: Calculate expirationdate relative to waitingdate
emlam [Wed, 5 Apr 2023 13:30:30 +0000 (09:30 -0400)]
Bug 32627: Calculate expirationdate relative to waitingdate

Hold::set_waiting should calculate the MaxPickupDelay expiration date
based on waitingdate rather than the current date, to avoid resetting
the expirationdate on a hold that was already waiting.

To test:
1. Place a hold and check in the item so the hold will be set to Waiting
2. Confirm that the expiration date is correct based on the
   ReservesMaxPickupDelay setting
3. Adjust your system clock to one day later
4. Check in the item again and confirm the hold
5. Note that the expiration date has changed
7. Apply patch and restart_all
8. Repeat steps 1-4. Confirm that the expiration date is calculated
   correctly, and does not change when the item is checked in again
9. Reset your system clock to the current date
10. Set ExcludeHolidaysFromMaxPickupDelay to Use the Calendar
11. Add an upcoming holiday to the calendar
12. Repeat steps 1-4. Confirm the expiration date correctly accounts for
    the holiday, and does not change when the item is checked in again

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33053: Handle invalid biblio_id more robustly
Tomas Cohen Arazi [Thu, 11 May 2023 19:54:26 +0000 (16:54 -0300)]
Bug 33053: Handle invalid biblio_id more robustly

This patch addresses the fact the invalid FK error might differ under
some circumstances. We could try to catch the exception adding another
case, but I think this pattern is cleaner and the authors didn't provide
a fix.

We can discuss it later, as this controller class has several things to
review.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 29185: (QA follow-up) Quote title search in GetCnumSearchURL
Marcel de Rooy [Wed, 10 May 2023 13:33:53 +0000 (13:33 +0000)]
Bug 29185: (QA follow-up) Quote title search in GetCnumSearchURL

Test plan:
Disable UseControlNumber
Change biblio title to something like:
    Hamlet or CHINESE_CHARS
where you add some nice Chinese chars.
Create a 765 looking for that title in another biblio record.
Without this patch, the link at detail page finds both records,
since it looks for ti-phr:Hamlet OR the Chinese chars.
With this patch, the link at detail uses quotes and finds only
one, since the OR is now part of the ti-phr search.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 29185: (QA follow-up) Capitalize AND to ensure it is a boolean for ES
Nick Clemens [Fri, 28 Apr 2023 12:14:51 +0000 (12:14 +0000)]
Bug 29185: (QA follow-up) Capitalize AND to ensure it is a boolean for ES

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 29185: Display MARC tag 765 in OPAC and intranet XSLT
Marcel de Rooy [Thu, 13 Apr 2023 06:59:35 +0000 (06:59 +0000)]
Bug 29185: Display MARC tag 765 in OPAC and intranet XSLT

Test plan:

** For OPAC
[1] Pick a biblio record A as original entry, fill $001/$003.
[2] Pick another biblio record B as translation, add 765 with $t,
    $a and $d. Put (orgcode)cnum from A into $w.
[3] Disable UseControlNumber.
[4] Goto OPAC detail page of B. Check link; should be title based.
[5] Enable UseControlNumber.
[6] Goto OPAC detail page of B. Check link; should incl orgcode and cnum.
[7] Edit B. Replace $w with cnum of A only.
[8] Goto OPAC detail page of B. Check link; should incl cnum only.

** For staff client
[9] Goto staff detail page of B. Check link again.
[10] Edit B. Set 765 ind2 to 8, fill $i.
[11] Goto staff detail page of B. You should see different label.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 29185: Groundwork: add template GetCnumSearchURL in Utils
Marcel de Rooy [Wed, 15 Mar 2023 15:14:29 +0000 (15:14 +0000)]
Bug 29185: Groundwork: add template GetCnumSearchURL in Utils

Note for QA: Opened bug 33515 to see if we can use this same
function in a few other places too. Would probably reduce code
and increase consistency.

Test plan:
See next patch.

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>
13 months agoBug 29185: Facilitate searching for cnum
Marcel de Rooy [Thu, 23 Mar 2023 08:02:42 +0000 (08:02 +0000)]
Bug 29185: Facilitate searching for cnum

Instead of typing the case sensitive Control-number each time.
4 strikes instead of 15 on your keyboard. Wow! Gain of 73%.

Test plan:
Copy ccl.properties to /etc/koha/zebradb, restart Zebra and
search for cnum=SOME_ID in opac or intranet.

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>
13 months agoBug 33684: Make mandatory date fields required when editing a patron
Jonathan Druart [Tue, 9 May 2023 08:11:19 +0000 (10:11 +0200)]
Bug 33684: Make mandatory date fields required when editing a patron

Date fields in BorrowerMandatoryField are not required by the validation
form when a new patron is added or modified.

This is because the 'required' prop does not exist on the input element
when the flatpickr instance is created.
We should either add it in the DOM directly (tt), but it will require to
do it "manually" for each date fields, or add it when we add it to the
inputs. This patch implements the second option.

Test plan:
1. Add "dateofbirth" to syspref BorrowerMandatoryField.
2. Add patron and leave date of birth input field empty.
3. Save.
=> Form is not submitted and you are asked to fill in a date of birth

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
https://bugs.koha-community.org/show_bug.cgi?id=33648
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33403: Fix Letters.t if number pattern with id=1 does not exist
Jonathan Druart [Wed, 10 May 2023 10:34:08 +0000 (12:34 +0200)]
Bug 33403: Fix Letters.t if number pattern with id=1 does not exist

Bad assumption in DB, we should create the data we need

Test plan:
> delete from subscription_numberpatterns;

prove t/db_dependent/Letters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33557: DBRev 22.12.00.034
Tomas Cohen Arazi [Wed, 10 May 2023 18:22:04 +0000 (15:22 -0300)]
Bug 33557: DBRev 22.12.00.034

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33557: Add LinkerConsiderThesaurus system preference
Nick Clemens [Tue, 18 Apr 2023 13:13:12 +0000 (13:13 +0000)]
Bug 33557: Add LinkerConsiderThesaurus system preference

Bug 30280 added the ability to use multiple thesauri for authorities in Koha.
This is a large change, and many libraries use authorities in a ess strict manner.
This patch simply adds a preference, disabled by default, to enable this new feature

To test:
1 - Find or create a record with a 650 heading, second indicator 0 (LOC)
2 - Ensure this links to an authority in your system
3 - Disable AutoCreateAuthorities, enable CatalogModuleRelink
4 - Edit the heading to second indicator 2
5 - Save, the heading does not link
6 - Apply patch, updatedatabase, restart all
7 - Edit and save record again
8 - Heading should now link to the LOC authority, despite different second indicator value for source

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33277: (follow-up) Don't use regex, tidy
Nick Clemens [Tue, 9 May 2023 13:51:59 +0000 (13:51 +0000)]
Bug 33277: (follow-up) Don't use regex, tidy

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33277: Adjust source file for zebra mappings
Nick Clemens [Mon, 27 Mar 2023 08:53:24 +0000 (08:53 +0000)]
Bug 33277: Adjust source file for zebra mappings

The previous patches adjusted the mappings directly - moving this
change to the correct build file

Not needed for sign off, but QA can test that nothing changes when rebuilding the files:
xsltproc etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml > etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33277: (follow-up) Fix notdefined search for Zebra and ES
Nick Clemens [Wed, 22 Mar 2023 00:33:23 +0000 (00:33 +0000)]
Bug 33277: (follow-up) Fix notdefined search for Zebra and ES

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33277: Search thesaurus for 'notspecified'
Nick Clemens [Tue, 21 Mar 2023 19:34:50 +0000 (19:34 +0000)]
Bug 33277: Search thesaurus for 'notspecified'

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33277: Add comments and missing thesauri
Nick Clemens [Tue, 21 Mar 2023 19:28:10 +0000 (19:28 +0000)]
Bug 33277: Add comments and missing thesauri

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33277: Support custom thesaurus authority with no 040 specified
Nick Clemens [Tue, 21 Mar 2023 17:31:31 +0000 (17:31 +0000)]
Bug 33277: Support custom thesaurus authority with no 040 specified

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33277: Do not search using thesaurus when linking non 6XX fields
Nick Clemens [Mon, 20 Mar 2023 15:44:17 +0000 (15:44 +0000)]
Bug 33277: Do not search using thesaurus when linking non 6XX fields

This patch sets thesaurus as undefined when linking any field except 6XX

This fixes the case where authrotiy records don't have the thesaurus defined

Consequently - this means that Koha does not support multiple thesaurus records
for authorities outside of subjects

i.e. Using the default linker, and having both an LCSH and Sears record for 'Shakespeare,William'
A 100 entry will find two results and the heading won't be linked. Previously we always linked to the LCSH

To test:
1 - Import the attached auths and biblio (from bug 33159 comment 24)
2 - Set system preferences:
    RequireChoosingExistingAuthority - don't require
    AutoCreateAuthorities - don't generate
    CatalogModuleRelink - Do
    LinkerKeepStale - Don't
    LinkerModule - default
    LinkerRelink - do
3 - Edit the imported bib
4 - Save it
5 - Headings are not linked except 600
6 - Apply patch
7 - Restart all
8 - Edit and save record
9 - Headings are successfully linked

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33064: Update cypress tests
Matt Blenkinsop [Tue, 18 Apr 2023 13:18:34 +0000 (13:18 +0000)]
Bug 33064: Update cypress tests

This patch amends Searchbar_spec.ts to account for the new licenses option

Test plan:
1) Run yarn cypress open
2) Select the Searchbar_spec.ts test
3) The test should pass

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33064: Add a licenses option to the searchbar
Matt Blenkinsop [Tue, 18 Apr 2023 13:15:42 +0000 (13:15 +0000)]
Bug 33064: Add a licenses option to the searchbar

This patch adds a licenses option to the top searchbar

Test plan:
1) Apply patch
2) run yarn build
3) Navigate to the ERM module
4) Observe that the top search bar should have an option for licenses
5) Click on licenses in the left hand menu, the search bar should update to show licenses as the active search option

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31479: Option to skip t/00-check-atomic-updates.t when building custom packages
Aleisha Amohia [Sun, 28 Aug 2022 22:21:59 +0000 (10:21 +1200)]
Bug 31479: Option to skip t/00-check-atomic-updates.t when building custom packages

This enhancement adds an option to skip the check for leftover atomic
updates when building custom packages. This is particularly useful for
Koha providers or anyone else building Koha packages manually.

In practice, this could be run like: sudo CUSTOM_PACKAGE=1
./debian/build-git-snapshot -r ~/debian -v 21.11.01git -d

This test plan should all take place within the shell.
0. sudo koha-shell kohadev
1. Run prove t/00-check-atomic-updates.t and confirm the test passes
2. Add a fake atomic update to installer/data/mysql/atomicupdate/ . You
can use the example from
https://wiki.koha-community.org/wiki/Database_updates#How_to_write_an_atomicupdate_file
3. Run prove t/00-check-atomic-updates.t and notice the test fails
4. Set the CUSTOM_PACKAGE environment variable so we can test this. You
can either set on the commandline (using export) or in /etc/environment
(remember to run source /etc/environment so the changes are accessed)
5. Run prove t/00-check-atomic-updates.t and the test should now pass.

Sponsored-by: Catalyst IT
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25503: Add option to export items bundle contents in checkouts table
Julian Maurice [Thu, 14 May 2020 09:56:23 +0000 (11:56 +0200)]
Bug 25503: Add option to export items bundle contents in checkouts table

Test plan:
1. Enable system preference ExportCircHistory
2. Create an item bundle (see bug 28854 comment 458)
3. Check out the item bundle
4. In the checkouts table, check the box in column "Export",
   choose export format 'MARC with items', check "Export items bundle
   contents" and click on "Export" button
   The exported file should contain the biblio and item created at step
   2, but also the biblio and items that are part of the bundle

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
https://bugs.koha-community.org/show_bug.cgi?id=25508
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25503: Make _get_biblio_for_export test pass
Julian Maurice [Fri, 4 Nov 2022 08:53:51 +0000 (09:53 +0100)]
Bug 25503: Make _get_biblio_for_export test pass

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
https://bugs.koha-community.org/show_bug.cgi?id=25508
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25503: Add failing test for _get_biblio_for_export
Julian Maurice [Fri, 4 Nov 2022 08:53:25 +0000 (09:53 +0100)]
Bug 25503: Add failing test for _get_biblio_for_export

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
https://bugs.koha-community.org/show_bug.cgi?id=25508
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25503: Make Koha::Exporter::Record tests pass with unimarc
Julian Maurice [Fri, 4 Nov 2022 08:41:30 +0000 (09:41 +0100)]
Bug 25503: Make Koha::Exporter::Record tests pass with unimarc

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
https://bugs.koha-community.org/show_bug.cgi?id=25508
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 28328: DBRev 22.12.00.033
Tomas Cohen Arazi [Wed, 10 May 2023 17:49:37 +0000 (14:49 -0300)]
Bug 28328: DBRev 22.12.00.033

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 28328: Adjust tests
Jonathan Druart [Wed, 3 May 2023 13:42:15 +0000 (15:42 +0200)]
Bug 28328: Adjust tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 28328: DBIC schema changes
Jonathan Druart [Wed, 3 May 2023 13:41:51 +0000 (15:41 +0200)]
Bug 28328: DBIC schema changes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 28328: Extend biblioitems.lccn to longtext
Jonathan Druart [Wed, 3 May 2023 13:33:11 +0000 (15:33 +0200)]
Bug 28328: Extend biblioitems.lccn to longtext

Same sa issn and isbn, we want lccn to allow longer values.

Test plan:
Run the updatedatabase script to modify the DB structure
restart_all
Edit a bibliographic record and enter a long (more than 25 chars) lccn
Save

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 26403: (QA follow-up) Add missing debit and credit types to includes
Katrin Fischer [Wed, 10 May 2023 08:32:26 +0000 (08:32 +0000)]
Bug 26403: (QA follow-up) Add missing debit and credit types to includes

This adds the missing debit and credit types to the includes, namely:
DISCOUNT, PURCHASE, PAYOUT, and VOID.

I sorted them as they appear in the GUI (alphabetically) so it's a little
easier to spot missing ones.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 26403: Use accounts include in account management pages
Martin Renvoize [Wed, 10 May 2023 06:37:55 +0000 (07:37 +0100)]
Bug 26403: Use accounts include in account management pages

This patch updates the credit and debit types management pages to use
the proper includes for handling system type translations.  This is how
it should have been done in the first place on the original bugs that
introduced the management of these types but for some reason I think it
got dropped during the QA process leading to confusion around these
system types with their fixed descriptions.

To test:
1. Apply patch
2. Apply the translations
   ./misc/translator/translate install xx-XX
3. In the staff interface, go to Administration > Credit types
   --> They should be translated
4. Go to Administration > Debit types
   --> They should be translated

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 26403: (follow-up) Deleted old SQL files
Caroline Cyr La Rose [Mon, 3 Apr 2023 19:34:11 +0000 (15:34 -0400)]
Bug 26403: (follow-up) Deleted old SQL files

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan. Works as advertised.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 26403: Move credit and debit types into translatable YAML files
Caroline Cyr La Rose [Mon, 3 Apr 2023 18:35:04 +0000 (14:35 -0400)]
Bug 26403: Move credit and debit types into translatable YAML files

This patch moves account debit and credit types, as well as the CASH
payment type, into YAML files under
installer/data/en/mandatory. This should make the debit and credit types
translatable (for new installations only).

To test:
1. Apply patch
2. Update po files
   ./misc/translator/translate update xx-XX
3. View the xx-XX-installer.po file
   -->The default account debit and credit types (and cash payment type)
      should be available to be translated
4. Translate the strings
5. Apply the translations
   ./misc/translator/translate install xx-XX
6. Load the new translated YAML files (with a fresh install, or by deleting
   the values in the db and using ./misc/load_yaml.pl to load the files)
7. In the staff interface, go to Administration > Credit types
   --> They should be translated
8. Go to Administration > Debit types
   --> They should be translated

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33512: (follow-up) Check item count before adding add/edit button
Lucas Gass [Mon, 24 Apr 2023 23:53:50 +0000 (23:53 +0000)]
Bug 33512: (follow-up) Check item count before adding add/edit button

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33512: (QA follow-up) Remove 'Click to' from buttons
Katrin Fischer [Sat, 15 Apr 2023 23:14:10 +0000 (23:14 +0000)]
Bug 33512: (QA follow-up) Remove 'Click to' from buttons

This is following recommendations from accessibility
guidelines. It being a link or button already indicates
that you need to click it. We don't need to spell it out.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33512: Change text and add button classes on serial-edit page
Lucas Gass [Wed, 12 Apr 2023 22:28:06 +0000 (22:28 +0000)]
Bug 33512: Change text and add button classes on serial-edit page

To test:
1. Create a subscription
2. Make sure that you choose "Create an item record" when receiving the serial and associate it with a record.
3. Fill out the numbering pattern stuff and save the subscription.
4. Receive and change the status to arrived. Doing so will make the item subfields appear for editing.
5. Add some stuff, like a barcode, and Save.
6. Now, if you have made a mistake, you may want to edit the serial/item. Check the edit box and click 'Edit serials '
7. For your issue that has already arrived click 'Click to add item'. The item record from before appears.
8. Apply patch.
9. Try 6 & 7 again. The existing items should now read 'Click to edit item'

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33671: Update POD, remove unneeded check in relationship->guarantor
Marcel de Rooy [Thu, 4 May 2023 07:06:07 +0000 (07:06 +0000)]
Bug 33671: Update POD, remove unneeded check in relationship->guarantor

[1] Update POD for $patron->guarantor_relationships
[2] Remove check from Patron::Relationship->guarantor

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33671: Fix for 30472 - Remove null-guarantors
Marcel de Rooy [Thu, 4 May 2023 06:41:19 +0000 (06:41 +0000)]
Bug 33671: Fix for 30472 - Remove null-guarantors

These guarantors cannot be added. They are of no use.

NOTE FOR QA/RM: I do not think that it is needed to add a new
db rev for this change since it happens seldom. But if you think
that it is, just copy it to atomicupdate/change bugno.

Test plan:
[1] Check your table definition and modify it:
    alter table borrower_relationships modify column `guarantor_id` int(11) NULL;
[2] Add an empty guarantor:
    insert into borrower_relationships (guarantee_id,relationship) values (SOME_PATRON_ID,'father');
[3] Run the dbrev and verify that the inserted record has been removed.
[4] Check table definition with 'show create table borrower_relationships'.
    You should see NOT NULL with guarantor_id.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 30928: DBRev 22.12.00.032
Tomas Cohen Arazi [Wed, 10 May 2023 17:09:44 +0000 (14:09 -0300)]
Bug 30928: DBRev 22.12.00.032

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 30928: DBIC schema
Tomas Cohen Arazi [Wed, 10 May 2023 17:08:59 +0000 (14:08 -0300)]
Bug 30928: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 30928: (QA follow-up) DB updates
Aleisha Amohia [Sun, 30 Apr 2023 21:31:44 +0000 (21:31 +0000)]
Bug 30928: (QA follow-up) DB updates

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 30928: Add interface to statistics
Lucas Gass [Fri, 28 Apr 2023 14:30:41 +0000 (14:30 +0000)]
Bug 30928: Add interface to statistics

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 30928: Add tests
Lucas Gass [Fri, 3 Feb 2023 23:22:20 +0000 (23:22 +0000)]
Bug 30928: Add tests

prove -v t/db_dependent/Koha/Statistics.t
prove -v t/db_dependent/Stats.t

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33053: DBIC schema
Tomas Cohen Arazi [Wed, 10 May 2023 17:06:52 +0000 (14:06 -0300)]
Bug 33053: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33673: DBRev 22.12.00.031
Tomas Cohen Arazi [Tue, 9 May 2023 15:44:58 +0000 (12:44 -0300)]
Bug 33673: DBRev 22.12.00.031

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 30621: Add author column to opac-readingrecord.tt
Lucas Gass [Fri, 31 Mar 2023 16:53:24 +0000 (16:53 +0000)]
Bug 30621: Add author column to opac-readingrecord.tt

To test:
1. Have a patron with some checkout history.
2. Go to that patrons OPAC reading history page, notice author is listed in the same column as title. You cannot sort by author.
3. Apply patch and look again.
4. Now there should be an author column that allows patrons to sort by it.

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25379: (QA follow-up) Adjust other occurrences and add line break
Nick Clemens [Fri, 28 Apr 2023 16:03:07 +0000 (16:03 +0000)]
Bug 25379: (QA follow-up) Adjust other occurrences and add line break

This updates the other occurrences and adds html_line_break to all
except the edit page - it seems html or raw doesn't affect the value of the textarea,
but moved to raw for consistency

To test:
1 - Add an HTML note to a patron, make sure to add a line break:
<h1>Testing</h1>
<h2>Newline</h2>
2 - Checkout to patron and return
3 - Confirm note shows correctly
4 - Add patron to a list
5 - Confirm note displays correctly
6 - Edit patron, confirm note field is correct
7 - Batch modify borrower
8 - Confirm note displays correctly in batch list

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25379: Add raw filter to circulation note on checkin page
Katrin Fischer [Fri, 17 Mar 2023 21:36:23 +0000 (21:36 +0000)]
Bug 25379: Add raw filter to circulation note on checkin page

This is a consistency patch: we already allow adding HTML tags
to the patron circulation note and the contents display
correctly in the patron account and in the patron search results
in the staff interface. But the HTML tags are printed on the
checkins page.

To test:
* Add a circulation note including HTML tags to a patron
  Example: <h1>This patron is great!</h1>
* Check an item out to this patron
* Verify that the note displays formatted in patron search results
* Verify that the note displays formatted in the patron record
* Return the item
* Verify the note shows the printed tags
* Apply patch
* Check item out again and check it in again
* Verify the note now displays correctly in list of checkins

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>
13 months agoBug 32917: Fix sample notice for CHANGE_PASSWORD
Katrin Fischer [Sun, 16 Apr 2023 12:19:40 +0000 (12:19 +0000)]
Bug 32917: Fix sample notice for CHANGE_PASSWORD

We've identified 3 issues:
* Name of patron is not showing up in subject line
* Name of patron is now showing in notice text
* Notice is set to be HTML, but has no line breaks and uses no HTML tags

In the database update, these issues don't occur:

$dbh->do( q{
    INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('members', 'PASSWORD_CHANGE', 'Notification of password change', 'Library account password change notification',
    "Dear [% borrower.firstname %] [% borrower.surname %],\r\n\r\nWe want to notify you that your password has been changed. If you did not change it yourself (or requested that change), please contact library staff.\r\n\r\nYour library.", 'email');
});

So this patch will make them match up:

* Remove HTML flag
* Update patron. to borrower. in message text
* Remove patron name from subject (it won't work even with the correct variables)

To test:
* Add an email address to your favourite sample user
* Make sure NotifyPasswordChange is set to "Notify"
* Update the sample user's password using the "change password" feature
* Verify a notice is shown in the notices tabs
  Note: you won't see the line break issue there because of bug 30287
* Apply patch
* Recreate your database/run web installer so sample notices are loaded
* Repeat the test, it should generate a nice lookig notice now

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33253: Turn off autocompletion for 2FA authentication code
Katrin Fischer [Sun, 16 Apr 2023 10:45:06 +0000 (10:45 +0000)]
Bug 33253: Turn off autocompletion for 2FA authentication code

The form for entering your authentication code shoudl not suggest
previous codes.

To test:
* Activate TwoFactorAuthentication
* Go to your patron account in staff
* More > Manage 2-factor authentication
* I used "Google authenticator" on my phone, so:
* Open app on your phone, add new and scan the QR code
* Enter activation code
* Log out of staff interface
* Log back in, you are now also asked for an authentication code
  as second step
* Look up code in app, enter, get logged in
* Log out, log back in - the form now suggests the previous code
  when you click on it
* Apply patch
* Reload things (restart_all on ktd)
* Verify that you no longer get the suggestion

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32548: Replace while with map
Jonathan Druart [Fri, 31 Mar 2023 12:11:55 +0000 (14:11 +0200)]
Bug 32548: Replace while with map

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32548: Add tests
Jonathan Druart [Fri, 31 Mar 2023 12:11:46 +0000 (14:11 +0200)]
Bug 32548: Add tests

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 32548: Make illrequestattributes available in ILL emails
Katrin Fischer [Thu, 29 Dec 2022 16:17:40 +0000 (16:17 +0000)]
Bug 32548: Make illrequestattributes available in ILL emails

Without this ILL module only provides very limited data to
be included in the notices sent about the request itself.

We have the columns illrequests, but not the illrequestattributes,
that often will contain the more useful information needed.

This patch enables to use values of the illrequestattributs using
[% illrequestattributes.<attributname> %] in the notices.

To test:
* Apply patch
* First you'll need to activate the ILL module and install a
  backend to use it with. FreeForm was used for this test plan,
  BLDSS is usually also good for testing.
  See: https://wiki.koha-community.org/wiki/ILL_backends
* Also set up an SMTP server to use for notices and make
  sure the email address is set in KohaAdminEmailAddress
  and the user you are using for testing this with.
* Make sure your user has an email address and will receive
  ILL notices by seleting them in the messaging preferences.
* Create an ILL request with the FreeForm backend for your user.
* On the ILL request detail page: "Display supplier metadata"
  Pick some attributes you want to use in the notice
* Go to Tools > Notices and slips and edit ILL_REQUEST_UNAVAIL
* Add some of the attributes you picked. Example:
  [% illrequestattributes.type %]
  [% illrequestattributes.title %]
* Back to the ILL request detail page: Send notice to patron >
  ILL request unavailable
* Go to your patron's account and check the notices tab
* The generated notice shoudl show and include the information
  from the illrequestattributes you picked.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>