koha.git
20 months agoUpdate release notes for 22.05.05 release v22.05.05
Lucas Gass [Mon, 26 Sep 2022 14:35:00 +0000 (14:35 +0000)]
Update release notes for 22.05.05 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
20 months agoIncrement version for 22.05.05 release
Lucas Gass [Mon, 26 Sep 2022 14:28:35 +0000 (14:28 +0000)]
Increment version for 22.05.05 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
20 months agoTranslation updates for Koha 22.05.05
Koha translators [Mon, 26 Sep 2022 14:18:21 +0000 (11:18 -0300)]
Translation updates for Koha 22.05.05

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
20 months agoBug 31219: Prevent JS injection in patron extended attributes
Jonathan Druart [Mon, 25 Jul 2022 07:23:25 +0000 (09:23 +0200)]
Bug 31219: Prevent JS injection in patron extended attributes

We are sanitizing other attributes but "extended patron attributes".

Test plan:
Make a patron attribute editable at the OPAC
Edit an existing patron, or register a new one
Use a script tag in the new value ("<script>alert("booh!")</script>" for
instance)
With this patch the value is remove if containing an HTML tag that is
not br b i em big small strong (see C4::Scrubber)

Signed-off-by: Mark Hofstetter <koha@trust-box.at>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
20 months agoBug 31499: Add libhttp-tiny-perl 0.076 dependency for ES7
Mason James [Wed, 31 Aug 2022 16:38:17 +0000 (04:38 +1200)]
Bug 31499: Add libhttp-tiny-perl 0.076 dependency for ES7

no testing info provided

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 486f5af3035228f5ad55175ee6ff0b78a96c64b7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31455: (QA follow-up) Make table creation O(N)
Joonas Kylmälä [Thu, 1 Sep 2022 19:45:25 +0000 (19:45 +0000)]
Bug 31455: (QA follow-up) Make table creation O(N)

We can insert the indices before the main loop to a hash,
this way we don't have to look up during each loop iteration
the index from an array which in the worst case might take O(N)
thus making the total time complexity O(N^2).

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 223d9d3a99903cff3d8a3078e6921da79099375c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31455: Make batchMod sort by order scanned
Lucas Gass [Thu, 1 Sep 2022 16:55:14 +0000 (16:55 +0000)]
Bug 31455: Make batchMod sort by order scanned

To test:
1. In batch item deletion and batch item modification add some
   barcodes.
2. Notice they are being sorted by item number, not in the order
   scanned.
3. Appply patch and restart services.
4. Try scanning items again in both batch item deletion and batch item
   modification.
5. The found barcodes should now sort by order scanned.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5c2b2ac09a0cabbab9333bc0cab90cf1880de17f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30909: Retain permanent_location if mapped
Jonathan Druart [Tue, 7 Jun 2022 09:27:04 +0000 (11:27 +0200)]
Bug 30909: Retain permanent_location if mapped

If items.permanent_location is mapped to a MARC subfields we must retain
the value, not using items.location

Test plan:
1 - Map permanent_location to a marc field
2 - Expose that field in the item editor
3 - Change the location of the item and retain the permanent location on saving
4 - note that permanent location has not changed

Test the different other situation, when adding and editing: Empty the field, change only location, change only permanent_location, etc.

Signed-off-by: andrew <andrewfh@dubcolib.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e2668a685702a0cd9adf3deeafcc9e4433199e0f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31223: Do not explode if plugins disabled
Tomas Cohen Arazi [Tue, 26 Jul 2022 12:55:38 +0000 (09:55 -0300)]
Bug 31223: Do not explode if plugins disabled

This patch makes the code skip calculating the plugin-related task
codes => class mapping if plugins are entirely disbaled.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Plugins/BackgroundJob.t
=> FAIL: Tests explode with: Can't call method "GetPlugins" on an
undefined value at... Koha/BackgroundJob.pm line 424.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7867106d430dd9ab3f673185945467931a10082e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31223: Regression tests
Tomas Cohen Arazi [Tue, 26 Jul 2022 13:48:21 +0000 (10:48 -0300)]
Bug 31223: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 28896d9c302ad41fce463fd8d80ea02283a7d55b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 23202: Fix screen freeze when ordereing several items
Johanna Raisa [Tue, 26 Jul 2022 09:01:56 +0000 (12:01 +0300)]
Bug 23202: Fix screen freeze when ordereing several items

This patch fixes adding multiple items on order acquisitions

The error is: Uncaught TypeError: $(...).parent(...).attr(...) is undefined

Test plan:
1) Set dateaccessioned.pl plugin to ACQ framework's 952$d field.
2) Create basket to a vendor and add order from a new empty record.
3) Add date acquired value from calendar.
4) Add multiple items and see that the view freezes.
5) Apply the patch
6) Reload the page and repeat the steps 3 and 4.
7) See that the items are added.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
JD Amended patch: adjust commit title
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d2d78e2581419dd3d8101fd9aecf358c71213733)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31244: Fix 500 if logout and not logged in
Jonathan Druart [Tue, 26 Jul 2022 12:55:02 +0000 (14:55 +0200)]
Bug 31244: Fix 500 if logout and not logged in

Can't use an undefined value as a HASH reference at /kohadevbox/koha/C4/Auth.pm line 985
        C4::Auth::checkauth('CGI=HASH(0x5603b7dc4300)', 0, 'HASH(0x5603b2633238)', 'intranet', undef, 'intranet-main.tt') called at /kohadevbox/koha/C4/Auth.pm line 186
        C4::Auth::get_template_and_user('HASH(0x5603b7b83d08)') called at /kohadevbox/koha/mainpage.pl line 40

Test plan:
Open a private window
Hit /cgi-bin/koha/mainpage.pl?logout.x=1

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1ae5454b01f2a5cfac105b056bc2a8d72ac444a8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31246: <span> displayed in 'Additional fields' section
Tomas Cohen Arazi [Wed, 27 Jul 2022 12:54:19 +0000 (09:54 -0300)]
Bug 31246: <span> displayed in 'Additional fields' section

This patch avoids escaping HMTL data in the additional fields section.

To test:
1. Open the additional fields section
   http://kohadev-intra.mydnsname.org:8081/cgi-bin/koha/admin/additional-fields.pl
=> FAIL: there are some nasty <span> </span> texts in there
2. Apply this patch
3. Reload
=> SUCCESS: Things display nicely again!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a7272f988679904d3f018550a73719fc102b3425)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31120: Items will renew for zero ( 0 ) days if renewalperiod is blank/empty value
Kyle M Hall [Thu, 7 Jul 2022 19:14:59 +0000 (15:14 -0400)]
Bug 31120: Items will renew for zero ( 0 ) days if renewalperiod is blank/empty value

If the rule renewalperiod is the blank empty string instead of being null/undefined or non-existant, Koha will interpret the renewal period as being zero days instead of falling back to the issuelength rule.

It makes sense to me that a literal 0 here should make it renew for zero days even though that is nonsensical.

Test Plan:
1) Delete all your rules
2) Create an all/all/all rules with an empty string for renewal base
   period
3) Note that renewing an item does nothing
4) Apply this patch
5) Restart all the things!
6) Renew again
7) Note the renewal uses the issuelength rule as intended

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b010d99dfcb1a77a6ebd679aabafd819c6e67cf)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31120: Add unit tests
Kyle M Hall [Thu, 14 Jul 2022 10:38:57 +0000 (10:38 +0000)]
Bug 31120: Add unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 511ae8298e033ddf2a12799c968d25bd716d62af)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 21982: Circulation statistics wizard does not count deleted items
Jérémy Breuillard [Wed, 24 Nov 2021 15:56:09 +0000 (16:56 +0100)]
Bug 21982: Circulation statistics wizard does not count deleted items

By default statistic assistant filter is set on the
existing items and doesn't mind about deleted items.
The patch corrects this. Items belong to the same library.

