koha.git
9 months agoBug 34656: Do not update real Time Holds Queue when moving from cart to shelf
Nick Clemens [Wed, 30 Aug 2023 13:46:52 +0000 (13:46 +0000)]
Bug 34656: Do not update real Time Holds Queue when moving from cart to shelf

To test:
1 - Enable RealTimeHoldsQueue system preference
2 - Set UpdateItemLocationOnCheckin to _ALL_: CART
3 - Check in an item
4 - Check the background jobs - the RTHQ is updated
5 - perl -e 'use C4::Items; C4::Items::CartToShelf(##);' -- substitute the itemnumber from above
6 - Check the background jobs - no new update to RTHQ
7 - Confirm item was set back to correct permanent_location

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 84521918d93878ffa314decc4eb3b67afe46dca3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34656: Unit test
Nick Clemens [Wed, 30 Aug 2023 13:46:17 +0000 (13:46 +0000)]
Bug 34656: Unit test

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aff84104127552fe5f5e4394f84b501dafcbc497)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34767: Pass fee_ack into ::Transaction::Renew(All)
Martin Renvoize [Tue, 12 Sep 2023 15:24:19 +0000 (16:24 +0100)]
Bug 34767: Pass fee_ack into ::Transaction::Renew(All)

This patch copies the $fee_ack field into the generated
::Transaction::Renew|All objects such that the fee acknowldegement flag
is respected for renewals.

Test plan
To test:
1) Add a rental charge to an itemtype
2) Checkout an item of that itemtype to a user
3) Attempt a renewal of that item via SIP2 and note that it fails
   sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 --item 39999000007756 -m renew
4) Pass the fee_acknowledgement bit in renewal and note the renewal
   still fails.
   sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m renew
5) Apply patch and note the above now succeeds
   sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m renew

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>
(cherry picked from commit 3a2dcf0733733a92ddbf46fb863434a46060e279)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34768: Remove checkbox column from relatives fines on OPAC
Nick Clemens [Tue, 12 Sep 2023 15:28:34 +0000 (15:28 +0000)]
Bug 34768: Remove checkbox column from relatives fines on OPAC

When a patron has a guarantee and can see their fines on the opac and
an opac payment plugin is enabled there is an error on the 'Charges'
tab.

The table uses a 'COLSPAN' variable which is set to 5 or 6 depending on
if OPAC payments are enabled. The guarantees table has one less column
than the patron's however, so it is going out of range and causing a JS
error. Additionally, we are adding a column to the child's table which
is not used as their fines cannot be selected for payment at this time.

This patch removes the checkbox column and sets the colspan directly to
4

I also fix an issue where the table is not being set as we need to
reference the patron object in the guarantor info to obtain the id.

To test:
1 - Set system preference: AllowStaffToSetFinesVisibilityForGuarantor to
    allow
2 - Find a patron
3 - Add some fines to their account
4 - Install and enable an opac payment plugin
    (https://github.com/bywatersolutions/koha-plugin-pay-via-govolution
    for example)
5 - Sign in to OPAC as borrower
6 - Go to 'Charges' tab
7 - Select a fee
8 - Confirm 'Make payment' button enabled and 'amount to pay' is
    updated
9 - Add a guarantee to patron in staff interface
10 - Set 'Show charges to guarantors' to 'Yes'
11 - Add and pay a fine for the child
12 - View guarantor account on the OPAC
13 - Confirm you now see child's charges
14 - Confirm selecting your own fees does not enable the button or
     update amount to pay
15 - Note JS error in console
16 - Apply patch
17 - Reload patrons page
18 - Confirm the table loads correctly (no JS error)
19 - Confirm selecting a fine updates the total and enables button
20 - Disable the payment plugin
21 - Confirm the display is still correct, no errors

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>
(cherry picked from commit a3e40408ea6792186e87e95a7de1dff515981432)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34764: Set fee_acknowledged to expect a string
Martin Renvoize [Tue, 12 Sep 2023 13:18:37 +0000 (14:18 +0100)]
Bug 34764: Set fee_acknowledged to expect a string

For consistency with other options I opted to have the fee acknowledged
parameter to expect a string and as it's an optional parameter I've
dropped the default value of 'N' too.

