koha.git
10 months agoBug 32739: Unit tests
Tomas Cohen Arazi [Mon, 17 Jul 2023 18:48:09 +0000 (15:48 -0300)]
Bug 32739: Unit 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>
(cherry picked from commit 419d1d4fe9e4dae2e98493b81a74b0193104acfd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 30451: DBRev 22.11.08.002
Fridolin Somers [Thu, 17 Aug 2023 18:47:34 +0000 (08:47 -1000)]
Bug 30451: DBRev 22.11.08.002

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bff83490455663852b4ff48eaaf9f52566f3e7dc)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 30451: Update FK constraint on aqorders.subscriptionid
Katrin Fischer [Fri, 21 Jul 2023 14:39:07 +0000 (14:39 +0000)]
Bug 30451: Update FK constraint on aqorders.subscriptionid

This updates the FK constrant from ON DELETE CASCADE to ON DELETE
SET NULL. This means that if a subscription linked to an order is
deleted, we no longer will also delete the order, but we will just
set subscrptinid in the order to NULL. This will avoid data loss
that can cause the budgets/funds not to add up anymore with the
real espenses of the library.

To test:

Preparation:
* Create 2 subscriptions on different records
* Create a new basket
* Use the "order from subscription" functionality to create order
  lines for both of your subscriptions
* Close basket

Without patch:
* Delete the first subscription
* Verify the order line for this subscription is gone from your basket

Apply patch:
* Run database update and restart_all
* Delete the second subscription
* Verify the order line now remained in the basket

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
JD amended patch: perl tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 765d3d85b5b2b2e0711550b5b244d71967a2ee0c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43c55cad8a4a14fccc6112ca327603c07068d0c1)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34343: Update style of fixed footer navbar in Z39.50 searches
Owen Leonard [Mon, 24 Jul 2023 10:36:18 +0000 (10:36 +0000)]
Bug 34343: Update style of fixed footer navbar in Z39.50 searches

We use a Bootstrap fixed navbar in the footer of two pages: the popup
Z39.50 searches in cataloging and authorities. The style of these
footers needs to be udpated for the new staff interface design.

This patch also changes the style of the "cancel" controls in these
footers from links to buttons. The popup window in cataloging has been
adjusted to be the same size as the one in authorities.

To test, apply the batch and rebuild the staff interface CSS.

- Go to Cataloging -> New from Z39.50/SRU.
  - In the popup window, the form should fit comfortably in the window.
  - The footer should be white with a grey border at the top, with
    Bootstrap-styled buttons aligned to the right.
- Perform the same test in Authorities -> New from Z39.50/SRU
- Install and enable an additional translation so that you can confirm
  that the language-selection footer still has the correct style.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3ac122f47d18fe527c6c789a664d4c2b401f5e4c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 79e8d787a82ca0db01b3a5c9f551b86498f909c9)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 31667: Merge 'tip' and 'hint' classes
Owen Leonard [Tue, 25 Jul 2023 15:32:44 +0000 (15:32 +0000)]
Bug 31667: Merge 'tip' and 'hint' classes

This patch corrects a few instances of the use of the "tip" class and
replaces them with "hint." The patch also removes the class from the
staff interface CSS.

To test, apply the patch and rebuild the staff interface CSS.

- View a patron account and click the "Routing lists" link in the
  left-hand sidebar.
  - On the subscription routing lists page the "Search subscriptions"
    page label should look correct.
- Go to Reports -> Catalog by item type.
  - The "Select none..." hint should be styled correctly.
- The third instance, in the installer, is only visible if you try to
  install Koha using a MySQL user who doesn't have the correct
  privileges, so may be too much trouble to really test. A check of the
  patch should be adequate.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d8054e30fcc8ee402e0e7d96f68bc1b35f41ad4f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c74d7351b59af73b6e3290c5ff8d8c3961aae6ee)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33140: Use facet label value for mouseover text on facet removal link
Andreas Jonsson [Sun, 5 Mar 2023 12:21:34 +0000 (13:21 +0100)]
Bug 33140: Use facet label value for mouseover text on facet removal link

This patch updates the facets includes in both the staff interface and
OPAC so that the title attribute on "remove" links uses the full name
rather than the code of the facet. So, library name instead of
branchcode, collection code description instead of authorized value
code.

To test, apply the patch and perform a search in the staff interface.

- Click a facet in the left-hand sidebar which will return more than one
  result.
  - On the reloaded page there should be a link next to that facet: [X].
    Hovering your mouse over it should show "Remove facet [facet name]"
    e.g. "Remove facet Centerville" instead of "Remove facet CPL"
- Test on library facets, item type facets, and collection code facets.
- Perform the same test in the OPAC.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 01a6b2b63b929d6b367f95919dd72559736cb002)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 75b09126207a91d1314d2676d1fc1ee18c567761)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34305: Account for negative prices on acq details tab
Katrin Fischer [Tue, 18 Jul 2023 14:47:43 +0000 (14:47 +0000)]
Bug 34305: Account for negative prices on acq details tab

The acquisition detail tab shows the estimated cost while
the order is still pending and the actual price, once received.
At least the tool tip on the table header row says so. This
was not working correctly.

To test:
* Create a basket
* Create a new order line with a negative list price (credit)
* Close the basket
* Verify that the price shows correctly in the acquisition details
  tab on the record
* Receive the order and enter a different negative actual price.
* Reload detail view, verify it still shows the estimated price
* Apply patch, restart_all
* Verify now the correct actual price displays
* Create another basket and order line
* Verify while not yet received, it still shows the estimated price

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>
(cherry picked from commit 758712dc0140bb40cf0254125d006eed6c590b3a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cc21197125b8c4a8d237c5cf41cacbcf55f12422)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34447: Do not export "Actions" columns
Jonathan Druart [Mon, 31 Jul 2023 11:23:53 +0000 (13:23 +0200)]
Bug 34447: Do not export "Actions" columns

In the KohaTable Vue component we should add the noExport class to the actions columns to not export them.

Test plan:
Go to the ERM module, create at least one agreement.
Go to the agreement list view and click "export" to export the table
=> Without this patch the "Actions" column was exported
=> With this patch is no longer there

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 585138f13f42ec76a7d45b44faba70445b27d7b3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 50dfe2be55f22c6f4be429472b6dd5b3a493a8ed)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34435: Remove side effect from get_password_expiry_date
emlam [Thu, 27 Jul 2023 16:36:34 +0000 (16:36 +0000)]
Bug 34435: Remove side effect from get_password_expiry_date

If get_password_expiry_date is passed a DateTime object
as a parameter, it modifies and returns the original
object. This can create possible side effects.

This patch modifies get_password_expiry_date to clone the
DateTime object that it receives as a parameter and
return the modified clone, so that object references can
be passed in safely.

To test:
prove t/db_dependent/Koha/Patron/Category.t

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dae5607fd184c2e4b19b197cca313aca92975e47)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f067a82e3aa2d45b92415cc6cfb0fea71b0866c2)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34435: Add unit test
Emily Lamancusa [Thu, 27 Jul 2023 16:29:15 +0000 (12:29 -0400)]
Bug 34435: Add unit test

To test:
prove t/db_dependent/Koha/Patron/Category.t

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 420363258214e2c397ef604c63b13491462ed955)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ef24af8da3bc1221cb952c27aa9fe02c86b6444c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33848: Enabling Coce in the OPAC breaks cover images on bibliographic detail...
Owen Leonard [Fri, 26 May 2023 17:28:50 +0000 (17:28 +0000)]
Bug 33848: Enabling Coce in the OPAC breaks cover images on bibliographic detail page

Bug 32412 added an additional "context" parameter to KOHA.coce.getURL.
The code which pulls a Coce image for the "main" cover image slider
needs to include the correct context parameter for the images to load.

This patch also makes a minor correction to CSS in order to make the
cover image slider "dots" change color to highlight the current slide.

To test, apply the patch and rebuild the OPAC CSS.