Test plan:
1)Make sure to have at least 1 or more item(s) in deleteditems database table
2)Home > Reports > Circulation statistics
3)Fill up 'Issuing library', 'Home library' and 'Holding library'
4)Submit
5)Notice that only statistics for active items are shown
6)Apply patch and repeat from 2) to 5)
7)Now active items and deleted items are shown

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 610f287db9581bfa6d606468810792d25c6dc47b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30878: Avoid resetting waiting reserves tab
Lari Taskula [Wed, 1 Jun 2022 15:06:52 +0000 (15:06 +0000)]
Bug 30878: Avoid resetting waiting reserves tab

When canceling holds waiting over X days in "Holds awaiting pickup"
view, form submission resets the selected tab to "Holds waiting". This
tab reset may cause confusion for the user and lead to unwanted
actions. Instead, the user should be returned to the same tab that they
began with.

To test:
1. Apply patch
2. Navigate to /cgi-bin/koha/circ/waitingreserves.pl
3. Select "Holds waiting over X days" tab
4. Refresh page
5. Observe "Holds waiting over X days" is still selected
6. Have some holds waiting over X days
7. Select one of them and press "Cancel selected (1)" and confirm
8. Observe "Holds waiting over X days" is still selected after form
   submission

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 30235d31884c6c24edf692a9f69170b25a645e05)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 15187: (QA follow-up) Fix test permissions
Tomas Cohen Arazi [Fri, 22 Jul 2022 18:11:58 +0000 (15:11 -0300)]
Bug 15187: (QA follow-up) Fix test permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e6947b740883670b48f002bba7a64103016bc4ef)

21 months agoBug 15187: (QA follow-up) Add unit test
Martin Renvoize [Wed, 6 Jul 2022 11:52:05 +0000 (12:52 +0100)]
Bug 15187: (QA follow-up) Add unit test

This patch adds a unit test for the newly introduced filter.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 058d411643c4b868553b97896fb065cf9870e456)

21 months agoBug 15187: Index 880 in Zebra the same as Elasticsearch
David Cook [Mon, 2 May 2022 07:34:34 +0000 (07:34 +0000)]
Bug 15187: Index 880 in Zebra the same as Elasticsearch

This patch modifies the MARC21 export to Zebra, so that 880 fields
are rewritten as their linked fields, in the same way that we
already do with Elasticsearch, so that the alternate graphic
representation of fields are indexed accordingly. (ie 880 $6245-01
Chinese titles will be indexed into the title index using the 245 rules)

Test plan:
0. Apply patch
1. Turn on ICU indexing
1b. vi /etc/koha/zebradb/etc/default.idx
1c. Replace charmap word-phrase-utf.chr with icuchain words-icu.xml
1d. Replace charmap word-phrase-utf.chr with icuchain phrases-icu.xml
1e. Restart Zebra server
1f. Re-index Zebra
2. Add record with a 880 $6 245-01 $a 教牧書信 field.
3. Search for this record using a title index with the Chinese title
4. Note that the record is correctly retrieved

(Note: This test probably works better using author or series as they
 present as links on the detail page which makes the fix more obviously
 useful.)

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 85690a14f8685a2eb6cb88316bb4a3145c024cc2)

21 months agoBug 26689: Prepend letter codes.
Martin Renvoize [Wed, 29 Jun 2022 16:26:30 +0000 (17:26 +0100)]
Bug 26689: Prepend letter codes.

This patch prepends the credit_type_code and debit_type_code with
CREDIT_ and DEBIT_ respectively when doing a lookup on the notice letter
code.

Test plan
1) As previous patches, however instead of just naming your notice to
   match the credit_type_code or debit_type_code use
   CREDIT_credit_type_code and DEBIT_debit_type_code respectively.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 87aa05f9deb7fa09f059d53b422b89c8411e0c84)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 26689: Check for specific template then fallback - printinvoice
Martin Renvoize [Fri, 12 Mar 2021 16:09:22 +0000 (16:09 +0000)]
Bug 26689: Check for specific template then fallback - printinvoice

This patch adds a check for a more specific ACCOUNT_DEBIT template
(named to match the debit_type_code of the credit line) prior to
falling back to the ACCOUNT_DEBIT template.

Test plan
1/ On a patrons account page use the print option on a series of debit
lines with differing credit types (Overdue, Payout)
2/ Note that the same template 'ACCOUNT_DEBIT' is used for all types
3/ Apply the patch
4/ Run step 1 again and note all still print using ACCOUNT_DEBIT
5/ Add a new notice template under the 'circulation' module with a code
that matches one of your account debit types (OVERDUE, PAYOUT)
6/ Run step 1 again and note that where you have added a specific notice
for that debit type it has been used.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8e46612d7c5dfc8d0faff009ef9f86198bdd0f83)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 26689: Check for specific template then fallback - printfeercpt
Martin Renvoize [Fri, 12 Mar 2021 14:38:31 +0000 (14:38 +0000)]
Bug 26689: Check for specific template then fallback - printfeercpt

This patch adds a check for a more specific ACCOUNT_CREDIT template
(named to match the credit_type_code of the credit line) prior to
falling back to the ACCOUNT_CREDIT template.

Test plan
1/ On a patrons account page use the print option on a series of credit
lines with differing credit types (Payment, Lost Item Return, Writeoff)
2/ Note that the same template 'ACCOUNT_CREDIT' is used for all types
3/ Apply the patch
4/ Run step 1 again and note all still print using ACCOUNT_CREDIT
5/ Add a new notice template under the 'circulation' module with a code
that matches one of your account credit types (PAYMENT, WRITEOFF,
LOST_FOUND)
6/ Run step 1 again and note that where you have added a specific notice
for that credit type it has been used.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 422ab472836cfcd0dd4197173de1213c06375d42)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31121: Fix date formatting in cashup summary modal
Martin Renvoize [Fri, 8 Jul 2022 14:46:04 +0000 (15:46 +0100)]
Bug 31121: Fix date formatting in cashup summary modal

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c12d037da294944cf82208b2bd72d3348b66c0cf)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31204: Clearly indicate edit buttons are for record modification
Lucas Gass [Wed, 20 Jul 2022 16:53:28 +0000 (16:53 +0000)]
Bug 31204: Clearly indicate edit buttons are for record modification

To test:
1. Apply patch
2. Do a search and select some records
3. On the toolbar (#selection_ops) open the Edit dropdown.
4. The labels should read 'Batch edit records' and 'Batch delete records'.

Note: To see both you must have batchmod and batchdelete permission.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7ce420ed82862e750b7a6a46c66c5cf1587f5e7d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30838: (QA follow-up) Add unit tests
Martin Renvoize [Wed, 6 Jul 2022 10:54:35 +0000 (11:54 +0100)]
Bug 30838: (QA follow-up) Add unit tests

Two tests added, one in t/db_dependent/Circulation.t to catch the
initial setting of to_address at enqueue time and a second in
t/db_dependent/Letters.t to catch the correcting at send time.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 467b444c7e355b1ef3ecbab29f67544bfd72360b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30838: (QA follow-up) Add missing semicolon
Kyle Hall [Tue, 28 Jun 2022 11:27:17 +0000 (07:27 -0400)]
Bug 30838: (QA follow-up) Add missing semicolon

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 008e6ae9ebd45cc8161a86f293703f02d7409319)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30838: Set to_address to smsalertnumber at send
Martin Renvoize [Tue, 24 May 2022 11:57:09 +0000 (12:57 +0100)]
Bug 30838: Set to_address to smsalertnumber at send

It may be helpful to know exactly what number was used for the sms alert
that was sent. As such, we should ensure it's set at the time of
sending.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e9cdc1da651faa24a93f87569bf2b219f31552ee)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30838: Don't fallback through phone numbers for sms
Martin Renvoize [Tue, 24 May 2022 11:32:45 +0000 (12:32 +0100)]
Bug 30838: Don't fallback through phone numbers for sms