Test plan
1) Prior to this patch
1a) Attempt a checkout without passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will be '|BON', the default
1b) Attempt a checkout passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will still be '|BON', failure
1c) Attempt a checkout passing a string for fee_acknoewledeged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will still be '|BON', failure
2) Apply the patch
2a) Attempt a checkout without passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529000035676 --item 39999000007756 -m checkout`
    The optional `|BO` element should not be present
2b) Attempt a checkout passing -fa/--fee_acknowledged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged N --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will now be '|BON', success
2c) Attempt a checkout passing a string for fee_acknoewledeged flag
    `./misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --fee-acknowledged Y --patron 23529000035676 --item 39999000007756 -m checkout`
    The final field of the SIP request will now be '|BOY', success

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>
(cherry picked from commit 0e9603bb49436e4bb74e893f74a63ef31065f798)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34736: Don't trigger quantity change on loading order
Nick Clemens [Thu, 7 Sep 2023 19:02:08 +0000 (19:02 +0000)]
Bug 34736: Don't trigger quantity change on loading order

We have a change event to automatically check or uncheck the first items on a list when
the value is changed directly.

The code is calling this when setting the quantity when loading an order, but this is causing a problem
in that we are setting the quantity to load.switch orders and triggering the checkboxes wrongly

To test:
 1 - Create a new basket, create items on placing the order
 2 - Create an order line with 4 items
 3 - Create another order line with 2 items
 4 - Close the basket
 5 - Receive shipment and create an invoice
 6 - Select both orders via the checkboxes got multi-receive
 7 - Click "receive selected"
 8 - Edit first order line, quantity received = 1 (1 out of 4)
 9 - Verify that one item is also selected in the table
10 - Switch to "next order"
11 - Quantity received is 0, no items checked in the second order
12 - Switch to "Previous order"
13 - ERROR: Item checkbox was lost, quantity received still correct
14 - Switch to next order
15 - ERROR: item is now checked, quantity received 0
16 - Note: We see a mix up of the information entered, one has the checkbox now, the other the quantity.
17 - Save changes
18 - Click confirm
19 - Continue (complaint about the second order left unchanged)
20 - You are back on the summary:
     * pending order: quantity changed from 4 to 3 - correct
     * received order: quantity shows 1 - correct
21 - Click on receive for your updated order line (with 3 items)
     * 4 items show to be received (should be 3)
22 - Apply patch
23 - Cancel receipt of items
24 - Repeat 1-12
25 - Items are loaded correctly
26 - Try with various checkboxes and switch back and forth
27 - Confirm that manually adjusting quantity received checks the first n boxes
28 - Confirm setting quantity to 0 unchecks the boxes

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 08858b161c597b329d21815f8ae0d787e71d7e2e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34532: Silence warns in Patroncard.pm
Lucas Gass [Mon, 14 Aug 2023 21:11:52 +0000 (21:11 +0000)]
Bug 34532: Silence warns in Patroncard.pm

To test:

1. Go to patron card creator and make a patron card batch, card layout, and card template.
2. In the card layout leave some values blank for Lower left X coordinate and Lower left Y coordinate.
3. Now go create a card batch while tailing the plack-intranet-error log/
4. Notice in the logs:

[2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 109.
[2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 248.
[2023/08/14 20:50:54] [WARN] Argument "" isn't numeric in multiplication (*) at /kohadevbox/koha/C4/Patroncards/Patroncard.pm line 249.

5. Apply patch, restart_all
6. Try again and notice the WARNS should be gone from the logs now.
7. Make sure you can still create patron cards and the PDF's the generate look right.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.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 1164402b49bfb775a7aafab55b629ae443bddf1c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34502: Remove useless SEARCH_RESULT.localimage
David Cook [Wed, 9 Aug 2023 01:06:05 +0000 (01:06 +0000)]
Bug 34502: Remove useless SEARCH_RESULT.localimage

This patch removes a useless Template Toolkit tag.

To test:
0. Apply the patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=LocalCoverImages
2. Change to "Show"
3. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
4. Upload an image
5. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test
6. Note that the local cover image appears even without the TT tag

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 9da5895d79163a518825fbb102526aef119a93fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 32765: Retry transfer after cancelling hold
Julian Maurice [Tue, 31 Jan 2023 08:20:15 +0000 (09:20 +0100)]
Bug 32765: Retry transfer after cancelling hold

When trying to manually transfer an item that is on hold, we have the
choice to cancel the hold and try the transfer again. When choosing
this option, the hold is correctly cancelled but the transfer is not
tried again.
This patch fixes that

Test plan:
1. Place a hold on a specific item
2. Try to transfer it manually (Circulation » Transfer)
3. Choose the option to "Cancel hold and then attempt transfer"
4. See that the hold was cancelled, but no transfer was made
5. Apply the patch
6. Repeat step 1-3
7. See that the hold was cancelled, and the transfer was made

Signed-off-by: Nicolas Giraud <nicolas.giraud@inlibro.com>
Signed-off-by: Sam Lau <samalau@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 68b97cc7e4c60e6b84b9a7554e29c1c32453f685)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34223: (follow-up) Ensure consistent ordering of statuses
Martin Renvoize [Mon, 11 Sep 2023 13:50:43 +0000 (14:50 +0100)]
Bug 34223: (follow-up) Ensure consistent ordering of statuses

This patch adds an order_by clause to ensure consistent ordering of the
returned status and status_alias statuses from the database between
MySQL 8 and other DB engines.

This fixes the failing tests introducd in bug 34223.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7f9ff906d9c2800fc5bf3d38db23a77e1f3745ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34572: Simplify template logic around check-in input form
Owen Leonard [Fri, 18 Aug 2023 07:40:16 +0000 (07:40 +0000)]
Bug 34572: Simplify template logic around check-in input form

This patch makes a minor simplifying change to the check-in template
around how to style the barcode input field in dropbox or fine-exempt
mode.

To test, apply the patch and go to Circulation.

- If necessary, check some items out to patrons so that you have items
  to check in.
- Go to the check-in page and click the icon inside the barcode field to
  expand the panel of options.
- Check the "book drop mode" checkbox. The barcode field should now be
  highlighted yellow.
- Check in an item. When the page redisplays, the barcode field should
  have the same highlighted style.

- If necessary, enable the finesMode system preference.
- On the check-in page, in the panel of options, check the "Forgive
  overdue fines" checkbox. Test checking in again, confirming the same
  style consistency in the barcode field.

Signed-off-by: Inkeri <inkeri.hakulinen@helsinki.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit edb9787fc85752c636e0d982871c4b715a2e57d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34723: Show thumbnails on opac-imageviewer.pl when imagenumber not provided
David Cook [Wed, 6 Sep 2023 06:28:45 +0000 (06:28 +0000)]
Bug 34723: Show thumbnails on opac-imageviewer.pl when imagenumber not provided

This patch fixes a method call in the opac-imageviewer.pl so that thumbnails
correctly appear.

Test plan:
0. Apply the patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=localcover
2. Change both *LocalCoverImages sysprefs to "Show"
3. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=AllowMultipleCovers
4. Change "AllowMultipleCovers" to "Allow"
5. Go to
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
6. Click "Images (0)" tab
7. Download or make two JPEG images
8. Upload the images
9. Go to http://localhost:8080/cgi-bin/koha/opac-imageviewer.pl?biblionumber=29
10. See one large image in the centre and two smaller thumbnails on the right side

PA amended patch: Added missing test plan step

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 00edf9a541c6d512682f19db7120c808d60a4bf2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34079: The phrase "Displaying [all|approved|pending|rejected] terms" was separated
Caroline Cyr La Rose [Wed, 21 Jun 2023 14:59:47 +0000 (10:59 -0400)]
Bug 34079: The phrase "Displaying [all|approved|pending|rejected] terms" was separated

This patch reunites the words for the sentence "Displaying
[all|approved|pending|rejected] terms" in order to facilitate
translating in languages that have a different syntax.

To test:
1. Install a new language

   ./misc/translator/translate install xx-XX

2. Check the xx-XX-staff-prog.po file for the sentence
   --> All the words are individual strings

3. Apply patch

4. Update the po files

   ./misc/translator/translate update xx-XX

5. Check the xx-XX-staff-prog.po file again
   --> The sentence is reunited for each status (Displaying all terms,
       Displaying approved terms, etc.)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 272a080cb35fe83e9f11ab8401effb7223f5d94c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34081: Contextualization of "Approved" (one term) vs "Approved" (more than one...
Caroline Cyr La Rose [Wed, 21 Jun 2023 16:27:12 +0000 (12:27 -0400)]
Bug 34081: Contextualization of "Approved" (one term) vs "Approved" (more than one term), and other tag statuses

To test:

1. Apply patch

2. Install language

   ./misc/translator/translate install xx-XX

3. Update po files

   ./misc/translator/translate update xx-XX

4. View the xx-XX-messages.po file

   --> Strings for tag statuses for one tag should be separated from
       strings for statuses for multiple tags, with context Tags
       (single) or Tags (multiple)

5. Change the strings so you know which is which

   For example, in French, the approved status for a single tag would
   be "Approuvé" and for multiple tags would be "Approuvés" (with the
   plural s at the end)

6. Apply translations

   ./misc/translator/translate install xx-XX

7. Add tags through the OPAC
   7.1. In another tab, go to the OPAC
   7.2. Log in
   7.3. Search for a record
   7.4. From the detailed record, click Add tags
   7.5. Enter a tag and click Add

8. In the staff interface, go to Tools > Tags

9. Approve/Reject the tag
   --> The status in the table and on the button should be the singular
       status, the status in the summary on the right should be plural

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5d23be933f958bf4b3343c41802530088afc0b1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34257: (QA follow-up): tidy up code
Victor Grousset/tuxayo [Sun, 3 Sep 2023 23:06:23 +0000 (01:06 +0200)]
Bug 34257: (QA follow-up): tidy up code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9254af7b41349d563d526a0eeac946464dfef7b4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34257: Limit item types by branch in batchMod.pl
Lucas Gass [Fri, 18 Aug 2023 14:45:14 +0000 (14:45 +0000)]
Bug 34257: Limit item types by branch in batchMod.pl

To test:
1. Go to Item types administration.
2. Set some items types to be limited to a branch you are not logged in as.
3. Find some items from the branch you are logged in at and go to Batch item modification.
4. Add the barcodes and attempt to edit the item type to the one you limited in step 2.
5. You can change these item types to ones that your branch should not be able to.
6. Apply patch
7. Try steps 4 -5 again but this time you should not see item types in the dropdown that are limited to other branches.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 13d5ff94248df32623853ed2d87258f81edc0a8f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34402: Sorting holds on patron account includes articles
Owen Leonard [Wed, 26 Jul 2023 12:25:11 +0000 (12:25 +0000)]
Bug 34402: Sorting holds on patron account includes articles

This patch adds some configuration to the table of holds shown on the
checkout and patron detail pages so that sorting by title correctly
excludes articles.

To test, apply the patch and clear your browser cache.

- Check out to a patron who has multiple holds on titles which include
  leading articles like "a" "an" and "the."
- Click the holds tab and click the "title" column to sort by title.
  - The titles should be correctly sorted alphabetically while ignoring
    articles.

Signed-off-by: Sam Lau <samalau@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 365121cae2d4df41333d4e2144acfe8c8a82b9a9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34163: Handle both anonymous userenv when generating CSRF tokens
David Cook [Fri, 30 Jun 2023 02:50:17 +0000 (02:50 +0000)]
Bug 34163: Handle both anonymous userenv when generating CSRF tokens

An anonymous session might have a userenv which is undef or which is
a hashref of undef/empty values.

This patch generates the "anonymous" prefix for undef/empty 'id'
values, which prevents CSRF errors when logging in via OAuth2/OIDC
following a Koha logout.

Test plan:
Before applying patch:
1. Go to https://wiki.koha-community.org/wiki/Testing_SSO
2. Set up OpenID Connect realm, user, client, and Koha
integration to Keycloak for koha-testing-docker as noted in the wiki

3. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl?logout.x=1
4. Click on OIDC "Log in with XXXX" button and log into IDP
5. Note that you're not logged in and you instead see an error message like:
"There was an error authenticating to external identity provider wrong_csrf_token"

6. Apply patch
7. Go to "Sessions" section of the test realm in Keycloak
e.g. http://sso:8082/auth/admin/master/console/#/test/sessions
8. Click "Action" on the far right side of the screen
9. Choose "Sign out all active sessions"

After applying patch:
10. koha-plack --restart kohadev
11. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl?logout.x=1
12. Click on OIDC "Log in with XXXX" button and log into IDP
13. Note that you're logged in

14. prove t/Token.t
15. Note all tests pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f965db69f1b1aaa0afaf7a3a48723f7e87c5b32c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34731: (follow-up) Fix conditional variable declaration
Martin Renvoize [Mon, 11 Sep 2023 11:47:48 +0000 (12:47 +0100)]
Bug 34731: (follow-up) Fix conditional variable declaration

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 60d6d79b2232893ec84488bf17aa32adde8c01be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34731: Use Koha::Notice::Message in EnqueueLetter
Kyle M Hall [Thu, 7 Sep 2023 15:40:59 +0000 (11:40 -0400)]
Bug 34731: Use Koha::Notice::Message in EnqueueLetter

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Letters.t

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 c030a5e5408956e16675c03c9412e1f5be45e013)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34731: Don't call SendQueuedMessages if message_id is bad
Kyle M Hall [Thu, 7 Sep 2023 15:15:25 +0000 (11:15 -0400)]
Bug 34731: Don't call SendQueuedMessages if message_id is bad

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 e0b3a6c2aaee82e2af2d817a98db1a749bbd1116)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34731: Throw exception if SendQueuedMessages is passed a bad message_id
Kyle M Hall [Thu, 7 Sep 2023 15:04:32 +0000 (11:04 -0400)]
Bug 34731: Throw exception if SendQueuedMessages is passed a bad message_id

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Letters.t

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 7eb195b6bdd0bdbf5bfa92a71b051935f78d1db4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34448: Update the way we handle response in http-client.js
Pedro Amorim [Mon, 31 Jul 2023 14:57:06 +0000 (14:57 +0000)]
Bug 34448: Update the way we handle response in http-client.js

Test plan:
Before patch:
- Visit a non-existent ID i.e. /cgi-bin/koha/erm/agreements/999
- Visit a char ID i.e. /cgi-bin/koha/erm/agreements/abc

Apply patch:
Repeat above steps.

Run cypress tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34448: Update cypress tests
Pedro Amorim [Mon, 31 Jul 2023 15:04:09 +0000 (15:04 +0000)]
Bug 34448: Update cypress tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 months agoBug 34639: Restore order_by
Lari Taskula [Tue, 29 Aug 2023 19:14:56 +0000 (19:14 +0000)]
Bug 34639: Restore order_by

To test:
1. prove t/db_dependent/Koha/Item.t
2. Observe success

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 066c0b3e0de7b2d49f673cea0eddf67b3b5eb171)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34639: Use coderef for releationship
Nick Clemens [Tue, 29 Aug 2023 12:17:14 +0000 (12:17 +0000)]
Bug 34639: Use coderef for releationship

This patch switches from a simple relationship to a custom join as
illustrated in the DBIx::Class docs

Reference:
https://metacpan.org/pod/DBIx::Class::Relationship::Base#Custom-join-conditions

This does not include an order_by, so I am not sure if it is sufficient

To test:
1 - On command line:
    export DBIC_TRACE=1;
2 - Save simple script:
use Modern::Perl;
use Koha::Items;

my $items = Koha::Items->search( {'me.itemnumber'=>27}, {prefetch => 'current_branchtransfers'} );
my $item = $items->next;

warn $item->_result->current_branchtransfers->count();
warn $item->get_transfer();
3 - run it
4 - Note that the query doesn't include conditions on the transfers
5 - Apply patch
6 - Repeat
7 - Note that query is correct

Test in staf client:
1. Add an item to library A
2. Go to Circulation -> Transfer
3. Transfer the item from library A to another library B
4. Set your currently logged in library to library B
5. Check-in the item
6. Observe message "Item received from A"
7. View the bibliographic record of the item (catalogue/detail.pl)
8. Observe item in "In transit from A to B since xx/xx/xxxx Available"
9. Apply patch
10. Restart all
11. Reload details - item no longer in transit

Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 74b205649bbbf59ab512e71dcad8d13046a13670)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34639: Add tests
Lari Taskula [Tue, 29 Aug 2023 09:34:04 +0000 (09:34 +0000)]
Bug 34639: Add tests

To reproduce:

1. Add an item to library A
2. Go to Circulation -> Transfer
3. Transfer the item from library A to another library B
4. Set your currently logged in library to library B
5. Check-in the item
6. Observe message "Item received from A"
7. View the bibliographic record of the item (catalogue/detail.pl)
8. Observe item in "In transit from A to B since xx/xx/xxxx Available"

To test:
1. prove t/db_dependent/Koha/Item.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1395bc00eb6bd9ec3d3f36d970972dc960ae6de8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34310: Input prompt in datatables column search boxes untranslatable
Owen Leonard [Thu, 20 Jul 2023 11:24:23 +0000 (11:24 +0000)]
Bug 34310: Input prompt in datatables column search boxes untranslatable

This patch corrects the internationalization function wrapped around the
"% search" string in datatables.js. It should be the double-underscore
function instead of the single-underscore.

To test, apply the patch and test that the placeholder string is
translatable. In this example I'm testing fr-FR:

- Update a translation:

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

- Open the corresponding .po file for the strings pulled from
  JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
  - Locate strings pulled from prog/js/datatables.js for
    translation, e.g.:

    \#: koha-tmpl/intranet-tmpl/prog/js/datatables.js:894
    \#, javascript-format
    msgid "%s search"
    msgstr "%s recherche"

  - Install the updated translation:

    > perl translate install fr-FR

In the staff interface, test a page that has column header filters, e.g.
patron search. Confirm that the table of search results shows the
translated string in the column header placeholders.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c23f36b81218032ed2aa3f2f476fd880e2d1b704)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 28995: Update aliases
Martin Renvoize [Mon, 15 Nov 2021 09:35:04 +0000 (09:35 +0000)]
Bug 28995: Update aliases

Add an alias for added-before, added-after (Using an alias makes it
backwards compatible) and update the POD.

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 8f7d565df51ac65d7b20b489a416355442fb141b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 28995: Add `--added_after` filter to writeoff_debts script
Martin Renvoize [Tue, 9 Nov 2021 10:33:01 +0000 (10:33 +0000)]
Bug 28995: Add `--added_after` filter to writeoff_debts script

This adds, as requested, the `added_after` filter option to
writeoff_debts.

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 0a5f4350bdd85f1f8378970c1e7c8fb14f47f1a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34666: Tidy
Nick Clemens [Tue, 5 Sep 2023 14:38:38 +0000 (14:38 +0000)]
Bug 34666: Tidy

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fcf0ba17b55be93c4b63b1683ca2960e5edda0cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34666: Combine queries in _Findgroupreserve
Nick Clemens [Wed, 30 Aug 2023 18:56:59 +0000 (18:56 +0000)]
Bug 34666: Combine queries in _Findgroupreserve

The queries here are the same except for 2 differences:
1 - They check if the hold was on a particular item
2 - The latter confirms that the reserve item group matches the item's item group

For 1, it doesn't matter - only 1 item can be mapped ot a reserve, itemnumber is the primary key
for hold_fill_targets - so we are either matching it in the first query or the second, either way we get the same
reserve - the returns are the same so we don't care which query it came from

For 2, this has already been checked when the queue was built. We don't need to verify the match because
it wouldn't be in the targets if they didn't match

To test:
1 - Apply second unit test patch
2 - prove t/db_dependent/Reserves.t
3 - It should pass
4 - Apply this patch
5 - prove t/db_dependent/Reserves.t
6 - It continues to pass

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>
(cherry picked from commit 72bfb416d3725bd11dc4595ac429d4c510d6d3ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34666: Add a second unit test for item level
Nick Clemens [Wed, 30 Aug 2023 18:54:15 +0000 (18:54 +0000)]
Bug 34666: Add a second unit test for item level

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>
(cherry picked from commit 6f7ccdf6c3d4916ac19b7ace58068ff862a5ee24)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34666: Allow item_group to be null and still match
Nick Clemens [Wed, 30 Aug 2023 18:38:56 +0000 (18:38 +0000)]
Bug 34666: Allow item_group to be null and still match

The current logic requires that the grop ids match, but this eliminates null matches
from the group.

The fallout essentially is that the queue won't be checked to fill holds in cases of title level matches
where holds don't have an item group id. The queue checks the transport cost matrix while the check reserves
check does not, so this may have an impact on holds costs and delivery times

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

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>
(cherry picked from commit fe3872f62885b4b0ee483e446c0b2b85e74970f7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34666: Unit test
Nick Clemens [Wed, 30 Aug 2023 18:29:27 +0000 (18:29 +0000)]
Bug 34666: Unit test

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>
(cherry picked from commit 99d7e55be67332fea1ced61ddf8105b4261923d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34339: (QA follow-up) Replace new by search in Licenses
Marcel de Rooy [Fri, 8 Sep 2023 06:16:44 +0000 (06:16 +0000)]
Bug 34339: (QA follow-up) Replace new by search in Licenses

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6f5915cf01b711d3a20af2634c9eb2a07d1bd289)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34339: Avoid relying on $c->validation - ERM
Jonathan Druart [Fri, 21 Jul 2023 14:35:05 +0000 (16:35 +0200)]
Bug 34339: Avoid relying on $c->validation - ERM

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dd8b3c3da77562569b397c208d112107c4490bf2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34339: (bug 33556 follow-up) Easy ERM-related changes
Tomas Cohen Arazi [Thu, 8 Jun 2023 16:27:13 +0000 (13:27 -0300)]
Bug 34339: (bug 33556 follow-up) Easy ERM-related changes

I left the (easy) ERM cases out because it throws this when running the
QA script:

Processing files before patches
|========================>| 51 / 51 (100.00%)

An error occurred : Inconsistent hierarchy during C3 merge of class 'Koha::REST::V1::ERM::EHoldings::Titles::Local':
current merge results [
Koha::REST::V1::ERM::EHoldings::Titles::Local,
]
merging failed on 'Mojolicious::Controller' at /kohadevbox/qa-test-tools/koha-qa.pl line 112.

and didn't want this to pollute the rest of the changes.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5788f94868bde660179a183382aad42e9e3b40be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34038: Fix incorrect use of __() in .tt and .inc files
Owen Leonard [Fri, 16 Jun 2023 14:29:42 +0000 (14:29 +0000)]
Bug 34038: Fix incorrect use of __() in .tt and .inc files

This patch corrects instances of the double-underscore function being
used in .tt and .inc files where the single-underscore function should
be used instead.

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 for JavaScript strings, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the strings are now in the .po file for translation. You
  should find these lines:

- koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc: "No
  title."
- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt:
  "Check in and add to bundle"
  "Ignore holds and add to bundle"
- koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt:
  "Please enter only a barcode, or only a biblionumber."
- koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt:
  "Please enter only barcodes, or only biblionumbers."
- koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt:
  "Please specify a content for 'Default'"

- Check fr-FR-opac-bootstrap.po for these lines:

- koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc:
  "Please enter a valid date (should match %s)."
- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt:
  "No item was selected"
- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt,
  koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt,
  koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt:
  "No item was selected"

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d1d9f4698eb2f959964d83d22b2079f07286a7c4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34223: (QA follow-up) Fix file permissions
Tomas Cohen Arazi [Wed, 6 Sep 2023 19:47:09 +0000 (16:47 -0300)]
Bug 34223: (QA follow-up) Fix file permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 93dd749ecaf229a8860ba078668190e5bbfd61c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34223: (follow-up) Mock backend in tests
Pedro Amorim [Thu, 27 Jul 2023 14:20:11 +0000 (14:20 +0000)]
Bug 34223: (follow-up) Mock backend in tests

Add a new request with a backend specific status

Signed-off-by: Pedro Amorim <pedro.amorim@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 b00806774d3353086fc7c7e3def22f4de570c795)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34223: Add unit test for existing_statuses
Martin Renvoize [Thu, 27 Jul 2023 12:20:13 +0000 (13:20 +0100)]
Bug 34223: Add unit test for existing_statuses

This patch adds a unit test for the 'existing_statuses' method.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@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 cda13a73284ce049535f782dad794c6593e55ba9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34223: (follow-up) Restore status_alias handling
Pedro Amorim [Thu, 27 Jul 2023 11:25:20 +0000 (12:25 +0100)]
Bug 34223: (follow-up) Restore status_alias handling

By reducing the original call to all distinct 'status' we also removed
the status_alias combinations. This patch adds an additional distinct
query to fetch all 'status_alias' and add them to the returned data
structure.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b67a4f8549d03a43ca771acc205779a78708240d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34223: Work around ONLY_FULL_GROUP_BY in Illbackend
Martin Renvoize [Mon, 10 Jul 2023 17:03:34 +0000 (17:03 +0000)]
Bug 34223: Work around ONLY_FULL_GROUP_BY in Illbackend

This patch re-works the query in the existing_statuses method to remove
the FIXME and improve performance.  We pass an SQL literal into the
query to make it explicit which illrequest_id we're looking for (which
dampens the SQL warning) even though we really don't mind which request
is returned here.

Test plan:

The following command will (hopefully) reset your ILL data and create 10k fake ILL requests (run this in DEV KTD only).

1) On an empty k-t-d, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev-data.sh)
2) Pet a cat
3) Visit /cgi-bin/koha/ill/ill-requests.pl and select a backend on the left side filters
4) Notice how the status filter takes a while (3-5 secs) to load
5) Apply patch and koha-plack --restart kohadev
6) Repeat 3, notice how the status filter now loads fast

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 87d1b1fdb61ea27effbac654d55923bf6abbe1ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34685: Make updatedatabase.pl propagate the error
Jonathan Druart [Fri, 1 Sep 2023 07:10:52 +0000 (09:10 +0200)]
Bug 34685: Make updatedatabase.pl propagate the error

updatedatabase.pl already return 0 even if an error occurred during the upgrade.

Test plan:
Adjust a db rev to make it fail and modify the value of the syspref 'version' in DB to
make the db rev run.

Run updatedabase.pl and `echo $?`

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 531fb2c9fd2e8b38ac1c6ef21be047bbb0358d7a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34684: Prevent 220600007.pl to fail if run twice
Jonathan Druart [Thu, 31 Aug 2023 15:05:57 +0000 (17:05 +0200)]
Bug 34684: Prevent 220600007.pl to fail if run twice

The error is
  ERROR 1292 (22007): Truncated incorrect DECIMAL value: 'no'

Happens on MariaDB 10.5.22, not MySQL 8

Test plan:
update systempreferences set value="0" where variable="DisplayClearScreenButton";
play installer/data/mysql/db_revs/220600007.pl
select value from systempreferences where variable="DisplayClearScreenButton";
=> "no"

update systempreferences set value="1" where variable="DisplayClearScreenButton";
play installer/data/mysql/db_revs/220600007.pl
select value from systempreferences where variable="DisplayClearScreenButton";
=> "issueslip"

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 027e1e18620e3c790e85ea49b3870f9ee7785871)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 30451: DBIC schema
Tomas Cohen Arazi [Wed, 6 Sep 2023 17:58:28 +0000 (14:58 -0300)]
Bug 30451: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9bb23b7d5e3606dad6e9b3976c3a1fad1cc2087a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 23548: (QA follow-up) tidy up code
Victor Grousset/tuxayo [Thu, 31 Aug 2023 21:00:46 +0000 (23:00 +0200)]
Bug 23548: (QA follow-up) tidy up code

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c6971d50cefa376df3a760519d1d9a8da1f5d71)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 23548: Set AQ to empty when item not exist
Per Larsson [Wed, 18 Sep 2019 08:50:37 +0000 (10:50 +0200)]
Bug 23548: Set AQ to empty when item not exist

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2256a8532335f763346f13698cb840dd97ecafa3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 23548: Unit test - Set AQ to empty when item not exist
Matthias Meusburger [Thu, 17 Aug 2023 12:26:39 +0000 (12:26 +0000)]
Bug 23548: Unit test - Set AQ to empty when item not exist

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1cd82e29b5ceec08cf77f8c24497b1def1ee3c7e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34036: Reload 'already received' table when edit modal closed
Aleisha Amohia [Thu, 31 Aug 2023 22:31:36 +0000 (22:31 +0000)]
Bug 34036: Reload 'already received' table when edit modal closed

Bug 33784 introduced a fix that prevents the 'already received' table from reloading completely if the modal is hidden and there is only one order in the table. This appears to assume that the 'hidden modal' event is only triggered if the receive form is cancelled, but the 'hidden modal' event is also triggered when the receive form is submitted. This means that the table isn't redrawn when the form is submitted and there's one order already received, so the next order does not show in the table when the page reloads.

To test:
1. Set up a vendor, budget, fund, and create a new basket.
2. Add two orders (two different records) to this basket.
3. Close the basket and go to receive the orders.
4. Once on the 'Receive orders' page, use the checkboxes in the Pending orders table to receive both orders at once. Choose the 'Receive selected' button
5. Click Edit for the first order, receive the item and click 'Next order'. Receive the next item and click 'Save changes'. Then Confirm
6. Both orders should now show under Already received. Click Cancel receipt for one of the orders. It should go back to Pending orders.
7. Click Receive for the now pending order. Receive the item and Confirm.
8. Notice that the page appears to reload but the order doesn't show under Already received with the other order. The order also no longer shows under Pending orders.

9. Apply the patch and restart services. Reload the page. Cancel receipt of the order again.
10. Click Receive for the now pending order. Receive the item and Confirm.
11. The Already received table should reload so that both orders now show under Already received.
12. Click Cancel receipt for the order.
13. Click Receive for the now pending order, then Cancel without receiving the item.
14. Confirm the page loads as expected with one pending order and one already received order.

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aea3ad0b7bbe900840998d3e6597328708350b05)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34109: Check mandatory item fields when creating during recipt
Nick Clemens [Fri, 4 Aug 2023 14:13:25 +0000 (14:13 +0000)]
Bug 34109: Check mandatory item fields when creating during recipt

This patch adds a check of mandatory item fields before saving during order receipt.
We check both when adding the item initially, and when submitting the order, as it will use
the values from the open form.

To test:
* Go to administration > frameworks > ACQ > MARC structure > 952
* Set callnumber (o) or barcode (p) to mandatory
* In acquisition:
* Create a basket with "create items on order" and "is standing"
  "standing" helps as you can do multiple receives testing different things,
  but is optional
* Add an order line
* Receive shipment
* Verify the mandatory fields show in the item form
* Set itemtype = Music
* Save with the fields blank
* Item row is added, no warning
* Edit the item, change the item type to blank
* Click 'Confirm' for the order without closing the item edit form
* Verify the item was added with itemtype Books (on sample data) and empty mandatory field
* Apply patch
* Repeat above, however, you should not be able to submit the item or order until mandatory fields are filled

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eaab32eb0ee100752bee8822a367144157c69c51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34641: Fix Novelist display when NovelistSelectView is set to below
Lucas Gass [Tue, 29 Aug 2023 15:45:39 +0000 (15:45 +0000)]
Bug 34641: Fix Novelist display when NovelistSelectView is set to below

To test:
1. Have Novelist credentials:  NovelistSelectProfile,  NovelistSelectPassword.
2. Enable  NovelistSelectEnabled
3. Set  NovelistSelectView to 'below holdings table'.
4. Find a record on the OPAC that would have Novelist content. It does
   not display.
5. Set  NovelistSelectView to any except 'below holdings table'. Notice it displays the content.
6. APPLY PATCH
7. Try steps 1 -5 again, this time when NovelistSelectView is set to
   'below' the content should properly display.

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>
(cherry picked from commit 0663e692cf022611a0be2c3e5ef5beb7eac10e5e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 22135: Display 'shelved out of order' error in inventory CSV export
Katrin Fischer [Mon, 29 May 2023 15:41:44 +0000 (15:41 +0000)]
Bug 22135: Display 'shelved out of order' error in inventory CSV export

When using the inventory tool with an uploaded barcode file
and checking the "Compare barcodes list to results",
"Check barcodes list for items shelved out of order" and
"Export to CSV file" checkboxes, the resulting CSV file showed
a blank in the "problem" column for items with out of order
callnumbers. With this patch, you'll see "Shelved out of order".

To test:
* Create 3 items with callnumbers and barcodes a, b, and c
* Go to Cataloguing > Inventory
* Enter a c b (each on its own line) into the barcode field
* Check "Compare barcodes list to results"
* Check "Check barcodes list for items shelved out of order"
* Check "Export to CSV file" (at the bottom)
* Verify the file has empty lines in the problem column
* Apply patch
* Repeat test, the empty lines should now read: "Shelved out of order"

Note: Also fixes "problem" to "Problem" to make capitalization
consistent. All those strings are currently not translatable,
this will be filed separately.

Co-authored-by: Mark Alexander <marka@pobox.com>
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>
(cherry picked from commit 5d35c3596da488b61f49fd605872de02f0f31fe4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34620: Do not throw expection if payment type is writeoff
Lucas Gass [Fri, 25 Aug 2023 15:49:09 +0000 (15:49 +0000)]
Bug 34620: Do not throw expection if payment type is writeoff

To test:
1. Turn on RequirePaymentType
2. Create a manual invoice and then attempt to write it off.
3. 500 error
4. Turn of RequirePaymentType, no error.
5. Apply patch, restart_all
6. Try step 2 again, you should not get an error
7. prove t/db_dependent/Koha/Account.t
8. Make sure tests pass

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>
(cherry picked from commit d77aa887e4b9df61493837b9d88a80537c525471)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34625: Fix search engine configuration tables header problem
Owen Leonard [Mon, 28 Aug 2023 12:26:51 +0000 (12:26 +0000)]
Bug 34625: Fix search engine configuration tables header problem

This patch corrects the JavaScript which allows DataTables to be created
and destroyed based on which tab is clicked on the search engine
configuration page. When you click from one tab to the other, the
original tab's DataTable should be destroyed and the new tab's DataTable
initialized.

To test, apply the patch and go to Administration -> Search engine
configuration (Elasticsearch)

- The page should load with the "Search fields" tab enabled and the
  DataTable initialized: Sorting and filtering should work. If you
  scroll down the page the floating table header should be correct.
- Switch to the "Bibliographic records" tab. This table should have
  filtering enabled, and the floating table header should work when you
  scroll down the page.
- The same should be true for the "Authorities" tab.
- Return to the "Search fields" tab to confirm that the DataTable is
  still working as expected.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cac122b6117d10f58fefa437a67b9f23ed9ab947)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34569: (QA follow-up) Tidy block
Tomas Cohen Arazi [Fri, 1 Sep 2023 15:04:23 +0000 (12:04 -0300)]
Bug 34569: (QA follow-up) Tidy block

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a707d10d8017cad5333a2eb5c0be784004874cd6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34569: Fix misc/cronjobs/holds/holds_reminder.pl trigger arg
Fridolin Somers [Thu, 17 Aug 2023 20:42:31 +0000 (10:42 -1000)]
Bug 34569: Fix misc/cronjobs/holds/holds_reminder.pl trigger arg

misc/cronjobs/holds/holds_reminder.pl help says one can use arge -t for --triggered
But not implemented in code.
Should be like in misc/cronjobs/overdue_notices.pl :
  't|triggered'    => \$triggered,

Test plan :
Play with misc/cronjobs/holds/holds_reminder.pl with arg -t and
--trigger

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 f4f4feb50b3d2b58b9212b692daf2c4e3e000b7d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34634: Show expirationdate of expired holds on reserve/request.pl
Lucas Gass [Mon, 28 Aug 2023 22:24:24 +0000 (22:24 +0000)]
Bug 34634: Show expirationdate of expired holds on reserve/request.pl

To test:
1. Place some holds and go to /reserve/request.pl for that bib.
2. If the reserves.expirationdate is set to today or some date in the past the date does not display in the Flatpickr instance.
3. Change the reserves.expirationdate to sometime in the future, the date displays.
4. Aply patch, restart_all
5. Try steps 2-3 again.
6. This time if the expiration date is in the past you should see it displayed. However it will be uneditable.
7. Make sure holds with a expiration date in the future can still be properly edited.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Christine <chlee@pascolibraries.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0710ccb606faba126acb7b7e62b2868b6a28cbb5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34583: Overdue notice - wrong coding in outlook in czech e-mail in “print” mode
Petr Svoboda [Tue, 22 Aug 2023 13:13:18 +0000 (15:13 +0200)]
Bug 34583: Overdue notice - wrong coding in outlook in czech e-mail in “print” mode

Koha overdue notice “print” email in Outlook is incorrectly encoded in czech language.
Tested in KohaTestingDocker - https://gitlab.com/koha-community/koha-testing-docker
This patch fixes that error.

Test plan:
Overdue notice, set print in UI, https://snipboard.io/FLkIxf.jpg.

Message body:
<table style="padding:0; margin: 0; border-collapse: collapse; font-family: 'Trebuchet MS', Helvetica, sans-serif; width: 100%; "><tr><td style="vertical-align: top; padding: 0"> </td><td style="width: 75mm; vertical-align: top;"><table style="margin-top: 2.5cm; font-size: 11pt;"><tr><td><<borrowers.cardnumber>></td></tr><tr><td><<borrowers.firstname>> <<borrowers.surname>></td></tr><tr><td><<borrowers.address>> <<borrowers.streetnumber>></td></tr><tr><td><<borrowers.city>></td></tr><tr><td><<borrowers.zipcode>></td></tr></table></td></tr><tr><td colspan="2" style="padding: 0;"><table style="width: 100%; margin: 3cm 0 0 0;"><tr><td style="width: 5mm; height: 5mm; border-bottom: 1px dotted #000;"> </td><td style="height: 1mm;"></td><td style="width: 5mm; height: 1mm; border-bottom: 1px dotted #000;"> </td></tr></table></td></tr><tr><td colspan="2"><table><tr><td style="padding: 0.5cm 0.3cm">V Chrudimi dne <<today>></td></tr><tr><td style="padding: 0 0.3cm">Upozorňujeme Vás, že byla již o 30 dnů překročena doba, na kterou jsme Vám půjčili dokumenty (celkem<<count>>). Žádáme Vás o brzké vrácení těchto výpůjček:</td></tr><tr><td style="padding: 0.5cm 0.3cm;"><table><tr><th>Od</th><th>Do</th><th>Název</th><th>Autor</th><th>Částka</th></tr><item><tr><td><<issues.issuedate>></td><td><strong><<issues.date_due>></strong></td><td><<biblio.title>></td><td><<biblio.author>></td><td><<items.fine>> Kč</td></tr></item></table></td></tr><tr><td style="padding: 0 0.3cm">Zpozdné je účtováno dle ceníku knihovny.</td></tr><tr><td style="padding: 0 0.3cm">Dokumenty můžete vrátit na jakémkoli oddělení knihovny a pobočce v jejich provozní době.</td></tr><tr><td style="padding: 0 0.3cm">Nesplní-li čtenář svou povinnost vyrovnat závazky s knihovou, má knihovna právo postupovat podle příslušných ustanovení občanského zákoníku.</td></tr></table></td></tr></table>

Set delay 1 day, https://snipboard.io/boAd3F.jpg.

Checkout any book.

Set in database issues->date_due = today() - 1
for checkouted book, https://snipboard.io/PrylGB.jpg.

Run this scripts:

koha-shell kohadev -c "/kohadevbox/koha/misc/cronjobs/overdue_notices.pl -v -t"

You must have KOHA set up for sending e-mails (SMTP server). Replace xxx@email.cz to your e-mail and run this script:

koha-shell kohadev -c "/kohadevbox/koha/misc/cronjobs/gather_print_notices.pl /var/spool/koha/kohadev/ --email xxx@email.cz"

Signed-off-by: Michal Denar <black23@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 7c3a0b9131f3a0df92d1aba4b2548ab3ffbc9980)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34266: Add unit tests
Julian Maurice [Thu, 13 Jul 2023 08:58:42 +0000 (10:58 +0200)]
Bug 34266: Add unit tests

Signed-off-by: joubu <xxx@example.org>
Signed-off-by: tuxayo <victor@tuxayo.net>
Took the opportunity to perltidy this file as I was signing off

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Added a rollback. Shouldnt harm :)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3d0e443ce7a90687077c73b5d5a7116d4401d71)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34266: Default to biblioitems.itemtype only if it's a valid itemtype
Julian Maurice [Thu, 13 Jul 2023 07:22:44 +0000 (09:22 +0200)]
Bug 34266: Default to biblioitems.itemtype only if it's a valid itemtype

biblioitems.itemtype can contain values that are not itemtypes (for
instance if the MARC field mapped to it uses another authorised value
category)
This patch checks that before using it as a default value for the
'itemtypes' item subfield.

Test plan:
0. Do not apply the patch yet
1. Change your MARC framework so that the field linked to
   biblioitems.itemtype uses an authorised value category different from
   'itemtypes'
2. Make sure that you have an item subfield linked to the authorised
   value 'itemtypes' in your MARC framework
3. Create a biblio with an itemtype (using a value that is NOT an item
   type, but a value from the authorised value category you selected in
   step 1)
4. Create a new item for this biblio. Notice that the biblio itemtype is
   automatically selected for the 'itemtypes' subfield
5. Apply the patch
6. Create a new item for the same biblio. Now the 'itemtypes' subfield
   should be empty.
7. Revert the change at step 1 so that your biblioitems.itemtype MARC
   field uses the 'itemtypes' AV category
8. Modify your biblio to use a valid item type.
9. Create a new item. The biblio itemtype should be used as a default
   value

Signed-off-by: joubu <xxx@example.org>
Signed-off-by: tuxayo <victor@tuxayo.net>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 807c58d28d7be4fa1a9606cd6cf2f59f661249ec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34617: Preserve calculated expiration dates if set to update on import whether...
Nick Clemens [Fri, 25 Aug 2023 14:51:28 +0000 (14:51 +0000)]
Bug 34617: Preserve calculated expiration dates if set to update on import whether column included or not

To test:
1 - Setup a csv with column headers:
    surname firstname branchcode categorycode cardnumber dateenrolled
2 - add values
    Acosta Edna CPL PT 23529001000463 02/01/2013
3 - Set PT catgeory enrollement period to a specific date in the future
4 - Import the file and overwrite patrons and update dateexpiration
5 - Check Edna, note her date is not correct
6 - Apply patch
7 - Repeat
8 - Expiration date is now set as expected

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>
(cherry picked from commit ed2b395a1084d9c064e1631f3f68215ce9df7702)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34617: Unit tests
Nick Clemens [Fri, 25 Aug 2023 14:51:23 +0000 (14:51 +0000)]
Bug 34617: Unit tests

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>
(cherry picked from commit b38780f6cb0ec0cddc0fdbf8cc2c1a3c6dcecfb6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34646: Fix two attributes class in OPAC masthead-langmenu.inc
Fridolin Somers [Tue, 29 Aug 2023 17:59:05 +0000 (07:59 -1000)]
Bug 34646: Fix two attributes class in OPAC masthead-langmenu.inc

In OPAC template masthead-langmenu.inc a link as two class attributes :
  <a class="dropdown-item" href="#" tabindex="-1" class="menu-inactive" role="menuitem">

Test plan :
1) Go to OPAC with at least one translation
2) Look at HTML source code
=> Without patch you see a link with 2 class attributes
=> With patch you see the 2 classes in same class attribute

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>
(cherry picked from commit 8c63a4bb049b663bb94769b5f5e78ba85ca9918f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 33744: Fix cloning (sub)fields with framework plugins
Matt Blenkinsop [Tue, 16 May 2023 11:14:01 +0000 (11:14 +0000)]
Bug 33744: Fix cloning (sub)fields with framework plugins

This patch is meant as a temporary measure for fixing the problem.
Bug 30975 may resolve it further, but this is good for now.

Note: The original commit message referred to removing a deprecated internal
structure. But this patch actually still uses the structure which has been
moved to _data in jQuery now.

Test plan:
1) Apply patch
2) Repeat steps in the original bug description
3) This time clicking on the Upload button for a cloned field should launch the uploads pop up.

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>
(cherry picked from commit 2fa6105779d02e9b7fa81bc0ea47bff51e9f3170)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34650: Convert list toolbar delete into form POST
David Cook [Wed, 30 Aug 2023 00:28:53 +0000 (00:28 +0000)]
Bug 34650: Convert list toolbar delete into form POST

This patch adds a HTML form with a CSRF token to POST the list delete,
which is triggered by a click handler on the A element. The A element
is still needed for existing style reasons.

Test plan:
0. Apply patch
1. koha-plack --reload kohadev
2. In the staff interface, add a list
3. Go into that list (e.g. virtualshelves/shelves.pl?op=view&shelfnumber=X)
4. From the toolbar click the "Edit" dropdown
5. From the dropdown try either "Edit list" or "Delete list"
6. Note no CSRF error and operation completes as expected

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5d3b7cf08949d5776b732f24cefcbe377260c281)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34650: Remove unnecessary CSRF check on edit_form
David Cook [Wed, 30 Aug 2023 00:07:23 +0000 (00:07 +0000)]
Bug 34650: Remove unnecessary CSRF check on edit_form

The op "edit_form" doesn't change state. It just renders the edit
form. Therefore, it doesn't need a CSRF token/check.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit caf962fbaa4f52bfea12acfa02671cd6920f7a53)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34609: Add missing test for Koha::Hold->biblio
Jonathan Druart [Thu, 31 Aug 2023 07:03:31 +0000 (09:03 +0200)]
Bug 34609: Add missing test for Koha::Hold->biblio

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7cab415f0b3d363761e773c728e976470c81337a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34609: Add biblio method to Old::Hold
Pedro Amorim [Wed, 30 Aug 2023 13:12:31 +0000 (13:12 +0000)]
Bug 34609: Add biblio method to Old::Hold

Test plan, clean k-t-d:

1) Add a reserve to koha/koha user, mysql run:
insert into reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, biblionumber)
VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 76);

2) Add an old_reserve to koha/koha user, mysql run:
insert into old_reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, reserve_id)
VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 1);

3) Visit holdshistory on either OPAC (requires OPACHoldsHistory sys pref) or STAFF
STAFF/cgi-bin/koha/members/holdshistory.pl?borrowernumber=1
OPAC//cgi-bin/koha/opac-holdshistory.pl

4) Notice it blows up with a 500 error
5) Repeat step 3

Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7b57163ef32e08179acd76b245b1b4f49aa93875)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34609: Add tests
Pedro Amorim [Wed, 30 Aug 2023 13:13:04 +0000 (13:13 +0000)]
Bug 34609: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eaa1a1d7e29d1421bf58f8215994e9ddfe8cdefa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34466: Add listener to enable or disable clear filter button on KohaTable.vue
Pedro Amorim [Thu, 31 Aug 2023 16:18:56 +0000 (16:18 +0000)]
Bug 34466: Add listener to enable or disable clear filter button on KohaTable.vue

Test plan:
Apply only the cypress test patch
Run KohaTable_spec.ts
Notice it fails

Apply this patch, repeat

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5316b4c9cc1138c21a8ff05d2599784e2f6139ca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34466: Cypress tests
Pedro Amorim [Thu, 31 Aug 2023 16:14:45 +0000 (16:14 +0000)]
Bug 34466: Cypress tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 68baf8a7c13e77dc8fa5208665044498fa3f936c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34616: Move default server info outside the <fieldset>
Pedro Amorim [Fri, 25 Aug 2023 16:41:12 +0000 (16:41 +0000)]
Bug 34616: Move default server info outside the <fieldset>

Also DRY current default information dialog block

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 fb47d04efd0987bb173fb78d12c439d82e4e83ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34616: Fix showing default server info on edit SMTP server page
Pedro Amorim [Fri, 25 Aug 2023 16:36:20 +0000 (16:36 +0000)]
Bug 34616: Fix showing default server info on edit SMTP server page

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 f0383e5f6a8025f6b50bdb32a287456375800e60)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34616: Add native bootstrap behaviour to default server dialog
Pedro Amorim [Fri, 25 Aug 2023 14:14:35 +0000 (14:14 +0000)]
Bug 34616: Add native bootstrap behaviour to default server dialog

Test plan:
Create a new SMTP server
Tick the 'default server' checkbox
Verify it now has a backdrop, closes if u click the backdrop or press 'esc'
The Yes and No buttons are now styled properly

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 b9d3997063344dcd04f6fac4810a9d3576c9e4c2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002
Jonathan Druart [Wed, 30 Aug 2023 14:21:37 +0000 (16:21 +0200)]
Bug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.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 352a2afd0bf1b67c4c579d299c088604d131ae1a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
9 months agoBug 31964: add a man page for koha-z3950-responder
Andreas Roussos [Sun, 27 Aug 2023 23:42:49 +0000 (23:42 +0000)]
Bug 31964: add a man page for koha-z3950-responder

The koha-z3950-responder command does not have a man page.

This patch fixes that.

Test plan:

1) Apply this patch.

2) Run the following command to generate the new man page:

   xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/manpages/docbook.xsl debian/docs/koha-z3950-responder.xml

3) View the generated man page with `man -l koha-z3950-responder.8`

   (KTD users may need to `apt-get install man-db` first as
   that package provides tools for reading manual pages)

4) Make sure this unit test passes:

   prove -v xt/verify-debian-docbook.t

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.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 eb902d7a92b2e435890cff78c9c118a2a8280fa7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34066: Datatable options don't fully translate on list of saved reports
Owen Leonard [Wed, 21 Jun 2023 13:30:57 +0000 (13:30 +0000)]
Bug 34066: Datatable options don't fully translate on list of saved reports

This patch corrects the DataTable option for defining an alternate
language string when no records are returned by a table filter. An
obsolete version of the option name was breaking the existing custom
option supplied by our datatables.js

To test, apply the patch and go to Reports -> Use saved..

 - In the DataTable of existing reports, all the DataTable controls
   should look correct.
 - In the filter field at the top of the table, enter a string which
   will not be found. You should see a message, "No matching reports
   found."
 - Install another language if necessary, and switch to that language.
 - The labels on all the DataTable controls should show the terms which
   have been translated for that language.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e26d7c783eb8c70d318e402e3a90930afcff44cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34465: Make KohaTable.vue actions column not sortable
Pedro Amorim [Fri, 25 Aug 2023 10:28:58 +0000 (10:28 +0000)]
Bug 34465: Make KohaTable.vue actions column not sortable

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 60cf53cf798b16138b53d6012f083caee06941f3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34522: Pass the suggestion branchcode, not the suggester branchcode
Lucas Gass [Fri, 11 Aug 2023 20:53:44 +0000 (20:53 +0000)]
Bug 34522: Pass the suggestion branchcode, not the suggester branchcode

To test:
1. Turn on OPACViewOthersSuggestions
2. Log into OPAC as patron of Branch A
3. Make purchase suggestion for Branch B
4. Refresh /cgi-bin/koha/opac-suggestions.pl and see that suggestion appears to have been made for Branch A
5. View suggestion from staff client - See that it accurately reflects suggestion having been made for Branch B
6. Apply patch and try steps 2 - 5 again, this time you should see the proper branch.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cb4db13612da28c3a04114fbdb2c7005c13631ef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34571: Remove use of "onclick" for ExpandField in cataloguing editors
David Cook [Fri, 18 Aug 2023 04:32:31 +0000 (04:32 +0000)]
Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors

This change replaces the onclick HTML attribute with a Javascript binding
to make it more in line with Koha conventions and make it CSP compatible.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=#
2. Try hiding/unhiding fields
3. Try cloning fields and hiding/unhiding those too
4. Note that everything works as expected
5. Do the same thing for authorities by going to
http://localhost:8081/cgi-bin/koha/authorities/authorities.pl?authtypecode=#

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 8341ffe13db350f3d0c623e1f6ff6671e1944d82)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34570: Remove use of "onclick" for PopupMARCFieldDoc()
David Cook [Fri, 18 Aug 2023 03:02:30 +0000 (03:02 +0000)]
Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc()

This change removes the "onclick" attribute for the MARC doc
link in the cataloguing editor.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=#
2. Click on the question mark (?) next to any of the MARC fields
3. Press the "Repeat this tag" button
4. Click on the question mark (?) on the cloned MARC field
5. Note that both times it worked

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>
(cherry picked from commit 0b992dd12ed657a9af516bac6a507bab395e9add)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34592: Patron Search filter fields needs to be at least an empty array
Michael Hafen [Thu, 24 Aug 2023 16:27:36 +0000 (10:27 -0600)]
Bug 34592: Patron Search filter fields needs to be at least an empty array

If buildPatronSearchQuery() doesn't return an empty array when it exits
early, then the code that adds the sort fields to the filters will fail.

Test plan:

- If there is not all ready a patron with a sort1 or sort2 value from
  the bSort1 or bSort2 authorized values, add an authorized value if
  necessary.
- Add a patron if necessary, and set the patrons sort field to the added
  value.
- In Tools -> Patron card creator start a new card batch.
- Click on Add Patron(s) to open the patron search window.
- Pick the value in either the sort1 or sort2 drop down.
- Submit the page.  The page will reload and there won't be results.
- Apply the patch, close the patron search window, clear the browser
  cache, reload the "New patron card batch" page, and open the patron
  search window again.
- Repeat the search. There will be results.

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 275197f4052c1695994a978b9ade04b6fc38e910)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34115: Use a global tab select function for activating Bootstrap tabs based on...
Owen Leonard [Fri, 23 Jun 2023 16:02:43 +0000 (16:02 +0000)]
Bug 34115: Use a global tab select function for activating Bootstrap tabs based on location hash

This patch fixes automatic tab selection by location.hash in the MARC
subfield editor. This allows links which target a specific subfield to
open the page with the subfield tab selected.

I've put this into a global function since it can be reused in multiple
places: The about page and the checkout page have variations of this
functionality which can be replaced with this function.

The patch also corrects two links in Koha pointing to the About
page which included the wrong location hash (changed in the switch to
Bootstrap tab wrappers).

To test, apply the patch and go to Adminstration -> Bibliographic
frameworks.

- View the MARC structure for any framework.
  - In the "Search for tag" input field, submit a tag and subfield which
    will be found in that framework, e.g. "245$a"
  - When you submit the form you should be sent to the MARC subfield
   structure page for that tag with the subfield tab automatically
   selected.
- View the MARC subfield structure for any framework.
  - In the table of subfields, click the subfield link in the first
    column. You should be taken to the edit form with the corresponding
    tab selected.
- Go to Circulation and check out to a patron. Append a tab anchor to
  the URL, e.g. "#holds_panel" and submit. You may have to shift-reload
  the page to see the change. (As far as I know no links in Koha take
  advantage of this)
- Perform the same test on the patron detail page
- Go to the About page and perform the same test with a tab anchor like
  "#team_panel" or "#sysinfo_panel"

Signed-off-by: Sam Lau <samalau@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 cb6dd4e82be67977c5f58f10639a0e6f39219c0e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34095: Adjust logic so that shipment cost is empty if the receiving shipment...
Laura Escamilla [Fri, 11 Aug 2023 15:36:20 +0000 (15:36 +0000)]
Bug 34095: Adjust logic so that shipment cost is empty if the receiving shipment cost is blank.

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a5cadff4829eb62624ac839799b9b13c8cc7eac6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34445: Set default budget in addorderiso2709.pl
Matt Blenkinsop [Mon, 31 Jul 2023 09:48:18 +0000 (09:48 +0000)]
Bug 34445: Set default budget in addorderiso2709.pl

This patch allows the default budget to be used as a fallback if no budget is selected. Currently the default budget is set using lines 129-133 but then is never used.

QA follow-up:
- perl tidied
- budget_codes changed to budget_ids for consistency

Test plan:
1) Apply patch
2) restart_all
3) Follow the steps from the bug description
4) Order lines should be added properly

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Rearranged comments
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b3427f71aede6cf0c8915c1b3e0ef970d2f188de)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34307: (follow-up) Use template wrapper for title tag
Owen Leonard [Mon, 21 Aug 2023 12:34:43 +0000 (12:34 +0000)]
Bug 34307: (follow-up) Use template wrapper for title tag

This patch updates the title tag to use a wrapper too, since Bug 33906
is in the process of getting fixed.

The patch also removes an extra <span> tag: Only the translatable string
needs the span, not the entire line.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 62a757acd1d370f442f49992933f998bb5b3702e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34307: (QA follow-up) add <span> to have cleaner strings for i18n
Victor Grousset/tuxayo [Sun, 20 Aug 2023 02:22:44 +0000 (04:22 +0200)]
Bug 34307: (QA follow-up) add <span> to have cleaner strings for i18n

Cleaner strings are extracted this way.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a6ec493647f29843eed0fc9f7937944f2f39562c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34307: Update plugin template to match master conventions
David Cook [Wed, 19 Jul 2023 05:35:35 +0000 (05:35 +0000)]
Bug 34307: Update plugin template to match master conventions

This change uses WRAPPER to build the breadcrumbs and
updates the plugin template to follow some other master conventions
like differentiating between Administration and Tools for plugins.

Test plan:
0. Apply patch
1. Upload koha-plugin-test-wrapper
2. Enable the plugin
3. Click "Actions" and click "Run tool"
4. Note how the plugin page looks like a perfect Koha Tools page
5. Note that the plugin only contains 6 lines of template code
to achieve this effect

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 e8a48054354613f96565a22c610145b0e946fc02)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34340: Changed "Tendered" to the correct input id which is "Collected"
Laura Escamilla [Fri, 21 Jul 2023 13:30:00 +0000 (13:30 +0000)]
Bug 34340: Changed "Tendered" to the correct input id which is "Collected"

Must also apply bug 34332 - fixed a syntax error for the pos email template

To test:
1. Configure your Koha to enable the point of sale system (i.e. enable syspref,
   set up a register, set up an item to sell).
2. Complete a transaction in the POS system.
3. Click on the “Email receipt” button next to the “Print receipt” option and
   enter an email address and confirm that the email is sent.
4. Check the “Tendered” field. It is showing up as 0.00 and not reflecting the
   actual amount that was tendered.
5. Apply patch
6. Repeat steps 2 & 3
7. The emailed receipt is now showing the correct tendered amount.
8. Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f2ecb1e9be38613e32800f0d96bfe7a139b0edbf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 30362: Fix GetSoonestRenewDate to really return soonest renew date
David Cook [Thu, 20 Jul 2023 02:39:27 +0000 (02:39 +0000)]
Bug 30362: Fix GetSoonestRenewDate to really return soonest renew date

This change fixes GetSoonestRenewDate so that it returns the soonest
renew date as calculated using "No Renewal Before" and "NoRenewalBeforePrecision".
In the past, it would only return the soonest renew date if "$now" was
lesser than it, which would typically only happen when using an "exact"
precision rather than a "date" precision.

Test plan:
0. Apply the patch
1. prove t/db_dependent/Circulation.t

Signed-off-by: Sam Lau <samalau@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 f8c474019d74c9fd608206daf3074a79c5737f12)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 30362: Fix unit test
David Cook [Thu, 20 Jul 2023 02:39:18 +0000 (02:39 +0000)]
Bug 30362: Fix unit test

Signed-off-by: Sam Lau <samalau@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 95aa1c3da584c06ce439cc2d065e838790e7f6f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 30362: Unit test
Nick Clemens [Fri, 25 Mar 2022 15:18:27 +0000 (15:18 +0000)]
Bug 30362: Unit test

Signed-off-by: Sam Lau <samalau@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 145788398ab6ef606bb9cb86a4783577b6f2d234)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34567: Correct colors for advanced cataloging editor status bar
Owen Leonard [Thu, 17 Aug 2023 13:06:01 +0000 (13:06 +0000)]
Bug 34567: Correct colors for advanced cataloging editor status bar

This patch updates the advanced cataloging editor CSS so that the
"status bar" footer below the editor has colors consistent with the
staff interface redesign.

To test, apply the patch and clear your browser cache if necessary.

- Enable the EnableAdvancedCatalogingEditor preference if necessary.
- Go to Cataloging -> Advanced editor.
- At the bottom of the screen below the editor the "status bar" should
  have a green border that matches color in the header search bar.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3ed91683159206474505f697d0888919f77f8b4c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34601: Fix wrong quote
Tomas Cohen Arazi [Wed, 30 Aug 2023 11:51:17 +0000 (08:51 -0300)]
Bug 34601: Fix wrong quote

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1e9d4dfdd58e61f384c8704c7028774fa8679cab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34601: (QA follow-up) Fix edit/delete links in toolbar
Katrin Fischer [Thu, 24 Aug 2023 19:48:44 +0000 (19:48 +0000)]
Bug 34601: (QA follow-up) Fix edit/delete links in toolbar

We also need to fix the links in the toolbar visible when
'viewing' the suggestion.

1) Create a suggestion
2) Click on the title
3) Click edit > CSRF error
4) Click delete link in toolbar > CSRF error
5) Apply patch and repeat

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3b9de04b8917a62e1e8d143c2c4f5e8a6abdd81a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34601: Fix edit/delete links on suggestion.tt
Lucas Gass [Wed, 23 Aug 2023 18:18:57 +0000 (18:18 +0000)]
Bug 34601: Fix edit/delete links on suggestion.tt

1. Make a suggestion
2. Try to edit, delete the suggestion.
3. Error:
4. Apply patch and restart_all
5. Try again and you should not get the error anymore.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b630dfcb080ddbca5e7f14a9c9863989f0252ea3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34627: CMS pages do not correctly display the opaccredits footer
Owen Leonard [Mon, 28 Aug 2023 10:59:29 +0000 (10:59 +0000)]
Bug 34627: CMS pages do not correctly display the opaccredits footer

This patch corrects the page structure of CMS pages in the OPAC so that
the contents of the footer, including opaccredits, OpacKohaUrl, and the
language selection bar, are displayed correctly.

This patch contains indentation changes, so ignore whitespace when
viewing the diff.

To test you should have these settings:

- OpacKohaUrl enabled in system preferences
- Some content in the opaccredits HTML customization region
- Some content in the OpacNav HTML customization region
- At least one translation installed and enabled
- The opaclanguagesdisplay preference enabled
- The OpacLangSelectorMode set to "only footer" or "both top and footer"

- Apply the patch and go to Tools -> Pages and create a page with the
  display location "OPAC."
- Open the OPAC link for your newly-created page and confirm that the
  page looks correct:
  - The "main" region with the white background should contain the
    breadcrumb navigation, the sidebar OpacNav content, and the contents
    of your CMS page.
  - The opaccredits and OpacKohaUrl content should appear below that
    region.
  - The language selection footer should be at the bottom of the page.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7d5dc65867a55045fa32189d177379e70ecf5725)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
10 months agoBug 34505: Patron invalid age in search_for_data_inconsistencies.pl skip expired...
Fridolin Somers [Wed, 9 Aug 2023 07:44:24 +0000 (21:44 -1000)]
Bug 34505: Patron invalid age in search_for_data_inconsistencies.pl skip expired patrons

Bug 26311 added patron invalid age in search_for_data_inconsistencies.pl
But this is not relevant for expired patrons, especially in child categories.
Check should skip expired patrons

1) Set a non-expired patron with invalid age
2) Run misc/maintenance/search_for_data_inconsistencies.pl
=> Check you see the patron
3) Edit patron to be expired
4) Run misc/maintenance/search_for_data_inconsistencies.pl
=> Check you do not see the patron

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] If we do not want to test valid age for expired patrons, you should
obviously test expired first. Reversing the order in the test.
Putting it in the search criteria would be nicer but leads to more
complicated code.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c26dff61e729df5c782840dfe29f032c83e0e14b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>