koha.git
3 months agoBug 35581: Koha::Illrequest -> Koha::ILL::Request
Pedro Amorim [Fri, 15 Dec 2023 10:07:11 +0000 (10:07 +0000)]
Bug 35581: Koha::Illrequest -> Koha::ILL::Request

Koha/Illrequests.pm -> Koha/ILL/Requests.pm

Merged:
t/db_dependent/Koha/Illrequests.t
t/db_dependent/Illrequests.t

Into:
t/db_dependent/Koha/ILL/Requests.t

ILL classes file structure is, for the most part, around 7 years old and doesn't follow a strict logic. It's so confusing that some test files exist redundantly.

This housekeeping should help future work in regards to ISO18626 to add Koha as a supplying agency instead of just requesting agency, as is now.
It should also help future housekeeping of moving backend related logic out of the Illrequest.pm into Illbackend.pm (now ILL/Request.pm and ILL/Backend.pm as of this patchset).
It should also help in structuring the addition of a master generic form (see bug 35570)

This patchset will require existing backends to be updated to match the new class names and structure, if they invoke them.

Test plan, k-t-d, run tests:
prove t/db_dependent/api/v1/ill_*
prove t/db_dependent/Koha/ILL/*

Test plan, k-t-d, manual:
1) Install FreeForm, enable ILL module, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) You'll have to switch the FreeForm repo to the one compatible with this work, like:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout reorganize_ILL
3) Do some generic ILL testing:
3.1) Create a request
3.2) Add a comment to a request
3.3) Edit a request
3.4) Edit a request's item metadata
3.5) Confirm a request
3.6) List requests
3.7) Filter requests list using left side filters
4) Install a metadata enrichment plugin:
https://github.com/PTFS-Europe/koha-plugin-api-pubmed
4.1) Create an ILL batch and insert a pubmedid like 123
4.2) Add the request and finish batch
5) Verify all of the above works as expected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35581: Koha::Illrequest::SupplierUpdate* -> Koha::ILL::Request::SupplierUpdate*
Pedro Amorim [Thu, 14 Dec 2023 17:24:50 +0000 (17:24 +0000)]
Bug 35581: Koha::Illrequest::SupplierUpdate* -> Koha::ILL::Request::SupplierUpdate*

Koha/Illrequest/SupplierUpdate.pm -> Koha/ILL/Request/SupplierUpdate.pm
Koha/Illrequest/SupplierUpdateProcessor.pm -> Koha/ILL/Request/SupplierUpdateProcessor.pm

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35581: Koha::Illrequest::Logger -> Koha::ILL::Request::Logger
Pedro Amorim [Thu, 14 Dec 2023 17:07:23 +0000 (17:07 +0000)]
Bug 35581: Koha::Illrequest::Logger -> Koha::ILL::Request::Logger

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35581: Koha::Illrequest::Config -> Koha::ILL::Request::Config
Pedro Amorim [Thu, 14 Dec 2023 16:32:56 +0000 (15:32 -0100)]
Bug 35581: Koha::Illrequest::Config -> Koha::ILL::Request::Config

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35581: Koha::Illrequest::Workflow* -> Koha::ILL::Request::Workflow*
Pedro Amorim [Thu, 14 Dec 2023 16:20:48 +0000 (15:20 -0100)]
Bug 35581: Koha::Illrequest::Workflow* -> Koha::ILL::Request::Workflow*

Koha/Illrequest/Workflow.pm -> Koha/ILL/Request/Workflow.pm
Koha/Illrequest/Workflow/Availability.pm -> Koha/ILL/Request/Workflow/Availability.pm
Koha/Illrequest/Workflow/TypeDisclaimer.pm -> Koha/ILL/Request/Workflow/TypeDisclaimer.pm

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35581: Koha::Illrequestattribute* -> Koha::ILL::Request::Attribute*
Pedro Amorim [Thu, 14 Dec 2023 16:02:05 +0000 (15:02 -0100)]
Bug 35581: Koha::Illrequestattribute* -> Koha::ILL::Request::Attribute*

Koha/Illrequestattribute.pm -> Koha/ILL/Request/Attribute.pm
Koha/Illrequestattributes.pm -> Koha/ILL/Request/Attributes.pm

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35581: Koha::Illcomment* -> Koha::ILL::Comment*
Pedro Amorim [Thu, 14 Dec 2023 15:41:07 +0000 (14:41 -0100)]
Bug 35581: Koha::Illcomment* -> Koha::ILL::Comment*

Koha/Illcomment.pm -> Koha/ILL/Comment.pm
Koha/Illcomments.pm -> Koha/ILL/Comments.pm

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35581: Illbatchstatus* -> ILL::Batch::Status*
Pedro Amorim [Thu, 14 Dec 2023 15:08:20 +0000 (15:08 +0000)]
Bug 35581: Illbatchstatus* -> ILL::Batch::Status*

Koha/IllbatchStatus.pm -> Koha/ILL/Batch/Status.pm
Koha/IllbatchStatuses.pm -> Koha/ILL/Batch/Statuses.pm
Koha/REST/V1/IllbatchStatuses.pm -> Koha/REST/V1/ILL/Batch/Statuses.pm

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35581: Koha::*Illbatch* -> Koha::*ILL::*Batch*
Pedro Amorim [Thu, 14 Dec 2023 14:46:11 +0000 (14:46 +0000)]
Bug 35581: Koha::*Illbatch* -> Koha::*ILL::*Batch*

Koha/Illbatch.pm -> Koha/ILL/Batch.pm
Koha/Illbatches.pm -> Koha/ILL/Batches.pm
Koha/REST/V1/Illbatches.pm -> Koha/REST/V1/ILL/Batches.pm
t/db_dependent/Koha/Illbatch.t -> t/db_dependent/Koha/ILL/Batch.t
t/db_dependent/Illbatches.t -> t/db_dependent/Koha/ILL/Batches.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35581: Koha::Illbackend -> Koha::ILL::Backend
Pedro Amorim [Thu, 14 Dec 2023 14:16:01 +0000 (14:16 +0000)]
Bug 35581: Koha::Illbackend -> Koha::ILL::Backend

Koha/Illbackend.pm -> Koha/ILL/Backend.pm
Koha/REST/V1/Illbackends.pm -> Koha/REST/V1/ILL/Backends.pm

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36400: (follow-up) remove option editorconfig from .prettierrc.js
Paul Derscheid [Mon, 25 Mar 2024 13:55:13 +0000 (14:55 +0100)]
Bug 36400: (follow-up) remove option editorconfig from .prettierrc.js

- The option doesn't seem do what it's intended for:
- The debug logs still show options from the .editorconfig (which is actually what we want in this case).
- The option causes unwanted warnings when using the cli.
- In summary: we have to keep in mind that the rules are now hierarchical:
1. .editorconfig
2. .prettierrc.js

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36400: Centralize {js,ts,vue} formatting config in .prettierrc.js
Paul Derscheid [Fri, 22 Mar 2024 11:29:50 +0000 (12:29 +0100)]
Bug 36400: Centralize {js,ts,vue} formatting config in .prettierrc.js

    Let's centralize all formatting for js, ts and vue files in a .prettierrc.js.
    The goal here is to preserve eslint's linting but ignore all of its formatting options.

    Seems to work for vue files in vscode, vscodium and neovim w/ vscode-eslint-language-server.

    To test:
    1) Pick any vue file for example.
    2) Run format via your editor and either npx prettier -c .prettierrc.js <PATH_TO_VUE_FILE> [you can also use the -w flag to directly write].
    3) Look for unexpected changes: vue files should be already formatted w/ these inline flags (see: https://wiki.koha-community.org/wiki/Coding_Guidelines#JS14:_Prettier_JavaScript): [--trailing-comma es5, --arrow-parens avoid].
    4) Sign off if you're happy and comment or show what went wrong in a comment.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35363: Update transfer order pop-up window with consistent footer markup
Owen Leonard [Fri, 17 Nov 2023 17:42:33 +0000 (17:42 +0000)]
Bug 35363: Update transfer order pop-up window with consistent footer markup

This patch updates the "Transfer order" pop-up window so that it has a
fixed footer consistent with other similar pop-up windows.

In order to make navigation between pages within the pop-up window
easier I've added a button in the footer which can take the user back to
the previous step, including any necessary parameters.

To test, apply the patch and go to Acquisitions.

- Locate a vendor with a basket, and a basket with one or more orders.
- On the basket detail page, click the "Transfer" link in the "Modify"
  column.
- In the pop-up window, test each step:
  - Vendor search
  - Vendor selection
  - Basket selection
- Confirm that at any step you can use the new button to go back to the
  previous step.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35568: Add a transform_prepared_letter plugin hook to allow modification of notic...
Kyle M Hall [Thu, 14 Dec 2023 11:58:40 +0000 (11:58 +0000)]
Bug 35568: Add a transform_prepared_letter plugin hook to allow modification of notices created via GetPreparedLetter

A plugin hook for GetPreparedLetter would be very useful. It could be used to add universal headers and/or footers to messages, attach news, and modify notices in other ways in whole or in part. It could even be used for call webhooks when certain types of notices are sent.

For example, the MessageBee ( https://uniquelibrary.com/messagebee/ ) plugin for Koha generates YAML based notice content, which is then further processed by the before_send_messages hook. This process is unreliable due to the possible changes in data between the creation of the yaml and the reading of that yaml and transforming it into JSON with much more data. For example, the yaml may contain an issue_id, but that checkout may have been returned in the meantime. A hook like this would allow the MessageBee plugin to skip the yaml step and create the json data directly which is then sent to MessageBee for transmission to the patron.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Plugins/Transform_prepared_letter_hook.t
3) Download and install the Kitchen Sink plugin v2.4.0
   https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases/tag/v2.4.0
4) Generate any notice or slip, such as a checkin or checkout notice
5) Note that all notices now end with "Thanks for using your local library!"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35616: DBIC schema update
Katrin Fischer [Mon, 22 Apr 2024 06:55:34 +0000 (06:55 +0000)]
Bug 35616: DBIC schema update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35616: DBRev 23.12.00.026
Katrin Fischer [Mon, 22 Apr 2024 06:55:24 +0000 (06:55 +0000)]
Bug 35616: DBRev 23.12.00.026

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35616: (QA follow-up): tidy up code and fix exec permission
Victor Grousset/tuxayo [Tue, 19 Mar 2024 01:21:06 +0000 (02:21 +0100)]
Bug 35616: (QA follow-up): tidy up code and fix exec permission

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35616: Update catalog concerns to set/filter on source
Martin Renvoize [Wed, 20 Dec 2023 14:52:10 +0000 (14:52 +0000)]
Bug 35616: Update catalog concerns to set/filter on source

This patch updates the catalog concerns feature to respect the new
'source' field in the API.  We both set the source for new ticket
submissions and use it for filtering in the corresponding display
tables.

To test:
1) Nothing should noticably change here.. follow the test plan for bug
   31028 and confirm all continues to work as described there.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35616: API specification update
Martin Renvoize [Wed, 20 Dec 2023 14:47:08 +0000 (14:47 +0000)]
Bug 35616: API specification update

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35616: Add source field to tickets table
Martin Renvoize [Wed, 20 Dec 2023 14:42:20 +0000 (14:42 +0000)]
Bug 35616: Add source field to tickets table

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36309: Make create_superlibrarian.pl output more useful
Tomas Cohen Arazi [Wed, 13 Mar 2024 17:56:27 +0000 (14:56 -0300)]
Bug 36309: Make create_superlibrarian.pl output more useful

In situations in which you are not familiar with all the Koha settings,
and table structure, the fact this script just fails telling there's a
broken FK is just not practical.

We should capture those exceptions and display a useful message instead.

This script does that. It adds some validations and some exception
handling too. It prints a nice message about the bad value the user
passed, and the valid values too!

To test:
1. Run this on a fresh KTD:
   $ ktd --shell
  k$ perl  misc/devel/create_superlibrarian.pl \
      --userid tcohen \
      --password tomasito \
      --cardnumber 123456789 \
      --categorycode POT \
      --branchcode ATO
=> FAIL: It explodes with a MySQL exception message!
2. Apply this patch
3. Repeat 1
=> SUCCESS: It tells you which value is wrong and what values you can
pick to make the command work
4. Pick a valid value, and repeat
=> SUCCESS: Now the other value is wrong, a nice message is displayed!
5. Fix with a valid value and repeat
=> SUCCESS: Patron created!
6. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36204: (follow-up) Add parenthesis to match display in other places
Katrin Fischer [Mon, 22 Apr 2024 06:54:59 +0000 (06:54 +0000)]
Bug 36204: (follow-up) Add parenthesis to match display in other places

Updated display to:
Acevedo, Henry (othername)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36204: Add othernames field to PatronAutoComplete display
Lucas Gass [Fri, 19 Apr 2024 17:33:05 +0000 (17:33 +0000)]
Bug 36204: Add othernames field to PatronAutoComplete display

To test:
1. APPLY PATCH
2. Make sure PatronAutoComplete is on.
3. Find or add othernames to a patron record.
4. Search for that patron and make sure othernames properly displays in the dropdown.
5. Add a middle name to that patron and search again, make sure the display looks good.
6. Remove the othernames field and search again, make sure the display looks good.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35151: (follow-up) Remove ILLModuleCopyrightClearance from .pref file
Katrin Fischer [Mon, 22 Apr 2024 06:51:42 +0000 (06:51 +0000)]
Bug 35151: (follow-up) Remove ILLModuleCopyrightClearance from .pref file

Previous patches removed the preference from the database and sysprefs.sql,
but the yaml file was missed.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 33393: DBRev 23.12.00.025
Katrin Fischer [Fri, 19 Apr 2024 17:48:28 +0000 (17:48 +0000)]
Bug 33393: DBRev 23.12.00.025

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 33393: Specify layout this works with a bit more clearly in system preference...
Katrin Fischer [Fri, 19 Apr 2024 17:46:51 +0000 (17:46 +0000)]
Bug 33393: Specify layout this works with a bit more clearly in system preference description

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 33393: tidy layout1page.pm
Kyle M Hall [Fri, 15 Mar 2024 11:49:34 +0000 (11:49 +0000)]
Bug 33393: tidy layout1page.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 33393: Add note to system preference explaining text length
Alex Buckley [Tue, 2 May 2023 05:56:52 +0000 (05:56 +0000)]
Bug 33393: Add note to system preference explaining text length

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 33393: Enable libraries to configure their own text in the 1-Page order PDF
Alex Buckley [Thu, 30 Mar 2023 22:01:54 +0000 (22:01 +0000)]
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF

Test plan:
1) Apply patches and restart services
2) Upgrade Koha schema:
sudo koha-upgrade-schema <instance>
3) Go to Koha Administration -> Libraries. Ensure Library A has an
address, phone and fax.
4) Go to Koha Administration -> System preferences. Search for
OrderPdfFormat. Set this to English 1-page layout option.
5) Go to Acquisitions. Use an existing vendor or create a new one.
Ensure the vendor has a postal address, phone, fax and accout number.
6) Create a basket for this vendor. Add many orders to this basket, for
example 25 items (this is to make the Order PDF cover multiple pages).
7) Close the basket and add it to a basket group of the same name.
8) Edit the basket group. Add an address in the delivery place, and a
delivery comment. Check the box to close the basket group and Save.
9) Click the button to Export as PDF.
10) View the exported PDF. Confirm the PDF is multiple pages long. If it
is not then re-open the basketgroup and add more orders to the basket
and repeat steps 7, 8, and 9
11) If the PDF is multiple pages long then confirm:
- The text "Order number must appear on all related correspondence, shipping papers and invoices. Notify us immediately if you are unable to supply item(s)." appears above the order table.
- The page numbers at the bottom of the first page are not obscured by
the order table.
- That the order table starts near the top of the second page, and not
half way down.
12) Change content in the '1PageOrderPDFText' syspref (use the Enter key
    to split text over multiple lines) and save
13) Back in the Acquisitions module click the button to Export as PDF
14) View the exported PDF. Confirm the following:
- The text above the order table is what you saved in the
1PageOrderPDFText system preference
- The page numbers at the bottom of the first page are not obscrued by
the order table.
- That the order table starts near the top of the second page and not
halfway down.
15) Empty the 1PageOrderPDFText system preference and save
16) Back in the Acquisitions module click te button to Export as PDF
17) View the exported PDF and confirm the line of text between the
Tel/Fax line and the order table has been removed.

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 33393: Add system preference
Alex Buckley [Thu, 30 Mar 2023 21:56:15 +0000 (21:56 +0000)]
Bug 33393: Add system preference

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35967: Add more test cases
Tomas Cohen Arazi [Mon, 11 Mar 2024 13:45:08 +0000 (10:45 -0300)]
Bug 35967: Add more test cases

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35967: (QA follow-up) `status` is not nullable
Tomas Cohen Arazi [Mon, 11 Mar 2024 13:38:33 +0000 (10:38 -0300)]
Bug 35967: (QA follow-up) `status` is not nullable

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35967: Add REST API endpoint to list patron recalls
Aleisha Amohia [Thu, 1 Feb 2024 00:43:26 +0000 (00:43 +0000)]
Bug 35967: Add REST API endpoint to list patron recalls

This enhancement adds a REST API endpoint to list a patron's recalls:

/api/v1/patrons/{patron_id}/recalls

This depends on the logged in patron having the manage_recalls subpermission.

To test:

1. Log in to the staff interface as your superlibrarian self (Patron A)
2. Go to Koha Administration -> Global system preferences. Enable the UseRecalls system preference
3. Set the relevant recalls circulation and fines rules
4. Search for an item (Item A)
5. Check out Item A to yourself (Patron A)
6. Log in to the OPAC as Patron B, a patron who does not have the manage_recalls permission
7. Search for Item A and request a recall
8. While still logged in to the OPAC as Patron B, hit this URL: https://your-opac-url/api/v1/patrons/patron-b-borrowernumber/recalls (swap out your URL and Patron B's borrowernumber)
9. Confirm you are given an error: "Authorization failure. Missing required permission(s)."
10. Log out of the OPAC and log back in, this time as Patron A
11. Hit the URL again https://your-opac-url/api/v1/patrons/patron-b-borrowernumber/recalls
12. Confirm you are able to view a list of Patron B's recalls
13. Confirm tests pass: t/db_dependent/api/v1/patrons_recalls.t

Sponsored-by: Auckland University of Technology
PA amended: QA follow-up: tidy

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 19605: (QA follow-up): available_backends fix reduce
Pedro Amorim [Fri, 19 Apr 2024 13:28:02 +0000 (13:28 +0000)]
Bug 19605: (QA follow-up): available_backends fix reduce

available_backends was only considering dir backends for reduce, it should consider all backends, including plugin backends.

This relates to the ILLOpacbackends syspref, where if you add a backend name that happens to be a plugin, it was not disabling it for the OPAC.
This change considers all backends for Illopacbackends, regardless of if its a plugin or a directory backend.

This was made evident while writing tests for bug 36197.
Regression tests for this particular use case, and others, are part of bug 36197.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 19605: Another fix after bug 35536
Pedro Amorim [Thu, 28 Mar 2024 16:56:34 +0000 (16:56 +0000)]
Bug 19605: Another fix after bug 35536

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 19605: Fix after bug 35536
Tomas Cohen Arazi [Mon, 25 Mar 2024 17:18:09 +0000 (14:18 -0300)]
Bug 19605: Fix after bug 35536

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 19605: Clarify method name
Tomas Cohen Arazi [Sat, 9 Mar 2024 13:00:17 +0000 (10:00 -0300)]
Bug 19605: Clarify method name

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 19605: Rename method and use the instantiated plugin in the call
Tomas Cohen Arazi [Sat, 9 Mar 2024 12:47:45 +0000 (09:47 -0300)]
Bug 19605: Rename method and use the instantiated plugin in the call

This patch makes the backend instantiation happen through a plugin
object method instead of a static one. This way, the (already)
instantiated plugin can be reused (if needed) in the plugin workflow
like this:

sub new_il_backend {
    my ($self, $params) = @_;
    return Custom::Backend->new(
        {
            config => $params->{config},
            logger => $params->{logger},
            plugin => $self,
        }
    );
}

The passed plugin object would then be used to retrieve whatever
plugin-defined configurations, template paths or even helper methods. On
INN-Reach, it gives the backend access to API user agents, task queue
injection, etc.

This patch also renames the method so it is more straight-forward this is
related to ILL.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 19605: Tidy
Tomas Cohen Arazi [Sat, 9 Mar 2024 12:10:03 +0000 (09:10 -0300)]
Bug 19605: Tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 19605: Add support for ILL backends as plugins
Pedro Amorim [Mon, 30 Oct 2023 12:14:04 +0000 (11:14 -0100)]
Bug 19605: Add support for ILL backends as plugins

This is designed to maintain existing functionality of loading ILL
backends through the backend_dir config (default Koha/Illbackends/).

A check for a plugin of a given backend name takes precedence over a
backend of the same name loaded the old way through backend_dir, this
means that if this happens, the backend plugin is used and NOT the
backend present in backend_dir.

Old backend_dir backends AND new backend plugins coexist.

Test plan, k-t-d:
1) Enable ILLModule and install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) Install the plugin ILL backend example .kpz located at:
https://github.com/ammopt/koha-ill-backend-plugin/releases/tag/1.0.0
3) koha-plack --restart kohadev
4) Visit ILL requests:
/cgi-bin/koha/ill/ill-requests.pl
5) Click "+ New ILL request". Notice it lists 'FreeForm' and
   'PluginBackend'
6) Click 'PluginBackend'. Enter a '123' in pubmedid, '42' in cardnumber
   and pick a library. Click 'Marke request'
7) Notice the request is created successfully.
8) Visit plugins:
/cgi-bin/koha/plugins/plugins-home.pl
9) Click "View plugin by class". Pick "ill backend plugins". Notice the
   correct plugin is listed.
10) Click "configure" on the ILL backend plugin. Notice it's a normal
    plugin configuration page

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 19605: Update expandTemplate to expand_template method name
Pedro Amorim [Mon, 30 Oct 2023 12:22:52 +0000 (12:22 +0000)]
Bug 19605: Update expandTemplate to expand_template method name

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 19605: Add 'ill_backend' plugin category
Pedro Amorim [Mon, 30 Oct 2023 12:09:39 +0000 (11:09 -0100)]
Bug 19605: Add 'ill_backend' plugin category

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 33174: Add warning about how many holds are being cancelled
Lucas Gass [Wed, 8 Mar 2023 21:12:39 +0000 (21:12 +0000)]
Bug 33174: Add warning about how many holds are being cancelled

To test:
1. Apply patch
2. Find or make a record with many holds on it.
3. Go to the Holds tab ( request.pl ).
4. Select some hodls to cancel and press "Cancel selected"
5. A modal popup will appear. Notice the warning telling you exactly how many holds you are about to cancel. Confirm the count is accurate.
6. Try using the select all button and make sure the warning is accurate.
7. Make sure you can cancel the holds.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35862: Display modal search results to the right of form above 1200px
Lucas Gass [Wed, 6 Mar 2024 23:44:08 +0000 (23:44 +0000)]
Bug 35862: Display modal search results to the right of form above 1200px

To test:
1. Apply patch
2. Rebuild CSS ( yarn build )
3. Look at some of the places where there is a modal patron search.
    -suggestion/suggestion.pl: Set to patron
    -members/memberentry.pl: Add guarantor

4. Make sure the modal looks good before and after you have searched for a patron.
5. Play with many different screen sizes, ensuring everything looks good and makes sense.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34575: Add a CSS class to patron email
Pedro Amorim [Fri, 22 Dec 2023 10:36:42 +0000 (10:36 +0000)]
Bug 34575: Add a CSS class to patron email

Adds a CSS class to the patron email section in the 'name-address' column of search results in members-home.pl
No functional behaviour change.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34574: Add CSS class to datatable select filter
Pedro Amorim [Thu, 21 Dec 2023 14:11:35 +0000 (14:11 +0000)]
Bug 34574: Add CSS class to datatable select filter

Test plan:

1) Create a new patron category, visit:
/cgi-bin/koha/admin/categories.pl?op=add_form
2) Add a category code, en enrollment period, a category type and a really long description like:
"This is a real long description of the patron category code for demo purposes"
3) Now do the same but for a library, visit:
/cgi-bin/koha/admin/branches.pl?op=add_form
4) Add a library code and a really long name like:
"This is a real long library name for demo purposes"
5) Visit patrons home:
/cgi-bin/koha/members/members-home.pl
6) Hit "Search". Notice the "library" and "category" columns grow in width to match the largest option (added in previous steps)
7) Apply patch, add the following CSS to IntranetUserCSS:
.dt-select-filter{
max-width:200px;
}
8) repeat 5) and 6). Notice the columns no longer grow in width.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35151: DBRev 23.12.00.024
Katrin Fischer [Fri, 19 Apr 2024 17:11:56 +0000 (17:11 +0000)]
Bug 35151: DBRev 23.12.00.024

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35151: (follow-up) Remove ILLModuleCopyrightClearance from sysprefs.sql
Katrin Fischer [Fri, 19 Apr 2024 17:10:42 +0000 (17:10 +0000)]
Bug 35151: (follow-up) Remove ILLModuleCopyrightClearance from sysprefs.sql

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35151: Convert ILLModuleCopyrightClearance system preference to additional contents
Owen Leonard [Thu, 26 Oct 2023 14:38:14 +0000 (14:38 +0000)]
Bug 35151: Convert ILLModuleCopyrightClearance system preference to additional contents

This patch moves the ILLModuleCopyrightClearance system preference into
HTML customizations, making it possible to have language- and
library-specific content.

To test you should have some content in the ILLModuleCopyrightClearance
system preference before applying the patch. Apply the patch, run the
database update process, and rebuild the OPAC CSS.

- In the staff client, go to Tools -> HTML customizations and verify
  that the content from ILLModuleCopyrightClearance is now stored there.
- The HTML customization entry form should offer
  ILLModuleCopyrightClearance as a choice under "Display location."
- Update and reinstall active translations (for instance fr-FR):
  - perl misc/translator/translate update fr-FR
  - perl misc/translator/translate install fr-FR
- Enable the translation if necessary under Administration -> System
  preferences -> language.
- Enable the "opaclanguagesdisplay" preference if necessary.
- Edit the ILLModuleCopyrightClearance HTML customization and add unique
  content to the "fr-FR" tab.

- Enable the "ILLModule" and "ILLModuleUnmediated" system preferences if
  necessary. You must have at least one ILL backend installed.
- Log into the OPAC and click the "Interlibrary loan requests" in the
  sidebar menu on the user summary page.
- Click "Create new request."
- You should be taken to a page with your ILLModuleCopyrightClearance
  content shown along with "Yes" and "No" buttons.
  - Clicking "Yes" should take you to the form for creating a new
    request.
- Switch to your updated translation and confirm that the content
  appears correctly.
- Remove all "ILLModuleCopyrightClearance" html customizations. Test the
  "Create new request" process in the OPAC again.
  - There should be no confirmation step before arriving at the form for
    creating a new ILL request.
- Go to Administration -> System preferences and search for
  "ILLModuleCopyrightClearance." It should return no results.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36105: Add 'No status alias' option
Pedro Amorim [Thu, 15 Feb 2024 15:18:38 +0000 (15:18 +0000)]
Bug 36105: Add 'No status alias' option

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/admin/authorised_values.pl add search for 'alias', click on ILL_STATUS_ALIAS
3) Click on the 'New authorized value for ILL_STATUS_ALIAS' button and add 'alias_code' in authorized value and 'Alias Description' in Description
4) Visit /cgi-bin/koha/ill/ill-requests.pl and create a new FreeForm request
5) After created, click 'Manage request', and then click the 'Edit request' button
6) Edit the Status and select 'Alias Description', click 'Submit'
7) Create a second request but do not set a status alias this time
7) Visit /cgi-bin/koha/ill/ill-requests.pl and select 'Alias description' on the 'Status aliases:' left-side filter
8) Notice the correct record is returned.
9) Now repeat 7) and select 'No status alias'. Notice the request with an empty status_alias is returned
10) Repeat 7 but select 'All status aliases'. Notice both requests are returned

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nell O’Hora <nohora@aub.ac.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 32132: DBIC schema update
Katrin Fischer [Fri, 19 Apr 2024 17:03:30 +0000 (17:03 +0000)]
Bug 32132: DBIC schema update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 32132: DBRev 23.12.00.023
Katrin Fischer [Fri, 19 Apr 2024 17:01:54 +0000 (17:01 +0000)]
Bug 32132: DBRev 23.12.00.023

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 32132: Do not allow NULL value in column aqbudgets.budget_period_id
Emmi Takkinen [Fri, 2 Feb 2024 07:02:59 +0000 (09:02 +0200)]
Bug 32132: Do not allow NULL value in column aqbudgets.budget_period_id

If budget_period_id column is set as NULL, "Late orders"
page dies on error 500. Logs read:

Template process failed: undef error - DBIC result _type isn't of the _type Aqbudget at
/home/koha/Koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt line 157

This patch makes changes to column aqbudgets.budget_period_id so that it
no longer allows NULL values. This is in line with aqbudgets tables foreign key
"budget_period_id" which has ON DELETE CASCADE clause.

To test:
1. Run prove t/db_dependent/Koha/Acquisition/Fund.t
=> Tests should fail
2. Run updatedatabase.pl and restart services if needed
3. Rerun prove t/db_dependent/Koha/Acquisition/Fund.t
=> Tests should now pass

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35724: DBIC schema update
Katrin Fischer [Fri, 19 Apr 2024 16:26:03 +0000 (16:26 +0000)]
Bug 35724: DBIC schema update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35724: DBRev 23.12.00.022
Katrin Fischer [Fri, 19 Apr 2024 16:22:21 +0000 (16:22 +0000)]
Bug 35724: DBRev 23.12.00.022

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35724: (QA follow-up) Also account for port in FTP
Martin Renvoize [Tue, 27 Feb 2024 11:08:59 +0000 (11:08 +0000)]
Bug 35724: (QA follow-up) Also account for port in FTP

We were only passing port into SFTP connections.. now that we allow
defining it, we should also pass it to FTP connections just in case
someone is still using those.

This patch adds such functionality and defaults to port 21 in this case
when the port isn't defined.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35724: Sync database update and kohasctructure and set to int(11)
Martin Renvoize [Tue, 27 Feb 2024 11:01:42 +0000 (11:01 +0000)]
Bug 35724: Sync database update and kohasctructure and set to int(11)

We use int(11) in the smtp_servers table for port, so I think it makes
sense to use the same here too.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35724: Define non-standard ports for EDI SFTP in EDI accounts
Alex Buckley [Mon, 8 Jan 2024 14:47:37 +0000 (14:47 +0000)]
Bug 35724: Define non-standard ports for EDI SFTP in EDI accounts

Not all EDI vendors accept Koha servers connecting on port 22, sometimes
they require a different port to be used, so it would be helpful for
librarians to be able to configure non-standard EDI SFTP ports
themselves.

Test plan:
1. Set EDIFACT syspref = 'Enable' and define a EDI account: Administration > Acquisition parameters > EDI
accounts.
2. Create an EDI order: https://koha-community.org/manual/latest/en/html/acquisitions.html#ordering-via-edi
3. Confirm you can upload the EDI order and download the vendor invoice.
4. Apply patches, update database, and restart services.
5. Go to the EDI account you made in #1.
6. Confirm there are two new fields: Upload port and Download port, both
have the value of 22.
7. Create a new EDI order.
8. Confirm you can upload the EDI order and download the vendor invoice.
9. Change the EDI account. Set the Download port = 10022.
10. Create a third EDI order.
11. Confirm you can upload the EDI order and download the vendor
invoice.

Sponsored-by: Waikato Institute of Technology, New Zealand
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35724: Template changes
Alex Buckley [Mon, 8 Jan 2024 14:45:04 +0000 (14:45 +0000)]
Bug 35724: Template changes

Sponsored-by: Waikato Institute of Technology, New Zealand
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35724: Database changes
Alex Buckley [Mon, 8 Jan 2024 14:40:38 +0000 (14:40 +0000)]
Bug 35724: Database changes

Sponsored-by: Waikato Institute of Technology, New Zealand
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36138: Add reason to status column on opac-holdshistory, if there is a reason
Lucas Gass [Tue, 20 Feb 2024 20:49:29 +0000 (20:49 +0000)]
Bug 36138: Add reason to status column on opac-holdshistory, if there is a reason

TO TEST:
1. Turn on OPACHoldsHistory
2. Make some holds for a patron and then cancel them with a reason.
3. Log in as that patron and go to the 'Holds history' tab. Notice the text in the 'Status' column is 'Cancelled' but nothing shows up regarding the reason.
4. Apply patch and try again, this time you should see the reason for cancellation.

Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35362: Update patron module pop-up windows with consistent footer markup
Owen Leonard [Fri, 17 Nov 2023 16:29:39 +0000 (16:29 +0000)]
Bug 35362: Update patron module pop-up windows with consistent footer markup

This patch updates two patron-related templates in order to style
submission and close buttons in a fixed footer at the bottom of the
window, with markup consistent with other pop-up windows.

The patch also updates the "Update child" popup js so that it uses
the same window-opening function we use elsewhere. I also added form
validation to the category selection form to help prevent errors if
someone submits the form without making a selection.

To test, apply the patch and go to the Patrons module

- Click "New patron" and add a patron with the same first and last name
  of a patron already in the database.
- When you save the new patron record the page should reload with an
  error message: "Duplicate patron record?"
- Click "View existing record"
- A pop-up window should appear with patron information.
- Confirm that the window's footer looks correct.

- Locate a patron with an age-limited child category. In the sample data
  the "Juvenile" category works.
- View the patron detail page and click More -> Update child to adult
  patron.
- A pop-up window should appear with patron category selection options.
- Try submitting the form without making a selection. You should see a
  message about fields being required.
- Select a category and submit the form to confirm that the controls
  work correctly.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35108: Hide empty fields on ILL manage request page
Pedro Amorim [Thu, 19 Oct 2023 14:13:48 +0000 (14:13 +0000)]
Bug 35108: Hide empty fields on ILL manage request page

Optionally empty fields are: orderid, biblio_id, batch,
type, type_disclaimer_value, type_disclaimer_date, cost,
price_paid, notesstaff, notesopac.

Test plan, k-t-d:
1) Install FreeForm and BLDSS backends, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev-plus.sh)
2) Create a new FreeForm request, visit:
/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
5) Set type 'Book', put '42' in the cardnumber, and pick a library. Click 'create'.
6) Notice how there is a lot of unnecessary empty field entries
7) Apply patch, restart plack (koha-plack --restart kohadev)
8) Refresh the page, notice all the empty fields entries are no longer displayed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35108: Move request id to page header
Pedro Amorim [Thu, 19 Oct 2023 14:00:12 +0000 (14:00 +0000)]
Bug 35108: Move request id to page header

Redundant information, can be moved to header for more visibility and less horizontal length

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36093: (QA follow-up) Fix unit tests
Matt Blenkinsop [Fri, 19 Apr 2024 09:02:13 +0000 (09:02 +0000)]
Bug 36093: (QA follow-up) Fix unit tests

This patch removes some unnecessary lines from the test file

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36093: Add unit test and fix QA tests
Matt Blenkinsop [Fri, 1 Mar 2024 10:29:40 +0000 (10:29 +0000)]
Bug 36093: Add unit test and fix QA tests

prove t/db_dependent/api/v1/erm_custom_reports.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36093: Fix missing array reference
Matt Blenkinsop [Wed, 14 Feb 2024 12:29:01 +0000 (12:29 +0000)]
Bug 36093: Fix missing array reference

This patch adds an array reference where it was previously missed.

Test plan:
Review patch diff and observe that the array reference is now correctly added

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36634: Replace cud-show with show in tools/automatic_item_modification_by_age.pl
Jonathan Druart [Thu, 18 Apr 2024 06:50:55 +0000 (08:50 +0200)]
Bug 36634: Replace cud-show with show in tools/automatic_item_modification_by_age.pl

It's never used in the template anyway but for consistency it would be better to use "show" (it's not CUD)

No change expected.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 8461: Tidy
Nick Clemens [Fri, 12 Apr 2024 11:21:07 +0000 (11:21 +0000)]
Bug 8461: Tidy

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 8461: Display information on withdrawn item when checked in
Nick Clemens [Wed, 24 Jan 2024 14:49:53 +0000 (14:49 +0000)]
Bug 8461: Display information on withdrawn item when checked in

This patch displays the due date and withdrawn information in the Checked-in items table when 'ShowAllCheckins' is enabled. While the top message is clear, if a staff member checks in two items, then refers to the table they would not have all the information.

To test:
1 - Enable system preference 'ShowAllCheckins'
2 - Set system preference 'BlockReturnOfWithdrawnItems' to 'Block'
3 - Check out an item to a patron
4 - Mark the item as withdrawn
5 - Check the item in
6 - Note message at top says things like 'Cannot check in' 'Item has been withdrawn'
7 - Note the Checked-in items table says 'Not checked out'
8 - Apply patch, restart all
9 - Check the item in again
10 - Note top message has not changed
11 - Note the table now say 'Item was not checked in' and displays the due date and patron info
12 - Note the table also includes the withdrawn value for the item

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36623: (follow-up) Fix translation 'Cronjobs'
Matt Blenkinsop [Thu, 18 Apr 2024 14:38:51 +0000 (14:38 +0000)]
Bug 36623: (follow-up) Fix translation 'Cronjobs'

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 34963: Restore the ability to blank fields when editing a suggestion
Jonathan Druart [Wed, 17 Apr 2024 09:48:16 +0000 (11:48 +0200)]
Bug 34963: Restore the ability to blank fields when editing a suggestion

Regression introduced by bug 23991.
We don't want to remove the fields from the edition if they are empty.

Ideally we should have separate parameters for edition and search, but
this is the low-effort fix, and hopefully won't introduce side-effects.

Test plan:
Try to edit a suggestion and blank some fields
Try to search for suggestions using the search form on the left of the
screen

Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35973: DBRev 23.12.00.021
Katrin Fischer [Fri, 19 Apr 2024 15:52:33 +0000 (15:52 +0000)]
Bug 35973: DBRev 23.12.00.021

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35973: (QA follow-up) Ad exec flag to update
Nick Clemens [Fri, 19 Apr 2024 13:30:28 +0000 (13:30 +0000)]
Bug 35973: (QA follow-up) Ad exec flag to update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35973: Correct wrong values for RedirectGuaranteeEmail system preference
Katrin Fischer [Sun, 17 Mar 2024 16:46:26 +0000 (16:46 +0000)]
Bug 35973: Correct wrong values for RedirectGuaranteeEmail system preference

The system preferences was added with 0/1 in sysprefs.sql is checked
as boolean. But the .pref file was added with yes/no which both
evaluate as strings to true.

This fixes the .pref file and includes a database update that sets
0 and 1 correctly for the value currently chosen in the pref.

To test:
* Make sure to update RedirectGuaranteeEmail to Enable/Don't enable
  before applying the patch
* Verify in the database, that the values was set to yes or no
  You can use a report like:
    SELECT * from systempreferences WHERE variable = "RedirectGuaranteeEmail";
* Apply patch and run database update
* Verify the value in the database was corrected:
  Yes = 1, No = 0
* Change the setting, verify the new value is stored correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 35394: Correction to booked items logic
Martin Renvoize [Fri, 8 Mar 2024 15:25:10 +0000 (15:25 +0000)]
Bug 35394: Correction to booked items logic

This patch fixes the overly extreme message that was designed to appeared
when someone tried to check out a booked item to the wrong user.
However, the message never appeared due to a logic error within
CanBookBeIssued which this patch also resolved.

Test plan
1) Make an item bookable
2) Add a booking for the item to patron A from tomorrow
3) In the database, update the booking start_date to today (or wait a
   day before the next step)
4) Attempt to check the book out to patron B.
   Note that you are displayed with the new message 'The item is booked
   for another patron' and you are unable to check the item out.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36635: Fix vendor's issue show view
Jonathan Druart [Thu, 18 Apr 2024 06:54:48 +0000 (08:54 +0200)]
Bug 36635: Fix vendor's issue show view

Should be "show" not "cud-show"

Test plan:
Create an issue for a vendor, click on the issue's id on the issue list
table
Notice that with the patch applied the issue is displayed. Without the
patch the "show" view is empty

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 27893: (QA follow-up) Rephrase warning
Marcel de Rooy [Fri, 19 Apr 2024 07:05:53 +0000 (07:05 +0000)]
Bug 27893: (QA follow-up) Rephrase warning

See comment24 as well.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 27893: (QA follow-up) Terminology
Marcel de Rooy [Fri, 19 Apr 2024 07:03:02 +0000 (07:03 +0000)]
Bug 27893: (QA follow-up) Terminology

See comment24.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 27893: Optionally skip biblio with open orders in batch delete
Marcel de Rooy [Mon, 19 Feb 2024 13:24:47 +0000 (13:24 +0000)]
Bug 27893: Optionally skip biblio with open orders in batch delete

If the user unchecks the skip checkbox (on by default), we must
make sure that order cancellation is done in background job.

Test plan:
Pick two biblios. One has linked open orders, the other not.
Go to batch delete records. Select 'Enter list of numbers'.
Enter both biblio numbers and check that only one is used on the
follow-up form.
Run the deletion without the skip open orders and verify
that linked order line is cancelled.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 27893: Cancel acq orders in addbiblio.pl
Marcel de Rooy [Mon, 19 Feb 2024 11:43:32 +0000 (11:43 +0000)]
Bug 27893: Cancel acq orders in addbiblio.pl

When the user confirms removal although we have linked orders,
we should cancel them.

Test plan:
Add order line to a basket.
Goto newly added biblio record, remove items, remove biblio.
Notice the warning about attached order lines.
Confirm. Check the basket again after deletion took place (cancelled line).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36068: (QA follow-up) Add OPTIONS section in POD
Marcel de Rooy [Thu, 18 Apr 2024 14:31:37 +0000 (14:31 +0000)]
Bug 36068: (QA follow-up) Add OPTIONS section in POD

Test plan:
Run script with --help.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36068: Do not overwrite cancellation date in ->cancel
Marcel de Rooy [Wed, 14 Feb 2024 15:57:50 +0000 (16:57 +0100)]
Bug 36068: Do not overwrite cancellation date in ->cancel

Test plan:
Run t/db_dependent/Koha/Acquisition/Order.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36068: Add maint script acq_cancel_obsolete_orders.pl
Marcel de Rooy [Thu, 8 Feb 2024 15:29:30 +0000 (15:29 +0000)]
Bug 36068: Add maint script acq_cancel_obsolete_orders.pl

Introducing $orders->filter_by_obsolete and $orders->cancel.

Test plan:
Run t/db_dependent/Koha/Acquisition/Orders.t
Create basket with few orders. Remove some biblio records.
Run acq_cancel_obsolete_orders.pl -c

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36563: Turn into array only if required
Pedro Amorim [Thu, 11 Apr 2024 10:40:16 +0000 (10:40 +0000)]
Bug 36563: Turn into array only if required

Test plan, apply first patch:
1- Visit item search:
   http://localhost:8081/cgi-bin/koha/catalogue/itemsearch.pl
2- Set "Home library" -> "is not" -> "Centerville". Notice you get items
   from Centerville.
3- Apply second patch, repeat step 2, notice you now don't get items
   from Centervile.
4- Test other use cases, like 'is' and 'is not' for multiple choices

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36563: Dirty fix
Jonathan Druart [Wed, 10 Apr 2024 10:04:18 +0000 (12:04 +0200)]
Bug 36563: Dirty fix

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36473: (follow-up) Additionally warn the stringified exception
Nick Clemens [Thu, 18 Apr 2024 11:17:33 +0000 (11:17 +0000)]
Bug 36473: (follow-up) Additionally warn the stringified exception

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36473: (follow-up) Add biblionumber to warning
Nick Clemens [Thu, 18 Apr 2024 10:35:52 +0000 (10:35 +0000)]
Bug 36473: (follow-up) Add biblionumber to warning

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36473: (follow-up) Correct biblio to bibliographic
Nick Clemens [Thu, 18 Apr 2024 10:33:40 +0000 (10:33 +0000)]
Bug 36473: (follow-up) Correct biblio to bibliographic

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36386: Pass user and group to Net::Server
Marcel de Rooy [Thu, 21 Mar 2024 14:17:35 +0000 (14:17 +0000)]
Bug 36386: Pass user and group to Net::Server

This prevents the User/Group Not Defined warns in syslog.

Test plan:
Restart sip and check your syslog.

KTD Test Plan:
1) Stop your SIP server
2) Run "perl C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/koha-conf.xml"
   We need valid XML without any valid SIP settings to the output goes
   to the command line
3) Note the warnings
4) Apply this patch
5) Repeat step 2
6) No warnings!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36623: Remove localhost reference
Matt Blenkinsop [Wed, 17 Apr 2024 15:03:53 +0000 (15:03 +0000)]
Bug 36623: Remove localhost reference

This patch removes a reference to localhost from a url within ERM

Test plan:
This is quite hard to test without sushi credentials and is quite an easy fix. Check the patch diff to verify that the localhost reference has now been removed from the url

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 30068: Remove table_settings_borrowers_table from circulation.tt
Jonathan Druart [Wed, 17 Apr 2024 10:06:03 +0000 (12:06 +0200)]
Bug 30068: Remove table_settings_borrowers_table from circulation.tt

The history is a mess, but here we init a JS variable that is never
used.

Test plan:
  git grep table_settings_borrowers_table
should not return anything after this patch applied

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36490: Correct tab-switching keyboard shortcut for header search forms
Owen Leonard [Tue, 2 Apr 2024 12:41:42 +0000 (12:41 +0000)]
Bug 36490: Correct tab-switching keyboard shortcut for header search forms

This patch updates staff-global.js so that we correctly define the
keyboard shortcuts for search header tabs following the switch to using
the WRAPPER for tabs in Bug 35850.

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

- Go to the staff interface.
- Test each keyboard shortcut to confirm that the header search tabs
  activate correctly:
  - Check in: Alt-r
  - Renew: Alt-w
  - Search: Alt-q
  - Check out: Alt-u
- Test that the keyboard shortcut takes you to the correct page if the
  header search form doesn't exist on the page, e.g. the Authorities
  home page.

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@bsz-bw.de>
3 months agoBug 36420: Allow Basic authentication using `cardnumber`
Tomas Cohen Arazi [Wed, 27 Mar 2024 12:01:32 +0000 (12:01 +0000)]
Bug 36420: Allow Basic authentication using `cardnumber`

This patch makes the API Basic authentication work with cardnumbers.
The used `checkpw_internal` method already does the fallback check.

To test:
1. Apply the unit tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/auth_basic.t
=> FAIL: Tests explode! [1]
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

[1] This highlights an underlying bug! Instead of getting 403, etc we get a 500. This is because of the internal fallback mechanism allowing the cardnumber+password combination, but then the Koha::Patron->find... not finding :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36420: Unit tests
Tomas Cohen Arazi [Wed, 27 Mar 2024 12:00:48 +0000 (12:00 +0000)]
Bug 36420: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 30987: Fix relationship fields for patron full and quick add forms
Lucas Gass [Mon, 26 Feb 2024 15:59:29 +0000 (15:59 +0000)]
Bug 30987: Fix relationship fields for patron full and quick add forms

To test:
1. APPLY PATACH and restart services.
2. Find the borrowerRelationship system preference. The description should no longer include the words "Leave empty to deactivate."
3. Populate the system preference with at least 1 choice.
4. Find a patron category with can_be_guarantee set to 'Yes'.
5. Quick add a patron of that type, making sure the relationship field shows in the Patron guarantor section. ( You have to +Add gaurantor before this field will show )
6. The values in the dropdown should refelct the borrowerRelationship values.
7. With BorrowerMandatoryField make relationship mandatory.
8. Try step 5 again, this time the Relationship field should be mandatory.
9. Remove the field from  BorrowerMandatoryField and add it to BorrowerUnwantedField.
10. Do step 5 again, the relationship field should not show on the quick add form.

Signed-off-by: Myka Kennedy Stephens <mkstephens@fosgail.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36630: Change Post to GET to fix CSRF error on item search batch operations buttons
Brendan Lawlor [Wed, 17 Apr 2024 20:57:34 +0000 (20:57 +0000)]
Bug 36630: Change Post to GET to fix CSRF error on item search batch operations buttons

This patch changes the form that submits to batchMod.pl from the Item search results page. The form method does not need to be a POST.

    To recreate:

    1. Do an item search
    2. On the results page 'click Select visible rows'
    3. Click 'Batch operations' and select 'Batch item modification'
    4. See Programming error - op 'show' must start with 'cud-' for POST http://localhost:8081/intranet/tools/batchMod.pl (referer: http://localhost:8081/cgi-bin/koha/catalogue/itemsearch.pl)
    5. Click 'Batch operations' and select 'Batch item deletion'
    6. See the same error

    To test:
    1. Apply patch and repeat steps to recreate the issue
    2. See that the batchMod.pl page loads with no error.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36577: (bug 34478 follow-up) marc21_linking_section.pl not working
Janusz Kaczmarek [Thu, 11 Apr 2024 12:36:25 +0000 (12:36 +0000)]
Bug 36577: (bug 34478 follow-up) marc21_linking_section.pl not working

After applying "Bug 34478: op =~ ^cud- everywhere" the plugin
marc21_linking_section.pl stopped working properly.  Since the plugin
does not perform a CUD operation, the GET request can be used, and so
the use of CSRF token is not needed.

The patch fixes also problems with result page numbers display.

Test plan
=========
1. Configure a MARC bibliographic framework to use the plugin
   marc21_linking_section.pl (e.g. in 773 $t).
2. Start creating a new record and go to 773 $t. Activate the plugin to find
   the any record to become the host record (perform a search for any
   common word, like 'and').
3. You will get no results.
4. Apply the patch, restart plack etc.
5. Repeat p. 2 - you should now see some results, possibly more than one
   page.  You should be able to change page with Next/Previous arrows and
   also with the page numbers.

BTW, QA people - maybe it would pay to remove the commented code present there
since the very beginning (2012).

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 36597: Fix deletion of circulation desks broken by CSRF
Owen Leonard [Fri, 12 Apr 2024 12:31:15 +0000 (12:31 +0000)]
Bug 36597: Fix deletion of circulation desks broken by CSRF

Our CSRF work introduced a problem with deleting circulation desks: The
"delete_confirm" does not need "cud-" because it's a GET operation
leading to a POSTed deletion after the confirmation is submitted.

To test, apply the patch and restart services.

- Go to Administration -> Circulation desks.
- If necessary, create a circulation desk.
- Click the "Delete" button for you new desk.
- You should be taken to a confirmation page which shows details of the
  desk you're deleting.
- Confirming the deletion should result in deletion of the desk.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
3 months agoBug 33832: Allow updating username without changing password on member-password.pl
Brendan Lawlor [Fri, 12 Apr 2024 15:29:37 +0000 (15:29 +0000)]
Bug 33832: Allow updating username without changing password on member-password.pl

This patch updates the change password page on the staff interface to
allow for changing the patron's username without changing the password.
If the new password is an empty string we can skip setting the patron's
password and sending the new password to the template.

Test plan:
1. From a patron record tool bar click 'Change password'
2. Notice that if you try to change the user's name without also
   changing the password the page just reloads and nothing happens
3. Apply patch and restart_all
4. From the patron record click 'Change password' again
5. Set the user's new username and  password eg. '1234Abc' and click
   'Save'
6. Confirm that you can log in to the OPAC with the user
7. Return to the patron record and click 'Change password' again
8. This time change just the 'New username field' and click 'Save'
6. Notice that the username is updated
7. Confirm you can log into the OPAC with the new username and the
   original password '1234Abcd'
8. Make sure that the change password form still validates passwords
   for length and matching errors etc

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>