This patch removes the fallback handling for smsalartnumber as the
to_address in notices. We ignore the to_address field in the message
queue at send time for sms anyway and use smsalertnumber exclusively so
having this field populated is just confusing to the end user

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5e388ed509c58b5f7398baf6f7bb027b4dc46c1c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: DBRev 22.05.04.002
Lucas Gass [Fri, 2 Sep 2022 17:20:14 +0000 (17:20 +0000)]
Bug 31086: DBRev 22.05.04.002

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: DBIC
Lucas Gass [Fri, 2 Sep 2022 17:12:24 +0000 (17:12 +0000)]
Bug 31086: DBIC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: (QA follow-up) Use plain SQL in db_rev
Tomas Cohen Arazi [Fri, 22 Jul 2022 17:36:39 +0000 (14:36 -0300)]
Bug 31086: (QA follow-up) Use plain SQL in db_rev

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit efd2dfdaae0441c4e8701278853e7a75db285717)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: Notify of problematic holds during upgrade
Nick Clemens [Fri, 22 Jul 2022 12:31:55 +0000 (12:31 +0000)]
Bug 31086: Notify of problematic holds during upgrade

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0704102bc800dd43db1255918348e454a6df2f75)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: (QA follow-up) Improve atomicupdate to be more resilient
Martin Renvoize [Fri, 22 Jul 2022 09:05:55 +0000 (10:05 +0100)]
Bug 31086: (QA follow-up) Improve atomicupdate to be more resilient

We now populate the branchcode field with the first available branch on
the system if we find it to be NULL before we set the NOT NULL

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5fa510b431c043671c7bcb73c431c60aac0039ed)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: (QA follow-up) Add unit tests
Martin Renvoize [Tue, 12 Jul 2022 15:22:46 +0000 (16:22 +0100)]
Bug 31086: (QA follow-up) Add unit tests

This patch adds the unit tests for the change to Koha::Hold::store.

We test for and catch the exception introduced for both the create and
update cases.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0685f0f4053da428ab13d9f3991790fb71b7e55)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: (QA follow-up) Fix failing tests
Martin Renvoize [Tue, 12 Jul 2022 15:21:30 +0000 (16:21 +0100)]
Bug 31086: (QA follow-up) Fix failing tests

This test was missed first time around, branchcode needed adding to all
the calls to AddReserve.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bdddc7ee0a3a0ed2ec1c5996ab5be587c1e395df)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: (QA follow-up) Remove DEFAULT from column
Martin Renvoize [Tue, 12 Jul 2022 14:39:37 +0000 (15:39 +0100)]
Bug 31086: (QA follow-up) Remove DEFAULT from column

There's no need to have a default here, and in fact it doesn't make
sense.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d731943c2464592624d2b34bc91a75ea3ceae5b7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: Update existing unit tests
Nick Clemens [Fri, 1 Jul 2022 15:30:33 +0000 (15:30 +0000)]
Bug 31086: Update existing unit tests

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 bf2a9b5279151b61bb149c318505e2d5e5ca8df8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: Prevent placing hold with no pickup location
Nick Clemens [Fri, 1 Jul 2022 14:46:26 +0000 (14:46 +0000)]
Bug 31086: Prevent placing hold with no pickup location

To test:
1 - Apply patch
2 - Repeat test on previous patch
3 - You should get a warning popup when attempting to save hold
4 - Reload page
5 - Inspect the HTML and manualy set #pickup value of selected option to ""
6 - Attempt to save hold
7 - You get the popup
8 - Place a hold normally (with location) and verify it works

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 e609e20c041084a5b763f0b8fe8cd304e5ca8159)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: Throw an exception when a hold is stored with no branchcode
Nick Clemens [Fri, 1 Jul 2022 14:44:09 +0000 (14:44 +0000)]
Bug 31086: Throw an exception when a hold is stored with no branchcode

To test:
1 - Apply first 2 patches
2 - On staff client, find a biblio, place hold, select a patron
3 - Before creating hold, right click on 'Pickup location'
4 - Inspect the element
5 - In the console find the top <li> for pickup, and right click
6 - Select 'Delete node'
7 - Save hold
8 - You get an exception/error

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 e7d886d388dc9825c6e93a158e19f7da60db145b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31086: DB update
Nick Clemens [Fri, 1 Jul 2022 14:43:09 +0000 (14:43 +0000)]
Bug 31086: DB update

This update sets branchcode as NOT NULL
default set to 0 as borrowernumber is

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 1565efe8f3e4c782e4d94a6c06cc71d2ac460d43)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30308: Fix bulkmarcimport.pl broken by OAI-PMH:AutoUpdateSets(EmbedItemData)
Frédéric Demians [Mon, 11 Jul 2022 10:05:54 +0000 (12:05 +0200)]
Bug 30308: Fix bulkmarcimport.pl broken by OAI-PMH:AutoUpdateSets(EmbedItemData)

Test plan:

(A) Reproduce the bug:

A1 In Administration > System preferences > Web services:
   - Enable OAI-PMH
   - Enable OAI-PMH:AutoUpdateSets
   - Enable OAI-PMH:AutoUpdateSetsEmbedItemData

A2 In Tools > Export data > Export bibliographic records, export 1 (one)
   biblio record. Be sure that this biblio record has at least one item.
   Don't tick "Don't export items".

A3 Delete the exported biblio record, and its items.

A4 In command line, on the server load the exported file:
   ./bulkmarcimport.pl -b -v -file /path/to/koha.mrc

A5 Retrieve the biblio record in Koha. Note the absence of the item(s). This is
   the bug.

(B) Apply the patch

B1 Delete the record (without item) loaded at A4.

B2 In command line, on the server load the exported file:
   ./bulkmarcimport.pl -b -v -file /path/to/koha.mrc

B2 Retrieve the biblio record in Koha. Note the presence of the item(s).

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 d5e65dd4c0352c4fb2d96f4cabfc6e6311770cd0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31138: Don't ignore DataTables errors and raise them to the end-user
Jonathan Druart [Tue, 12 Jul 2022 08:09:25 +0000 (10:09 +0200)]
Bug 31138: Don't ignore DataTables errors and raise them to the end-user

DataTables is not raising error to the end user, it's only displaying a generic message in the console.
This leads to lot of questions on IRC or the mailing list ("the table is empty").
We can do better and display what went wrong.

We could also imagine add a link to the wiki for the more common problems (won't be implemented here however).

Test plan:
Revert "Bug 31104: Put each link on a separate header" and search for a
patron using a very long string
You should get an alert with the reponse of the server.
In my case:
"""
Something went wrong when loading the table.
414: Request-URI Too Long
"""

You can also make the REST API returns a 500 (bad specs or simply with a
die statement).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 76b984bb6ccee55ba1ddfdb5b08c6ee2e75eaa37)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31213: Auto search simple term quoted
Nick Clemens [Thu, 21 Jul 2022 18:16:22 +0000 (18:16 +0000)]
Bug 31213: Auto search simple term quoted

This patch does a second search if the first had no results and was a simple single term search

We simply quote the term, rebuild the query, and rerun the search

This targets both Zebra and ES, but is more relevant for ES

To test:
0 - Have Koha running using ES
1 - Add titles your system "Ivy + Bean" "The 6:20 Man"
2 - Search for these titles without quotes - NO results under ES
3 - Search with quotes - you find them
4 - Apply patch, restart all
5 - Search again without quotes
6 - Success!
7 - Confirm search still works under Zebra

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2ce5f0532c8fea625c838725f70518421ebbb22b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30458: Include librarian (manager_id) in accountline when using "Payout amount...
Kyle Hall [Tue, 5 Apr 2022 13:40:51 +0000 (09:40 -0400)]
Bug 30458: Include librarian (manager_id) in accountline when using "Payout amount" button

When using the "Payout amount" button, accountlines.manager_id is not
populated. This is not the case with the "Issue payout" buttons.

