]> git.koha-community.org Git - koha.git/log
koha.git
11 months agoBug 35072: Fix invalid usage of "&" in JavaScript intranet-tmpl script redirects
Michał Kula [Mon, 23 Oct 2023 13:51:40 +0000 (15:51 +0200)]
Bug 35072: Fix invalid usage of "&" in JavaScript intranet-tmpl script redirects

These escapes were invalid in these places, as HTML entity escapes
are meant to be used only inside of HTML elements/attributes, not
inside of JavaScript code.

These URLs would be sent out by the browser as-is, and that'd usually
work on the default install only coincidentally. Unfortunately, on some
setups (such as when using reverse proxies), this would break, and the
URL after "&" would have been truncated.

This small patch adjusts the URLs in templates to not use wrong escapes,
and makes them consistent with how URLs are formatted for JavaScript
redirects in most of the templates already.

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 da9f74e56aa3fcaab2a53f0211113d7600263806)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 37eb3092c19361c88ab0442219cd523832b24d2f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34983: Force a sort order in JSON output of po2json
Marcel de Rooy [Wed, 4 Oct 2023 13:04:27 +0000 (15:04 +0200)]
Bug 34983: Force a sort order in JSON output of po2json

This patch does so by default. If you do not want them sorted,
export CANONICAL-0 on the command line.

Test plan:
Copy a staff PO file from misc/translator to test.po
Now run:   time misc/translator/po2json test.po > json1
And do:    time misc/translator/po2json test.po > json2
Run:       diff json1 json2; #They should be the same.
Now:       export CANONICAL=0
And run:   time misc/translator/po2json test.po > json3
And again: time misc/translator/po2json test.po > json4
And run:   diff json3 json4; # Lots of changes
Remove the created cruft. And signoff :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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 a5fc346403665cf6eb692f401bf1cca5ece3cb81)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 82d4eff906cf0b88b001cfe2f43f15d8e63f6ca6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 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: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 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: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 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: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35112: Fix return claims table showing on other patron tabs
Aleisha Amohia [Fri, 20 Oct 2023 01:02:30 +0000 (01:02 +0000)]
Bug 35112: Fix return claims table showing on other patron tabs

This patch fixes some unintentional changes introduced by Bug 25023.

To test:

1. Set a LOST authorised value in the ClaimReturnedLostValue to enable return claims.
2. Check out an item
3. Submit a return claim for the checkout
4. Refresh the patron page
5. Notice the return claims table is showing strangely when viewing the other patron tabs i.e. Checkouts, Holds, Restrictions.
6. Apply the patch and refresh the page
7. Confirm the return claims table only shows when viewing the Claims tab, as expected.

Sponsored-by: Pymble Ladies' College
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35105: Fix patron accessor in Illrequest.pm
Pedro Amorim [Thu, 19 Oct 2023 10:42:48 +0000 (10:42 +0000)]
Bug 35105: Fix patron accessor in Illrequest.pm

Patron is nullable, so we need to consider undef return

Test plan, k-t-d:
1) Install FreeForm and enable ILLmodule, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) Visit /cgi-bin/koha/ill/ill-requests.pl
3) Create 'New ILL request'
4) Select the request type, input cardnumber '42' and select a library
5) Hit 'Create'
6) Manage the request created just now: click the request id or 'manage request' button from the table
7) Click "Edit request" from the top actions toolbar
8a) Input text in Patron ID e.g. 'asdasdasf'. Notice you get redirected to the table - now renders correctly.
8b) Input a patron id that doesn't exist e.g. '987654'. Notice you get an error upon saving "FK Constraint error",
go back to the table and verify it renders correctly.

In both instances, the request is saved with borrowernumber as NULL,
this was preventing the table from rendering because the 'patron' API
embed was trying to retrieve a patron - getting an empty resultset instead
of undef.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 540626ef1510f9cae567efe646bb72f520cfbf2e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 049285b441641d917c1d17bceff27a5f583db936)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35105: Regression tests
Tomas Cohen Arazi [Thu, 19 Oct 2023 18:05:59 +0000 (15:05 -0300)]
Bug 35105: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c91e02a4d6b7ec75137fcd1fe17f1acf6d3b3236)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit adeb074491d5728f831e97d9e47417dda0368e40)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35124: Incorrect item groups table markup
Owen Leonard [Fri, 20 Oct 2023 17:01:00 +0000 (17:01 +0000)]
Bug 35124: Incorrect item groups table markup

This patch corrects the markup of the item groups table which is found
under the "Item groups" tab on the bibliographip detail page in the
staff interface.

The patch also adds the "NoSort" class to the "actions" column to
prevent it from being sortable.

To test, apply the patch and make sure the "EnableItemGroups" system
preference is enabled.

- In the staff interface, locate a record with items and view the detail
  page.
- Under the "Item groups" tab confirm that the table looks correct: The
  heading labels should be centered bold text.
- You should see sorting indicators on the "Display order" and "Description"
  headings but not on the last one.

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 174cd59cea0e9a69aa3d690ef25190c293345a83)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0c3807caa01e6ffcf01028928fc226081f5d9c61)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34946: Remove the use of event attributes from self checkout and check-in
Owen Leonard [Thu, 28 Sep 2023 12:48:36 +0000 (12:48 +0000)]
Bug 34946: Remove the use of event attributes from self checkout and check-in

This patch removes the use of event attributes from the self checkout
and self check-in templates. These events are defined now along with the
other in-page JS.

To test you must have SelfCheckInModule and WebBasedSelfCheck
preferences enabled. And SelfCheckoutByLogin = cardnumber.

- Navigate to the self checkout interface
  (/cgi-bin/koha/sco/sco-main.pl).
- When the page loads, cursor focus should be automatically placed in
  the barcode field.
- Test the "munge history" feature from Bug 10016:
  [1] Start a web-based self-check session.
  [2] Enter a patron barcode.
  [3] Allow the self-check session to time out.
  [4] Use the back button.  You should get the patron barcode
      entry form; you should not be prompted to resubmit form input.
  [5] Enter a patron barcode, perform some transactions, then
      use the finish button.
  [6] Next, use the back button.  You should get the patron barcode
      entry form.
- Test the updated checkout_confirm function by submitting the "magic"
  barcode for checkout: __KOHA_NEW_CIRC__. The user's session should be
  ended.

- Navigate to the self check-in interface
  (/cgi-bin/koha/sco/sci-main.pl).
- Test the cursor focus and "munge history" feature on this page too.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 76d522a90346ccbdb38793c048d61e73e869d9a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b27a2a2eb09a7390d9e56af2b03c42df6d692dcf)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35110: Authorities editor with JS error when only one tab
Fridolin Somers [Thu, 19 Oct 2023 19:17:57 +0000 (09:17 -1000)]
Bug 35110: Authorities editor with JS error when only one tab

Exactly like Bug 34251 for biblios :
When using the an authorities framework with all fields in the same tab, there is thrown a JS error in selectTab( "#tab0XX_panel" );
This is because no nav tabs are build in authorities/authorities.tt as BIG_LOOP has a length(size) of 1

Test plan :
1) Edit an authority framework, for example 'Meeting Name', to set all sufields in tab 0
   You may use SQL : UPDATE auth_subfield_structure SET tab=0 WHERE authtypecode='MEETI_NAME'
   Don't forget to restart memcached
2) Go to 'Authorities'
3) Click on 'New authority' then 'Meeting Name'
4) Check you don't see any JavaScript error
5) Check you can save

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 35110: (follow-up) Fix comment in addbiblio.tt

Change comment in addbiblio.tt since any biblio framework may use only
one tab.
Also fixes indenting using 4 spaces.

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>
Edit: squashed because follow-up fixes code introduced by the same
author.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 32e301df15d2eb73d43cb4cdbbb4b5b45bd3e784)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 748ea28983d1407686e42cd29c4cfedf821bf1bb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35000: Fix OPACMandatoryHoldDates feature in opac-reserve
Marcel de Rooy [Tue, 10 Oct 2023 11:36:45 +0000 (13:36 +0200)]
Bug 35000: Fix OPACMandatoryHoldDates feature in opac-reserve

Somewhere (perhaps after bug 29012) this feature has been broken
somehow.
The fact that we have two inputs for the date and the active one
is one level deeper, requires a few adjustments in the jquery
selectors etc. (Note that two Required lines were visible too.)
The corrected jquery constructs become a bit complexer now.