- Enable multiple cover image sources in the OPAC including Coce, e.g.
  Amazon, Google, OpenLibrary, etc.
- Search for a title which will match multiple cover image sources. In
  the sample data a search for "Perl" will return good results.
- Note the number of cover images loading for a title in the search
  results.
- View the detail page for that title. There should be the same number
  of covers in the cover image slider.
- Clicking the slider navigation dots should work to show each image,
  and the dot should change color to highlight the current image.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d313f9b963ff0e5187eb19d81ef13231e0add39d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4125aec704464560515fb4f1f083b4cf4705ba30)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33848: Don't remove coce container from template
Jonathan Druart [Wed, 31 May 2023 11:41:26 +0000 (13:41 +0200)]
Bug 33848: Don't remove coce container from template

It's removed from coce.js

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aa8dc28e97d1971e191d5f7d08802257ae98f378)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6cef886164eb3fd792eacffa6a8451bdcc711cec)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33755: Set profile_id and add missing import
Matt Blenkinsop [Mon, 31 Jul 2023 08:52:23 +0000 (08:52 +0000)]
Bug 33755: Set profile_id and add missing import

This patch adds a missed parameter (profile_id) in stage-marc-import.pl and also adds a missing import in the background job for staging marc files. This means that the profile used when importing can now be shown in the import batches table and also in batch details

Test plan:
1) Stage a record for import and make sure to save the import profile you use
2) Import a record using that profile
3) Navigate to Cataloging > Manage staged MARC records
4) In the Profile column, no value will be shown for the staged record
5) Click on the batch, the profile will be missing in this screen as well
6) Apply patch
7) Restart_all
8) Repeat steps 2-5, the profile name should be visible in both places

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 38fc85ade940b732b3565400a0ff41c06a382497)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a0a03cb08bcfb91cd7b12d473acdb16939b2fcd4)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34354: Fix progess typo
Pedro Amorim [Mon, 24 Jul 2023 13:36:02 +0000 (13:36 +0000)]
Bug 34354: Fix progess typo

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2234ecb8c93d3ad2dc0a0f41d46db479c9a05d56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 57ca63cd00db408eea2f032b962be60c6e60e4d8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34493: Fix indenting in search_indexes.inc
Fridolin Somers [Mon, 7 Aug 2023 23:11:14 +0000 (13:11 -1000)]
Bug 34493: Fix indenting in search_indexes.inc

Bug 32683 broke indenting in koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc
Not on purpose looks like.

Test plan :
1) Look at changes to validate indenting
2) Run prove xt/tt_valid.t

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>
(cherry picked from commit fc2dc973f0beca5e30777a465aece074a29682ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 14a46944fffdf0bfd4aaba1a5bd7cca22d7c54b7)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34469: Block editing for received order lines
Katrin Fischer [Fri, 4 Aug 2023 15:13:36 +0000 (15:13 +0000)]
Bug 34469: Block editing for received order lines

When an already received order line is modified/edited,
we experience data loss. Most prominently, we will lose the
linked invoiceid. Therefore we should not allow editing an
order line that was already received. If something needs to be
changed, the receipt should be cancelled first.

To test:
* Create basket as standing order with items added in cataloguing
* Add an order line
* Receive shipment
* Go to the basket summary page, click on 'Modify'
* Change the actual cost
* Save
* Verify that the invoice is now empty
* In the database aqorders.invoiceid will be NULL
* Apply patch
* Receive another shipment for the standing order
* Go back to basket summary page
* Verify the 'Modify' link is no longer present
* Click 'Modify' on the unreceived order line
* Edit the URL parameter odernumber to have the number of an
  already received order line
* Verify you see a nice error message:
  This order cannot be edited, the basket is closed or the order was already received.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a4b7490633d2e8bc9ca9a0f60ebec1200ed0b07a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 93e91843276beb48c69576b540f304d2ddec8a32)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34056: Add -api-client suffit to authorised-values API client
Jonathan Druart [Mon, 19 Jun 2023 08:15:20 +0000 (10:15 +0200)]
Bug 34056: Add -api-client suffit to authorised-values API client

In koha-tmpl/intranet-tmpl/prog/js/vue/fetch all files have the -api-client suffix but authorised-values. For consistency we should add it.

Test plan:
Go to the ERM module and confirm that dropdown lists are correctly
filled in with authorised values.
You can also inspect the console and confirm that a GET query to /authorised_value_categories is done

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 813cfe1eec1f6090f715638a774fa755b5ff4788)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bc3ddc56034bdccdb7a1fe308e53da1125846f72)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34365: Add cancellation request flow to DELETE /holds
Tomas Cohen Arazi [Mon, 24 Jul 2023 19:08:50 +0000 (16:08 -0300)]
Bug 34365: Add cancellation request flow to DELETE /holds

This patch adds a new `x-koha-override` header to allow enforcing the
cancellation request flow for waiting holds.

If the hold is not waiting, the header has no effect.

To test:
1. Apply the tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: The endpoint doesn't implement the required logic
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! The endpoint behavior is changed!
5. Sign off :-D

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb224540e223d71f1f494b94ce3442567a1c6664)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e4e145eb4ad61db989395e45dbe082c0df7feff4)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34365: Unit tests
Tomas Cohen Arazi [Mon, 24 Jul 2023 19:08:22 +0000 (16:08 -0300)]
Bug 34365: Unit tests

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2a8c43f975306081ec4f7a218346187bba08585c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ffe0f845688c2e76d11adc1613d1a969e27935ca)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34470: Initialize random seed after spawning a child worker process
Emily Lamancusa [Wed, 9 Aug 2023 16:29:35 +0000 (12:29 -0400)]
Bug 34470: Initialize random seed after spawning a child worker process

When background_jobs_worker.pl spawns a new child process, it needs to
explicitly reinitialize the random seed - otherwise each child process
will inherit the same random seed from the parent process, and any
randomization will produce identical results each time.

This patch adds a call to srand immediately after the fork to
reinitialize the seed. Note that child processes should not call
srand with no parameter anywhere else, as the Perl documentation
indicates that srand should not be called with no parameter more than
once per process.

To test:
1. Apply the logging patch only
2. Set system preferences:
    a. RealTimeHoldsQueue -> Enable
    b. RandomizeHoldsQueueWeight -> in random order
3. Watch the logs for the staff interface
   in ktd:
   ktd --shell
   koha-intra-err
4. Place a hold. Note that the logs display the branch list before and
   after it is randomized.
5. Place some more holds. Note that the branch order after randomization
   is identical each time.
6. Apply both patches and restart_all
7. Repeat steps 3-5.
   -> Note that the branch order before randomization hasn't changed
   -> Note that the branch order after randomization is now different
      each time.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3c64f62c0dca2acf7d7558281e006ef41286771)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1155af8e80434f7793d0111b058dd20ac9c5aef8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34117: Add unit tests
Emily Lamancusa [Thu, 27 Jul 2023 14:33:38 +0000 (14:33 +0000)]
Bug 34117: Add unit tests

To test:
prove t/db_dependent/Koha/Patron/Categories.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3ff1430bb4f1203a3d2d9ee8017633c73ff6a3de)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 33e046f41cbaa41ee3aea90ba4d619c6fe86507f)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34117: Remove side effect from get_expiry_date
Emily Lamancusa [Thu, 20 Jul 2023 17:41:15 +0000 (13:41 -0400)]
Bug 34117: Remove side effect from get_expiry_date

If get_expiry_date is passed a DateTime object as a parameter,
it modifies and returns the original object. When memberentry.pl
prefills the input fields for duplicating a patron, it passes the
enrollment date object to get_expiry_date. This causes the enrollment
date object to be modified with the expiry date value.

This patch modifies get_expiry_date to clone the DateTime object that it
receives as a parameter and return the clone, so that references to an
enrollment date object can be passed in safely.

