koha.git
6 months agoBug 34413: Fix style of Flatpickr in iOS mobile view
Owen Leonard [Thu, 9 Nov 2023 13:21:06 +0000 (13:21 +0000)]
Bug 34413: Fix style of Flatpickr in iOS mobile view

This patch updates Flatpickr CSS in the OPAC and staff interface so that
date fields are displayed correctly in iOS mobile views.

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

- In the OPAC, click "Create new account"
- In the account entry form, confirm that the date of birth field looks
  correct and that the date-picker works as it should.
- In the staff client, go to Patrons -> New patron.
- Check the date of birth field in this form too.

This patch has been tested in the Xcode iOS device simulator with iOS
17. While I wasn't able to reproduce the problem in Firefox, I was able
to use the developer tools' responsive design mode to trigger the mobile
view and thus be able to see the styles which are being applied:

- In the OPAC, on the "Create new account" screen, open the Web
  Developer Tools panel (Tools -> Browser tools -> Web Developer Tools).
- Click the "Responsive Design Mode" button in the upper-right corner of
  the developer tools panel (it looks like a phone and tablet together).
- The main browser window will now how some settings at the top.
- In the first dropdown, choose an iPhone model.
- The date of birth field should now be styled differently because of
  the addition of a "flatpickr-mobile" style.
- Right-click the field and choose "Inspect." In the developer console
  you can see the styles which are being applied to the field. One of
  those should be ".flatpickr-input.flatpickr-mobile"

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9e9fa64d5a9f8966c45a923b258c994df70ac35f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0b468bd4139b1d35e87e0ff44b6f5e48ca26641d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35295: Move JS asset in returns.tt
Lucas Gass [Wed, 8 Nov 2023 21:18:27 +0000 (21:18 +0000)]
Bug 35295: Move JS asset in returns.tt

To Test:
1. Place a hold
2. Check-in an item of the held record
3. No hold modal ðŸ˜±
4. APPLY PATCH
5. Hold modal!!!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 771334218acc2a5eb97bac1eab38a53543084444)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6abfcbecd878bb634b129df59c345f2c80c4955f)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35262: Improve OPAC self registration confirmation page
Owen Leonard [Mon, 6 Nov 2023 19:40:06 +0000 (19:40 +0000)]
Bug 35262: Improve OPAC self registration confirmation page

This patch corrects logic in the OPAC self registration confirmation
template so that the right column markup is shown when various
combinations of OpacNav, OpacNavBottom, and OpacNavRight are displayed.

To test, apply the patch and enable the PatronSelfRegistration system
preference, and deactivate the PatronSelfRegistrationVerifyByEmail
preference.

- Go to the OPAC and start the process of registering online.
- Fill in the form and submit it.
- On the registration confirmation page, check that the layout looks
  correct.
- Test with the presence of various combinations of OpacNav,
  OpacNavBottom, and OpacNavRight HTML customizations.

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 64edb692458262133818553c4cbfa86ca3612260)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4e34b92112df0e97d7a4fcc72c5bd95ca7c202dd)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35206: Adjust style of add button on curbside pickups administration
Owen Leonard [Tue, 31 Oct 2023 17:10:15 +0000 (17:10 +0000)]
Bug 35206: Adjust style of add button on curbside pickups administration

This patch adds Bootstrap classes to the "Add" button on the curbside
administration page, in the "Curbside pickup hours" section. This makes
it consistent with the markup of similar buttons in the interface and
makes it slightly smaller so that it fits better in the form.

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

- Go to Administration -> Curbside pickups.
- Fill out the form, including the "New slot" fields in the "Curbside
  pickup hours" section.
  - Confirm that the corresponding "Add" button looks correct, and that
    it works to add your new slot.

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 cc70e17f5d07ad8988a1a4a02e0049abc7428547)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b7cb356363d09c1bb1839165cbc4d090c47317ea)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35198: Sort database column names alphabetically on automatic item modification...
Owen Leonard [Tue, 31 Oct 2023 13:48:11 +0000 (13:48 +0000)]
Bug 35198: Sort database column names alphabetically on automatic item modification page

This patch modifies the automatic item modification by age page so that
the rule entry form sorts <select>s alphabetically, making it easier to
find the entry you need.

The [% FOR field IN... %] directives now include the "sort" method, e.g.

    [% FOR field IN agefields.sort %]

To test, apply the patch and go to Cataloging -> Item modifications by
age

- Click the "Add rules" button, then the "Add rule" button.
- Check the "Age field," "Conditions," and "Substitutions" dropdowns to
  confirm that the choices are listed alphabetically.
- Fill in the form and save the rule.
- Go back and edit the rule you created. Check that the dropdowns are
  still correct.

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd258280482e0c84bf6baf61d7054b1c628e53f7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2872ebe3d49e3425077b58ce6829a34e954b80c0)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 34704: Remove regex for adding additional line breaks to print templates
Katrin Fischer [Tue, 7 Nov 2023 22:31:31 +0000 (22:31 +0000)]
Bug 34704: Remove regex for adding additional line breaks to print templates

This makes sure that we don't change the line breaking for either
HTML nor plain text print notices.
For plain text, the <pre> is used to keep the line breaks as defined
in the notices template.
For HTML we require on the line breaks added by block elements in the
HTML notice, not adding any additional ones like before.
This gives the full control of the formatting to the notice editor.

To test:
* Make sure your patron doesn't have an email address
* Make sure to check the hold filled notice in messaging preferences
* Place a old on any item
* Checkin the item
* Confirm hold
* Verify notices tab shows the Hold (print) notice
* ./misc/cronjobs/gather_print_notices.pl ./ --html
* Verify the generated file has the HTML output wrapped in pre.
* Reformat the HOLD print notice to be HTML by setting the checkbox.
  Mmake sure to add some empty lines for (they should not print later)
  and some <br>, <p>, <div>  - They should be reflected in the notice later.
* Repeat test.
* All should be well :)

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4c15ad658d59d7f63d27fe61dc102ecd4c22a03d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e0eb511d59093321b7df638a654a93b8010ddb10)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35187: Fix missing line breaks in WELCOME notice
Katrin Fischer [Fri, 10 Nov 2023 18:24:15 +0000 (18:24 +0000)]
Bug 35187: Fix missing line breaks in WELCOME notice

When a notices is marked as HTML, we need to use block elements
(p, div, li, etc.) or explicit line breaks.
This adds the line breaks where required.

To test:

WELCOME
* Without patch
* Make sure your Koha can send email (set up SMTP server, KohaAdminLibraryAddress)
* Make sure your patron has an email set
* In patron account, use "More > Welcome email"
* Verify all text is on one line
* Apply patch
* reset_all to install new sample notice templates
* Repeat test, verify welcome notice is now nice

(cherry picked from commit d60fe27ea4bda16efcd0db096d756e8a54552056)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35280: Fix patron attributes "clear" link in OPAC patron entry form
Owen Leonard [Tue, 7 Nov 2023 17:07:17 +0000 (17:07 +0000)]
Bug 35280: Fix patron attributes "clear" link in OPAC patron entry form