Test plan:
Enable AllowHoldDateInFuture + OPACAllowHoldDateInFuture.
Set circ rule for book to test with allows item level holds.
Set OPACMandatoryHoldDates to no hold dates.
Place hold on a book in OPAC. Check that More options is collapsed.
(If you force item level holds, it will open.)
Set OPACMandatoryHoldDates to Hold start date.
Refresh place hold page. More options is expanded now.
Click Place hold. You should see an alert and focus goes to start date.
Set OPACMandatoryHoldDates to Hold end date. Repeat place hold.
Set OPACMandatoryHoldDates to Both hold dates. Fill one. Place hold.
Bonus: Place hold on multiple biblios. Repeat former steps.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cd7a8840d54a8db00096e1e9044e600c226935a8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 28320fe33aab11f3ec4fd4ee33e80ca4c6c70fae)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35019: Add a CSRF token when deleting news
Emily-Rose Francoeur [Tue, 10 Oct 2023 17:30:43 +0000 (13:30 -0400)]
Bug 35019: Add a CSRF token when deleting news

I add a CSRF token as a parameter in the link for deleting a news
entry, which solves the problem.

TEST PLAN
1) Apply the patch
2) Go to "Tools > News > New entry"
3) "Display location" should be set to "Staff interface"
4) Fill in the fields
5) Return to the homepage
6) Delete the created news entry
7) The "Additional contents" page is displayed, and the deleted news
   entry no longer appears
8) Return to the homepage; the news entry no longer displays

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>
Edit: adapted the template change to latest master inline
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f4b858778268730d49dc9f11d9d2d9bf6faf3f6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d9d95873427cff8347d2a8d83cbfff4cb3d7f89c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 26994: List names in alphabetical order in Suggestion filter
Shi Yao Wang [Wed, 26 Jul 2023 16:58:39 +0000 (12:58 -0400)]
Bug 26994: List names in alphabetical order in Suggestion filter

Display list of names in alphabetical order when using the Suggestion information filter in Suggestions management

Test plan:
1. Add different purchase suggestions from various patron's names
2. Go to Acquisition > Suggestions
3. Click on the Suggestion information filters on the left-hand side
4. Use one of these drop-down menus: "Suggested by" or, "Managed by" or "Accepted by"
--> notice the list of names in menus, names aren't displayed from A to Z
5. Apply patch and refresh page
6. Redo step 4
--> notice now it's sorted alphabetically

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bcaaffa838c3276b8590863c826cb133dae03258)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 099d25a44a2e659eefb263f01e9f3efee5c843b4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34171: Use barcodedecode when attaching items to another record
Katrin Fischer [Fri, 21 Jul 2023 15:25:00 +0000 (15:25 +0000)]
Bug 34171: Use barcodedecode when attaching items to another record

Bug 26351 added barcodecode that transforms scanned barcodes either
by using itemBarcodeInputFilter  or via a plugin to various pages in
Koha, including checkout and checkin. But the feature for attaching
items to a new record was missed.

To test:
* Add an item with barcode "ab" to any record
* Set itemBarcodeInputFilter to "Remove spaces from"
* Search for another record in the catalog
* Edit > attach item > "a b"
* The item is not found.
* Apply patch, restart_all
* Try again with "a b"
* Verify that the item is found and attached to the record

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cd033bfc60f9700d0d52986a95da55a92c88ee01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e65437199ae3c2abb0467c14b2a3884be524b087)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34990: Add persistent header when sending msg to RabbitMQ
Marcel de Rooy [Thu, 5 Oct 2023 09:56:30 +0000 (09:56 +0000)]
Bug 34990: Add persistent header when sending msg to RabbitMQ

Test plan:
NOTE: It is very hard to add a Koha unit test for adding this
single header when communicating to RabbitMQ via Stomp plugin.
When we would mock the send, we are only testing if perl can
pass a hashref to a subroutine ;)

Do NOT yet apply this patch.
Make sure that RabbitMQ runs.
Stop the koha-worker for long_tasks:
  koha-worker --stop --queue long_tasks myclone
Stage a MARC file.
Check queues with rabbitmqctl list_queues.
Look for: koha_myclone-long_tasks 1  (at least 1)
Stop rabbitmq (something like /etc/init.d/rabbitmq-server stop)
Start rabbitmq (/etc/init.d/rabbitmq-server start)
Check queue again with with rabbitmqctl list_queues.
Look for: koha_myclone-long_tasks 0
Your messages have been gone.

Now apply this patch.
Reiterate the former steps. But note that you will still see
a non-empty queue in the last step:
koha_myclone-long_tasks 1 (at least 1)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5797f5095ecb9fc1eab3fe129eab83c048cc422b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8c0ee5ce0dbeb5427b214060483e5235d8a6fa73)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 32305: Counterpart for es_indexer_daemon.pl
Marcel de Rooy [Wed, 18 Oct 2023 13:58:17 +0000 (13:58 +0000)]
Bug 32305: Counterpart for es_indexer_daemon.pl

This is a kind of copy-and-paste variant of background worker.
We probably could do better than having two scripts here ;)

Test plan:
See former test plan. Apply it to ES indexing.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed queue from query at MQ side. Discussed on IRC.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 709dabb7e8c6285d5c93ece3baed845123cd3a8e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 17560ba44333f23e611f74f3879287575c116d4c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 32305: Worker should ignore wrong status or queue in MQ mode
Marcel de Rooy [Tue, 17 Oct 2023 14:43:32 +0000 (14:43 +0000)]
Bug 32305: Worker should ignore wrong status or queue in MQ mode

MQ mode: The worker has seen that MQ is running and consumes messages
instead of polling db only.

Test plan:
Stop worker for long tasks.
Make sure that Rabbit MQ runs.
Stage a file. (This adds a long task.)
Goto staff view of jobs and cancel this job.
Check if job is still in MQ with rabbitmqctl list_queues.
Now start worker for long tasks.
Check if job is gone in MQ with rabbitmqctl list_queues.
And check logfile for the adjusted warning like:
  [WARN] Job 5 not found, or has wrong status/queue main:: /usr/share/koha/misc/workers/background_jobs_worker.pl (134)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed queue from query at MQ side. Discussed on IRC.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f1edd8fe77897c0f293f3d11ac20fd9ddb8bde8f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 20b0687b74f923a65b5db0bee2a8a4d39af4e849)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35053: Make sure request is checked as an item-level request if item_id passed
Tomas Cohen Arazi [Tue, 17 Oct 2023 12:07:28 +0000 (09:07 -0300)]
Bug 35053: Make sure request is checked as an item-level request if item_id passed

This patch makes the validation code have the `$item` variable defined
when checking holdability, in the case both `item_id` and `biblio_id`
params are passed.

Otherwise, if the requested item is not holdable, but a biblio-level
hold *could* be placed, the item-level hold is placed.

This is highlighted by the regression tests.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests don't pass. A request that should be rejected is allowed
because biblio-level hold is allowed.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! Item-level rules are checked and thus the
request rejected (code 403)
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 82e0edd87606ce05511b33ddeeea10f2b9e68f3d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8a945f3e811cfb39c0a0212554b1adfca2b041bb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35053: Regression tests
Tomas Cohen Arazi [Tue, 17 Oct 2023 12:03:33 +0000 (09:03 -0300)]
Bug 35053: Regression tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 683b74d202d57f4c3fdad62d81b92bf49f7d1fc4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6de7575caee576335b2a764a117b70cc1171c472)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35101: Stop screen from jumping back to top when using barcode.pl plugin
Lucas Gass [Wed, 18 Oct 2023 20:31:32 +0000 (20:31 +0000)]
Bug 35101: Stop screen from jumping back to top when using barcode.pl plugin

To test:
1. Set 'autoBarcode' to something other than 'don't generate automatically'
2. If the a framwwork make sure some 952 fields have the barcode.pl plugin enabled
3. Add a new item and click the '...' next to the 952 field with the barcode.pl plugin enabled.
4. The screen jumps back to the top, annoying.
5. Apply patch
6. Try again, it should not jump anymore!

Signed-off-by: Barbara Johnson <barbara.johnson@swbell.net>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eec5d7e4be7d092f07e47468c50a4ec48b842dc1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 85d38e5ef587657ba5681825cbd0c5fda5094047)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34531: Fix template logic to not hide patron restrictions
Lucas Gass [Mon, 16 Oct 2023 19:37:41 +0000 (19:37 +0000)]
Bug 34531: Fix template logic to not hide patron restrictions

To test:
1. From BorrowerUnwantedFields Hide Gone no address flag (gonenoaddress) and Lost card flag (lost).
2. Got to memberentrygen.tt and see that Patron restrictions is now hidden
3. Apply patch, now the Patron restrictions field should not be hidden.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7e23abcccb4868637d542147f25e6ca437ec5622)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 40a45f6d7545304bd4687a1c1673e5b0801eca46)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34980: Remove the use of event attributes from title-actions-menu.inc in OPAC
Owen Leonard [Sat, 14 Oct 2023 14:20:00 +0000 (14:20 +0000)]
Bug 34980: Remove the use of event attributes from title-actions-menu.inc in OPAC