Test Plan:
1) Create a manual credit
2) Issue a payout using the "Payout amount" button
3) Inspect the payout accountline, note it has no manager_id
4) Apply this patch, restart all the things!
5) Repeat steps 1 and 2
6) Note the new payout accountline has a manager_id!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
JK: Fix commit title

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0177b88eb33d398da4eb5ffb6344226930c3346b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30471: Correct display of default rules
Nick Clemens [Wed, 6 Apr 2022 13:49:58 +0000 (13:49 +0000)]
Bug 30471: Correct display of default rules

To test:
1 - Browse to 'Administration->Circulation and fines rules'
2 - Make sure you are editing 'Standard rules for all libraries'
3 - Set 'Lost item fee refund on return policy' to 'Refund lost item charge and charge new overdue fine'
4 - Swtich to edit rules for a specific library, click on the dropdown for 'Lost item fee refund on return policy' and note default says 'Use default (Refund lost item charge and restore overdue fine)'
5 - Switch default/all libraries rule to 'Refund lost item charge and restore overdue fine'
6 - On specific branch note the default option is now 'Use default (Refund lost item charge and charge new overdue fine)'
7 - Apply patch and repeat, note the default descriptions now display correctly

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 417d8df61b4d00b6b904dd374835e99cfb9be4a2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29001: (QA follow-up) Remove code duplication
Joonas Kylmälä [Thu, 21 Jul 2022 17:57:20 +0000 (17:57 +0000)]
Bug 29001: (QA follow-up) Remove code duplication

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0df59817bf52e26b44348848ea8d299d814482c2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29001: Fix framework edition when subfields are reordered
Jonathan Druart [Tue, 19 Jul 2022 15:00:29 +0000 (17:00 +0200)]
Bug 29001: Fix framework edition when subfields are reordered

There is a flaw when subfields are ordered, the inputs are not retrieved
correctly.
We should not rely on the order but use an id instead.
Test plan:
Create, edit subfields
Modify values from the different subfields
Confirm that values are correctly saved

Signed-off-by: Thibault Kero <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 16a919d9191dd4221f7f370cfcd36555428ea9fa)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31202: Don't remove optional SIP fields with a value of "0"
Kyle Hall [Wed, 20 Jul 2022 16:32:58 +0000 (12:32 -0400)]
Bug 31202: Don't remove optional SIP fields with a value of "0"

If the value of a SIP field is "0", that evaluates to false, so any calls to maybe_add with a value of "0" will not get added to the SIP response message.

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

Signed-off-by: Michal Urban <michalurban177@gmail.com>
JK: Adjust commit title

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8b957a69d4449bedd0f593cf946e5fde0e8d7a69)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31201: Prevent Pseudonymization.t to fail
Jonathan Druart [Wed, 20 Jul 2022 15:44:05 +0000 (17:44 +0200)]
Bug 31201: Prevent Pseudonymization.t to fail

It's failing if selenium/patrons_search.t failed before, they are using
the same code and the selenium tests didn't clean correctly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ed83d7744502d767d9806afb8516ec5ecb967fa5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30658: (bug 29496 follow-up) CheckMandatorySubfields don't work properly with...
Janusz Kaczmarek [Sun, 1 May 2022 21:59:09 +0000 (23:59 +0200)]
Bug 30658: (bug 29496 follow-up) CheckMandatorySubfields don't work properly with select field in serials-edit.tt for Supplemental issue

CheckMandatorySubfields use the class "input_marceditor" but in file
serials-edit.tt this class is not set for select input in Supplemental
issue form. In consequence if a select field is set as mandatory, it is
detected as missing even if it is filed and so you can't submit the form
and receive the new supplemantal issue.

Test plan:
1- Create (or find) a subscription for a biblio record and select the
   option "Create an item record when receiving this serial"
2- Be sure to have at least one mandatory subfield that is filed with a
   select input in the framework used by the biblio record. (ex: 952$a,
   952$b or 952$c).
3- From the subscription-detail page click on "Receive"
4- In the lower part--Supplemental issue--fill the suppelemant details,
   change the status to "Arrived" and fill the item form that appears.
5- Click on "Save"
6- Check that an error box appear with the message " Form not submitted
   because of the following problem(s) 1 mandatory fields empty
   (highlighted)" (the number can be different according to the number of
   concerned subfields)
7- Apply the patch
8- Repeat step 3 to 5
9- Check that no error appear and that your item has been created

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4f6164d1940f4d666d2efb0e3e8d76bea3108125)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31186: Fix the hidingrules test for result numbering
Marcel de Rooy [Tue, 19 Jul 2022 11:27:55 +0000 (11:27 +0000)]
Bug 31186: Fix the hidingrules test for result numbering

We should not test the $hidingrules variable but the number
of keys it contains.

Test plan:
Clear OpacHiddenItems.
Check with and without this patch search result numbering on
the OPAC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d7647052f20104b70ba6b02d1535874fb9ab3b61)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 27045: (follow-up) Fix delimiter in header rows
Katrin Fischer [Sat, 16 Jul 2022 11:23:54 +0000 (11:23 +0000)]
Bug 27045: (follow-up) Fix delimiter in header rows

The header rows still showed \t because the newly defined
variable wasn't used there.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2eea061ca30e4810b07ca2920bfe1e55762fab02)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 27045: Fix other exports using CSV profiles
Jonathan Druart [Fri, 20 Nov 2020 14:33:14 +0000 (15:33 +0100)]
Bug 27045: Fix other exports using CSV profiles

This patch corrects the export of the 2 other reports
using CSV profiles:

* Late issues (serials)
* Basket (acquisitions)

To test:
1) Late issues
* Update the late issues sample report to use tab as separator
* Create a subscription
* Go to serial collection and 'generate next' to get some late issues
* Go to Claims
* Export the late issues and verify format is correct
* Verify exported file has tabs

2) Basket summary
* Create an order with several order lines
* Create an SQL type CSV profile for basket export using tab as separator
  Example: aqorders.quantity|aqordres.listprice|Title=biblio.title
* Export the basket using your configured CSV profile
* Verify exported file has tabs

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7cd84171ab57a35138fa5c585d2ed6de442e453c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 27045: Fix items lost report export if delimiter is tab
Jonathan Druart [Fri, 20 Nov 2020 14:33:02 +0000 (15:33 +0100)]
Bug 27045: Fix items lost report export if delimiter is tab

When choosing tabulation as the delimiter for a CSV profile
for the lost item report, the tabs appear in the file as \t
instead of as proper tabs.

title\tauthor\tstocknumber\tcallnumber
"E Street shuffle :"\"Heylin, Clinton."\\

To test:
* Upate the existing sample lost item CSV profile to use tabs as
  separator
* Make sure you have some lost items in your database or create some
* Go to Reports > Lost items
* Run the report
* Check all or some of the checkboxes in the result list
* Export using the link on top and the CSV profile
* Verify the tabs are not exported correctly
* Apply patch
* Verify tabs now are proper tabs instead of \t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 983965ee4790fd7841af87fcfdb8395ccea9e813)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30268: Check mandatory fields in addorderiso2709.pl
Julian Maurice [Wed, 9 Mar 2022 15:42:50 +0000 (16:42 +0100)]
Bug 30268: Check mandatory fields in addorderiso2709.pl

Test plan:
1. Make sure you have mandatory item subfields in the MARC bibliographic
   framework used in acquisitions ("ACQ" if it exists, the default framework
   otherwise).
2. Use the "Stage MARC records for import" tool to upload a file. Do not import
   the bibliographic records.
3. Create a new acquisition basket ("Create items when:" must be set to
   "placing an order") and add a new order from a staged file
4. Select the file you just uploaded
5. In the "Items information" tab, make sure at least one mandatory subfield is
   empty
6. Try to submit the form. If there are errors about other mandatory fields
   (like the fund for instance), fix those errors and resubmit. There should be
   an error message about mandatory item subfields.
7. Enter a value for the mandatory item subfields and resubmit the form. Verify
   that the order and the item have been correctly created.