This patch makes a minor correction to the JavaScript controlling the
behavior of the "clear" link which appears on the patron entry form next
to patron attribute <select>s or <textarea>s which are editable in the
OPAC.

To test, apply the patch and create patron attributes
which have both "Display in OPAC" and "Editable in OPAC" checked.

- Create one which is tied to an authorized value, and one which isn't.
- Log in to the OPAC and click the "Personal details" tab.
- In the entry form, find the patron attribute fields under the
  Additional information" heading..
- Select a value in the dropdown, and enter text in the textarea.
- Confirm that clicking the corresponding "Clear" link for each works as
  expected.

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 3a027a0da974ecc72d2144f2b503d3013257c8a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f49e438ed9a8fcc99854fac60869e19e75f4d0f1)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 34857: Do not enable hidden select element (regression from bug 33233).
Andreas Jonsson [Tue, 7 Nov 2023 13:42:58 +0000 (14:42 +0100)]
Bug 34857: Do not enable hidden select element (regression from bug 33233).

Test plan:

Using Chrome as web browser:

* Go to opac advanced search
* Press "more options"
* Search for two keywords using "and" operator (on ktd search for idea AND behind, which matches 1 result)
* Search for two keywords using "or" operator (on ktd search for idea OR behind, which matches 4 results)
* Search for two keywords using "not" operator (on ktd search for idea NOT behind, which matches 2 results)

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 b5d174c7d9e87766fc7dbe6160932052199b4638)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit edbe64ef5e278be69bdfa7f57d6d55cf0d07a00d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 31041: (follow-up) Clean up and generalise
Martin Renvoize [Tue, 7 Nov 2023 11:35:22 +0000 (11:35 +0000)]
Bug 31041: (follow-up) Clean up and generalise

This patch cleans out the print media css rules that were originally
added for modalprinting.  The window.open method is simpler to maintain
and will more reliably print modal content as expected.

We factor out the printer code into it's own JS asset that we can apply
to other printable modals and then use it in the two existing places
where such modals have been defined already (cashup summary and bundle
confirmation).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ef880e349f959686a830bda67ec5a295e3d76eb4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 39a8ff6bb5c97b07cf8e73424e7432cf675b3777)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 31041: Prevent duplicate display of cashup summary when printing
Lucas Gass [Thu, 2 Nov 2023 19:56:00 +0000 (19:56 +0000)]
Bug 31041: Prevent duplicate display of cashup summary when printing

To test:
1. Have POS on.
2. Have some registers and items for sale. Make some sales to 'Cashup'.
3. If you have enough enough lines in the table so that 'register.pl' would print on 2 or more pages, the summary will be duplicated that same number of time.

If you are lazy like me and don't want to make that many transaction you can also add some content to the page like this:

for (let i = 0; i < 100; i++) {
  $('#register').append('<h1>TEST</h1>');
}

4. APPLY PATCH, clear browser cahche
5. Try printing again, you should only get one cashup summary when printing.

Signed-off-by: Juliet Heltibridle <jheltibridle@rcplib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 85fb62f3d6e0784bf75309325b78712f18877055)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d74cec96120cec3ea6bec79006c371e4794cb3da)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 31041: add modal_printer.js asset to registers.tt
Lucas Gass [Tue, 7 Nov 2023 22:32:47 +0000 (22:32 +0000)]
Bug 31041: add modal_printer.js asset to registers.tt

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fcd97d8741d1141ee99e5ad0d8ec89d0f9ea32c8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fc117555718bd4ff47c4dc0c14617097ce924944)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 34931: Remove fieldset/legend in favor of div/h3
Lucas Gass [Thu, 12 Oct 2023 22:14:10 +0000 (22:14 +0000)]
Bug 34931: Remove fieldset/legend in favor of div/h3

1. Create some PA_CLASS authorized values.
2. Create some custom patron attributes and add them to the newly created PA_CLASS's.
3.  Set CollapseFieldsPatronAddForm to collapse 'Additional attributes and identifiers'.
4. Go to a new or existing patron record.
5. At the top of the page click the checkbox for "Show collapsed fields:".
6. Scroll down to that section and notice the PA_CLASS <legend> element is shown but not the individual patron attributes within that PA_CLASS.
7. Apply patch
8. Try again, the Additional attributes and identifiers fieldset should display properly.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1944c66fc03e0e661745ece4bbc04e0607dd6def)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2d96b55f32771965dcfba6c135d57e4adf17e817)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 34375: Fix the option to provide no fund in budget dropdown
Matt Blenkinsop [Mon, 6 Nov 2023 10:40:33 +0000 (10:40 +0000)]
Bug 34375: Fix the option to provide no fund in budget dropdown

Currently it is not possible to use the No fund option as the dropwdown will default to the first budget in the list. This patch re-adds this option so that the defaulting behaviour is fixed

Test plan:
1) Go to a vendor record in Acquisitions and then Receive Shipment
2) Enter an invoice number
3) Leave the Shipping cost empty and Shipping Fund as 'No fund'
4) Receive some orders or go straight to Finish receiving
5) Notice the Shipping fund has defaulted to the first fund in the alphabetical list of funds.  It is not possible to select 'No fund' and the selected fund is recorded in shipmentcost_budgetid incorrectly.
6) Apply patch
7) Repeat steps 1-5 and this time the No fund option should be used correctly

Signed-off-by: Georgia Newman <g.newman@arts.ac.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e7e0390dabbe267abb702812c03a484c4a7909b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 534cee26ba59132c63826c3d44fa1411521984a7)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35245: Set default width for select2 in authorities
Pedro Amorim [Fri, 3 Nov 2023 10:17:23 +0000 (10:17 +0000)]
Bug 35245: Set default width for select2 in authorities

Test plan:
1) Edit a authority Marc framework, e.g. 'CHRON_TERM', visit:
   /cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=CHRON_TERM
2) Pick any field to turn into a AV field, e.g. 371, and edit its subfields:
   /cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=371&authtypecode=CHRON_TERM
3) Pick a subfield e.g. 'd' and click edit, visit:
   /cgi-bin/koha/admin/auth_subfields_structure.pl?op=add_form&tagfield=371&tagsubfield=d&authtypecode=CHRON_TERM#subdfield
4) Pick a Authorized value list e.g. DEPARTMENT, click Submit
5) Create a new authority of the same type 'CHRON_TERM', visit:
   /cgi-bin/koha/authorities/authorities.pl?authtypecode=CHRON_TERM