This patch updates the include file used to show actions with each
search result, removing two instances of "onclick" in favor of an event
handler class which was already in use elsewhere.

To test, apply the patch and log in to the OPAC.

- Perform a catalog search which will return results.
- Test the "Save to lists" link under any search result. The "Save to
  lists" pop-up window should appear.
- View the contents of a list which contains some titles.
- Test the "Save to another list" control. The same pop-up window should
  be triggered.
- Tag at least one title in the catalog and view the "Tag cloud" page.
- Perform the same test with the "Save to lists" button in the table of
  our tags.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5dd4043b06b462080858061dc5bf6b1b193d5c33)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 743538abe787c98b36926518926968a00557b051)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35055: Exclude actions column from patron search results DataTables export
Owen Leonard [Mon, 16 Oct 2023 12:50:06 +0000 (12:50 +0000)]
Bug 35055: Exclude actions column from patron search results DataTables export

This patch updates the markup of the patron search results table so that
the "actions" column (Edit, Check out) are excluded when using the
DataTables "Export" button. The configuration was already in place but
the column header lacked the required class.

To test, apply the patch and perform a patron search which will return
multiple results.

Click the "Export" control at the top of the patron search results
table and choose "Print." In the print preview there should be no final
column containing "Edit" and "Check out."

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5bad6a6d4963010c43f14f8af7c9dff7c03d36d4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c2970fd838688e6ac861a9e9e5595122ca1d7b00)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34462: (follow-up) Shorten card experiation message
David Nind [Thu, 28 Sep 2023 22:14:29 +0000 (22:14 +0000)]
Bug 34462: (follow-up) Shorten card experiation message

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 ab14e7f8ebe200de748a38f1d795c2588048aa3a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 28b8522ac62a29b78912980654ba94dac303ce98)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34462: Display the patron's expiration date
emilyrose [Thu, 28 Sep 2023 14:10:26 +0000 (10:10 -0400)]
Bug 34462: Display the patron's expiration date

The problem is in the patron_messages.inc file on line 25. The variable "expiry" is used, but it should be "patron.dateexpiry" because the patron's card isn't expired yet.

TEST PLAN
1) Go to “Patrons > + New patron”
2) Create a patron with an expiry date that is less than 30 days in the future
3) Go to the "details" tab of this account
4) Notice that the date is missing after "expires on":
"Expiration: Patron's card will expire soon. Patron's card expires on Renew or Edit details"
5) Apply the patch
6) Reload the page; the expiry date should now be displayed

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 7d4e5a66bd8ce72a997f7c4285efa84d4ee5c04f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0231f8d14444a18fd8db2de1f5e5d4365ec2f1b7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34204: Fix koha-shell under debian 12
Jonathan Druart [Wed, 11 Oct 2023 07:58:34 +0000 (09:58 +0200)]
Bug 34204: Fix koha-shell under debian 12

In Debian 12/Bookworm:
root@kohadevbox:koha$ koha-shell kohadev
This account is currently not available.

This is because /etc/passwd has /usr/sbin/nologin as shell, which is coming from the --disabled-login param we passed to adduser in koha-create.

Looks like a bug has been fixed in adduser, because we didn't have this behavior in bullseye.

Context:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625758#72

"""
- change and document (adduser(8)) that --disabled-password will behave
  like --disabled-login and additionally set the shell to
  /usr/sbin/nologin.
"""
https://salsa.debian.org/debian/adduser/-/commit/427ade7d9116af5af7baa9d0c538e14fa86560cf

Test plan:
Confirm the above and that the change makes sense.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c03352ae57a3c8f6f77d64a026a5d87d6f6830e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c3d30dc4e86aecbcbd87a5f5a2a057cdf86eb215)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34271: Remove a few Logger statements from REST API
Marcel de Rooy [Thu, 13 Jul 2023 14:23:22 +0000 (14:23 +0000)]
Bug 34271: Remove a few Logger statements from REST API

See also bug 22678.
We should call app->log->warn, ->debug, etc. instead of Logger.

Test plan:
The simplest way I tested V1, is add a app->log->warn in the try
blocks, restart all and check that your log4perl is set correctly
too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3ce05012b8a2ee6b47c82d14f61c082798ab8a1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c2f1a41670f52835d1d0b00f12eb8faebc2ad636)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35064: Extra parenthesis in db_revs/220600072.pl
Blou [Mon, 16 Oct 2023 15:07:39 +0000 (11:07 -0400)]
Bug 35064: Extra parenthesis in db_revs/220600072.pl

See Bug 34332.

The same error it corrected is also present in the update process.

This patch simply removes an extra parenthesis in the tt instruction.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0f860a43dd7bc32af36caf941a31efb8e24aca6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1de535046a9285ddc5f1baf9d36f11b6fe71180c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34119: Improve staff interface print stylesheet following redesign
Owen Leonard [Tue, 10 Oct 2023 15:12:12 +0000 (15:12 +0000)]
Bug 34119: Improve staff interface print stylesheet following redesign

This patch makes some updates to the staff interface print stylesheet in
order to make it work better following the staff interface redesign.

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

In the staff client, go to various pages and view the print preview. The
print view should exclude the header navigation, header search, page
toolbars and page sidebars.

- Pages with tabbed displays should show content from all tabs: e.g.
  bibliographic details, MARC editor.
- In Reports, check that report results print well.
- Pages with DataTables should print with table information visible but
  table controls hidden.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c8748cd289f37cfa871b8fe368422c4ea58f1c0d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b95cde78ba81ff379e2384cdb4c973f506e9761b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34119: (Preliminary) Run stylelint fixes on print.css
Owen Leonard [Tue, 10 Oct 2023 14:24:22 +0000 (14:24 +0000)]
Bug 34119: (Preliminary) Run stylelint fixes on print.css

This patch corrects errors raised by the new stylelint configuration in
print.css. Most of the fixes were made automatically by using the
"--fix" option:

npx stylelint koha-tmpl/intranet-tmpl/prog/css/print.css --fix

Some examples of errors fixed automatically:

- Expected indentation of 4 spaces
- Unexpected whitespace before ":"
- Unexpected unit
- Expected single space before "{"
- Expected newline after ";" in a multi-line declaration block

Errors from use of "!important" have been ignored.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e8f6a3bfee47d90ad3db7f3a934e3f6af5c17032)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dad427b2d6791383800bcf19cd2c3eed09c466f3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34901: Display transit status on patron holds tab only if hold found value is "T"
Emily Lamancusa [Wed, 27 Sep 2023 16:35:58 +0000 (12:35 -0400)]
Bug 34901: Display transit status on patron holds tab only if hold found value is "T"

Check the transit status of the *hold* in addition to the transit status
of the *item*, to avoid displaying a misleading transit status on
item-level holds when the item is actually in transit for a different
hold

To test:
1. Create a record-level hold for Patron A for pickup at a library other
   than the logged-in library
2. Check in an item to fill that hold
3. Put an item-level hold on that same item for Patron B at a different
   library other than the logged-in library
4. Open Patron A's and Patron B's account details pages in separate tabs
--> Note that the Holds tab on Patron A's account detail page correctly
    shows that their hold is in-transit
--> Note that the Holds tab on Patron B's account detail page incorrectly
    shows that their hold on the same item is also in-transit
4. Apply patch
5. Clear browser cache
6. Refresh both patrons' account details pages
--> Confirm that the holds tab on Patron A's account still correctly
    says their hold is in-transit
--> Confirm that the holds tab on Patron B's account now correctly shows
    a blank status for their hold
7. Cancel Patron A's hold
8. Check in the item again to put it in transit for Patron B's hold
9. Reload Patron B's account page
--> Confirm that the holds tab on Patron B's account now correctly says
    their hold is in-transit

Signed-off-by: Katariina Hanhisalo <katariina.hanhisalo@xamk.fi>
Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fa1485639b6727061572c310731f9b5a3f79adcd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9411b66eaa35b415c670216ab8e695baa21f9e08)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35042: Remove set datelastseen to null on table in Members.t
Marcel de Rooy [Thu, 12 Oct 2023 09:56:25 +0000 (09:56 +0000)]
Bug 35042: Remove set datelastseen to null on table in Members.t

Non-trivial was adding the category_type <> S.

Test plan:
Run t/db_dependent/Members.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f08fc018670a356103a80a41ea83aa67e33476fa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6dbbbef3e9481d611c616e3af12f16316ea608e6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35006: OPAC holdings table - Fix sort for library columns
Owen Leonard [Tue, 10 Oct 2023 12:03:18 +0000 (12:03 +0000)]
Bug 35006: OPAC holdings table - Fix sort for library columns

This patch updates the holdings table on the OPAC's bibliographic detail
page so that home and current library columns can be sorted correctly by
library name. There have been changes to the way the template shows
these values, but the DataTables "data-sort" attribute on the table cell
had not been updated accordingly.