To test:
1. Have or make a patron
2. Duplicate that patron
3. Before saving the new patron, scroll down to Registration Date and
   see that it's defaulting to a date in the future.
4. Apply patch and restart_all
5. Try duplicating a patron again
6. Registration Date should correctly set to today

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bba9feff5ca9e1601a38408625cf7ba40b70645f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1628791ca24a44bf07e224f2194f12ebfe60779c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34155: Hide 'Next available' at OPAC when item-level hold is forced
Julian Maurice [Mon, 17 Jul 2023 09:10:07 +0000 (11:10 +0200)]
Bug 34155: Hide 'Next available' at OPAC when item-level hold is forced

This was a regression caused by bug 24860

Test plan:
1. Set up circulation rules so that OPAC users can place holds only on
   specific items ("OPAC item level holds" = "force")
2. Try to place a hold at OPAC. The "Next available item" option should
   not appear.
3. Set "OPAC item level holds" to "allow"
4. Try to place a hold at OPAC. The "Next available item" option should
   appear

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b1bd01a428823e0ed99d7d265dec3606ea3e893)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9916e1853462d293eac5eecbf15184d360d58079)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34269: (QA follow-up) Add missing TT filters
Katrin Fischer [Fri, 14 Jul 2023 09:17:27 +0000 (09:17 +0000)]
Bug 34269: (QA follow-up) Add missing TT filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e211d8b34b8e3755ef254f9677d8c82dc27e0ae1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 741f331e7d0ca7f616bd9b794a428ef3cff01b12)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34269: Convert to using codes in select compares
Martin Renvoize [Thu, 13 Jul 2023 16:01:07 +0000 (17:01 +0100)]
Bug 34269: Convert to using codes in select compares

This patch updates the logic in smart rules to compare option values to
codes as apposed to option texts to value descriptions.

0. Apply patch
1. Install another language in the staff interface
   1. ./translate install xx-XX
   2. Check the box of the language in the 'language' system preference
   3. Refresh
2. Create an item type with a parent
   1. Go to Administration > Item types
   2. Create a new item type or modify an existing one, assigning a parent type
      Example: Create a 'Children's books' itemtypetype
      and assig 'Books' as its parent
   3. Create a third item type with the same description but something added in ():
      Example: 'Children's books (3-5)'
3. Create a circulation rule for the parent type
   Example: All/Books, with 2 checkouts allowed
4. Create a circulation rule for:
   All/All with 3 checkouts allowed
5. In English, click on "Edit" next to the parent type rule (All/Books)
   --> Note that the item type in the bottom row (the modifiable row) is changed to 'Books (All)'
6. Modify the number of checkouts allowed (e.g. 99)
   --> The All/Books rule is modified
7. Switch the interface to the other language
8. Click on "Edit" next to the parent type rule (All/Books)
   --> The All/Books rule is modified
9. Add rules for Children's books and Children's books (3-5)
10. Click on "Edit" next to each rule and change a value
   --> Verify that the changed values are always saved for the correct rule

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0fdb2db51072e10a3f53b1efb9571728560bd64)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 864f4ecba550e4daaa18d8de7ed76a6268436be2)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34452: Restore fund label and 'Update adjustments' button
Katrin Fischer [Fri, 4 Aug 2023 14:29:11 +0000 (14:29 +0000)]
Bug 34452: Restore fund label and 'Update adjustments' button

This patch fixed 2 small and recent regressions:

* The "Update adjustments" button used to always display. It's
  required to save a new first adjustment, but also to save
  changes to existing adjustments edited inline. It now would
  only display after "Add adjustments" was clicked. We retore
  to display it always. (bug 32746)

* We have several "Fund" pull downs on this page, but they are
  for different things and require different labelling.
  "Fund" was changed to "Shipping fund" which matches at the top,
  but doesn't work for the adjustments table and single adjustment
  form. Now we use "Shipping fund" "Fund" and no label in the table
  as the table header covers it there. (bug 33721)

To test.
  * Add a vendor
  * Receive shipment
  * Add invoice and save
  * Click on "Finish receiving"
  * Verify the button "Update adjustments" appears after clicking
    "Add new adjustment"
  * Verify the button is gone after you clicked it and the table shows
  * Change something in the table - no button to save change :(
  * Apply patch
  * Repeat steps, button "Update adjustments" should not always be
    visible.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 72ef65edbe3413027fb877e37929e98cf7fd26fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4ababc2dc8bab31c7083235ee5b866e2f8fd3761)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34059: Add only issues from the branch that is creating the notice
Pedro Amorim [Mon, 19 Jun 2023 14:24:30 +0000 (14:24 +0000)]
Bug 34059: Add only issues from the branch that is creating the notice

Test plan, on k-t-d
1) Go to 'my account' on top right user menu
2) On 'Patron messaging preferences', click 'Edit'
3) On the 'Item due' row, check the 'Email' and 'Digests only' checkboxes and save
4) On the top search bar, press 'Check out' and enter '42' (koha user cardnumber)
5) On the checkout input bar, enter 39999000001372 and press checkout
7) Go to 'Set library' on top right user menu and pick a different library
8) Repeat step 4), then, on the checkout input, enter 39999000004571 and press checkout
9) Verify that this user now has 2 items checked out, from 2 different libraries at /cgi-bin/koha/circ/circulation.pl?borrowernumber=51
9) Run the following 2 queries to force the due_date to be equal to 'today's' date for both issues:
NOTE: change the YYYY-MM-DD below to whatever day it is you're running this test plan

UPDATE issues SET date_due = '2023-06-19 23:59:00' where issue_id = 1;
UPDATE issues SET date_due = '2023-06-19 23:59:00' where issue_id = 2;

10) Run the cronjob:
./koha/misc/cronjobs/advance_notices.pl -c --digest-per-branch

11) Verify that two DUEDGEST notices were created, one per each library, but both notices contain both issues:
SELECT letter_code, time_queued, content FROM message_queue ORDER BY message_id DESC LIMIT 2;

12) Apply patch, then do 10) and 11) again
13) Verify that each notice only contains the issue for its respective library

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39e6b100cb977f072e6f23a13625e986a31aab97)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bdfe5b3cdebc444c7327280ffcf0e44121d35fca)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34387: (QA follow-up) Fix display of 'Import batches'
Katrin Fischer [Sat, 29 Jul 2023 21:14:39 +0000 (21:14 +0000)]
Bug 34387: (QA follow-up) Fix display of 'Import batches'

Fixes the heading and sidebar display of the 'Import batches'
section.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34387: (follow-up) Minor spelling and quoting fixes
Martin Renvoize [Wed, 26 Jul 2023 06:15:56 +0000 (07:15 +0100)]
Bug 34387: (follow-up) Minor spelling and quoting fixes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34387: Improve API docs naming consistency
Tomas Cohen Arazi [Tue, 25 Jul 2023 18:57:58 +0000 (15:57 -0300)]
Bug 34387: Improve API docs naming consistency

This patch aims to make our API docs be more consistent.
It addresses two particular things:

* There's no consistency on the `tags` used across the spec, and not all
  of them are correctly described and have an `x-displayName` entry.
  More on this later.
* This are not sorted either by some for of grouping, or at least
  alphabetically.

For the former, I did my best trying to harmonize (specially on the ERM
front) with what we do in the rest of the use cases.

For the latter, I opted for sorting everything alphabetically, as a
first step. Hoping someone else could work on grouping things.

To test (ON YOUR HOST MACHINE):
1. On current master run:
   $ cd api/v1/swagger
   $ docker run --rm -v $(pwd):/api --workdir /api redocly/cli \
           build-docs swagger.yaml --output index.html
=> SUCCESS: It doesn't break or anything
2. Open your browser, open the generated api/v1/swagger/index.html file
=> FAIL: The left column has
         * several lower case entries
         * not everything is correctly grouped (ERM? packages?)
         * Things are not sorted. There's an attempt but looks messy
3. Apply this patch
4. Repeat 1 and 2
=> SUCCESS: Things look much better!
5. Sign off :-D