6) Click on Tab '3' and click on field 371 ADDRESS to expand it
7) Notice field 'd' select2 width is very narrow
8) Apply patch. Repeat. Notice its not narrow anymore

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 f918c3ff803d811ad025bff42e1263e3b3aafa83)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c577710c40a60236549e88700c654d718da5f7df)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 34993: (QA follow-up) Perltidy
Katrin Fischer [Sun, 5 Nov 2023 11:50:17 +0000 (11:50 +0000)]
Bug 34993: (QA follow-up) Perltidy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24e1ee2118311bad39203a932dd4c6ab67c5d8c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6b193a80975bc43c9462493cd70117a75d7c7088)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 34993: Pass context parameters to generate_subfield_form
Emily Lamancusa [Thu, 2 Nov 2023 16:56:35 +0000 (12:56 -0400)]
Bug 34993: Pass context parameters to generate_subfield_form

Pass necessary parameters from the UI to ensure that the basic
MARC editor can correctly identify when a framework is changed,
a bib is being duplicated, or a bib is being imported with Z39.50 -
for purposes of filling in default values according to the settings
of ApplyFrameworkDefaults.

To test:
1. Set the system preference ApplyFrameworkDefaults - Select All
2. Create or edit a MARC bibliographic framework with a default value in
   one of the fields (such as 500$a)
3. Go to the Cataloguing module and create a new record using the
   framework from step 2
   --> Confirm that the default value is filled in
4. Search for an existing bib record
5. Click Edit > Edit record to open the basic editor
6. If the field from step 2 already has data, clear it
7. Switch the framework to the framework from step 2
   --> Confirm that the default value is filled in
8. Clear the field again, and save the edit
9. Click Edit > Edit as new (duplicate)
   --> Confirm that the default value is filled in
10. Go to the cataloguing module and do a Z39.50 search
11. Find a record that does not have a value for the subfield from step 2
12. Import the record using the framework from step 2
    --> Confirm that the default value is filled in

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 0c941147903294dd33996a8d293285c9a82e4f13)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e72ac1bacc063fa3650c528c84eee132d888f8ea)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35212: Correct mismatched label on identity provider entry form
Owen Leonard [Wed, 1 Nov 2023 10:21:41 +0000 (10:21 +0000)]
Bug 35212: Correct mismatched label on identity provider entry form

This patch corrects the identity provider form so that the label for the
"Allow staff" field has the correct "for" attribute. Currently it is a
duplicate of the one for the "Allow OPAC" field.

To test, apply the patch and go to Administration -> Identity providers.

- Click "New identity provider"
- Near the bottom of the form, look for the "Allow staff" field.
- Clicking the "Allow staff" label should activate the corresponding
  dropdown.

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 15f0dc2c2a027896c0b2f62c4e08cd46279426e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ddc3c4172a013e01d2dcfc4149d4133c514621f7)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 17798: (follow-up) Adjust color of fieldset nested in .dialog.alert
Owen Leonard [Fri, 3 Nov 2023 12:22:34 +0000 (12:22 +0000)]
Bug 17798: (follow-up) Adjust color of fieldset nested in .dialog.alert

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 aaa0bd2391fc49a23c2d7a5a8369c7b7300e6bdf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d15d94279790c4561ee0e4bd71f496d7e582c3a)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 17798: Add fieldset for 'Yes, check out (Y)'
Nick Clemens [Thu, 2 Nov 2023 19:10:02 +0000 (19:10 +0000)]
Bug 17798: Add fieldset for 'Yes, check out (Y)'

With the increased text, the buttons don't arrange neatly. Adding a
fieldset around the options for 'Yes' mitigates this somewhat - it
could do with a bit more styling, however, it also fixes bug 23953

To test:
Confirm the 'Yes' options are more clear that they only affect the yes
button
Confirm the other buttons arrange nicely

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 5d291a6f1d9df762232379bc214753953c2d672e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8ac35d4f15a96101bd68ead6af38f2e7e80a041b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 17798: Confirm hold when printing slip from another patron's account
Nick Clemens [Thu, 2 Nov 2023 19:05:16 +0000 (19:05 +0000)]
Bug 17798: Confirm hold when printing slip from another patron's account

This patch adds a few pieces of information to the print slip button
and makes the code confirm the hold

As we are printing before the confirm, we also add the ability to pass
in the itemnumber to 'ReserveSlip'

This is slightly hacky, however, I don't see another way to allow
printing without an additional page reload.

To test:
 1 - Place a title level hold for patron A, for delivery to library B
 2 - Attempt to checkout an item from the record above to Patron B from
     library A
 3 - You receive an alert about the hold
 4 - Click "Don't check out, confirm hold, and print slip"
 5 - Confirm the slip looks correct and has item info
 6 - Confirm that item is in transit to fill hold
 7 - Revert transit status
 8 - Attempt to checkout the item to Patron B from Library B
 9 - Click "Don't check out, confirm hold, and print slip"
10 - Confirm slip is correct
11 - Confirm item is marked waiting

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 3ec73d80e2a88e3a87eefc886865ccfb91f9be09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 96442d7ac738c3baf3a0e6914362e908bdc7adc3)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 32379: Add check on existing item
Marcel de Rooy [Thu, 2 Nov 2023 10:47:50 +0000 (10:47 +0000)]
Bug 32379: Add check on existing item

Simplest fix; bail out with output_error.

Test plan:
Try /cgi-bin/koha/cataloguing/additem.pl?biblionumber=1&op=saveitem&itemnumber=999999
Note: Replace 1 by existing biblionumber, and iitem 999999 should not exist.
You should get the 404 screen now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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 0677a53e1445342ac4927a1177100f69e4f02271)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7890c068fa5c3e51abeb94fa76f2f425af777768)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 30024: Make link_bibs_to_authorities.pl rely on LinkerRelink
Tomas Cohen Arazi [Tue, 27 Sep 2022 19:10:51 +0000 (16:10 -0300)]
Bug 30024: Make link_bibs_to_authorities.pl rely on LinkerRelink

This patch makes the trivial change of making the linker script rely on
LinkerRelink instead of CatalogModuleRelink, which is confusing and
incorrect (according to both sysprefs descriptions).

To test:
1. Verify that relinking is now tied to the right syspref

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4310e13a6416d680e825621278859e3b91b1942a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 234e00b1d62db02d0fa7870d8045b4398ef80eb5)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35242: Force memcache restart after koha upgrade
Mason James [Thu, 2 Nov 2023 22:56:51 +0000 (11:56 +1300)]
Bug 35242: Force memcache restart after koha upgrade

to test..

1/ install koha-common
    $ sudo apt install koha-common

2/ start memcached, check PID
    $ sudo service memcached start
    $ sudo systemctl status  memcached | grep PID
        Main PID: 52851 (memcached)

3/ build and install new koha-common package (will trigger a restart)
    $ sudo apt install ./koha-common-git+deadbeef.deb

5/ check that memcache is started, and has new PID (52900)
    $ sudo systemctl status  memcached | grep PID
        Main PID: 52900 (memcached)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1fa096e7a03ad7d42ca5f4de12d873ea1b8a4bce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 557425afd92dffeedb2794231852e99806d9733b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35073: perltidy subscription-batchedit.pl
Pedro Amorim [Tue, 17 Oct 2023 09:24:09 +0000 (09:24 +0000)]
Bug 35073: perltidy subscription-batchedit.pl