To test, apply the patch set the OpacLocationBranchToDisplay system
preference to "home and holding libraries."

- Make sure home and holding library columns are not hidden in the
  table settings under Administration -> Table settings -> OPAC ->
  holdingst.
- Locate a bibliographic record in the OPAC which has multiple items
  from different libraries.
- Test that the home and current library columns sort correctly by
  library name.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 06d182bc82b40872970d99055c449d3c406724fa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4ebfdba0cb9513631c12454f81bcddc7228120a6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34881: (QA follow-up) Remove stray paren
Nick Clemens [Thu, 12 Oct 2023 14:53:50 +0000 (14:53 +0000)]
Bug 34881: (QA follow-up) Remove stray paren

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0128ce5b100df4f96a9b79076077459d3ea8b6c2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43ab6e2825aee6c11c73b53981eb6963af580928)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34881: Improve idempotency of DBRev
Emily Lamancusa [Wed, 11 Oct 2023 13:40:05 +0000 (09:40 -0400)]
Bug 34881: Improve idempotency of DBRev

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d9463f82c4344b93e4b5d0aea64339bb6c3d492a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bcc160ebb659d5fdb70cef5322b44f41c5eff5d9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 27249: Replace DateTime->now by dt_from_string
Julian Maurice [Tue, 10 Oct 2023 09:53:17 +0000 (11:53 +0200)]
Bug 27249: Replace DateTime->now by dt_from_string

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1a2288052dab4709ba5c1236bc8141384e2d1aa5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ff565dd3b839199ce2a152f353cba882392080ac)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 27249: Add missing POD for Koha::Exceptions::Calendar
Julian Maurice [Tue, 10 Oct 2023 09:53:00 +0000 (11:53 +0200)]
Bug 27249: Add missing POD for Koha::Exceptions::Calendar

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9e2a258f6f6213629c33bbc838b4fbac5366c544)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1ddb79448ce1655005e322118bcedda4b86b567f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 27249: Fix code style
Julian Maurice [Tue, 10 Oct 2023 09:52:26 +0000 (11:52 +0200)]
Bug 27249: Fix code style

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4b4028d783a3660b9e16e647ef0e51c624ef3ff6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7cb8e222e41e3ecab9ee678534f1ee046debb028)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 27249: Catch NoOpenDays exception while checking out an item
Julian Maurice [Thu, 24 Aug 2023 07:27:28 +0000 (09:27 +0200)]
Bug 27249: Catch NoOpenDays exception while checking out an item

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 4eec4020fa66f789f77637234aab81c46c3e6972)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b1feff4228b68260221fdad1d9fb2bee3904378a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 27249: Prevent infinite loop when searching for an open day
Julian Maurice [Tue, 18 Jul 2023 08:26:03 +0000 (10:26 +0200)]
Bug 27249: Prevent infinite loop when searching for an open day

Calendars can be configured in a way that all days are closed.
The simplest way to do that is to configure a repeatable holiday for
every day of the week.
With such calendars, searching for an open day will literally take
forever.

This patch sets a hard limit on how many iterations are allowed before
giving up. This limit is set to the arbitrary value of 5000, which
should be large enough to be able to consider there is no open days if
we haven't found any with that many iterations, and small enough to
allow the loop to end quickly

Test plan:
1. Set system preference 'useDaysMode' to 'Use the calendar to push the
   due date to the next open day' ('Datedue'). Make sure the existing
   circulation rules do not conflict with that setting.
2. Browse to Tools » Calendar
3. Set every day of the week to "Holiday repeated every same day of the
   week"
4. Issue an item to a patron
5. Check the box and select 'Renew selected items'
6. The renewal should fail pretty quickly

Signed-off-by: Sam Lau <samalau@gmail.com>
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 2b58f4d89ca2d71c8979e4d87759fc45d63795f4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0f304c55e23ab382237846acb80ce94838f3e3f8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34800: Adding openhub links for Koha contributors
Aleisha Amohia [Fri, 15 Sep 2023 03:41:56 +0000 (03:41 +0000)]
Bug 34800: Adding openhub links for Koha contributors

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 2a7be7d6c86926226dab4356be3f760f5c166d19)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 458517fe0c3351c748dc50e2916ba4cc118620f1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoRmaint fix: Add exec flag to atomic update file for 22.11.11.000
Matt Blenkinsop [Mon, 13 Nov 2023 10:09:09 +0000 (10:09 +0000)]
Rmaint fix: Add exec flag to atomic update file for 22.11.11.000

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35079: Replace --force-extract by --generate-pot={always,auto,never}
Julian Maurice [Tue, 17 Oct 2023 15:13:55 +0000 (17:13 +0200)]
Bug 35079: Replace --force-extract by --generate-pot={always,auto,never}

This restores the original behaviour of always building the POT file
in order to not break existing workflows
Option --force-extract is deleted in favor of a new option
--generate-pot that can have 3 values:

* always: always build the POT file. This is the default value
* auto: build the POT file only if it does not exist
* never: never build the POT file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
11 months agoBug 35079: Rebuild POT files only if necessary or asked explicitely
Julian Maurice [Tue, 17 Oct 2023 14:33:37 +0000 (16:33 +0200)]
Bug 35079: Rebuild POT files only if necessary or asked explicitely

By default, gulp tasks po:create and po:update won't rebuild the POT
files if they already exist.
Both tasks gained a new option --force-extract to rebuild them
unconditionally

This makes it possible to create/update PO files for multiple languages
sequentially without rebuilding the POT file for each language.
For instance:

    gulp po:update --lang fr-FR
    # do something with the PO files
    gulp po:update --lang en-GB
    # ...

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
11 months agoBug 35043: Do not have \n or \t appear in PO files
Jonathan Druart [Thu, 12 Oct 2023 10:35:12 +0000 (12:35 +0200)]
Bug 35043: Do not have \n or \t appear in PO files

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

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

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

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

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

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

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

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

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
11 months agoBug 35024: Do not wrap translations
Jonathan Druart [Wed, 11 Oct 2023 09:35:41 +0000 (11:35 +0200)]
Bug 35024: Do not wrap translations

PO files wrap differently depending on versions.

Looks like (thanks Julian!) it's coming from libunistring, between 0.9.10 and 1.0 I am seeing a change in how the strings in the PO files are wrapped.

Debian 11 (using libunistring 0.9):
"%s %sPrintemps%s %s %sÉté%s %s %sAutomne%s %s %sHiver%s %s %sPrtps%s %s %sÉté"
"%s %s %sAut%s %s %sHiv%s %s %s %s"

Debian 12, Ubuntu 22.04(using libunistring 1.0)
"%s %sPrintemps%s %s %sÉté%s %s %sAutomne%s %s %sHiver%s %s %sPrtps%s %s "
"%sÉté%s %s %sAut%s %s %sHiv%s %s %s %s"

It *could* come from this changes:
https://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=blob;f=NEWS;h=5a43ddd7011d62a952733f6c0b7ad52aa4f385c7;hb=HEAD
   * The functions u*_possible_linebreaks and u*_width_linebreaks now make it
     easier to work with strings that contain CR-LF sequences: In this case,
     in the returned array, it will return UC_BREAK_CR_BEFORE_LF followed by
     UC_BREAK_MANDATORY (instead of twice UC_BREAK_MANDATORY).

The command used is:
% msgmerge --backup=off --quiet -F --update misc/translator/po/fr-FR-staff-prog.po misc/translator/Koha-staff-prog.pot

No matter the value of --width.

One solution is to use --no-wrap, and never wrap :)

I sent an email to the list about this suggestion https://lists.katipo.co.nz/pipermail/koha/2023-October/060143.html

Test plan:
% gulp po:update --lang LANG

And notice that the lines are no wrapped anymore.

Note that in master there were already not wrapped (?)
commit edd378f4d14d79107d662b053c8e6f750326dd23
Translation updates for Koha 23.05.00

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
11 months agoBug 34959: Sort PO files correctly
Jonathan Druart [Fri, 6 Oct 2023 14:48:57 +0000 (16:48 +0200)]
Bug 34959: Sort PO files correctly

The PO files are not sorted when we update them which leads to
unnecessary changes that are commited: hard to see differences and
make git index grow superfluously.

Test plan:
0. Do not apply this patch
1. gulp po:update --lang es-ES
2. git commit -a -m"First PO update"
3. Run again the gulp update command
4. git diff
=> You have a lot of changes generated here, the po:update is not
idempotent.

5. Apply this patch
6. Run the gulp update command
7 git commit -a -m"PO update after 34959"
8. Run the gulp update command
9. git diff
=> No changes are generated