Signed-off-by: Thibault Kero <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e37359cae96535e45ccb26a5e22d5b67920d27cd)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 7660: Use first available categorycode when none passed in
Nick Clemens [Mon, 18 Jul 2022 11:49:57 +0000 (11:49 +0000)]
Bug 7660: Use first available categorycode when none passed in

The code that populates the patron messaging preferences on initial form load
expects to have a category selected. Currently we only have one if one was
passed to the form. When creating an account from a parent, we don't have a
category explicitly selected - so we can just select the first of the possible
categories

To test:
 1 - In KTD set 'Juvenile' category to have some messaging preferences
 2 - Find a patron, say Edna Acosta, and 'Add guarantee'
 3 - In new form preferences are blank, cancel
 4 - Apply patch, restart all
 5 - Go to Edna, click 'Add guarantee'
 6 - Preferences are populated!
 7 - Cancel
 8 - Go to 'Patrons' module
 9 - Click "+ New patron"
10 - Confirm messaging preferences load correctly when not adding child

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 146423f1bcbefda20995429a1f8ed9152977495c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30570: Compiled CSS
Lucas Gass [Tue, 23 Aug 2022 20:00:28 +0000 (20:00 +0000)]
Bug 30570: Compiled CSS

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30570: Replace the use of jQueryUI tabs in OPAC templates
Owen Leonard [Wed, 6 Jul 2022 11:36:11 +0000 (11:36 +0000)]
Bug 30570: Replace the use of jQueryUI tabs in OPAC templates

This patch switches to Bootstrap tabs anywhere in the OPAC where
jQueryUI tabs were used.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Test the item type/collection/shelvinglocation tabs on the advanced
  search page. Test that it works correctly with different variations of
  the OpacAdvancedSearchTypes system preference.
- Search for an authority record and view the details. The "Notes"
  tab should be styled correctly.
- Locate a bibliographic record and view the detail page. Verify
  that tabs are working, including all the options:
- Holdings
- Other holdings ( If OpacSeparateHoldings is enabled)
- Descriptions ( MARC notes )
- Subscriptions
- Serial collection (UNIMARC, untested)
- Components ( If ShowComponentRecords is enabled. Link to sample
  record:
  https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78023 )
- Comments
- Editions (OPACFRBRizeEditions)
- Html5media ( If HTML5MediaEnabled is on. Link to sample records:
  (https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10685)
- Images ( If OPACLocalCoverImages is enabled )

Bonus points for testing these tabs for which I don't have
credentials:
- Syndetics TOC
- Syndetics Excerpt
- Syndetics Reviews
- Syndetics AuthorNotes
- LibraryThing for Libraries (with LibraryThingForLibrariesTabbedView
  set to "in tabs."
- NovelistSelect

- Check tabs on these patron-related pages:
  - Checkout history
  - Search history
  - Patron summary. The following tabs are
    ✓ Checkouts
    ✓ Relatives' checkouts
    ✓ Overdues
    ✓ Fines
    ✓ Relatives' fines
    ✓ Holds
    ✓ Recalls
    ✓ Article requests
    ✓ Overdrive

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Bug 30570: (follow-up) Correct rebase errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 894f7013ebef9ec9c8c6ffa52f5e5b9554f27986)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30039: (QA follow-up) Change published on to publication date
Katrin Fischer [Mon, 18 Jul 2022 20:18:50 +0000 (20:18 +0000)]
Bug 30039: (QA follow-up) Change published on to publication date

As the issue might not have been published yet, but should have
been that seemed a better fit.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 44d0f585d171b16e4eb8f435d79330d1423b9c60)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30039: Add published on column to claims.pl
Lucas Gass [Mon, 7 Feb 2022 19:02:53 +0000 (19:02 +0000)]
Bug 30039: Add published on column to claims.pl

To test:
1. Have a vendor setup
2. Go to serials and add a new serial w/ that vendor.
3. When creating a serial make this first issues sometime in the past.
4. Go to Claims, choose your vendor and load the table.
5. No published on column.
6. Apply patch
7. Try step 4 again and now you should see a published on column.

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 d8b63b05e938e58997950617e55af303a03b4ec3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 26377: Simplify JS code
Jonathan Druart [Tue, 31 May 2022 09:18:08 +0000 (11:18 +0200)]
Bug 26377: Simplify JS code

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0d19d7bcc50d48aa326a909b221a1251f664d632)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 26377: Show when loading the page if needed
Jonathan Druart [Tue, 31 May 2022 09:16:57 +0000 (11:16 +0200)]
Bug 26377: Show when loading the page if needed

Prevent a blink

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 97e8a5b00df05c25180b4564f21d689caae18902)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 26377: Clearly label parts of subscription-add.pl that relate to optional item...
Owen Leonard [Thu, 12 May 2022 16:25:05 +0000 (16:25 +0000)]
Bug 26377: Clearly label parts of subscription-add.pl that relate to optional item records

This patch modifies the form for adding a new subscription so that the
collection and item type fields are shown only when the subscription is
configured to create an item when receiving.

To test, apply the patch and go to Serials -> New subscription.

- When the page first loads, the "Do not create an item record when
  receiving this serial" radio button should be selected.
- Under the "Location" field there should be no item type or collection
  field.
- Select the "Create an item when receiving this serial" radio button.
- The item type and collection fields should appear.
- Test that the values are correctly saved when you add or edit a
  subscription.
- If you edit a subscription which had item type and collection defined,
  and you switch to "Do not create an item..." the record should save with
  empty values for those fields.
- Confirm that existing subscriptions open with the correct settings
  applied: Only records with "Create an item..." checked should open
  with the item type and collection fields displayed.

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 13525cff5ce866b060fcc899aa696646db351c3a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31020: Fix PassItemMarcToXSLT in system preferences description
Fridolin Somers [Thu, 23 Jun 2022 01:04:47 +0000 (15:04 -1000)]
Bug 31020: Fix PassItemMarcToXSLT in system preferences description

Bug 28373 added system preference PassItemMarcToXSLT is referenced is all XSLT system preferences.
But it only applies on results pages.
The only use in perl code is in C4::Search :
 > $marcrecord->delete_fields( @fields ) unless C4::Context->preference('PassItemMarcToXSLT');

I've tested by adding in all XSLT files :
  <strong>ITEMS <xsl:value-of select="count(marc:datafield[@tag=952])"/> </strong>
Number of items only appears in OPAC and staff interface results pages.

In fact only search pages get MARC record from search engine, in which items datas have been embedded for indexing.
In other pages MARC record does not embed items datas.

This patch adds "MARC21 952, UNIMARC 995" to be explicit we talk about
MARC datas not item tags build in XML recieved by XSLT.

Test plan :
1) Apply patch
2) Search for PassItemMarcToXSLT in system preferencies
3) Look at description of PassItemMarcToXSLT
4) Check PassItemMarcToXSLT only apprears in OPACXSLTResultsDisplay and XSLTResultsDisplay

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 f6dbad91c4f114471036695f1476dc5315a94d1a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30905: (follow-up) Get logged in branch once
Tomas Cohen Arazi [Tue, 19 Jul 2022 12:51:16 +0000 (09:51 -0300)]
Bug 30905: (follow-up) Get logged in branch once

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fc919fc796df42c29e73cd527d3c425377fcc27a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30905: Show waiting recalls in patron account
Aleisha Amohia [Mon, 6 Jun 2022 23:36:38 +0000 (23:36 +0000)]
Bug 30905: Show waiting recalls in patron account

This enhancement shows recalls ready for pick-up on the patron's account
so they can't be missed.

To test:
1) Enable the UseRecalls system preference and set up your
recalls-related circulation rules.
2) Check out an item to Patron B.
3) Log into the OPAC as Patron A and search for the item.
4) Place a recall on that item. Note the pickup library.
5) Go back to the staff client. At the top right of the page, confirm
your logged in library matches the recall pickup library. Set the
library to the recall pickup library if needed.
6) Check in the recalled item and confirm the recall as waiting for
Patron A.
7) Go to Patron A's account (members/moremember.pl). Confirm the recall
shows under 'Recalls waiting here' and all the information is correct.
8) Go to Patron A's checkouts (circ/circulation.pl). Confirm the recall
shows under 'Recalls waiting here' and all the information is correct.
9) Click on the menu at the top right of the page and choose 'Set
library'. Change the library to some other library.
10) Repeat steps 7 and 8, however this time the recall should show under
'Recalls waiting at other libraries'.