git show -w <this_patch_hash>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ffb5022591f6b96c50bf8a9c0409bd01b108a65c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3621e32bd13a467734894486db73e84a21d7baf6)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35073: Default to existing value if there is one
Pedro Amorim [Tue, 17 Oct 2023 09:20:59 +0000 (09:20 +0000)]
Bug 35073: Default to existing value if there is one

For values that dont exist in the batch edit submission, i.e. UI says 'No change', we default to existing value if there is one.

Test plan:
Preparation - Additional fields:
1) Add a new 'additional field', visit:
/cgi-bin/koha/admin/additional-fields.pl
2) Click 'subscription' and '+ New field'. Enter a 'name' and hit 'save'.

Serials:
1) Add a new serial, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Put a biblionumber in the 'record' field, i.e. '112'. Press 'next' and click 'ok' on the alert box
3) Fill all the required fields and click 'test prediction'
4) Input something in the additional field created previously.
5) Click 'save subscription'. Notice the additional field is as expected.
6) Repeat steps 1-5 to create a second serial.

Batch edit:
1) Visit serials and hit the 'Search' button:
/cgi-bin/koha/serials/serials-home.pl
2) Click the 2 checkboxes for the 2 serials we created previously and click the new link that pops up 'edit selected serials'.
3) Click 'Save' without changing anything.
4) Go back to either of the serials, notice the value for the additional field is unchanged. Visit:
/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=1

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7294908de35a46f491af4e170fb9f6294a5fb4bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bcb2adb604d74f9eebee462b19d6493a426bb67c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35073: Rename additional_fields to available_additional_fields
Pedro Amorim [Tue, 17 Oct 2023 09:18:29 +0000 (09:18 +0000)]
Bug 35073: Rename additional_fields to available_additional_fields

'additional_fields' is ambiguous and in other places we name this available_additional_fields instead. Do the same here.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 05d131febf2d98d1c0ec18da845589dcd80a5e8d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a5fa92d2c0cd30a982660e427285a22b8f1a8977)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35185: Remove is_html flag from sample notices that are plain text
Katrin Fischer [Sun, 29 Oct 2023 15:20:03 +0000 (15:20 +0000)]
Bug 35185: Remove is_html flag from sample notices that are plain text

Some notices had the is_html flag for new installations, but actually
didn't include any HTML formatting. These should be plain text
to have the line breaks behave as expected.

This updates:
* 2FA_OTP_TOKEN
* OPAC_REG_VERIFY

We cannot do a database update here, as libraries will
have changed and updated these. So this is only for new
installations.

To test:
* Apply patch
* reset_all (create a new sample database)
* Verify that the HTML checkbox is not set for these notices
* Verify they appear as plain text notices, not including HTML tags

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 c6284eed812eb4de52738e845b662e199f58fd1a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3cacb76e8e519521ad975a00720034cb7de9c127)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
6 months agoBug 35103: Add option to gulp tasks to pass a list of tasks
Jonathan Druart [Thu, 19 Oct 2023 07:41:03 +0000 (09:41 +0200)]
Bug 35103: Add option to gulp tasks to pass a list of tasks

You can now generate the messages.po for all languages with:
  gulp po:update --task messages

or for only es-ES
  gulp po:update --task messages --lang es-ES

It may be helpful for the "update po" script that will be used on
weblate.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
6 months agoBug 35033: (QA follow-up): tidy up code
Victor Grousset/tuxayo [Mon, 30 Oct 2023 17:58:09 +0000 (18:58 +0100)]
Bug 35033: (QA follow-up): tidy up code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0a8303c9fac42e16d4ff5c13dd700789d4a438c3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f50f5a1dccef4de31e1148232bacdf435f8bd156)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35033: Add a validation for biblioitems in about/system information
Blou [Wed, 11 Oct 2023 15:57:28 +0000 (11:57 -0400)]
Bug 35033: Add a validation for biblioitems in about/system information

In the About section, under the System information tab, we get validation between
issues, borrowers, biblio, items, reserves tables, and their deleted/old counterpart.

But there's no validation for biblioitems.

This patch will simply add the same test (and display) as the others, but for biblioitems.

Testing
0) Create a simple biblio entry through cataloguing. Note the biblioitemnumber created.
1) Insert a dummy entry in deletedbiblioitem using the biblioitemnumber.  An simple SQL will do
insert into deletedbiblioitems select * from biblioitems where biblioitemnumber = GIVENbin;
2) Go to about, see there's no warning in systeminformation.
3) apply the patch, validate that an error appears.

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 07ac0b1f72245de6e8ecf2a1a9d2e485ca233f79)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4579a814bc9b24dfe10f392bad6dd201ef465435)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34424: Add Emily Lamancusa to QA Team
Katrin Fischer [Sun, 29 Oct 2023 14:36:38 +0000 (14:36 +0000)]
Bug 34424: Add Emily Lamancusa to QA Team

Long overdue.

To test:
* Apply patch
* Verify that Emily shows as part on the QA Team
  on the About page

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e42d5c6e6f5a8d5c958a3dad5583490a550ce862)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 26d592d699850fcff73e1bfc0aac787aefdc7bce)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35180: DBIC schema
Tomas Cohen Arazi [Wed, 1 Nov 2023 18:26:00 +0000 (15:26 -0300)]
Bug 35180: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3f1e21bbca753168e194f0d4f23f9c84ebadeeaf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1fb6975cd12495cdc7dbb7c04ba5bbc89f4dd106)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35180: Fix 246 to 264 in COMMENT of deletedbiblioitems.publishercode
Katrin Fischer [Sun, 29 Oct 2023 09:31:06 +0000 (09:31 +0000)]
Bug 35180: Fix 246 to 264 in COMMENT of deletedbiblioitems.publishercode

This fixes a typo in the comment.

To test:
* Please check diff of the patch closely.

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 f5d0667f5a1eb6898c14a5cefddfe9c21609762d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a57bc7313125831010d05cba727182f689b93a9b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35186: Remove unnecessary html tags from PASSWORD notices
Katrin Fischer [Sun, 29 Oct 2023 15:42:36 +0000 (15:42 +0000)]
Bug 35186: Remove unnecessary html tags from PASSWORD notices

In HTML notices we don't need to explicitly use <html></html>.

This removes them from the 2 notices using them:
* PASSWORD_RESET
* STAFF_PASSWORD_RESET

To test:
* Apply patch
* Make sure your Koha can send email (set up SMTP server, KohaAdminLibraryAddress)
* Make sure your patron has an email set
* In patron account, use "More > Send password reset"
* Log out
* In the OPAC, request password reset ("forgot your password?")
* Verify both notices appear nicely formatted (line breaks, bold, etc.)

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 e772b96cacb509a54a52427262da03efd4e38015)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9d4042cfd675be1e05c7a74ff0ffc872f025e00d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 29811: Add timestamp option on authority record type
Thibaud Guillot [Thu, 6 Jan 2022 13:48:36 +0000 (14:48 +0100)]
Bug 29811: Add timestamp option on authority record type