Note that this patch will all the entries by files, and per line
numbers.
It fixes a bug in some condition, where we add information/context about
the string. For instance search for "For the first occurrence" in the
file. Prior to this patch this was not correct, we didn't add info about
the first occurrence (but whichever in the list).

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
11 months agoBug 34959: Remove unused sub
Jonathan Druart [Fri, 6 Oct 2023 15:17:51 +0000 (17:17 +0200)]
Bug 34959: Remove unused sub

Nothing special here, this sub is not used and we can remove it.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
11 months agoUpdate release notes for 22.11.11 release v22.11.11
Matt Blenkinsop [Tue, 7 Nov 2023 11:45:34 +0000 (11:45 +0000)]
Update release notes for 22.11.11 release

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoIncrement version for 22.11.11 release
Matt Blenkinsop [Tue, 7 Nov 2023 11:37:23 +0000 (11:37 +0000)]
Increment version for 22.11.11 release

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoFix translations for Koha 22.11.11
Matt Blenkinsop [Tue, 7 Nov 2023 11:34:18 +0000 (11:34 +0000)]
Fix translations for Koha 22.11.11

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoTranslation updates for Koha 22.11.11
Koha translators [Tue, 7 Nov 2023 09:32:46 +0000 (06:32 -0300)]
Translation updates for Koha 22.11.11

(cherry picked from commit d9d4d63892fc995430cd54e2076bdffe4d6d4aa0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 35014: Only set time for enable-time flatpickr
Martin Renvoize [Mon, 9 Oct 2023 15:37:22 +0000 (16:37 +0100)]
Bug 35014: Only set time for enable-time flatpickr

This patch adds a check to the onChange function such that we only
attempt to set the default time on change for time enabled flatpickrs
when the date is entered manually.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5b25b26f70c21c609793f10706c04c9dbce4a5ad)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34844: Rmaint fix: Remove unwanted permission
Matt Blenkinsop [Wed, 18 Oct 2023 08:53:38 +0000 (08:53 +0000)]
Bug 34844: Rmaint fix: Remove unwanted permission

12 months agoRmaint fix: Fix number of tests in Auth.t
Matt Blenkinsop [Wed, 18 Oct 2023 08:18:46 +0000 (08:18 +0000)]
Rmaint fix: Fix number of tests in Auth.t

12 months agoRmaint fix: Fix number of tests in ILS.t
Matt Blenkinsop [Wed, 18 Oct 2023 08:17:10 +0000 (08:17 +0000)]
Rmaint fix: Fix number of tests in ILS.t

12 months agoBug 35015: (QA follow-up) Fix paid transactions filter in the staff interface
Katrin Fischer [Mon, 9 Oct 2023 19:58:50 +0000 (19:58 +0000)]
Bug 35015: (QA follow-up) Fix paid transactions filter in the staff interface

Same problem: we added a column without adjusting the filter.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4b1d4ca170be6d35e72953a4eb233f4ddf4037a4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bd078e5ce42d60c64e6bb55dbd87ee69acf9e641)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 35015: Adjust column index in fnFilter
Matt Blenkinsop [Mon, 9 Oct 2023 16:11:48 +0000 (16:11 +0000)]
Bug 35015: Adjust column index in fnFilter

This patch fixes the column index in the call to fnFilter following the
addition of a new column to the table in bug 32341

Test plan:
1) Add some charges to a patron account
2) Pay some of these charges so that they are no longer outstanding
3) In the OPAC log in as that patron and navigate to the Charges tab in
   their account
4) Observe that all charges are listed, even if they have been paid and
   clicking the Show all transactions button has no effect even if
   clicked multiple times between the different filtering options
5) Apply patch
6) Refresh page and now the settled charges should be filtered out
7) Click the Show all transactions button and it should correctly update

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 7cf209a550260eb1dc60dd7457c8b8e197a9b5ef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 654594a789bd292cce4942a064e4b114fac3576f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 35010: In record checkout history do not show anonymous patron link
Fridolin Somers [Mon, 9 Oct 2023 08:57:29 +0000 (22:57 -1000)]
Bug 35010: In record checkout history do not show anonymous patron link

In a biblio record checkout history, when a checkout is anonymized the
patron id has been replaced by anonymous patron id.
In this case we should not show anonymous patron link.
It looks like a real patron did this checkout.

Test plan :
1) Set an existing patron id in system preference 'AnonymousPatron'
2) Perform anonymisation on old checkouts (or edit database manually)
3) Look at a record checkout history with old checkouts
=> You see 'Anonymized' for anonymized checkouts
4) Set system preference 'AnonymousPatron' empty
5) Look at same record checkout history
=> Check no error

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 dad04bbf0a1915930a95bdb3fea73f47602be884)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 704ed483000912d5f9935da31e312940cb01c960)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34883: Add unit test
Matt Blenkinsop [Fri, 29 Sep 2023 09:04:52 +0000 (09:04 +0000)]
Bug 34883: Add unit test

prove -v t/db_dependent/Koha/Patrons/Import.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b4f928003eac4bcd5d1c778cda7b346151782d45)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c414e9a43bbc850ed2c54f9ef499a9b2201bdb2c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34883: Stop patron expiry date being set to NULL during import
Matt Blenkinsop [Mon, 25 Sep 2023 10:34:18 +0000 (10:34 +0000)]
Bug 34883: Stop patron expiry date being set to NULL during import

A regression has been identified whereby an empty field in the dateexpiry field in a patron import file will cause the patron's expiry date to be set to NULL. This patch addresses this by checking for an empty field and using the existing expiry date if one is found.

Test plan:
1) Setup a csv with column headers:
    surname firstname branchcode categorycode cardnumber dateenrolled dateexpiry
2) Add values:
    Acosta Edna CPL PT 23529001000463 02/01/2013
3) Leave the dateexpiry column blank
4) Check Edna and make a note of her patron expiry date
5) Run the import_patrons.pl script with the following flags:
    a) --file <filepath_for_your_csv_file>
    b) --matchpoint cardnumber
    c) --confirm
    d) --overwrite
6) Check Edna, note her expiry date is now set to NULL
7) Manually edit Edna's expiry date to be reset to what it was before you ran the script
8) Apply the patch and restart_all
9) Repeat step 5
10) Check Edna, this time her expiry date should be the same as the value you set it to in step 7
11) Sign off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f4f77357f63013a21e700f14df82ca9261403310)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 08002cd0b94987164e93650e07ecb32fdfdf8822)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34467: OAI GetRecord bad encoding for Unimarc
Frédéric Demians [Thu, 3 Aug 2023 08:59:01 +0000 (10:59 +0200)]
Bug 34467: OAI GetRecord bad encoding for Unimarc

For some Unimarc biblio records, the OAI Server returns a bad XML
document, ie a document with extended characters, such as accents, not
encoded in UTF8. It seems to come from somewhere in MARC::Record library
trying to deduce biblio record endoding from some fields. It may work
for MARC21 records. It doesn't for Unimarc records. So it's necessary to
send to the method transforming record into XML the marcflavour. This
way there is no encoding guessing from Unimarc biblio records content.

https://bugs.koha-community.org/show_bug.cgi?id=34467
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 216a2dcb9f571134fd2fbb6ac5aeca096d0e8ef6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5f05074c118aeb4579acd4098a84f7ab2d077b32)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34549: Strip non-XML chars during TransformHtmlToMarc
David Cook [Thu, 17 Aug 2023 04:28:29 +0000 (04:28 +0000)]
Bug 34549: Strip non-XML chars during TransformHtmlToMarc

This patch strips non-XML characters from inputs during
TransformHtmlToMarc.

To test:
0. Apply patch
1. koha-plack --restart kohadev
2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl
3. Fill out record and use the text from "Text file containing control characters"
as the title
4. Click Save
5. Note that your record displays without any warnings like the following:
Error: invalid data, cannot decode metadata object
parser error : PCDATA invalid Char value 27

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Squashed the tidy patch. Still needed a few spaces to satisfy qa tools.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3e1d32f9caaab56acd8f4b338a859eb599955634)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 871d6eaa3fbb5eba14e17c3ebc6a46db708e5483)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34982: Add pagination to the currencies table
Jonathan Druart [Wed, 4 Oct 2023 09:42:44 +0000 (11:42 +0200)]
Bug 34982: Add pagination to the currencies table

Otherwise we only display the first 20.

Test plan:
Create more than 20 currencies and confirm that you can know
filter the table and see all the currencies.

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 6b6534a22a60f8797c678c8ea5d66eefdb474141)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 70af8ac5643346ced39d5826faeb38cbcc066d87)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34558: Update custom.sql for it-IT webinstaller
Zeno Tajoli [Thu, 17 Aug 2023 12:04:12 +0000 (14:04 +0200)]
Bug 34558: Update custom.sql for it-IT webinstaller

It is an update of this file, here there are the specific customization for
italian users. There are simple changes on defaults values.