Sponsored-by: Catalyst IT
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 952f00f20b0ab110bc9b2b2e7cf4eb6febf31698)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30935: Holds to pull shows wrong first patron
Shi Yao Wang [Wed, 29 Jun 2022 15:13:27 +0000 (11:13 -0400)]
Bug 30935: Holds to pull shows wrong first patron

When different patrons have item level holds on the same item, Holds to
pull shows wrong first patron.

Test plan:
1) Place a record-level hold on a biblio with an available item
2) Check the Holds to pull page (circ/pendingreserves.pl)
--> The biblio should appear in the list and the patron should appear in the 'First patron' column
3) Place a second record-level hold on the same biblio
4) Go back to the Holds to pull page
--> The biblio is still there, but the patron in the 'First patron' column is the second patron
5) Place a third record-level hold on the same biblio
6) Go back to the Holds to pull page
--> The biblio is still there, but the patron in the 'First patron' column is the third patron
7) Apply the patch
8) Go back to the Holds to pull page
--> The biblio is still there and the patron in the 'First patron' column is the first patron

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 87b985528edf0a714121fed13d2390fd57a27a36)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 27683: Impact on catalogue/detail.pl
Fridolin Somers [Thu, 11 Feb 2021 15:27:54 +0000 (16:27 +0100)]
Bug 27683: Impact on catalogue/detail.pl

Since EasyAnalyticalRecords pref is now in GetAnalyticsCount, remove
test in catalogue/detail.pl.

Test plan :
1) Build an item and a linked analytical record with 773$0 and $9
2) Go to record detail page
3) Enable EasyAnalyticalRecords
4) You see analytics tab and analytical count on item
5) Disable EasyAnalyticalRecords
6) You dont see analytics tab

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 cc23a4c478ab57f3b987b27fb7c2beebd4ceb823)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 27683: Bind results of GetAnalyticsCount to the EasyAnalyticalRecords pref
Fridolin Somers [Thu, 11 Feb 2021 14:33:35 +0000 (15:33 +0100)]
Bug 27683: Bind results of GetAnalyticsCount to the EasyAnalyticalRecords pref

C4::Items::GetAnalyticsCount is part of the easy analytics feature.
Like Bug 20702 make early return when the system preference EasyAnalyticalRecords is disabled.
Actually it may block an item deletion for wrong reason.

Test plan :
1) Dont apply patch
2) Build an item and a linked analytical record with 773$0 and $9
3) Enable EasyAnalyticalRecords
4) Try to delete the item
5) You have an alert because linked to analytics
6) Disable EasyAnalyticalRecords
7) Try to delete the item
8) You have an alert because linked to analytics
9) Apply patch
10) Try to delete the item
11) No alert, it works :D

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 dfc390940d8688195c5046f978f08bbd64bf24e1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 27683: Unit test for GetAnalyticsCount
Fridolin Somers [Thu, 11 Feb 2021 15:28:18 +0000 (16:28 +0100)]
Bug 27683: Unit test for GetAnalyticsCount

Run prove t/db_dependent/Items/GetAnalyticsCount.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd7652255c1a4c2ea6c62fab91cb94a92e312258)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30447: Unit tests
Michal Urban [Wed, 15 Jun 2022 08:04:37 +0000 (04:04 -0400)]
Bug 30447: Unit tests

Added tests to ensure that Koha::Holds->get_items_that_can_fill returns items with datecancelled and datearrived
Added test for correct number of items for each call of "get_items_that_fill"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b4a9edc83f72b9740cd59bd5c842855cd65e19cc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30447: Check if transfers arrived or cancelled
Nick Clemens [Mon, 4 Apr 2022 12:21:43 +0000 (12:21 +0000)]
Bug 30447: Check if transfers arrived or cancelled

TO test:
 1 - Find a bib with a single item
 2 - Browse to Circulation->Transfer
 3 - Transfer the item to another branch
 4 - Check the item in at current branch and cancel the transfer on the dialog
 5 - Place a hold on the biblio for a patron at current branch
 6 - Browse to Circulation->Holds to pull
 7 - Item does not show
 8 - Apply patch, restart all
 9 - Browse to Circulation->Holds to pull
10 - Item shows

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 206ba015c4a4b28b022ab9d6481a07ab76461747)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29922: (follow-up) Remove extra sort
Shi Yao Wang [Mon, 4 Jul 2022 13:18:51 +0000 (09:18 -0400)]
Bug 29922: (follow-up) Remove extra sort

Remove wrong sort in staff advanced search page

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 15918c33701fe2cf3b84e568bb9bd16b328f172f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29922: Make get_search_groups return results sorted by title
Shi Yao Wang [Mon, 27 Jun 2022 15:18:05 +0000 (11:18 -0400)]
Bug 29922: Make get_search_groups return results sorted by title

get_search_groups from Koha/Library/Groups.pm returns library groups sorted by title.

Test plan:
1- Go to administration > library groups and create multiple library groups with different names (e.g. AGroup, BGroup, ÄGroup, etc.). Make sure to tick "Use for OPAC search groups" checkbox.
2- Go to advanced search in OPAC.
3- Under "Groups of librairies" , click the select button.
4- Notice that the library groups are not in alphabetical order.
5- Apply the patch.
6- Notice that the library groups are in alphabetical order.
7- Run `prove t/db_dependent/LibraryGroups.t` and all test should pass.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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 d86d949551201bfc7745f65fbb8428abac324cb4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31163: Sort cashups newest to oldest
Martin Renvoize [Fri, 15 Jul 2022 13:58:40 +0000 (14:58 +0100)]
Bug 31163: Sort cashups newest to oldest

The cashup history table was sorting from oldest to newest.. it's
perferable to show the most recent at the top by default.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dbbaba3ee08f6551294a00194f03e6d64a409431)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29114: Trim whitespace before the barcode
Andrii Veremeienko [Fri, 29 Oct 2021 13:44:19 +0000 (16:44 +0300)]
Bug 29114: Trim whitespace before the barcode

The solution was to add regexp that trims all whitespaces.

How to test:
1. Go to the koha/virtualshelves/shelves.pl;
2. Add new list or edit existing one;
3. Start adding new items;
4. In the "Barcode" field add barcode(s) with whitespaces before them;
5. Observe that it wasn't added as the barcode isn't recognized because of whitespaces;
6. Apply the patch;
7. Repeat step 4;
8. Observe that the item was successfully added;

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 c4ee39bf3aa8f1077ec925630e70e22aa2f35f6a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 27667: (QA follow-up) Fix singular index and rephrase heading
Katrin Fischer [Fri, 15 Jul 2022 13:23:18 +0000 (13:23 +0000)]
Bug 27667: (QA follow-up) Fix singular index and rephrase heading

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 325d783419fd539ea596bf1f0a1ddc1b3ace66e2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 27667: Display a warning for records missing in Elasticsearch
Fridolin Somers [Wed, 11 May 2022 19:38:23 +0000 (09:38 -1000)]
Bug 27667: Display a warning for records missing in Elasticsearch

On "About Koha" page are displayed the numbers of indexed biblios and authorities with ES.
It could be great if we could have comparison with the number of records in the database to display the number of missing records.
In the "System information" tab with the other "Data problems".

If Searchengine has any issue (index count will be -1), we do not
display missing records.