According to the timestamp option for bibs record type I added the
timestamp option for authority records.
Timestamp is already present in database on field "modification_time"

Test Plan :
1 - Be sure to have authority record type for easiest test create one
2 - Execute script export_records.pl in your koha/misc directory and
choose a date (example yesterday if you just created an authority
right now).(see export_records.pl -h for help)
3 - Timestamp option has no effect on authority record type
4 - Execute script again but choose the date of tomorrow for example
5 - Same result
6 - Apply this patch
7 - Play again steps 2 and 4
8 - On step 2 you will see only your authorities created today (because
script show you authority has changes since the date you choose in
option) and for step 4 you must see an empty file.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24ee60cb62cfbe5dc80bbb698eb6fa1e99d1cd4e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e5d014de8c25bcf39dad1b0ee7e77f209b6b0996)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 22712: Make 'Show inactive funds' button on addorderiso2907.pl work for item...
Nick Clemens [Mon, 23 Oct 2023 19:56:21 +0000 (19:56 +0000)]
Bug 22712: Make 'Show inactive funds' button on addorderiso2907.pl work for item budgets

This requires enabling MarcItemFieldsToOrder, see bug 34645

Add an inactive Budget and some funds to your system

Import a file with multiple biblios

Confirm the button hids/displays the funds for all item orders

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 60ed1898a09b638ddbf16c5b0054348cd3967832)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b49fc7ea341f85f04ba478469b4b8df5f38a307f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 31393: Tidy
Tomas Cohen Arazi [Mon, 30 Oct 2023 12:00:31 +0000 (09:00 -0300)]
Bug 31393: Tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f1bbdee7ac8a49a5ba85686d8a0edb59efecc8ba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 550bc76328e97244a009be5402f951e8ebea70c3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 31393: Koha::Config: handle the special case for 'content' attribute
Julian Maurice [Mon, 26 Jun 2023 13:25:12 +0000 (15:25 +0200)]
Bug 31393: Koha::Config: handle the special case for 'content' attribute

<key content="value"></key>

was wrongly parsed as

{ key => 'value' }

whereas it should be

{ key => { content => 'value' } }

The 'content' attribute is used in shibboleth config

Test plan:
1 Run `prove t/Koha/Config.t`

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6973625e7a06e66ee731ea8f5b69f296943c580f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 35ae7b467e54c38b8f99e392b02838e9fd53e9e0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 32312: Add missing column descriptions to the statistics table
David Nind [Sun, 4 Dec 2022 01:33:32 +0000 (01:33 +0000)]
Bug 32312: Add missing column descriptions to the statistics table

This adds missing descriptions to the existing statistics database
columns.

It also improves some existing descriptions.

1. Go to Reports > Guided reports > Create guided report.
2. Choose 'Circulation' for the module to report on and select
   'Next'.
3. Choose 'Tabular' for the type of report and select 'Next'.
4. Scroll down to the statistics table section and note that there
   are no descriptions for:
   - statistics.other
   - statistics.location
   - statistics.ccode
   - statistics.categorycode
5. Note that:
   - the description for statistics.type is 'Type'
   - the description for statistics.itemtype is 'Item type'
6. Apply the patch.
7. Restart all the things (restart_all).
8. Reload the page.
9. Note that:
   . there are now descriptions for the columns in step 4
   . the description for statistics.type is now 'Transaction type'
     (to more clearly indicate what it contains)
   . the description for statistics.itemtype is now 'Koha item type'
     (consistent with other tables where this is used, such as items)
10. Sign off :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b0a8372c2f5eec6dd1671c0557bb82e3a71436db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a530cf3088195da651e4cccd09809e898f9e0ee2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35147: (QA follow-up) Capitalzation: Shibboleth Login
Katrin Fischer [Sat, 28 Oct 2023 22:44:56 +0000 (22:44 +0000)]
Bug 35147: (QA follow-up) Capitalzation: Shibboleth Login

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9cea8312a5e2444ed142e44e2ca5041ba7373b7b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6f383a05bf8c4644f49e2cef8bf9241dc2eb92f7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35147: Add classes to Shibboleth text on OPAC login page
Aleisha Amohia [Wed, 25 Oct 2023 00:40:26 +0000 (00:40 +0000)]
Bug 35147: Add classes to Shibboleth text on OPAC login page

This enhancement makes it easier for libraries to change the Shibboleth-related messages on the OPAC login page.

Libraries can employ OPACUserJS to change the text. For e.g., I can replace the message "If you do not have a Shibboleth account, but you do have a local login, then you may login below." by putting the following in OPACUserJS:

$(".shib_local_text").text("If you do not have a staff member account, but are a member of the library, then you may log in below.");

To test:

1. Go to <your-opac-url>/cgi-bin/koha/opac-user.pl , or disable the OpacPublic system preference. Ensure you are logged out of the OPAC.
2. In the staff interface, search for the OPACUserJS system preference under Koha Administration. Add the following JS and Save:

$(".shib_invalid").text("Test changing the invalid Shibboleth login message.");
$(".shib_title").text("Test changing the Shibboleth login heading.");
$(".shib_url").text("Test changing the Shibboleth account link text.");
$(".shib_local_title").text("Test changing the local login heading.");
$(".shib_local_text").text("Test changing the message that shows if you do not have a Shibboleth account.");

3. Refresh the OPAC and confirm the text changes to reflect your JS. Note: The invalid Shibboleth login will be a bit harder to test, so if you can't test, confirm the HTML in the patch looks correct.

Sponsored-by: New Zealand Council for Educational Research
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 184299c9c84ee35cdd31149214710778648729ad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7eebf895b9f0f033134be303d5cb71e2028af5c7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 32853: Fix cataloguing/value_builder/unimarc_field_125.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:53 +0000 (11:58 +0100)]
Bug 32853: Fix cataloguing/value_builder/unimarc_field_125.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 826aeaf22f36fb3ebacafdacf7c270cc72d8c5fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dd34d7df04c8674cf32cf8d7daa001d773213535)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 32856: Fix cataloguing/value_builder/unimarc_field_126.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:53 +0000 (11:58 +0100)]
Bug 32856: Fix cataloguing/value_builder/unimarc_field_126.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4fa7d59c61b524238b2e30f383ccda44e61e1096)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 57da913eae938a4968d4a9d3074ff807fef0b8cd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35173: Correctly concat error strings
Martin Renvoize [Fri, 27 Oct 2023 10:48:07 +0000 (11:48 +0100)]
Bug 35173: Correctly concat error strings

This patch moves the call to $sftp->error outside of the double quote
string and into a . concat to properly expose the error message as
apposed to outputting 'Net::SFTP::Foreign=HASH(0x559c9118f0c8)->error'

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 43bd124f873ac118a9f87a5b5160ee99dc8b8a47)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4c0191b69023167dba27830904ea6503f248f858)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35003: Make cancelled hold requests filter by branch
Lucas Gass [Fri, 6 Oct 2023 15:15:39 +0000 (15:15 +0000)]
Bug 35003: Make cancelled hold requests filter by branch