To test it:
1 - Start a web installation with italian language.
2 - Select Marc21 as biblio format
3 - Select all optional .sql files
4 - Conclude the installation.
5 - Go to MySQL command line and do:
    SELET value FROM systempreferences where variable = 'BorrowersTitles'
    You see: 'Sig|Sig.ra|Sig.na'
6 - Apply the patch.
7 - Drop and recreate the mysql db
8 - Redone the installation with italian language.
9 - Use the same options written above.
10 - Conclude the installation.
11 - Go to MySQL command line and do:
    SELECT value FROM systempreferences where variable = 'BorrowersTitles'
    You see: 'Sig|Sig.ra|Dott.|Dott.ssa'
12 - Refactor is OK

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 070af9aaf38e36c2c69d825ac43d28e288d62f04)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0bcfb0d95e7bec14e7a65304cd19ccd34e2580cd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 33819: Add page numbers to opac results breadcrumb
Matt Blenkinsop [Wed, 24 May 2023 14:57:20 +0000 (14:57 +0000)]
Bug 33819: Add page numbers to opac results breadcrumb

This patch adds the page number to the breadcrumb in the opac search results to ensure that it is unique to the content on the page. Currently it is not compliant to Accessibility guidelines as the breadcrumb is identical on every page despite the content being different.

To test:
1) Apply patch
2) Run a search in the OPAC that will return more than 20 results.
3) The breadcrumb should say "Results of search for 'search term', page x of y"
4) Run a search that will return less than 20 results
5) The breadcrumb should say "Results of search for 'search term'

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 1a0ccaa991c426219a8a304d43c1039286a7de58)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5d20395fa6b1008ee5ba73925b7091e8539a6ed2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34921: Tabs on Additional Content page need space above
Owen Leonard [Wed, 27 Sep 2023 12:36:15 +0000 (12:36 +0000)]
Bug 34921: Tabs on Additional Content page need space above

This patch adds a separator element, <hr /> between the additional
contents form and the tabs for visual clarity. Using an element is a
little hackish but it's a simple solution.

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

There should be a clear gap between the top form and the tabs below.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0c74f429bcc5e05fc2444ce47349c9905c5fc448)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 19d4b3e949393ef65bab8389884c4b654dc15782)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34722: Prevent other items from displaying to fill item-level recalls
Aleisha Amohia [Wed, 6 Sep 2023 00:13:48 +0000 (00:13 +0000)]
Bug 34722: Prevent other items from displaying to fill item-level recalls

This patch prevents other items attached to a record from being displayed as 'recalled' by item-level recalls.

To test:
1. Ensure UseRecalls system preference is enabled and circulation rules relevant to recalls are configured. Set 'on shelf recalls allowed' circulation rule 'if any unavailable' for ease of testing.
2. Search for a record that has multiple items, or create one with multiple items. Check out two of the items (Item A and Item B) to a patron, Patron A.
3. Log into the OPAC as another patron, Patron B. Search for the record and place a recall. Choose to recall a specific item and select Item A.
4. Go back to the staff interface and view the catalogue detail page for the record. Notice that every item has a 'recalled by...' message, even though Item A was specifically recalled.
5. Log into the OPAC as another patron, Patron C. Search for the record and place a recall. Choose to recall a specific item, notice every item has a 'recalled by...' message. Select Item B and Confirm.
6. In your terminal, the 'Other items are not returned for item-level recalls' test should fail when running
prove t/db_dependent/Koha/Item.t

7. Apply the patch and restart services

8. Confirm tests at t/db_dependent/Koha/Item.t now pass
9. Refresh the staff interface, confirm only Items A and B have the recalled message and the recall patron information for each item is accurate
10. Log into the OPAC as another patron, Patron D. Search for the record and place a recall. Choose to recall a specific item. Confirm only Items A and B have the recalled message.

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Perltidied new code.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit be375ed01ce997817b23bbd219b05033ac1c35e7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 60d5a6f0fb3ef719d376e95c38815c4820fb1043)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34923: Allow direct input of hold dates on opac-reserve.tt
Lucas Gass [Tue, 26 Sep 2023 19:04:17 +0000 (19:04 +0000)]
Bug 34923: Allow direct input of hold dates on opac-reserve.tt

To test:
1. Turn on AllowHoldDateInFuture and OPACAllowHoldDateInFuture
2. Make a hold in OPAC and notice you cannot directly input a date in either the "Hold starts on date:" field or the "Hold not needed after:" field.
3. APPLY PATCH
4. Clear your browser cache and try again. You should be able to directly input dates.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a6ba086a92115af5e43c84eb4e8dc8dbe2422ff7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 65f3c1d48eccd9682e7f8ecf3f18587ddf2ad1d9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34859: Remove unnecessary params from reports-home.pl
David Cook [Thu, 21 Sep 2023 01:27:45 +0000 (01:27 +0000)]
Bug 34859: Remove unnecessary params from reports-home.pl

This change removes unnecessary syspref template parameters
and tidies the code.

Test plan:
0. Apply the patch and koha-plack --reload kohadev
1. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=IntranetNav
2. Add the following and save:
<li><a href="#">Awesome</a></li>
3. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=intranetstylesheet
4. Add the following and save:
http://bad
5. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=intranetcolorstylesheet
6. Add the following and save:
http://bad2
7. Go to /cgi-bin/koha/reports/reports-home.pl
8. Note the "Awesome" link in the top navbar
9. Note in the console that there are two errors where http://bad
and http://bad2 can't be resolved

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7382e305e1bc6c43c74397f135e2267fcb9f8e4e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3fed05a8dfa36ab0c7da07fde2e6956ce94077b6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 33395: Patron search results - show number of overdues and checkouts when patrons...
David Nind [Sat, 23 Sep 2023 01:10:31 +0000 (01:10 +0000)]
Bug 33395: Patron search results - show number of overdues and checkouts when patrons have overdues

This fixes the display of patron search results, so that it shows
the number of checkouts when a patron has overdue items. For
example: 1 / 2

Bug 30063 changed the display to show only the number of overdue
items in bold and red, without the total number of items checked
out.

Test plan:
1. Check out two items to a patron - make one overdue (click the
   checkout setting options and then specify a due date a month
   ago).
2. Check out another item to another patron.
3. Search for patrons so that the two patrons you checked out
   items to are listed in the results.
4. Note the display for the 'Checkouts' column:
   4.1 For patrons without any checkouts: 0 / 0
   4.2 For the patron from step 2 with one checkout: 0 / 1
   4.3 For the patron from step 1 with one overdue and one
       checkout: 1 (in bold and red)
5. Apply the patch.
6. Refresh the page of results (step 3).
7. Note that for the patron from step 1, the display now shows:
   1 / 2 (with the 1 in bold and red).
8. Sign off! 8-)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.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 c9ab718a39174d0a874fc8de8964b6f96b704f37)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 96c97fb95f6258a04deafd75fc96ba6182c47d27)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34870: Perform UTF8 encoding before redirection
emilyrose [Fri, 22 Sep 2023 15:58:23 +0000 (11:58 -0400)]
Bug 34870: Perform UTF8 encoding before redirection

Display special characters correctly when writing off an invoice.

The issue arises because pay.pl does not perform UTF-8 encoding on the “notes” parameter before redirecting the page. By using uri_escape_utf8, characters with a code above 255 are also UTF-8 encoded. Then, paycollect.pl can collect the information without any trouble.

This patch work with “;” and “:” characters.

TEST PLAN
1) Go to any patron profile > Accounting
2) Click “Create manual invoice”
3) Fill the fields and click the “Save” button
4) Repeat steps 2 and 3
5) Click “Make a payment”
6) Add a note with special characters for each one (e.g., éçö)
7) Select the created invoices and click the “Write off selected” button
8) In the note field, you should see “�” symbols where the special characters are supposed to be
9) Click the “Cancel” button
10) Now add a note with “:;” for one of the invoices
11) Select the invoices and click the “Write off selected” button
12) You should see a page with an error 500
13) Go back to the “Make a payment” page
14) Apply the patch
15) Add a note with special characters for each one (e.g., éçö)
16) Add “:;” to one of the note fields
17) Select the invoices and click the “Write off selected” button
18) Now the special characters are displayed correctly

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 1c016176341be0197d1978e3b4ee0e6c5136c319)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit eea0310a620a333eb738146321ff4e19c88a5c3e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34961: Add sort parameter to OPAC search results RSS feed link
Owen Leonard [Fri, 29 Sep 2023 18:33:59 +0000 (18:33 +0000)]
Bug 34961: Add sort parameter to OPAC search results RSS feed link

This patch corrects two RSS links in the OPAC search results template so
that they include the correct parameters, including the descending sort
by acquisition date.

To test, apply the patch and go to the OPAC.