CAVEAT1: I'm not sure why, but import_batches doesn't work. Ideas are
welcome, I'll keep looking for fixes.
CAVEAT2: I don't have enough eHoldings background to weight in, but I
feel like 'ERM eHoldings packages' could just be 'ERM packages'.
Follw-up patches with better ideas are welcome.
CAVEAT3: Patron credits, debits, balance... They could all go in to
'Patrons accounts' or similar. Open to ideas.
CAVEAT4: Old redocly didn't support mapping an endpoint to more than one
target section. Something to explore if we want (for example) to reach
'credits' through the 'Patrons' section but also from 'Accounting'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33978: Adding authority from automatic linker closes imported record
Hammat Wele [Wed, 14 Jun 2023 17:20:00 +0000 (17:20 +0000)]
Bug 33978: Adding authority from automatic linker closes imported record

If you import a record, then create an authority record using the automatic linker, it closes the biblio record. The problem occures when a record is edited in a new tab.

To recreate:

1. Import the example records
   1.1. Download the example records
   1.2. Go to Cataloging > Stage records for import
   1.3. Choose the downloaded file
   1.4. Click Upload file
   1.5. Click Stage for import
   1.6. Click View batch
   1.7. Click Import this batch into the catalog
   1.8. Click View detail of the enqueued job
   1.9. Click Manage imported batch

Correct behaviour:

2. In another tab, search for one of the records (for example, Fafounet)
3. Click Edit > Edit record
4. Go to field 100
5. Click Link authorities automatically
   --> It should say 100 - No matching authority found.
6. Click the plus sign next to 100
7. Fill out the mandatory fields by clinking in the text fields (000, 003, 005, 008, 040), field 100 should already be filled
8. Click 'Save'
   --> Authority number is added in 100 and you get to stay in the record for more edits if needed

Incorrect behaviour:

9. Go back to the imported batch tab
10. Click Edit next to the second title (the one by Paventi, Eza)
11. Redo steps 4 to 8
    --> Record is closedclear :(
    The behaviour should be the same, stay in the bibliographic record until it is saved.

12. Apply the patch
13. Redo step 9, 10, 4
14. Edit field 100, Type 'Paventi Test 2'
15. Redo step 5 to 8
    --> Authority number is added in 100 and you get to stay in the record for more edits if needed

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ad124fe536aa11380bdce38b4dfc600864159477)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 03c5a75dfd6560eb30e0a6598d68ec015f6a073b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34213: import_patrons.pl - Fix short version of matchpoint option in POD
Jonathan Druart [Thu, 6 Jul 2023 12:54:11 +0000 (14:54 +0200)]
Bug 34213: import_patrons.pl - Fix short version of matchpoint option in POD

 44     'c|confirm'                      => \$confirm,

 46     'm|matchpoint=s'                 => \$matchpoint,

The POD is wrong.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2442a4537d4d439bdf27e031116f98d880e47e09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5fcaf0aa09bbc76a6b010e9e93a6696308bea9a6)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34332: Removed extra parenthesis that was causing an error
Laura Escamilla [Thu, 20 Jul 2023 18:23:32 +0000 (18:23 +0000)]
Bug 34332: Removed extra parenthesis that was causing an error

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb84c45da46b0b49dec9e9191aeb85a767d119f7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 46496e74a000a94befe2842c353a463daded4bde)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34334: Item(s) in MARCdetail untranslatable
Owen Leonard [Fri, 21 Jul 2023 10:17:39 +0000 (10:17 +0000)]
Bug 34334: Item(s) in MARCdetail untranslatable

This patch adds a <span> around the text "Item(s)" in the template for
the MARC detail page in the staff interface. Without the span the
translation tool can't detect the string.

To test, apply the patch and update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the string is now in the .po file for translation. You
  should find these lines:

koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt:146
c-format
msgid "Item(s)"
msgstr "Exemplaire(s)"

I found that the translation was already populated. Install the updated
po file:

 > perl translate install fr-FR

Test the MARC detail page in your translated language to confirm that
the string is correct.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 92692a2ee96f2eced21849e0ca9fa0b5d7c44801)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9bffe4aec1ec5cd9f224efa0ada0d0b8657a6d71)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34316: Add_credit should rethrow an exception correctly
Marcel de Rooy [Thu, 20 Jul 2023 07:45:05 +0000 (07:45 +0000)]
Bug 34316: Add_credit should rethrow an exception correctly

Found while running Items.t on top of 33608.
Another exception was thrown but not rethrown.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fa9750e24de0a6300d683a1316b64e9bed248c4b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2b1b8884ccd49e28bdf31a3c977a876a0f8c5283)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 28493: Make koha-passwd display the username
Mason James [Wed, 21 Sep 2022 11:38:59 +0000 (23:38 +1200)]
Bug 28493: Make koha-passwd display the username

to test...

1/ run command
 $ sudo koha-passwd dev1
 Password for dev1: CraZyPa$$WoRD!!
 Press enter to clear the screen...
 ^C

2/ apply patch

3/ run command again, note 'username' section
 $ sudo koha-passwd dev1
 Username for dev1: koha_dev1  <<<<<<<<<<<<
 Password for dev1: CraZyPa$$WoRD!!
 Press enter to clear the screen...
 ^C

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>
(cherry picked from commit 4ce7f8c49378c0e32212493779b07e3ab369dee7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ba51185fbd00591a72af41782ba2d6fd956b731a)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34279: Don't enforce overduefinescap unless it is greater than 0
Kyle M Hall [Fri, 14 Jul 2023 11:36:47 +0000 (07:36 -0400)]
Bug 34279: Don't enforce overduefinescap unless it is greater than 0

When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine.

Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is.

Test Plan:
1) Apply the first patch ( unit tests )
2) prove t/db_dependent/Circulation/CalcFine.t
3) Note the test fails
4) Apply the second patch as well
5) prove t/db_dependent/Circulation/CalcFine.t
6) Note the test passes

Test Plan 2:
1) Create an all/all/all rule with an overduefinescap of 0.00, with a
   daily fine. Enable CalculateFinesOnReturn
2) Backdate a checkout so it is overdue
3) Return this item, note the lack of a fine
4) Apply this patch set
5) Backdate a checkout and return it again
6) Note the fine is generated!

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1763b136d1dcd3348ee26bca8663823b5a05f07c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 662da18be2ec7c6c9348a704d9ad8ac955292862)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34279: Unit tests
Kyle M Hall [Fri, 14 Jul 2023 11:32:11 +0000 (07:32 -0400)]
Bug 34279: Unit tests

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8096ec9fff44a04c8ff32525499652116d1a8ad0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3e360c5637c1f910100e10f049823fda01f588d9)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32271: (QA follow-up) Restore $Price filtering for valid values
Martin Renvoize [Wed, 19 Jul 2023 11:41:28 +0000 (12:41 +0100)]
Bug 32271: (QA follow-up) Restore $Price filtering for valid values

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 093d1959af59423e3a9a69139a4745703b7a399a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cf41331ba113a7b176c292820fb2d51c48ff0605)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32271: (QA follow-up) Correction to 'can_be_blank' logic
Martin Renvoize [Wed, 19 Jul 2023 11:31:14 +0000 (12:31 +0100)]
Bug 32271: (QA follow-up) Correction to 'can_be_blank' logic

The logic introducing the can_be_blank check into the monetary decimal
format check was flawed and meant we were no longer checking decimal
formatting in the majority of cases. This patch updates that so we pass
the unit tests and correctly check any value passed that's not an empty
string.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c42725bab4f7f4dc360d9b4fe0417b8b3082d879)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7ccbda031cbc076fe2188133c9b1327ed1b599d8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32271: Unit test
Martin Renvoize [Wed, 19 Jul 2023 11:11:50 +0000 (12:11 +0100)]
Bug 32271: Unit test