To recreate:
1. Make sure you have the "Default waiting hold cancellation policy" set to allow via circulation rules.
2. Make several holds at different branches  holds and set them to waiting
3. Request to cancel those holds, making sure you cancel some for different branches.
4. Go to waitingreserves.tt and notice that you see all of the holds from all branches.
5. APPLY PATCH and restart services
6. Vist the waitingreserves.tt page and notice that the "Holds with cancellation requests" table can now filters by branch.
7. Use the "View all libraries" and make sure you can see all the holds with a cancellation request.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 67f4fcc204c11998f9110d8ed723fa826c62a5ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cb99c788f7c581b148a872c9ed3dcb013c369796)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35141: (QA follow-up) Increment the bad count
Marcel de Rooy [Fri, 27 Oct 2023 07:21:03 +0000 (07:21 +0000)]
Bug 35141: (QA follow-up) Increment the bad count

Also move earlier print to warn for consistency.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 3439185bb0b901e5a902cc8887fa07526f33ea55)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c3fda28fc565bbf5aad2031919681d63dca99640)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35141: Prevent link_bibs_to_authorities from dying on invalid metadata
Nick Clemens [Tue, 24 Oct 2023 12:01:09 +0000 (12:01 +0000)]
Bug 35141: Prevent link_bibs_to_authorities from dying on invalid metadata

When fetching the record we need to eval in case of exception

To test:
1 - Apply first patch
2 - perl misc/link_bibs_to_authorities.pl
3 - Note it dies on parser error at record 369
4 - Apply this patch
5 - perl misc/link_bibs_to_authorities.pl
6 - The process completes - with warning thrown on record 369

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 706641e747336eeb341172ed3d794d86551a45a9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ed2bb9534a143b6ab894e6ab4e24d8c7dc9fd58e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35141: Catch ES search exceptions in link_bibs_to_authorities, warn, and continue
Nick Clemens [Tue, 24 Oct 2023 11:51:29 +0000 (11:51 +0000)]
Bug 35141: Catch ES search exceptions in link_bibs_to_authorities, warn, and continue

This patch simplay adds an eval and a warning to link_bibs_to_authorities to catch any errors while searching and continue linking.

To test:
1 - edit /etc/kohia/sites/kohadev/koha-conf.xml and add to elasticsearch stanza
    <request_timeout>0</request_timeout>
2 - perl misc/link_bibs_to_authorities.pl
3 - It dies immediately
4 - Apply patch
5 - perl misc/link_bibs_to_authorities.pl
6 - Now it tries every record, throwing warnings along the way, but completes

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 22c0be31c73249fa534afb209f2a0229f84b7568)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 07cf6fccc0afdab10ac39ae33d6a9841cb1abf30)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34678: Allow new entries to overwrite hold_fill_targets
Nick Clemens [Wed, 13 Sep 2023 17:03:32 +0000 (17:03 +0000)]
Bug 34678: Allow new entries to overwrite hold_fill_targets

When using background jobs, there is a possibility of a race condition where two jobs will be updating the holds queue for the same biblio. We should try to minimize those cases (see bug 34596)

In the meantime though, we should prevent jobs possibly dying, and allow the most recent update to succeed.

There is a possibility two updates wil assign different items to the same reserve, and that a reserve could end up in the queue twice, however, whichever one is filled first will delete both entries. as filling the hold deletes by reserve id (see bug 24359)

This patch adds a transaction to delete and then inset the new row

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

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit bbeab36789d8dd020bc5395d76c54cc2910caf49)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a65964c35b2d38ec7bcd87182e00ae4567aa0ae4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34678: Unit test
Nick Clemens [Wed, 13 Sep 2023 17:01:09 +0000 (17:01 +0000)]
Bug 34678: Unit test

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit dfad12d0790e38e739c610dd2a5f2345a053ed52)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b4a5c3213fb455e9795a3abf8a79531f10100f1b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 33662: Add link to acq advanced search to acq navigation
Katrin Fischer [Fri, 15 Sep 2023 15:11:21 +0000 (15:11 +0000)]
Bug 33662: Add link to acq advanced search to acq navigation

Right now 3 clicks are needed to open the advanced search page
in the acquisitions module.

This adds a link to the advanced search to the left hand
module navigation.

To test:
* Go to acquisitions
* Verify the way is long to advanced search:
  At the top: Orders search > config icon > advanced search link
* Apply patch
* Notice new 'Order search' link on the left
* Verify it's way shorter now :)

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
  Renamed link from 'Advanced search' to 'Order search'
  Adjusted test plan

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 67930244ad5dc4e65e9e040b38d0080cb80b23b9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 156f0eac1e3ca3ff1b33453df2c71849685bd60c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 33810: Opac advanced search fields need aria-labels
Matt Blenkinsop [Tue, 23 May 2023 14:49:08 +0000 (14:49 +0000)]
Bug 33810: Opac advanced search fields need aria-labels

The OPAC advanced search fields need aria-labels to assist with screen reading. This patch adds labels to both the dropdown selects and the text inputs

Signed-off-by: joubu <xxx@example.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 933c779b7d49525a561070dd8d60941f5f000c06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 62fa8773c19f87c48ce70eb0c4ff8f7e46142a3a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34954: Fixed typo to 'dateexpiry'
Laura Escamilla [Thu, 19 Oct 2023 18:25:51 +0000 (18:25 +0000)]
Bug 34954: Fixed typo to 'dateexpiry'

To test:

1. In KTD use grep -rn --exclude=*.po "datexpiry" *
2. Notice that the four locations below are showing the typo:
    1. git add koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt
    2. git add misc/release_notes/release_notes_18_05_00.html
    3. git add misc/release_notes/release_notes_18_05_00.md
    4. git add t/db_dependent/Koha/Patrons/Import.t
3. Apply patch. Repeat step 1.
4. Notice that no results show. All instances of the typo have been fixed to dateexpiry.
5. Sign off and have a great day :)

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 d742f29d77ee1e8a6f825678ce879d4a04037c92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9b87ae61ad81e056ff7f8972ee8deca86666e17b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34910: (follow-up) alert in patron details
Fridolin Somers [Tue, 26 Sep 2023 08:11:39 +0000 (22:11 -1000)]
Bug 34910: (follow-up) alert in patron details

The anonymous patron details page should show an alert message.

1) Configure an existing borrowernumber in system preference 'AnonymousPatron'
2) Go to details page of this borrower :
   /cgi-bin/koha/members/moremember.pl?borrowernumber=x
3) Check you see alert 'This is the anonymous patron.'

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Signed-off-by: Päivi Knuutinen <paivi.knuutinen@joensuu.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a8e770d9c49a88fbfd46c27b31d3eb2a413a1618)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 83b251e91d418e85d236c945e0edd52e601a7513)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34910: Do not allow checkout for anonymous patron
Fridolin Somers [Tue, 26 Sep 2023 07:53:45 +0000 (21:53 -1000)]
Bug 34910: Do not allow checkout for anonymous patron