- Perform a catalog search which will return search results.
- Next to the page heading "Your search returned X results" is an RSS
  link. Check the link to confirm that it has all the expected
  parameters:

  opac-search.pl?idx=kw&q=nude&count=50&sort_by=acqdate_dsc&format=rss

- Perform a search which will return no results and check the RSS link
  on that page. It should be the same.

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 1f730fb8665a53457ad709933d3518577c041a6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b10097ca27ea89e80f97739ebe130e49a86f0e6c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 32676: Fix EDI message status case
Kyle Hall [Tue, 31 Jan 2023 17:42:46 +0000 (12:42 -0500)]
Bug 32676: Fix EDI message status case

Edifact status appear to vary between all lower case and being
capitalized. This breaks the switch in the edi_status block of the
basket.tt template. We should make this switch case-insensitive.

Test Plan:
1) View the basket for a sent EDI order, note the Sent status does not
   display.
2) Apply this patch
3) Reloate the page, note the status is now visible!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b0b33b382c5254db2b4d78ee4d00f03d589513ca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 92e977062cc70eb149e70e93e645b483d221a671)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34945: Remove the use of event attributes from OPAC clubs tab
Owen Leonard [Thu, 28 Sep 2023 11:30:35 +0000 (11:30 +0000)]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

This patch removes the use of event attributes (onclick) from the
template for the clubs tab shown in the OPAC to a logged-in user.
These events are defined now along with the other in-page JS.

The patch also makes some general improvements to the template for
consistency:

- Adding Bootstrap color classes to the "Enroll" and "Cancel enrollment"
  buttons.
- Enhancing the responsive configuration to the DataTable.

To test you should have a few patron clubs defined (Tools -> Patron
clubs).

- Apply the patch and log in to the OPAC.
- On the user summary page, click the "Clubs" tab.
- The "Enroll" and "Cancel enrollment" buttons should look correct and
  work as expected:
  - Click the "Enroll" button.
    - On the enrollment confirmation view, test both the "Finish
      enrollment" button and the "Cancel" link.
  - Test "Cancel enrollment" button.
- Test the responsive behavior of the page to confirm that it adjusts
  well to narrow browser widths.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3849909a98f286ffedead029aff5fc2b16a6c76)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a19515a9d41e14ff01b272292238853aba74c9be)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 22873: Add comment to explain what disallow_overpayment is for
Kyle M Hall [Mon, 25 Sep 2023 14:11:03 +0000 (10:11 -0400)]
Bug 22873: Add comment to explain what disallow_overpayment is for

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 075876fe0530258eaa22c0a24e7f472896232d9d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b4fc27770dd03dd0077d0bcedea7e410d4bf8fdb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34833: (follow-up): remove redundant spaces
Victor Grousset/tuxayo [Mon, 25 Sep 2023 06:47:36 +0000 (08:47 +0200)]
Bug 34833: (follow-up): remove redundant spaces

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dc140bdb2e4837dae5906f0e7e98a35c1ebe81b6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ebf88badbcc1b65b0889e07b93a992555a4b248a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34833: Make "order number" in acq modal translatable
Katrin Fischer [Tue, 19 Sep 2023 19:53:38 +0000 (19:53 +0000)]
Bug 34833: Make "order number" in acq modal translatable

The 'order number' was not translatable when editing the
estimated delivery date or notes from basket summary or
when editing the estimated delivery date from late orders.

To get there:
0. Make sure you have budgets and vendors set up

1. Create a basket (skip this if you already have an open basket)
   1.1. Go to acquisitions
   1.2. Search for a vendor
   1.3. Click New > basket
   1.4. Enter a name for the basket
   1.5. To make the tests easier, choose to create items when : cataloging the record
   1.6. Click save

2. Add an order
   2.1. Click add to basket > From a new (empty) record
   2.2. Fill out the form, minimally
        - Enter a title
        - Enter a quantity
        - Choose a fund
        - Enter a vendor price
   2.3. Click Save

3. Next to the order line, click Edit under Estimated delivery date
4. Verify that the 'order number <ordernumber>' shows on top of the modal
5. Edit internal/vendor note, verify it shows there as well
6. Close basket
7. Go to late orders
8. Edit estimated delivery date, text should show there as well
9. Apply patch
10. Run translation update script
11. Verify the string now appears in po files
12. Translate it
13. Install translation
14. Verify it shows nicely translated in all 3 mentioned spots

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 2b1b7c9ce84683543267816f6e6d351fe3f891d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 457fe88fa3e1d1c451e86465f383ff691d95d1f6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34511: Typo in manage_staged_records permission description
Caroline Cyr La Rose [Wed, 9 Aug 2023 20:22:39 +0000 (16:22 -0400)]
Bug 34511: Typo in manage_staged_records permission description

This patch corrects a typo in the description of the manage_staged_records permission. All other permission descriptions are in the present tense, but this one is in the past tense.

To test:
0. Apply the patch
1. Go to any patron record
2. Click More > Set permissions
3. Click Show details next to the Use all tools permission
4. Read the description for the manage_staged_records permission, make sure the spelling and grammar are correct

Signed-off-by: hebah <hebah@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 f91db88fcebeaa4b2ed0a58f4e2f2f9d1487178f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 269a52d08eff3eec065fa7aa2ae176f559d455a7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34679: Change description for RELTERMS authorized value category
Caroline Cyr La Rose [Thu, 31 Aug 2023 16:40:45 +0000 (12:40 -0400)]
Bug 34679: Change description for RELTERMS authorized value category

This patch changes the description of the RELTERMS authorized value
category to "List of relator codes and terms".

To test:
1. Apply patch
2. Go to Administration > Authorized values
3. Search for category RELTERMS
   --> The description should read "List of relator codes and terms"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8a45084b7f757e131f2cc1aa61b8bce16e0ea34c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ef59308a647adf28b7886dc410c342f08aff58db)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34887: Merge with db_dependent Patron.t
Marcel de Rooy [Sat, 23 Sep 2023 07:08:27 +0000 (07:08 +0000)]
Bug 34887: Merge with db_dependent Patron.t

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch: Fixed QA failures
 FAIL   t/db_dependent/Koha/Patron.t
   FAIL   spelling
                 personnal ==> personal
                 personnal ==> personal
                 personnal ==> personal
                 personnal ==> personal
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 361, now: 382)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 834365f4b4b2dea6eeb69ca500daea7d057155bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 90fb610432141812af30c8b8a1a3b1b6393af2ff)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34887: Fix transactions in db dependent Patron.t
Marcel de Rooy [Fri, 22 Sep 2023 14:14:02 +0000 (14:14 +0000)]
Bug 34887: Fix transactions in db dependent Patron.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 53377edcc7351935f8ff8bec838616479d59e358)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bc36b2318093ccb61eed9e1b8c1fc899d4b350a5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34887: Remove Test::DBIx::Class from Patron.t
Marcel de Rooy [Fri, 22 Sep 2023 13:54:31 +0000 (13:54 +0000)]
Bug 34887: Remove Test::DBIx::Class from Patron.t

Moving all tests into one subtest with two underlying
subtests for checking accessors after new or set.
This will make it more easy to merge with the db
dependent counterpart.

Test plan:
Run t/Patron.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a432dda3f4fc42c47e2ca7e2c68c2206dd5e2b5f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 90e990a3ebc4b90184b5b0e82468f6fc4521fc27)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34825: Merge Letters.t into t/db/Letters.t
Marcel de Rooy [Tue, 19 Sep 2023 07:09:54 +0000 (07:09 +0000)]
Bug 34825: Merge Letters.t into t/db/Letters.t

Test plan:
Run t/db_dependent/Letters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5fd831755205fc3b3b7481103fbe2145b421a5ea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f938f90795d5c57e59d4fc38de5b8fd0991f354f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34825: Remove Test::DBIx::Class from Letters.t
Marcel de Rooy [Tue, 19 Sep 2023 06:50:52 +0000 (06:50 +0000)]
Bug 34825: Remove Test::DBIx::Class from Letters.t

Includes a tidy.

Test plan:
Run t/Letters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 22aee4db67280da3a92713dae93e57737a94b303)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 071c8ca79e34b16d12901f225c1fcfe6d8c5545d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34968: Remove unneeded module from Search.t
Marcel de Rooy [Sat, 30 Sep 2023 06:40:50 +0000 (06:40 +0000)]
Bug 34968: Remove unneeded module from Search.t

Test::DBIx::Class is not even used here.
Just like C4::Biblio.
We should remove TestBuilder too (this is t not t/db)!

Test plan:
Run t/Search.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 23a8497123e9898f48f7e23f1fe8c09158e19d88)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6c4eeb1c4af29094b64816dd7e10eb1d78b52c84)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34969: Remove unneeded module from buildQuery.t
Marcel de Rooy [Sat, 30 Sep 2023 06:52:08 +0000 (06:52 +0000)]
Bug 34969: Remove unneeded module from buildQuery.t