Add a unit test for the allow blank option added to the monetary check
in CirculationRules.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 41274ef7516ad09f1f9a5e6723ba7bd53379dd02)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8d02637bec9848077bec53abfa449fd158ac12c0)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert...
Kyle M Hall [Fri, 14 Jul 2023 13:08:51 +0000 (09:08 -0400)]
Bug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert all 0 equivilents to blank value

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit daedce4f6ea7d7ae9d4f12cd54e94b0230683a92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 093a97c67b5cc9ab0741f860a119e090b8a3360b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 32271: Fix overdue fines cap (amount) set to 0.00 when editing rule.
Géraud Frappier [Mon, 5 Dec 2022 17:30:40 +0000 (12:30 -0500)]
Bug 32271: Fix overdue fines cap (amount) set to 0.00 when editing rule.

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit adeb4d54530d6ef8c4adc171846eb7c47a81bb23)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b8a9eefc4cdd3062a688a3c693209c2bef599364)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34133: Set default sort on first column (ID) desc
Pedro Amorim [Tue, 27 Jun 2023 15:00:00 +0000 (15:00 +0000)]
Bug 34133: Set default sort on first column (ID) desc

Test plan:

Before applying patch:
* Open incognito at /cgi-bin/koha/ill/ill-requests.pl,
* Verify order is by ASC (lowest ID first)
* Close incognito

Apply patch, then:
* Open incognito at /cgi-bin/koha/ill/ill-requests.pl,
* Verify order is by DESC (highest ID first)

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan from Bugzilla, and added it above.
Works as advertised.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 67916fc23a518bb1ddc895f6f3e0b27c434b8a92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f1c1cfdb0c7833ffafcefa06dfb3495a289cf1f9)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33992: Only consider the date when auto-expiring problematic recalls
Aleisha Amohia [Tue, 13 Jun 2023 05:29:22 +0000 (17:29 +1200)]
Bug 33992: Only consider the date when auto-expiring problematic recalls

This patch carries this fix into the misc/cronjobs/recalls/expire_recalls.pl cronjob so that recalls are automatically expired when they have been waiting a problematic number of days, not considering hours, as expected.

To test, follow the test plan from the first patch. This will set you up with a waiting problematic recall.

Run the cronjob manually

perl misc/cronjobs/recalls/expire_recalls.pl

Refresh your 'Recalls awaiting pickup' page. Your problematic recall should be gone/expired.

Expiration dates will apply when expiring any 'unfulfilled' recall i.e. newly requested, overdue to be returned, and awaiting pickup.

Sponsored-by: Auckland University of Technology
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>
(cherry picked from commit 0d2052088ec62654f81154be0b9916b8e8630891)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3a5f4d170117e264ed15c8cf40c799ddfd2f6299)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34028: Show the secret when registering from the auth screen
Jonathan Druart [Tue, 4 Jul 2023 10:03:59 +0000 (12:03 +0200)]
Bug 34028: Show the secret when registering from the auth screen

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3cb77a590bb884e2e6151ec2d24333e828c8ddb9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7651c42b6d1b6943a5cb8e368f863ccf6af3f38f)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34028: Fix manual entry for two factor authentication
David Cook [Fri, 16 Jun 2023 06:04:37 +0000 (06:04 +0000)]
Bug 34028: Fix manual entry for two factor authentication

This patch changes the "Account" and "Key" display so that
you can manually enter two factor authentication details into
an authenticator app.

The details are the same as those provided by scanning the QR code.

Test plan:
0. Apply patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=TwoFactorAuthentication
2. Change setting to "Enable"
3. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
4. Click "More" on record toolbar and choose "Manage two-factor authentication"
5. Click "Enable two-factor authentication"
6. Scan the QR code into an authenticator app and note it creates an entry called
"Centerville: Centerville_koha"
7. Manually enter an entry into an authenticator app (like Google Authenticator)
7a. Add the "Account" as shown on the Koha screen
7b. Add the "Key" as shown on the Koha screen
8. Note that the entries added by QR code and manual entry have the same
label and both were accepted by the authenticator app

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>
(cherry picked from commit 7c05333914e3f54d66b9de6dde82b614ea83569a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a51d570a6ebff0989df8e599dc4b1a2cd0b14172)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Lower the two digits requirement
Tomas Cohen Arazi [Wed, 19 Jul 2023 14:51:54 +0000 (11:51 -0300)]
Bug 33028: (follow-up) Lower the two digits requirement

This patch makes the code not require two decimal digits, as the main
intention here is to forbid (locale) formatted strings to reach the DB.

The number of digits we support needs to be discussed on its own bug,
and a centralized check implemented.

This patch fixes tests:

prove t/db_dependent/Circulation.t
t/db_dependent/Circulation.t .. 1/67 Exception 'Koha::Exceptions::CirculationRule::NotDecimal' thrown 'The circulation rule expected a decimal value' with name => fine, value => 0.1
t/db_dependent/Circulation.t .. Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 53/67 subtests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 45b050871e7ed882b553f211db97204f30634646)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 343221462e71101c13fa39bae5abb87c956e412d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Add POD to new Exception
Martin Renvoize [Wed, 19 Jul 2023 10:26:59 +0000 (11:26 +0100)]
Bug 33028: (follow-up) Add POD to new Exception

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b82f1bd8075e0d14aa9d08293831af4cd8a3059a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 187e58aa4907cefbef034a8d459493f40ef03673)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Unit tests
Martin Renvoize [Wed, 19 Jul 2023 10:21:46 +0000 (11:21 +0100)]
Bug 33028: Unit tests

Add unit tests for is_monetary functionality introduced in the
CirculationRules module.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 88ccaaf3acab9996070a5bcbc057bbe9dad1c771)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f0d56eb1dc7e7635d620bbe591c681005ea76638)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Make exception less generic
Tomas Cohen Arazi [Tue, 18 Jul 2023 18:05:50 +0000 (15:05 -0300)]
Bug 33028: Make exception less generic

While testing this bug I found Circulation.t was failing, but the
exception doesn't actually display anything useful in terms of helping
debug what's going on.

This patch makes it add the rule_name and rule_value to the message.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b7c077c9ddade728a7d84a1cf2f5b62cc4d4841)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f44e411edb51dc9f4afb7df18eb4509fed9d5a31)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (QA follow-up) Tidy introduced code
Tomas Cohen Arazi [Tue, 18 Jul 2023 17:28:27 +0000 (14:28 -0300)]
Bug 33028: (QA follow-up) Tidy introduced code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 82bdaa8fbcdf836dd2fea93850173f15f17b7de9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: DBRev 22.11.08.001
Tomas Cohen Arazi [Tue, 18 Jul 2023 17:24:46 +0000 (14:24 -0300)]
Bug 33028: DBRev 22.11.08.001

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 86c2d9d1e96f318615ca6c83d6bfd685723ab5c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 834b3ca5d9909f9dec08ef6aa014203b54032f51)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Perltidy database update script
Katrin Fischer [Tue, 11 Jul 2023 13:23:40 +0000 (13:23 +0000)]
Bug 33028: Perltidy database update script

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0a3b98cdb1ae0938403bf919f5494e2708821c4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 495a4a7477c715b56a4f96f07c455df029bbcd1c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Throw exception if not passed a decimal number
Martin Renvoize [Mon, 3 Jul 2023 12:45:28 +0000 (13:45 +0100)]
Bug 33028: Throw exception if not passed a decimal number

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d5b1041f43c2a6d8b82f6ee88c1ecf6aaaeb9cae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0bd5fb0bb64fb7eb6a23b719155b9da67d81e99e)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Apply unformat_price to decimal fields
Martin Renvoize [Tue, 27 Jun 2023 15:54:02 +0000 (16:54 +0100)]
Bug 33028: (follow-up) Apply unformat_price to decimal fields

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 461c1931b9137bfcf64c5ec9a5bc3f127727ec14)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 18ce1916fa59662187f7fbcbeee7fe376b49ff4c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Add unformat_price js function
Martin Renvoize [Tue, 27 Jun 2023 15:22:36 +0000 (16:22 +0100)]
Bug 33028: (follow-up) Add unformat_price js function

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 31cbd5ce946832234c8eb6b99729d781e75fd4bc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9741e94376ea6c7ecf3920132ea05cc2849db4a8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Rewrite database update
Katrin Fischer [Fri, 16 Jun 2023 17:01:52 +0000 (17:01 +0000)]
Bug 33028: (follow-up) Rewrite database update