The anonymous patron circulation page should show an alert message and not allow check-out.

1) Configure an existing borrowernumber in system preference
   AnonymousPatron
2) Go to circulation page of this borrower :
   /cgi-bin/koha/circ/circulation.pl?borrowernumber=x
3) Check you see alert 'This is the anonymous patron, so circulation is disabled.'

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Johanna Miettunen <johanna.miettunen@haaga-helia.fi>
Signed-off-by: Päivi Knuutinen <paivi.knuutinen@joensuu.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aca49ca14b9f2d009f469144f975cd9fbf098181)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9a64d2c93a97f387f89ae157bc379bf7b1261a4a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34966: Terminology - fix add item form (& to and)
David Nind [Sat, 30 Sep 2023 06:27:39 +0000 (06:27 +0000)]
Bug 34966: Terminology - fix add item form (& to and)

This patch updates the add item form in the staff interface to
change the 'Add & duplicate' button to 'Add and duplicate'.

In our terminology guide, & should only be used when
it is part of a proper noun or a common abbreviation:
https://wiki.koha-community.org/wiki/Terminology

Test plan:
1. In the staff interface, search for and select a record.
2. Select New > New item.
3. Note that "Add & duplicate" is one of the action buttons at the
bottom of the add item form.
4. Apply the patch.
5. Refresh the page.
6. Note that the action button is now labelled 'Add and duplicate'.
7. Sign off! 8-)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katariina Hanhisalo <katariina.hanhisalo@xamk.fi>
Signed-off-by: Reetta Pihlaja <reetta.pihlaja@siilinjarvi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 34897afc593148f30fd1cd6249f34a43643589bb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 33606: (QA follow-up) Cosmetic changes
Marcel de Rooy [Fri, 23 Jun 2023 07:11:23 +0000 (07:11 +0000)]
Bug 33606: (QA follow-up) Cosmetic changes

Even the POD name wasnt changed after copying :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 9c1dcfea13d6ac24bc9bceda601a95eb3f1a7623)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b702d1c6e713d0d5de458a88fe95ad5d8a33a3c1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 33606: Fix settings
Pedro Amorim [Wed, 17 May 2023 16:28:23 +0000 (16:28 +0000)]
Bug 33606: Fix settings

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit e98eb4e0ad643fc57ce82b71caab2056284b1d45)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e89d5599e0bc2b549e6632d931c6c6a2f91e5852)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 33606: Mark the endpoint as experimental
Jonathan Druart [Tue, 16 May 2023 12:33:29 +0000 (14:33 +0200)]
Bug 33606: Mark the endpoint as experimental

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit 42eb2fd2c98275e979c44fa8b65dd9d7b128357e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d0c2829f1065c14c385675a7ed88c3a8e47b6bd4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 33606: Add a erm/config route to retrieve the ERM config needed for the Vue app
Jonathan Druart [Tue, 25 Apr 2023 13:56:51 +0000 (15:56 +0200)]
Bug 33606: Add a erm/config route to retrieve the ERM config needed for the Vue app

This could be extended later in bug 32968 to pass the permission of the
logged in user.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit cda3c377a20c401ef9a755f24eb839d515a8af72)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5078f9f4dff2788318bee544e00724fa2fbf1dad)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 33169: (QA follow-up) Fix some icons for lower FA version
Katrin Fischer [Wed, 25 Oct 2023 11:38:27 +0000 (11:38 +0000)]
Bug 33169: (QA follow-up) Fix some icons for lower FA version

In the navigation some icons were missing, because they had changed
names between versions, this restores them. Fixed icons concerned
the navigation items:

* Local
* Local > Titles
* EBSCO > Titles

(cherry picked from commit 102b21d2aed8b305a3ea3811804f1f334e3b86e5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 33169: Add support for FA styles
Tomas Cohen Arazi [Wed, 21 Jun 2023 19:05:26 +0000 (16:05 -0300)]
Bug 33169: Add support for FA styles

Font awesome now provides a different approach to icon styles so you can
specify things like:

```
<i class="fa fa-camera-retro"></i>
```

but also

```
<i class="fa-solid fa-camera-retro"></i>
```

The original implementation had a hardcoded `fa` and having an extra
parameter for the *style* seemed overkill, as we would need to handle
even a list of styles like on this example:

```
<i class="fa-sharp fa-solid fa-camera-retro"></i>
```

So I chose to just explicitly require the full FA icon class and pass it
thru. With no manipulation on the Vue side.

This patch does that, and adjusts the 'style' for some icons, as
introduced by the FA v6 patchset.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 19221dc960532084e3e72e611403f4d2a43adfc9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6079d70e2d3c519b0759174b2e48b2221d82830e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 33169: Build breadcrumbs and left-hand side menu from routes definition
Agustin Moyano [Mon, 6 Mar 2023 19:44:44 +0000 (16:44 -0300)]
Bug 33169: Build breadcrumbs and left-hand side menu from routes definition

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e3f88f0438232ab2c61129466aaa1fb205f4f720)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 31f48a6d19cb6023af7c2fe023b5f39a237d17d0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35199: (bug 34448 follow-up) Fix error handling in http-client.js
Jonathan Druart [Tue, 31 Oct 2023 13:45:08 +0000 (14:45 +0100)]
Bug 35199: (bug 34448 follow-up) Fix error handling in http-client.js

From bug bug 34448.

386         // Submit the form, get 500
387         cy.intercept("POST", "/api/v1/erm/agreements", {
388             statusCode: 500,
389             error: "Something went wrong",
390         });
391         cy.get("#agreements_add").contains("Submit").click();
392         cy.get("main div[class='dialog alert']").contains(
393             "Something went wrong: SyntaxError: Unexpected end of JSON input"
394         );

This is wrong: we are now showing a JS error (SyntaxError) instead of the expected 500: internal server error!

The problem was that a regular 500 does not have anything in the body,
and _fetchJSON didn't handle that ( JSON.parse(text) ).
If the body of the response does not contain anything we need to get the
text from statusText (which contains "Internal Server Error" in case of
500).

Test plan:
1. Make sure all cypress tests pass
2. Confirm the above:
Raise an exception from a given route (/agreements for instance) and
confirm that the error displayed on the interface is correct (ie. not
SyntaxError, but "Error: Internal Server Error")

For QA:
* This change is covered properly in Dialog_spec.ts, no need to redo it in
every other test files.
* Without the following change in count, we see:
"Something went wrong: Error: Error: Internal Server Error" because
setError is called twice. We don't need to set the error from count, it
has been set from _fetchJSON already.
-            error => {
-                setError(error.toString());
-            }
+            error => {}

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit df3acf3d68cd24d3b1015432206236b563aaa5d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ae3804270d09e19be26e853e349f37de4e7b1c62)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35167: Make 'effective_not_for_loan_status' fallback to 0 if itype has it undef
Tomas Cohen Arazi [Thu, 26 Oct 2023 17:58:40 +0000 (14:58 -0300)]
Bug 35167: Make 'effective_not_for_loan_status' fallback to 0 if itype has it undef