Test plan :
1) Use Elasticsearch searchengine
2) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
3) Go to "About Koha" page and look at System information tab
=> you see no warning
4) On a biblio record delete the MARCXML in biblio_metadata.metadata
5) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
6) Go to "About Koha" page and look at System information tab
=> you see warning : 1 record(s) missing on a total of 435 in indice koha_kohadev_biblios.
7) On a authority record delete the MARCXML in auth_header.marcxml
8) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
9) Go to "About Koha" page and look at System information tab
=> you see warning : 1 record(s) missing on a total of 1705 in indice koha_kohadev_authorities.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fee0f29792353d895af9eb6328cd50faef743162)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 20439: Sort SMS providers in alphabetical order by DB field
Lucas Gass [Fri, 15 Jul 2022 16:55:53 +0000 (16:55 +0000)]
Bug 20439: Sort SMS providers in alphabetical order by DB field

To test:
1/ Add 'Email' to the 'SMSSendDriver' system preference.
2/ Make sure 'EnhancedMessagingPreferencesOPAC' and 'EnhancedMessagingPreferences' are turned on.
3/ Add some SMS providers (/cgi-bin/koha/admin/sms_providers.pl) with different names.
4/ Notice on memberentry.pl and opac-messaging.pl the SMS providers sort by when they were added, not alphabetically.
5/ Apply patch and restart services.
6/ Look at memberentry.pl and opac-messaging.pl and notice that they SMS providers now sort alphabetically.

Signed-off-by: George Williams <george@nekls.org
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd49601079fcf6790364522b41bd038bca3190c6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31144: When modifying an order we should not load the vendor default discount
Nick Clemens [Tue, 12 Jul 2022 18:39:06 +0000 (18:39 +0000)]
Bug 31144: When modifying an order we should not load the vendor default discount

After placing an order in a basket with a discount of "0" if you attempt to modify we will load the vendor default discount, this can lead to accidentally applying a discount when modifying other order parts

To test:
0 - Have a vendor with a discount set
1 - Add an order to a basket
2 - While adding, set discount to 0
3 - Add order - prices are calculated ocrrectly
4 - Modify order
5 - Note discount is populated with vendor discount
6 - Cancel
7 - Apply patch
8 - Modify order
9 - Discount remains at 0
10 - Repeat with a vendor with no discount set
11 - Placing order not specifiying discount it remains blank
12 - Modifying order discount remains blank
13 - Modify order and set discount
14 - Confirm it is retained on modifcation

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 73d2066837e5f73e44c89952497d12e6f1d13342)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31068: Context for translation: Print (verb) vs. Print (noun)
Caroline Cyr La Rose [Mon, 4 Jul 2022 16:10:54 +0000 (12:10 -0400)]
Bug 31068: Context for translation: Print (verb) vs. Print (noun)

This patch adds context to the term Print in the context of message transport types (as opposed to printing something/print button), for translation purposes.

To test:
0- Apply patch

Check the terms to be changed
1- Go to Tools > Notifications & slips
2- Edit a notification
** 3- In the tabs for different transport types, check the 'Print' term (letter.tt)
4- Go to Tools > Overdue notice/status triggers
** 5- In the transport types, check the 'Print' column heading (overduerules.tt)

Add a new language (fr-CA in the example, change for whatever language code you want)
6- In a terminal, run
gulp po:create --lang fr-CA
7- Then, run
gulp po:update --lang fr-CA
8- In system preferences, enable the new language in language and OpacLanguages
9- Switch the language in staff interface and OPAC

Change the translations
10- In your favourite text editor, open fr-CA-messages.po
11- Find the string msgctxt "Message transport type"
12- Enter a word in msgstr
13- Save the file
14- In a terminal, go to misc/translator
15- Run
./translate install fr-CA

Check the translations
16- Redo the steps to check the terms (steps 1-5) and make sure the terms in steps 3 and 5 are changed for the word you put in step 12.

17- Optionally, check the other pages where the term is supposed to be unchanged and make sure it is unchanged

Check the terms to leave unchanged (optional)
18- Enable the HoldsAutoFill and UseCashRegisters system preferences
19- Go to Administration > Cash registers and create a cash register
20- Go to a patron's account
** 21- Check the 'Print' button in the menu bar or the patron's account (members-toolbar.inc)
22- Go to the 'Accounting' tab
23- Create a manual invoice
** 24- In the 'Transactions' tab, check the 'Print' button in the fee line (boraccount.tt)
25- Pay the fee (make sure to use the cash register)
** 26- In the 'Transactions' tab, check the 'Print' button in the payment line (boraccount.tt)
27- At the top of the transactions table, click the 'Export' option
** 28- Check the 'Print' option (columns_settings.inc)
29- Go to the 'Check out' tab and check out an item
30- Go to the item's bibliographic record
** 31- Check the 'Print' button in the menu bar of the detailed record (cat-toolbar.inc)
32- Add the record to the cart and open the cart
** 33- Check the 'Print' button in the cart (basket.tt)
34- Place a hold on the item
35- In the search bar at the top, click the 'Check in' tab and check in the item
** 36- Check the 'Print' button in the 'Hold filled for' message (returns.tt)
37- Go to Tools > Cash summary for Branch
38- Click 'record cashup' and confirm
39- Click the 'Summary' link in the 'Last cashup' column
** 40- Check the 'Print' button in the cashup summary modal (cashup_summary.inc)
41- Go to Serials
42- Create a subscription (if there aren't any)
43- Receive an issue
44- From the subscription detail page, go to Create routing list
45- Add a recipient to the list
46- Save the routing list
47- Click 'Save and preview routing slip'
** 48- Check the 'Print' button in the routing list preview (routing_preview_slip.tt)

Note: I can't find where the 'Print' from tinymce_i18n.inc is displayed in the staff interface

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 920529df429ee12694ed92c7912e098da0f05942)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29105: Add effective_itemtype handling to items api
Martin Renvoize [Fri, 24 Sep 2021 11:19:12 +0000 (12:19 +0100)]
Bug 29105: Add effective_itemtype handling to items api

This patch adds effective_item_type_id to the items api.

We overload the to_api method to append the effective_item_type_id field
with that of the effective itemtype code.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dc75b5d5cd181d8f8e50e98adb7afc69fc6a8838)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29105: Unit test
Martin Renvoize [Fri, 24 Sep 2021 14:13:55 +0000 (15:13 +0100)]
Bug 29105: Unit test

This patch adds a unit test for the addition of effective_item_type_id
to the items responses.

Test plan
1) Run the unit test prior to applying the second patch and confirm it
   fails
2) Apply the second patch and confirm the unit test now passes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6ca908816f2e56acced272f7fc56a0f68df62a43)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30882: (QA follow-up) Fix tests
Tomas Cohen Arazi [Mon, 18 Jul 2022 17:36:28 +0000 (14:36 -0300)]
Bug 30882: (QA follow-up) Fix tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f8f9231562be10c769c57d42b0f3d2e395e5aac3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29632: Schema update
Lucas Gass [Tue, 23 Aug 2022 17:52:46 +0000 (17:52 +0000)]
Bug 29632: Schema update

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29632: (QA follow-up) Add ENUM value to kohastructure.sql :-D
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:09:41 +0000 (12:09 -0300)]
Bug 29632: (QA follow-up) Add ENUM value to kohastructure.sql :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8aaa728aeb39308de99e21175f38c2831ba36038)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29632: DBRev 22.05.04.001
Lucas Gass [Tue, 23 Aug 2022 17:42:43 +0000 (17:42 +0000)]
Bug 29632: DBRev 22.05.04.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 30882: Add max_result_window to index config
Fridolin Somers [Thu, 2 Jun 2022 06:24:03 +0000 (20:24 -1000)]
Bug 30882: Add max_result_window to index config

Elasticsearch number of results is by default limited by setting "index.max-result-window", default value is 10000.
https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-max-result-window

We use this setting:
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/SearchEngine/Elasticsearch/Search.pm#L411

I propose we add this setting in index config.

Test plan:
1) Use Elasticsearch
2) Apply patch and flush memcached
3) Rebuild indexes: misc/search_tools/rebuild_elasticsearch.pl -v -b -d
4) Check the settings of index (when using koha-testing-docker*):
   curl 'es:9200/koha_kohadev_biblios/_settings?pretty&filter_path=**.max_result_window'