This rewrite the database update with some things in mind:

* We now use a positive value list of allowed characters to check
  This makes sure that all of those are recognized:
  1,00
  1.00€
  abc
* Instead of dying after finding one wrong value, we loop through
  all values first, building up an error string
* When we have errors... we die and print the full list of things
  that need fixing.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0199f5fbbb50cbc4656cbeb73c269a7cc6718e55)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 00fc50a1f6af3b94e60b06c7edb0588974d6b1fd)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Add TT filters for Price and pattern checks to input fields
Katrin Fischer [Fri, 16 Jun 2023 16:59:22 +0000 (16:59 +0000)]
Bug 33028: Add TT filters for Price and pattern checks to input fields

With this patch, all monetary values in the table will be displayed
formatted.

Also, the input will be checked against our agreed pattern to make
sure no false values can be entered.

Missing: When editing a rule, we need to unformat the value, so that
instead of the display format we have the input format available
for editing.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c2d40bb4a05687eca67a8e06befd5d43d0a4b9d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 32bddca28690bb05695d3e25fbd5764b7af0a06d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Add is_monetary to recall_overdue_fine and article_request_fee
Katrin Fischer [Fri, 16 Jun 2023 16:57:51 +0000 (16:57 +0000)]
Bug 33028: Add is_monetary to recall_overdue_fine and article_request_fee

This patch marks the 2 missing monetary values for recal over due fines
and article request fees as monetary.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e2634097c15d808d4e9a96e33efa9ab245bba88c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit feb6ceaa249b938e1214c4e4bb104f043d1b5bb4)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Fix trailing 0 decimals
Martin Renvoize [Fri, 3 Mar 2023 11:33:46 +0000 (11:33 +0000)]
Bug 33028: (follow-up) Fix trailing 0 decimals

We want to recognise the truthyness of a number vs string so we drop
trailing decimals if they're just 0.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 598970a1223b9af043b1977965322758565f7d06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 84076285128d986f9a75c3135d40156248636420)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: (follow-up) Move monetary definition into hash
Martin Renvoize [Fri, 3 Mar 2023 11:28:20 +0000 (11:28 +0000)]
Bug 33028: (follow-up) Move monetary definition into hash

This patch moves the defintion of monetary rule type into the rule kinds
hash.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2b48a948cbe7f14526e4ea8836e5175e38ab9d20)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4a8fdaee6695c576966ddfa78262ae4f8da10651)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33028: Fix calculations around cronjob fines.pl
Thibaud Guillot [Tue, 21 Feb 2023 16:05:45 +0000 (17:05 +0100)]
Bug 33028: Fix calculations around cronjob fines.pl

When currency format is set on FR commas are decimals separators
but when cron like fines.pl try to calculate fines it's fails due to
this format.

I changed this behavior by targetted 'fine' and 'overduefinescap' in
circulation_rules.rule_name to unformat them when we save them.

This also fix the display in smart_rules table (before with commas price
was not good displayed - without decimals)

Test Plan :
1) Set your currency format on 'FR' and 'fine' OR/AND 'overduefinescap'
with commas
2) Be sure to have some patron overdues
3) Run ~/misc/cronjobs/fines.pl with args to find overdues
4) See an error like 'isn't numeric in substraction[..] or gt > [...]'
5) Run updatedatabase script (it will replace commas in your rules
changed in step 1) )
6) Repeat step 3 and see that everything was going "fine" (:tada:)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1f9e161b412621c048c55741bab56b92c0b01a15)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4f9eba2d232dcd709fe4ef74d37963f1e019569d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 33117: Make dbrev idempotent
Tomas Cohen Arazi [Mon, 7 Aug 2023 18:13:46 +0000 (15:13 -0300)]
Bug 33117: Make dbrev idempotent

QA didn't spot the issue, nor I. So fixing now.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 951e67a1b3dd1f26eddeaecd2dc63991f9667927)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit caa46019d07d89474feee02c7a2f8961e7414283)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34181: Fix jQuery selector to make delete checkboxes reappear
Katrin Fischer [Sun, 16 Jul 2023 14:11:19 +0000 (14:11 +0000)]
Bug 34181: Fix jQuery selector to make delete checkboxes reappear

Bug 32257 changed the page structure slightly to fix a display
issue with the labels. This resulted in a broken selector in the
function for displaying the checkboxes for deleting/emptying a
certain patron field.

To test:
* Go to Tools > Batch patron modifications
* Enter some cardnumbers or borrowernumbers
* On the batch patron edit form, verify that the checkboxes
  behind each input field are missing
* Apply patch
* Verify the checkboxes reappeared
  * Verify that for mandatory fields the checkbox is locked
* Make some batch edits and verify the checkboxes work as
  intended

Signed-off-by: Lisette Scheer <lisette.scheer@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d81b009ab0634e1ae33a1bb5cf20cad538bb361f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 625d0f812ad1c58750c032e7fdd271eaf2932f8c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34337: (bug 33581 follow-up) Sample patrons not inserted
Jonathan Druart [Fri, 21 Jul 2023 09:27:26 +0000 (11:27 +0200)]
Bug 34337: (bug 33581 follow-up) Sample patrons not inserted

The "select all" link for the optional sample data is not selecting
holidays and patrons.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39496af98f3d6408821636b92c5f6e3a25e5e71c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f400830a56ec12005f922e7b0de012e6c0ef9a07)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoRMAINT: Fix permission of .08 release db_rev
Martin Renvoize [Tue, 15 Aug 2023 09:36:42 +0000 (10:36 +0100)]
RMAINT: Fix permission of .08 release db_rev

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
11 months agoBug 33881: Clear self-check JWT during auth kick out
David Cook [Tue, 6 Jun 2023 03:48:06 +0000 (03:48 +0000)]
Bug 33881: Clear self-check JWT during auth kick out

This patch clears the JWT cookie during auth kick out (ie
when a web user navigates from the self-check out/in to
the rest of Koha).

Test plan:
0. Apply patch and koha-plack --reload kohadev
1. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
2. Log in as the "koha" user
3. In another tab, go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
4. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=a&weight_search=1
5. Note that you are prompted to "Log in to your account" via the normal Koha prompt
6. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
7. Note that you are prompted to "Log in to your account" within the "Self checkout system",
and note that your self-checkout session for the "koha" user has *not* persisted like
it did before the patch was applied

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1fa961b97b8f52d1c9920c72d9338d150deb829b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 30524: (QA follow-up) Fix tests
Tomas Cohen Arazi [Fri, 28 Jul 2023 13:40:28 +0000 (10:40 -0300)]
Bug 30524: (QA follow-up) Fix tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 158edb411b32253fae4f068ce416d6ad4d1a67d3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoUpdate release notes for 22.11.08 release v22.11.08
Matt Blenkinsop [Fri, 28 Jul 2023 11:09:51 +0000 (11:09 +0000)]
Update release notes for 22.11.08 release

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoIncrement version for 22.11.08 release
Matt Blenkinsop [Fri, 28 Jul 2023 10:58:17 +0000 (10:58 +0000)]
Increment version for 22.11.08 release

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoFix translations for Koha 22.11.08
Matt Blenkinsop [Fri, 28 Jul 2023 10:37:34 +0000 (10:37 +0000)]
Fix translations for Koha 22.11.08

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoTranslation updates for Koha 22.11.08
Koha translators [Fri, 28 Jul 2023 09:04:11 +0000 (06:04 -0300)]
Translation updates for Koha 22.11.08