This patch makes the effective not for loan status be set the item value
if not defined at itype level.

To test:
1. Apply the regressions tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/items.t
=> FAIL: Tests fail!
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: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit b9ea3eb988b116ffc912fad9315533c7774a3754)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 34d08324fcc20c8c83bbbb87f0f1eff0481638f5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35167: Regression tests
Tomas Cohen Arazi [Thu, 26 Oct 2023 17:56:35 +0000 (14:56 -0300)]
Bug 35167: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit c67d28c5f9136a96bfb665cd13f354af492e3233)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d37fbdb665e598cc630ac351d833d213be222f82)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35111: Ignore SIGPIPE in background jobs worker
David Cook [Fri, 20 Oct 2023 01:15:00 +0000 (01:15 +0000)]
Bug 35111: Ignore SIGPIPE in background jobs worker

This change explicitly ignores SIGPIPE signals in the background jobs
worker.

Daemons like Starman ignore SIGPIPE so it makes sense to explicitly set this.
Differences in the inner workings of MySQL vs MariaDB client libraries have yielded
different behaviours in automatic reconnections and potentially SIGPIPE handling,
so this helps to make the overall behaviour more consistent.

Test plan:
0. Apply patch and run "restart_all"
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
2. Click "Save" > "MARCXML"
3. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
4. Click "Choose file", choose the MARCXML file, click "Upload file"
5. Click "Stage for import"
6. Note the job is marked as "100% Finished"

7. In a separate window run "docker restart koha-db-1"
8. Repeat steps 3-5 for uploading file and running stage for import
9. Note that the job is marked as "100% Finished" as you'd expect

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Added comment on the SIG PIPE line.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2988c549719197a5a46a94039f7881b3e74e6e19)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b57dfb84bccd81c92e0c9176acf42043e0ac8363)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34520: DBIC schema
Tomas Cohen Arazi [Wed, 1 Nov 2023 18:24:43 +0000 (15:24 -0300)]
Bug 34520: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c7571c6a3295835c5016d02360af6ba7c4aecdeb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9250630098cdad674baaf0d6b71a437099a362e7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34520: DBRev 22.11.11.001
Tomas Cohen Arazi [Tue, 31 Oct 2023 14:02:20 +0000 (11:02 -0300)]
Bug 34520: DBRev 22.11.11.001

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 486d3582f2f6ec73982dca2082797c55ef78e5e2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34520: Fix FK for item_groups in reserves for new installations
Katrin Fischer [Sun, 29 Oct 2023 14:14:37 +0000 (14:14 +0000)]
Bug 34520: Fix FK for item_groups in reserves for new installations

There was a discrepancy between the database update for reserves
and the kohastructure.sql definition. This makes sure that the
FK is always "ON DELETE SET NULL".

To test:
* Before applying this path
* sudo koha-mysql kohadev
* show create table reserves;

CONSTRAINT `reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE

* Apply patch
* Run database update
* Check database again:

CONSTRAINT `reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE CASCADE

* reset_all (create a new database)
* Check database again:

CONSTRAINT `reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE CASCADE

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 6dd4626711866fbf92b49f88770a6b3bfb75ddca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d0090275b0fd2cd728183c072765a5a7cfdbbe54)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 34908: Sort item types alphabetically by description when adding a new empty...
Aleisha Amohia [Tue, 26 Sep 2023 22:40:01 +0000 (22:40 +0000)]
Bug 34908: Sort item types alphabetically by description when adding a new empty record as an order to a basket

To test:

1. Go to Koha administration -> Item types. Add a new item type "B" with the description "Test" so it will be obvious if it is sorted by the code "B" instead of the description "Test".
2. Go to Acquisitions. Add to a basket from a new empty record
3. In the Catalog details section, note the Item type dropdown. Confirm your "Test" item type, is showing near the top of the list, indicating it has been sorted based on the code "B"
4. Apply patch and restart services. Refresh the page.
5. Open the Item type dropdown again and confirm your "Test" item type is showing in the expected alphabetical order.

NC amended patch - tidied

Sponsored-by: South Taranaki District Council
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 0ef83c041d55cb95a4fd839101135126c3d9854a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0237ad8eb48d7bdeac9648d37ebdbccbb87cf2bc)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35148: before_send_messages plugin hook does not pass the --where option
Kyle M Hall [Wed, 25 Oct 2023 13:34:53 +0000 (09:34 -0400)]
Bug 35148: before_send_messages plugin hook does not pass the --where option

The before_send_messages plugin hook currently sends all the non-smtp related options with the exception of the --where option. This should be added.

Test Plan:
1) Install the latest version of the kitchen sink plugin (
   https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases
   )
2) Apply this patch
3) Run process_message_queue.pl with a --where option
4) Run the command: ./misc/cronjobs/process_message_queue.pl --where "letter_code='test'"
5) Note the output looks like:
Plugin hook before_send_message called with the params: $VAR1 = {
          'verbose' => 0,
          'where' => 'letter_code=\'test\'',
          'letter_code' => [],
          'type' => [],
          'limit' => undef
        };

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1508e81505f978b473f06b9f8e71a8f22721a7f5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 247b9da1723d08d14a4f413f78b582f5eba8ed63)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35069: Fix hold ratios items needed column sorting
Lucas Gass [Mon, 16 Oct 2023 23:03:03 +0000 (23:03 +0000)]
Bug 35069: Fix hold ratios items needed column sorting

This patch adds the data-sort attribute to the "Items needed" column to
ensure proper sorting.

To test:
1. Make a lot of holds.
2. On some holds have a high enough holds/copies ratio so the "Items
   needed" has values greater than 10.
3. Sort by that column. Notice the copies with an "Items needed" higher
   than 10 do not get sorted correctly.
4. APPLY PATCH
5. Try steps 1 -3 again. Everything should sort properly.

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 2ce68244991fc90b4606e1aa06e874c9854107a2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a6c53078a633db278b8a16b5ef7303e34446ee65)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35127: Fix 'Search type' for patron search
Jonathan Druart [Tue, 24 Oct 2023 13:32:53 +0000 (15:32 +0200)]
Bug 35127: Fix 'Search type' for patron search

We need to fallback on the syspref DefaultPatronSearchMethod but keep
the value when one is passed!

Test plan:
Search for patrons, and use the "search type". Set it to different
values than DefaultPatronSearchMethod and confirm that the value is
kept.
Fix is expected when searching for patrons in the header (use the
options to select a different value and run the search)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e08bf3bb4c4ef8208f7895c000397e4122664c57)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e9363693e026ebea2117a750c078dd71d4c0a1bb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
6 months agoBug 35072: Fix invalid usage of "&amp;" 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 "&amp;" 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 "&amp;" 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>