Test plan:
Run t/Search/buildQuery.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit af093305b8c936f20c49fa707d5bc58fc9059ba8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2007b17a8407f1a24c7d38e5669ac6a00f124388)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t
Marcel de Rooy [Sat, 30 Sep 2023 06:58:23 +0000 (06:58 +0000)]
Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t

There is really no need for all those modules here.
What remains, is just a trivial test.

Test plan:
Run t/SuggestionEngine_AuthorityFile.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 80db256a4700c6a7eec78fe85dade334d8b05bec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5fd2fe48b9e838bbfd6bb35c39033610e5362872)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34944: Remove the use of event attributes from OPAC full serial issue page
Owen Leonard [Thu, 28 Sep 2023 11:25:02 +0000 (11:25 +0000)]
Bug 34944: Remove the use of event attributes from OPAC full serial issue page

This patch removes the use of event attributes (onclick) from the OPAC's
full serial issues template. These events are defined now along with the
other in-page JS.

To test you must have a serial record with issues from multiple years.

- Locate the serial record and view the detail page.
- Click "More details" at the bottom of the "Subscriptions" tab.
- Click the "Full history" tab.
- Test the "Show year" controls to confirm that clicking each year
  correctly filters the table of issues to show only issues from that
  year.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 10ef1fe67226a09b15a563b04cde6cca266b87ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fc8972d45b0010761d800ce16d711dc1c1162bfe)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34912: Add 14 hours to 1970 date in Account(s).t
Marcel de Rooy [Tue, 26 Sep 2023 11:45:58 +0000 (01:45 +1400)]
Bug 34912: Add 14 hours to 1970 date in Account(s).t

This makes those tests pass in whatever timezone.

Test plan:
Do not yet apply patch.
Change timezone on commandline with: export TZ='Etc/GMT-14'
NOTE: GMT-14 is what we also call UTC+14 (sign reversed).
Run prove t/db_dependent/Accounts.t t/db_dependent/Koha/Account.t
This fails now.
Apply patch.
Rerun tests and verify that they pass now.
Bonus: Try some other time zone.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8d4b10fc846eb74aa381c809923d13bf258a9752)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c1078784db2a57d339b214d09d85662a85f2b338)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34916: Fix wrong borrowernumber in ArticleRequests.t
Marcel de Rooy [Tue, 26 Sep 2023 13:45:35 +0000 (13:45 +0000)]
Bug 34916: Fix wrong borrowernumber in ArticleRequests.t

Simple fix: Send patron to userenv instead of library only.

Test plan:
Do not apply patch.
Remove borrowernumber 51.
Run t/db_dependent/Koha/ArticleRequests.t. (FAIL)
Apply patch, rerun test (PASS)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7d93d18548d02b1b634db09356caf18795a6ddbf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 47d9e00a7081415be7471e22b925b5c3189dde39)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set
Lucas Gass [Wed, 27 Sep 2023 21:22:43 +0000 (21:22 +0000)]
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set

1. Find some places in the staff interface where data-flatpickr-enable-time is set to true. Examples: renew.tt or circulation.tt
2. Directly input a date in whatever date format you have specified in DateFormat but omit the hour/minute. Example: 12/12/2023
3. See that the hour/minute default to 00:00 if your TimeFormat is 24hr and 12:00 AM if your time format is 12hr
4. Apply patch, clear browser cache.
5. Try step again, setting a date like '12/12/2023'. The hour:minute should be added as 23:59.
6. With TimeFormat set to 24hr try entering a date with the hour:minute like '12/12/2023 11:22'. The hour:minute should be set to 11:22.
7. With TimeFormat set to 12hr try entering a date with the hour:minute like '12/12/2023 11:22 AM'. The hour:minute should be set to 11:22 AM.
8. Play with this in as many TimeFormat and DateFormat combonatinons as you can.

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
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 ff00e77f466bb217ed6235cec16047da5a620c75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b6cc786dfd5f11bbf896117660c5a82f1994c215)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34822: Process real time holds along with indexing
Nick Clemens [Mon, 18 Sep 2023 17:25:15 +0000 (17:25 +0000)]
Bug 34822: Process real time holds along with indexing

Current code already skips indexing when adding record to instead index in a single call. This patch pdates the code to do the same thing for real time holds queue updates.

Note: Newly added records do not need to be updated as they won't have holds yet.

To test:
1 - Have a marc file with several records that match records in your catalog
    You can export part of your catalog to generate one
2 - Set system preference:  RealTimeHoldsQueue to 'enable'
3 - Stage and import file, make sure you are matching and overlaying
4 - Go to Administration->Manage jobs
5 - Note a batch update for each updated record
6 - Apply patch
7 - Repeat
8 - Note a single job added for the entire batch containing only updated records

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 b50d43c14ee19b32c312a2955c888f48235fddc8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 56b15b0e2d5ac3e68734e81a660cda019ea55b6d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34689: Ignore itemnumber when creating item hash
Matt Blenkinsop [Fri, 29 Sep 2023 12:44:11 +0000 (12:44 +0000)]
Bug 34689: Ignore itemnumber when creating item hash

A primary key error can be thrown when an item number is included in a new title hash. We need the item creation to ignore an itemnumber even if it is included in a MARC Framework

Test plan:
1) Edit the MARC framework relating to books (BKS in KTD)
2) In the 952$9 field (Koha itemnumber (autogenerated)), change the value of "Managed in tab" to "items (10)"
3) In the catalog, find a record that uses that MARC framework
4) Click "New" and choose to add a new item
5) Enter a barcode and click the "Add & duplicate" button
6) The page will refresh and an item will have been added
7) Enter a new barcode and click the same button again
8) An error will be thrown
9) Click the back button in the browser
10) Apply patch and restart_all
11) Click the add and duplicate button again
12) This time no error will be thrown and the page will refresh with another new item added
13) Sign off!

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 5b9dbe558f6b9c548786691f29b940e4f2f66b86)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 71dda507622e35d5ab083a8a45cab50a29211596)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34645: (follow-up) save sort1 and sort2 in order
Nick Clemens [Mon, 25 Sep 2023 13:12:40 +0000 (13:12 +0000)]
Bug 34645: (follow-up) save sort1 and sort2 in order

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9f41a0fb979fabd70c1b1dc8ff6c54454969f818)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9ee8fdaf7d98a75595601928f7acf132ca2d3431)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34645: always use discount, sort1, and sort2 from MarcFieldsToOrder
Nick Clemens [Mon, 18 Sep 2023 16:32:10 +0000 (16:32 +0000)]
Bug 34645: always use discount, sort1, and sort2 from MarcFieldsToOrder

These values are stored at the order level, not per item. This patch simply sets the order values from the values retrieved from MarcFieldsToOrder even inf MarcItemFields to order is being used for other fields

To test:
Setup -- Set systempreferences below

MarcFieldsToOrder:
price: 949$g
quantity: 949$k
budget_code: 949$l
discount: 949$m
sort1: 949$n
sort2: 949$q

MarcItemFieldsToOrder:
homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
price: 949$g
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l

Stage the attached bib-303.marcxml file
Add to basket from the staged file
Note that discount and sort1 and sort2 are not populated per the Marc
Apply patch, restart all
Stage and add to basket again
Confirm discount and sort1 and sort2 are populated correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f3bf1f3da5f82e9479ac1c39f0a5ab869e7a748c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6270d813ef95ccf3d2b2cae54d2cec8a05a3bc3a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34911: Test files from HEAD instead of 'master'
Jonathan Druart [Tue, 26 Sep 2023 08:27:57 +0000 (10:27 +0200)]
Bug 34911: Test files from HEAD instead of 'master'

Since bug 34303 the test suite (when ran on jenkins) is no longer testing Perl::Critic

koha_1       | fatal: Not a valid object name master
koha_1       | [14:58:14] t/00-testcritic.t

We are not cloning the whole repo and "master" is not available. Additionally we do not want to test master's files on stable branches anyway...

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7dd57db42932a45e1af9a5bc3f827e1178bec469)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5c73ac5c23ee5d7e828f8cd2b02769fad1367589)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
12 months agoBug 34932: Patron.t - Pass borrowernumber of manager to userenv
Marcel de Rooy [Wed, 27 Sep 2023 12:48:27 +0000 (14:48 +0200)]
Bug 34932: Patron.t - Pass borrowernumber of manager to userenv

Test plan:
Make sure that you do not have borrowr 51.
Run t/db_dependent/Koha/Patron.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ca4da5e17ea7a65a473778f590c2703e8eecf7ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f5f0bc40106a06dcfeff5b36eb6527cc9350ff81)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>