5) You should see:
   "max_result_window" : "1000000"

* You also need to add this setting to the es section in koha-testing-docker's
docker-compose.yml (after the networks configuration):
     ports:
         - "9200:9300"

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 90ef5ec8c81b6010e6d7eafc6498bc2e6a9ca8f5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29632: Unit tests
Nick Clemens [Mon, 11 Jul 2022 15:56:05 +0000 (15:56 +0000)]
Bug 29632: Unit tests

This patch adds unit tests, as well as changing existing test to use a mock
and read the data as passed in tests, rather than relying on what exists in
the DB

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 295987a06184f8538a98a50907b5caf97988a242)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29632: Don't sort cn-sort numerically
Nick Clemens [Tue, 28 Jun 2022 13:47:45 +0000 (13:47 +0000)]
Bug 29632: Don't sort cn-sort numerically

When defining our sort fields in we defined all as 'numeric'

For other string containing numbers this is likely correct, however,
for callnumbers it is not. e.g. E45 should sort before E7

This patch adds a new 'callnumber' type and deifnes this for cn-sort and
adds to the field maping a sort without numeric set

To test:
0 - Be using ES with Koha
1 - On records with single item, add callnumbers:
    VA65 E7 R63 1984
    VA65 E7 T35 1990
    VA65 E45 R67 1985
2 - Add public note 'shrimp' or something to make them easily searchable as a group
3 - Search for 'shrimp', sort by callnumber
4 - Note E45 comes last, it should come first
5 - Apply patch
6 - Reset ES mappings
7 - Reindex ES
8 - Repeat search
9 - Sorting should be correct when set to callnumber

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Michal Urban <michalurban177@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b8b8a62f112dc6937a7187d4150146a7cad6941f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31153: Correct include for patron-search-header
Lucas Gass [Thu, 14 Jul 2022 15:10:55 +0000 (15:10 +0000)]
Bug 31153: Correct include for patron-search-header

To test:
1) Turn on recalls
   1.1) In Administration > Global system preferences, enable UseRecalls
   1.2) Add recalls permissions in your circulation rules
2) In the OPAC, log in as a patron
3) Find a record with checked out items and place a recall
4) In the staff interface, go to the patron's account
5) Click on any tab on the left in the patron's account (e.g. Holds history)
--> Note that the Koha logo and search bar is at the top of the page between the module menu and the breadcrumbs
6) Click on the 'Recalls history' tab
--> Note that the Koha logo and search bar disappear
7) Apply patch
8) Conform search bar is there

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6dc978375e5a11829951aca2808482e7d7723c39)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 14680: Always subtract discount from price to calculate estimated cost
Nick Clemens [Tue, 12 Jul 2022 18:10:54 +0000 (18:10 +0000)]
Bug 14680: Always subtract discount from price to calculate estimated cost

This patch simply removes a discrepancty where when a discount is provided on the order form
we add the discount to the price, and when it comes form the vendor we subtract the discount.

Discounts should always descrease the estimated cost

To test:
 0 - Have a vendor with a discount of 10% specified
 1 - Export a record from your Koha
 2 - Stage the record for import and match on biblionumber
 3 - Add to a basket in acq from the staged file
 4 - Select the title, and set order price to $10 and do not fill the discount field
 5 - Add the order - note $10 RRP and $9 actual/budgeted cost
 6 - Repeat 2&3
 7 - Select the tile, set price $10 and discount 50%
 8 - Add the order - note $20 RRP and $10 actual/budgeted cost! FAIL
 9 - Apply patch, restart all
10 - Repeat 2-7
11 - Add the order, note $10 RRP and $5 actual.budgeted cost

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7c734c6903a823eeb58be9ab1c4af251def776b7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31036: (QA follow-up) Add a warning to the system preference
Martin Renvoize [Fri, 15 Jul 2022 14:20:03 +0000 (15:20 +0100)]
Bug 31036: (QA follow-up) Add a warning to the system preference

As suggested by Katrin, adding a warning to the system preference that
this has an effect on SIP configurations that needs to be understood.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f154fb0372d2e24318cad75bb65b993d47da8290)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31036: Treat SIP00 that same as CASH
Martin Renvoize [Fri, 24 Jun 2022 08:20:52 +0000 (09:20 +0100)]
Bug 31036: Treat SIP00 that same as CASH

SIP00 is the code for CASH transactions that have taken place on a SIP
client.  Cash management treats CASH type transactions as a special case
for banking and register requirements. This patch brings SIP00 in line
with the CASH handling code of cash management.

Test plan
1) Enable cash management with 'EnablePointOfSale'
2) Enable cash registers with 'UseCashRegisters'
3) Add a cash register via 'Administration > Cash registers'
4) Make some payments against the ash register in the staff client
5) Attempt to make a payment via a SIP client without having associated
   a cash register to the SIP account config
5a) This should now fail
6) Attach the cash register to the SIP account used above
6a) Payment should now work again on SIP transactions
7) Look at the cash register details page for the cash register
7a) 'Bankale' should now include cash from both SIP and Staff client
sales

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9d8be887d08f523171faa30b35ff86798c4b0115)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31069: Remove ExplodedTerms dependency on templates
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:33:47 +0000 (12:33 -0300)]
Bug 31069: Remove ExplodedTerms dependency on templates

This patch removes the use of templates and CGI in ExplodedTerms by using the
Koha::I18N library.

The functionality on the package is too simple, and messing with the
template paths complexity on the tests was too much, given we have a
nice way to have translatable strings at the package level.

This patch does that, and cleans up the test file as well, that required
complex template and CGI mocking to run properly.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/SuggestionEngine_ExplodedTerms.t
=> FAIL: It fails in master
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass
4. Follow the original test plan
=> SUCCESS: Things work
5. Enjoy the rest of the day and forget this ever happened

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ecd91d608914aa04660b3f83e9337effbed3822e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31069: fix <span> in OPAC search suggestions (Did you mean)
Victor Grousset/tuxayo [Sat, 9 Jul 2022 03:39:39 +0000 (05:39 +0200)]
Bug 31069: fix <span> in OPAC search suggestions (Did you mean)

== test plan ==
1. Enable "Did you mean?":
   . go to Administration > Additional parameters > Did you mean?
   . put a tick in each plugin and save the configuration
2. In the OPAC, search for 'open source'
3. Without the patch you see escaped <span> after "Did you mean:"

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 1672d0c1c0be45aba66c17b2024495852f1ab2fe)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 29094: Adding hold via SIP should check if patron can hold item first
Kyle Hall [Thu, 23 Sep 2021 12:57:30 +0000 (08:57 -0400)]
Bug 29094: Adding hold via SIP should check if patron can hold item first

When placing holds via SIP2, there is no holdability check. This seems very incorrect.

Test Plan:
1) Apply this patch
2) prove -r t/db_dependent/SIP

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 7b21fb020b868ebaad97fc8a8970dc9570b76e56)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
21 months agoBug 31137: (QA follow-up) Also fix new template page
Nick Clemens [Fri, 15 Jul 2022 12:10:43 +0000 (12:10 +0000)]
Bug 31137: (QA follow-up) Also fix new template page

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7bfcb8288b9eca65ee2b3e36501242dad3331102)

21 months agoBug 31137: Only display label printer profiles when editing labels
Adolfo Rodríguez [Tue, 12 Jul 2022 07:20:45 +0000 (09:20 +0200)]
Bug 31137: Only display label printer profiles when editing labels

This patch filters the printer profiles in the label edition template so you may only choose Printer Profiles created for Labels.

To test
1 Create a new Printer Profile in Patron Cards
2 Edit a Label template, pick the Printer Profile you just created.
3 Save the Label Template. You get an error 500
4 apply patch, restart services
5 Edit a Label template and check that you can't pick the Printer Profile you created in Patron Cards

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e7d0b2ab47f1770ed11d3edc5ece8a4cf6753829)