(cherry picked from commit 1b14e70f7fb487fab02e2055f5b4f0fe860d75db)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 30524: (QA follow-up) Unit tests for GenerateCSRF()
Tomas Cohen Arazi [Thu, 27 Jul 2023 18:33:55 +0000 (15:33 -0300)]
Bug 30524: (QA follow-up) Unit tests for GenerateCSRF()

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 60d11ae7251a227fab3977ecd61cb01d0f062f79)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d4187c77eb3b39977b759af7df7641e70cd96358)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 30524: (QA follow-up) Only generate CSRF token if it will be used
Kyle M Hall [Thu, 27 Jul 2023 11:45:57 +0000 (07:45 -0400)]
Bug 30524: (QA follow-up) Only generate CSRF token if it will be used

This patch avoids generating CSRF tokens unless the csrf-token.inc file
is included in the template.

Passed token doesn't need HTML escaped. The docs for WWW::CSRF state:
  The returned CSRF token is in a text-only form suitable for inserting into a HTML form without further escaping (assuming you did not send in strange things to the Time option).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ddf1eb6cef14da365675890920ff72f010c59527)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 73ca151686b682aaa2b950ccbc89fcec14514112)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34023: Prevent HTML injection in "back to results" link from search page
Michał Górny [Fri, 16 Jun 2023 14:16:37 +0000 (16:16 +0200)]
Bug 34023: Prevent HTML injection in "back to results" link from search page

It is possible inject raw HTML into the "Back to search results" link by leading the user to a search with specially crafted URL.

For example, using the demo instance:

1. Visit https://koha.adminkuhn.ch/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1&%22%3Etest%3Ca%20foo=%22

2. Refresh the page (for some reason, "back to results" doesn't appear unless I do that at least once).

3. Click any result.

Note that the result page now contains:

  <a href="opac-search.pl?idx=&amp;q=test&amp;weight_search=1&amp;">test<a foo=%22" title="...

i.e. `">test<a ...` was successfully injected into the HTML.

I'm attaching a quick patch I've used to patch up our instance.  It just indiscriminately URI-escapes all parameter keys.  I didn't decode them back since as far as I understand all valid keys do not contain special characters.

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>
(cherry picked from commit e86e81a2480ec5486660bac241c694210eaefa11)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cbc2b0e8dafe7053785f98247df253f014cd632c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 22990: (follow-up) Fix suggestion.pl
Martin Renvoize [Thu, 13 Jul 2023 09:40:38 +0000 (10:40 +0100)]
Bug 22990: (follow-up) Fix suggestion.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 64500a92130f6e879b6a49b5ee7c9f45b7554170)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6fbc51bf06ba731d35a11ad5be3cba1c154b42a4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 22990: Fix template toolkit syntax issues in shelves_results.tt
David Cook [Wed, 11 May 2022 07:06:55 +0000 (07:06 +0000)]
Bug 22990: Fix template toolkit syntax issues in shelves_results.tt

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd69581fcf743c6720cc8b5fba687f75fc613321)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6f820f0f6b07eff3f2c4ad8c2d3d4dd909dd47b6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 22990: Fix for shelves table
Martin Renvoize [Thu, 16 Sep 2021 14:13:23 +0000 (15:13 +0100)]
Bug 22990: Fix for shelves table

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c0f232250e1186dd217e77db7e121a0b98a789cb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 20fa891788e002a6679651397ca0782410882bb0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 22990: Add CSRF protection to boraccount, pay and suggestion
Amit Gupta [Wed, 22 Jan 2020 16:07:22 +0000 (21:37 +0530)]
Bug 22990: Add CSRF protection to boraccount, pay and suggestion

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Test plan would have been nioe.
Tested by changing MAX_AGE with suggestions.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 833d1dc8b082cc742b88e358edef77960b5ffc2f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0c365b52f474e0fc0dd439f11bfa0a95534db029)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34368: Add CSRF token to Content Management pages
David Cook [Tue, 25 Jul 2023 05:18:00 +0000 (05:18 +0000)]
Bug 34368: Add CSRF token to Content Management pages

This change adds a CSRF token to the Content Management pages
at additional-contents.pl.

Test plan:
0. Apply patch
1. koha-plack --restart kohadev
2. Try to add "News", "HTML customizations", and "Pages".
3. Try to delete these new content entries
4. Note that you were successful in your endeavours

JD amended patch: remove empty line removal (no need to create
unecessary conflicts)

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>
(cherry picked from commit e97fae72141446b0a2fb06c454c601966e5f3494)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a759adc91730da7b57ced0f1baf59e83031197f9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 30524: Unit tests
Martin Renvoize [Fri, 23 Jun 2023 10:52:28 +0000 (11:52 +0100)]
Bug 30524: Unit tests

Test plan:
Run t/Output.t
Run t/db_dependent/Auth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2918f6ceda533719ac0da53d8245ea4826f43681)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9436074a26fe903134f71e66b0f9fcb7f6724438)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 30524: Core CSRF checking code
Martin Renvoize [Wed, 13 Apr 2022 12:55:04 +0000 (13:55 +0100)]
Bug 30524: Core CSRF checking code

Split out from bug 22990 as requested.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aba9e61cfbab1e915f1be4a527b5708b9ec59c35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6d6d36f6df79d3df22ea299934073d903f86e64a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33167: (RMAINT fix) Revert 33167
Matt Blenkinsop [Thu, 20 Jul 2023 08:41:00 +0000 (08:41 +0000)]
Bug 33167: (RMAINT fix) Revert 33167

Bug 33167 was reverted from 22.11.x but the revert does not seem to have removed all lines causing failing tests. This patch removes remaining lines and refactors the code to its pre-33167 state

11 months agoBug 33671: (follow-up) Disable FK check for column change
Marcel de Rooy [Wed, 12 Jul 2023 14:09:35 +0000 (14:09 +0000)]
Bug 33671: (follow-up) Disable FK check for column change

See also BZ report. As suggested by Tomas.

NOTE: The dbrev is extended too for removing records with a failing guarantor_id
foreign key (theoretically not present obviously).

Test plan:
1) cp installer/data/mysql/db_revs/220600048.pl installer/data/mysql/atomicupdate/
2) Run updatedatabase.pl
3) Remove copied file

Bonus:
Manually remove FK constraint before running updatedatabase.
Insert a record with bad guarantor_id into relationships manually.
Run the update again.
You should not see the message that the constraint is removed.
Is the bad record count reported and record removed?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Simplified. No longer removes the FK. Just disables during ALTER.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0397251ece455801d5b3083feb84cf959cfcea83)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4cdb3a57db739c8b5ad672444b02b333ef914762)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34303: Only perlcritic files from git repo
Marcel de Rooy [Tue, 18 Jul 2023 10:59:33 +0000 (10:59 +0000)]
Bug 34303: Only perlcritic files from git repo

Test plan:
Run t/00-testcritic.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2bc251cfdd1efdf6d0f7f299838ff067744ff17b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 835bc43d316df60882c09fb201caa75e027af0a3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 29471: Add display of MARC 520 to staff interface detail page
Katrin Fischer [Fri, 30 Jun 2023 14:22:17 +0000 (14:22 +0000)]
Bug 29471: Add display of MARC 520 to staff interface detail page

At the moment 520 only displays in the OPAC. With this patch it
also displays in the staff interface detail page.

To test:
* Find a record with 520 or add some 520 entries to a record
  Note: different ind. 1 values will result in different labels
* View the record in the staff interface and the OPAC
* Verify only the OPAC shows the 520 entries
* Apply patch
* Verify now the staff interface displays them as well

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Updated patch for displaying $u as link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Restored signoff line from Phil. Change only for $u.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 256518bf75f4df70a62bfe401bd911473e629efd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2cb9fa1b52e0f09d52c9a85d3b7ca04694add6a9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33270: (QA follow-up) Do not change param hashref
Marcel de Rooy [Mon, 17 Jul 2023 10:59:26 +0000 (10:59 +0000)]
Bug 33270: (QA follow-up) Do not change param hashref

Might just be a theoretical thing now, but safer to clone.

Test plan:
Run t/db_dependent/Koha/Biblio/Metadata.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cfbe8daf2118f0ecdeea13ef866e86d2e905b686)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 32db2823b89ae7250dbd35d5931f682e9a6ce4e2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33270: (QA follow-up) Tidy
Marcel de Rooy [Mon, 17 Jul 2023 10:52:03 +0000 (10:52 +0000)]
Bug 33270: (QA follow-up) Tidy

Resolve:
WARN   tidiness
  The file is less tidy than before (bad/messy lines before: 21, now: 24)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b3aba2b06527a36ad4edcf1cafbf614c974a590e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1d11b4360a3684ce3dad5f1f3908fed17e99ad4b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33270: (follow-up) Handle records that fail attempt to ignore bad characters
Nick Clemens [Tue, 11 Jul 2023 13:59:50 +0000 (13:59 +0000)]
Bug 33270: (follow-up) Handle records that fail attempt to ignore bad characters

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ea1a282b5e2100578354c44d273ba77ede7ae5af)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 247ebf90b226e826c96a85d3912688ccd6cd643a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33270: Attempt to recover from invalid metadata exception
Nick Clemens [Thu, 22 Jun 2023 11:22:18 +0000 (11:22 +0000)]
Bug 33270: Attempt to recover from invalid metadata exception

This patch uses the new record_strip_nonxml routine to attempt to display
the record when it contains invalid characters

Rather than silently strippg these, we warn in the logs, then add an 'about'
container to the response. It is displayed nicely in the web view or sent as "INVALID_METADATA" in
the xml response

The 'error' codes for OAI seem to be at the request level, and the offered codes don't have a match
for a bad record. Adding the about when we can recover seems the most generous response

To test:
Test plan, assumes using KTD default data - otherwise you need to find and import a record with encoding issues:
 1 - Enable OAI-PMH system preference
 2 - Browse to:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&resumptionToken=marcxml/350////0/0/352
 3 - 500 error:
    Invalid data, cannot decode metadata object (biblio_metadata.id=368, biblionumber=369, format=marcxml, schema=MARC21, decoding_error=':8: parser error : PCDATA invalid Char value 31...
 4 - Apply patch, restart all
 5 - Reload the page
 6 - It loads!
 7 - Click 'Metadata' for record 369 - it succeeds!
 8 - Check the logs - confirm you see a warning of the record problem
 9 - Confirm 369 has an about section
10 - Check the individul 'GetRecord' response as well
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=oai_dc&identifier=KOHA-OAI-TEST:369

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c71468537b4fa589e91e7fd5823ddd4f54379e21)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2e23ed06b7d6abbb3b27f0b0728bba10532d6c63)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33270: Add record_strip_nonxml routine to Koha::Biblio::Metadata
Nick Clemens [Fri, 23 Jun 2023 13:08:31 +0000 (13:08 +0000)]
Bug 33270: Add record_strip_nonxml routine to Koha::Biblio::Metadata

This adds a routine that can strip non xml characters form a record.
It is intended for cases where we do not wish to throw an exception,
but rather need to process a record to allow other work to continue

To test:
prove -v t/db_dependent/Koha/Biblio/Metadata.t

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4997d59c83ec1c63a3dc2c089fed79e3ad5fa764)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9544bd25a2b3c4811abb941b67a5684952a78da6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34251: When using the fast add framework in addbiblio.pl there is thrown a JS...
Jan Kissig [Wed, 12 Jul 2023 08:40:32 +0000 (10:40 +0200)]
Bug 34251: When using the fast add framework in addbiblio.pl there is thrown a JS error in selectTab( "#tab0XX_panel" );

This is because no nav tabs are build in addbiblio.tt as BIG_LOOP has a
length(size) of 1

To test:

1) go to More>Cataloging
2) click +New record
3) Click Settings> Fast add framework
4) take a look on console
5) try selecting a different framework now, will have no effect
6) apply patch and redo steps 1 to 5
7) there should be no error in console and a change in settings works a
   expected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e3ff3a62048731c130e7185f7ac81e07f41f6ff9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 05f5c83140860a292916a522ae042c2dbf69dc58)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34288: Unit tests
Tomas Cohen Arazi [Mon, 17 Jul 2023 15:08:34 +0000 (12:08 -0300)]
Bug 34288: Unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fbc21148e73547c0e557f106c02dcedbdcc67807)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e7c83d93cf7f59019c7245930522dc47f72487de)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34288: (follow-up) Tidy block
Tomas Cohen Arazi [Mon, 17 Jul 2023 13:22:39 +0000 (10:22 -0300)]
Bug 34288: (follow-up) Tidy block

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8e545cff7523b1930702b9de0eaff0b246a0ef1e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7a77ea698589f5d98269878f13ef54c0fabdf123)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34288: Allow access to the cataloguing module with `tools` permission
Tomas Cohen Arazi [Fri, 14 Jul 2023 23:15:41 +0000 (20:15 -0300)]
Bug 34288: Allow access to the cataloguing module with `tools` permission

Bug 31162 moved the cataloguing tools to a new cataloguing module home
page. This prevents people without cataloguing permissions, but with
some tools permissions to access things like the labels creator tool.

I tracked all permissions on the cataloging-home.tt template, including
the Stock Rotation ones which I initially missed because I was focusing
on tools.

This patch makes the cataloging-home.pl page require either
'cataloguing' or any relevant 'tools' permission to allow access. the
page.

The staff interface main page and the top bar dropdown are updated using
the same logic to display the cataloguing module link.

For that purpose, I wrapped the permissions on a sub in `C4::Auth`.

To test:
1. Have a patron with only 'catalogue' and some of this permissions:

* inventory
* items_batchdel
* items_batchmod
* items_batchmod
* label_creator
* manage_staged_marc
* marc_modification_templates
* records_batchdel
* records_batchmod
* stage_marc_import
* upload_cover_images
* stockrotation => manage_rotas

2. Log in
=> FAIL: No link to the cataloguing module, neither in the dropdown
3. Apply this patch
4. Repeat 2
=> SUCCESS: You have the link!
5. Play with the different combinations and notice things are sound and
   correct
6. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0db60995a8dd093210ffa772f56b7d5bac28d197)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit afacad6a2d5477870c55d8f0c56dec66bce64b9d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoRevert "Bug 33496: Add 'host_items' param to Koha::Biblio->items"
Matt Blenkinsop [Wed, 19 Jul 2023 09:52:40 +0000 (10:52 +0100)]
Revert "Bug 33496: Add 'host_items' param to Koha::Biblio->items"

This reverts commit aac8c1e36ea84deed0f4b9ad59f9f1bd44ba607f.

11 months agoRevert "Bug 33496: (follow-up) Correct param names"
Matt Blenkinsop [Wed, 19 Jul 2023 09:52:30 +0000 (10:52 +0100)]
Revert "Bug 33496: (follow-up) Correct param names"

This reverts commit f0e208c1e7e804a9e8db2de614ad612e3d14255d.

11 months agoRevert "Bug 33496: (QA follow-up) Update POD statement"
Matt Blenkinsop [Wed, 19 Jul 2023 09:52:16 +0000 (10:52 +0100)]
Revert "Bug 33496: (QA follow-up) Update POD statement"

This reverts commit 552c25f4f95e0ab6f70d93e5581f0acff4f66d7e.

11 months agoRevert "Bug 33497: Use 'host_items' param to fetch all items at once"
Matt Blenkinsop [Wed, 19 Jul 2023 09:51:48 +0000 (10:51 +0100)]
Revert "Bug 33497: Use 'host_items' param to fetch all items at once"

This reverts commit dc273a8dfe384b7c847a23b842f1dde601537d82.