Commit graph

50695 commits

Author SHA1 Message Date
32e73fd122 Bug 34479: Update syntax for translatable string
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 63ec521608)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 79944eb6ee)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-05 20:15:39 +00:00
87014b9786 Bug 34479: Fix string for translatability
When moved from .tt to .js we need to convert the single
underscore into a double underscore.

Also uses format() to better deal with the variable.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 066e349561)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 265826ea32)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-05 20:15:38 +00:00
b507f94108 Bug 34479: Move patron selection history to a re-useable file
This patch takes some of the functionality for maintaining patron selections and moves it to a new file that can be used in other template files. It also introduces a new method for determining whether to delete the history after an operation is complete, along with an .inc file containing the checkbox that manages this

Test plan:
1) Navigate to Patrons and run a search
2) Use the checkboxes to select some patrons and run the three different options in the menu bar: Add to patron list, Merge selected patrons, Batch patron modification.
3) For each operation, you should see a checkbox asking if you want to "Keep patrons selected for anew operation". N.B. For adding patrons to a list, you will only see this when selecting to add them to a new list
4) When you run the operations, if you select the checkbox to keep the patrons then when you return tho the patron search, those patrons should all be still selected.
5) If you don't check the box, when you return to the search, your patron selection history should be empty and no patrons should be selected
N.B. If you have run a merge operation and elected to keep the patron history, you will only keep the patron who was kept

Signed-off-by: Sharon Dugdale <sharon.dugdale@cumberland.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Michael Adamyk <madamyk@ckls.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 21e2ee11fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8ea3e73edc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 18:18:22 +00:00
d28e035f4d Bug 34479: Add new files to templates
This patch adds two newly created files to the templates to allow the patron selection history to be wiped or persisted as appropriate

Test plan as per previous commit

Signed-off-by: Sharon Dugdale <sharon.dugdale@cumberland.gov.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2de99d0b02)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 967294acfa)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 18:18:22 +00:00
c8c9d21c69 Bug 35474: Add icon for protected patrons
This patch adds a "protected" icon (fa-lock) to the patron information
in the sidebar of patron-related pages in the staff interface.

To test, apply the patch and perform a patron search in the staff
interface.

- Edit a patron and go to the "Library management" section.
- Set "Protected" to "Yes."
- Save the record and view the information in the sidebar. You should
  see the lock icon by the patron's name.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 272056791f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d7dc3c1b5b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 18:02:36 +00:00
b71d875d5e Bug 35341: Improve processing hard due date and auto renewal date
After quite a struggle, came up with this approach using
flatpickr's parseDate and setDate. Seems to be the best.
The dateformat variable is set in calendar.inc.

Test plan:
Test edit, save, clear rules, focus on both dates.
Toggle all I18N preference date formats.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 35341: Do not reinstantiate flatpickr

We do not need to reinstantiate flatpickr, we need to retrieve the
existing instance.

Test plan:
See previous patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
12-01-2024 Squashed both patches. Removed the unused hidden inputs for
hardduedatecompare and added a data attribute for the duedate.
The check with is_valid_date seems no longer needed here. Normally
date is empty or valid. A js warning from parseDate should be
exceptional. Made code for both dates a bit more consistent.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 963a3a4715)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7f416ac227)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 18:01:06 +00:00
Emily Lamancusa
1129a79d38 Bug 35322: (QA follow-up) Perltidy
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9e168686cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit baebf8e42c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:59:46 +00:00
d29550e988 Bug 35322: Add unit tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 77f045e9a5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 85a77895b5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:56:31 +00:00
b59f8701af Bug 35322: Fix the logic for checking for holds in CanBookBeIssued
We are having reports that AllowItemsOnHoldCheckoutSCO and AllowItemsOnHoldCheckoutSIP no longer work. It appreas that in CanBookBeIssued, the ignore reserves check was changed from "check reserves unless the ignore reserves flag was passed" to "check reserves unless the ignore reserves flag was passed *and* we have a recall". I think this was a logic mistake and we want to check reserves unless we have an ignore flag *or* there is a recall.

Test Plan:
1) Enable AllowItemsOnHoldCheckoutSCO
2) Place a hold on an item
3) Attempt to check that item out to another patron
4) Note the checkout is blocked
5) Apply this patch
6) Restart all the things!
7) Attempt the checkout again
8) The checkout now succeeds!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9b10f69ee3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c279c31daf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:56:31 +00:00
Laura Escamilla
dbc487fddd Bug 34950: Add availability statuses for in transit and on hold items.
To test:
1. Enable the ILS-DI system preference.
2. Place a hold for a patron and put it in transit.
   Place another hold for a patron that is available for pickup at the local branch.
   And then select an item that is available for checkout but don’t change the status for it.
3. Go to your testing OPAC and make an ILS-DI “Get Availability” call using
   the item ids of the three items you worked with in step 2.
   (i.e. http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item)
4. Notice that the availability status for all three items is showing as available.
   The item in transit and the item with a local hold should have a status
   of not available and a message of why they are not available.
5. Apply the patch
6. Use restart_all.
7. Refresh the page and notice that the statuses are now correct.
   The item in transit has a status of not available and an availability
   message of “In transit”.
   The item with the local hold has an availability status of not
   available with an availability message of “On hold”.
   Finally the available item is correctly showing up as available.
8. Sign off and have a wonderful day. :)

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 122f29cd8f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 986ef9ac22)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:54:40 +00:00
83933dafe5 Bug 35510: Non-patron guarantor missing from CollapseFieldsPatronAddForm options
This patch adds a missing option to the CollapseFieldsPatronAddForm
system preference so that the "Non-patron guarantor" section can be
collapsed by default.

To test, apply the patch and go to Administration -> System preferences.

- Search for CollapseFieldsPatronAddForm.
- In the dropdown of options you should see an entry for "Non-patron
  guarantor."
- Click "Select all" and save your changes.
- Go to Patrons -> New patron and choose a patron category which can
  have a guarantor (for example J - Juvenile)
- The patron entry page should load with all sections collapsed,
  including the Non-patron guarantor section.
- Uncheck  all options in the CollapseFieldsPatronAddForm
  preference and return to the patron entry form. All sections should
  now appear.

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>
(cherry picked from commit e97dac3cbe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 036228a4e0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:53:02 +00:00
a267c38a3f Bug 35641: Reduce DB lookups when sending a list of barcodes to inventory
This patch does three things:
1 - Removes a specific query for withdrawn status of each item scanned - we can use the withdrawn field
2 - Removes a specific query for checkouts on each item scanned - we can use the onloan field
    a - additionally we don't need to fetch the checkout as we check it in to the homebranch,
    this is likely incorrect - we should use the current branch, but I preserve behavior for now
3 - Fetches the items ahead of time and builds a hash based on barcode, reduces DB lookups, may raise memory usage

To test:
1 - Checkout some items
2 - Withdraw some items
3 - Generate a lsit of barcodes including some checked out items and some withdrawn items
4 - Enter that list of barcodes into inventory tool
5 - Note your results
6 - Apply patch
7 - Issue the items again
8 - Repeat inventory
9 - Confirm results are the same as before patch

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5ae5e4367b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 41580a0a58)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:51:54 +00:00
Katrin Fischer
40c8816bd4 Bug 25691: (follow-up) Update control file with wiki link
This is in case it's needed anyway (see comment on previous patch)

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>
(cherry picked from commit 328c5dcdfa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f7915af15f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:49:52 +00:00
Katrin Fischer
96bfc78030 Bug 25691: Replace link to non-existing README with wiki link
This doesn't update the occurrence in the control file
as it says in control.in:

To test:
* Verify all occurrences of the README file have been updated. Exceptions:
  * control (see above)
  * changelog

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>
(cherry picked from commit 0a49f71e8f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e067575e0a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:49:52 +00:00
ff3cc5ff6d Bug 35438: Remove skip_intermediate_commit parameter
It no longer does anything.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 067034f9e0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8d58f0231c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:47:39 +00:00
84d0c6ac9b Bug 35438: Transact each record import separately
When importing a staged file we commit every 50 records
For an authority import we are also merging, which can affect many more biblios, and these all end up in the transaction.
This can cause tables locks and issues across Koha

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

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 74bbb89e99)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cc4f879465)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:47:39 +00:00
Emmi Takkinen
84cc07b507 Bug 32477: Fix hiding all columns in item batch mod tools
If one hides all columns in batch item modification tool
and then reloads the page or launches tool again, "Holds"
column isn't displayed and "Itemtype" column is. Also
"Itemtype" columns checkbox remains checked. This happens
because "Itemtype" columns id is out of scope of list of column
numbers set in cookies. This patch adds 3 to number of columns
in variable "allColums" to take account all 3 columns we don't
want to hide.

To test:
1. Find items to modify and modify them with batch item
modification tool.
2. Use "Hide all columns" checkbox to hide all columns.
3. Confirm all columns expect checkbox, "Title" and "Holds"
columns are hidden correctly.
4. Reload the page.
=> Note that "Holds" column is now hidden and "Itemtype"
column is displayed. Also "Itemtype" checkbox is checked.
5. Apply this patch.
6. Repeat steps 1 to 4.
=> "Holds" column should now be displayed and "Itemtype"
hidden. None of the checkbox should be checked.

Sponsored-by: Koha-Suomi Oy
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>
(cherry picked from commit deed5233b7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 043fd7ffa4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:46:02 +00:00
Emmi Takkinen
44adbd6628 Bug 32477: Launch function hideColumns after changing datatables settings
Hiding columns in batch item modification breaks if page is
loaded again. If one hides e.g. column "Collection" and then loads
the page column "Holds" disappears. Also behaviour of checbox
changes for "Collection" column. This happens because we launch
function "hideColumns" before changing datatables settings and
"hidden" column with class "sorting_1" is still present.

To test:
1. Find items to modify and modify them with batch item
modification tool.
2. In modification page, hide column "Collection". Confirm
correct column is hidden.
3. Reload the page or modify items again.
=> Note that column "Holds" is now hidden and checking checkbox
for column "Collection" behaves incorrectly (unchecked checkbox
shows column, checked hides it)
4. Apply this patch.
5. Repeat steps 1, 2 and 3.
=> Confirm correct column is now hidden when page is loaded again
and checkbox works correctly.

Sponsored-by: Koha-Suomi Oy
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>
(cherry picked from commit 71a7aa1cdc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ff32095205)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 17:46:01 +00:00
e1fcd24cd3 Bug 35702: Fetch biblios at once and loop
Test plan:
prove -v t/db_dependent/Authority/Merge.t

Signed-off-by: David Nind <david@davidnind.com>

Amended-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Replace $biblio->id with $biblio->biblionumber

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1847e2ab56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fa443bcef1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:31:03 +00:00
fc0efe7909 Bug 35702: Use framework code from biblio object
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>
(cherry picked from commit c703bb2c1c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f8ab19a3eb)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:31:03 +00:00
8bd1585e1a Bug 35086: (follow-up) Use 5000 as example in conf file
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ed23bc1364)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a14f44ea8a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:25:22 +00:00
5defc65ddd Bug 35086: Tidy tests
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>
(cherry picked from commit ddbd00de72)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e1157dcdcd)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:25:22 +00:00
eb2617409a Bug 35086: Also split chunks when indexing from background job
The es background indexer is designed to combine background jobs when started based on the 'batch_size' option.

While this is helpful for combining individual updates, it can be problematic when there are several large batch modifications, or when worker has stopped and is restarted.

This patch uses the same logic as in the indexer to split the chunks that are sent directly for indexing.

To test:
1 - Follow test plan on previous patch
2 - Confirm items are correctly indexed and jobs marked

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>
(cherry picked from commit 7496a603cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2f8ae2ec21)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:25:22 +00:00
19f442c18f Bug 35086: Add chunk_size option to elasticsearch configuration
Whne performing batch operations we can send a large numebr of records for reindexing at once.
Currently this can create requetss that are too large for Elasticsearch to process. We need
to break these requests into chunks/

This patch adds a chunk_size configuration to the elasticsearch stanza in koha-conf.xml

If blank we default to 5000.

To test:
0 - Have Koha using Elasticsearch
1 - Create and download a report of all barcodes:
    SELECT barcode FROM items
2 - Batch modify these items
3 - Note a single ESindexing job is created
4 - Create and download a report of all authority ids:
    SELECT auth_header.authid FROM auth_header
5 - Setup a marc modification template, and batch modify all the authorities
6 - Again note a single ES backgorund job is created
7 - Apply patch
8 - Repeat the modifications above - you still get a single job
9 - Edit koha-conf.xml and add <chunk_size>250</chunk_size> to elasticsearch stanza
10 - Repeat modifications - you now get several background ES jobs
11 - prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t

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>
(cherry picked from commit 9951e230e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 636920558c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:25:22 +00:00
486140a758 Bug 34999: Add unit test
Test plan:
Run t/db_dependent/api/v1/auth.t
[Bonus] Run prove t/db_dependent/api/v1

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b8d9cce664)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ce924fa1db)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:22:25 +00:00
d3ea6d8cbd Bug 34999: Throw exception for public routes if OPACMaintenance is enabled
Test plan:
[1] Try public endpoint like /api/v1/public/biblios/X/items.
    * Replace X by an existing biblionumber.
    You should receive a 200.
[2] Enable OPACMaintenance. Set to Show.
[3] Try same endpoint. You should get a 503 with a json error.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1fc82dd827)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 24b14de398)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:22:25 +00:00
dde9176e2c Bug 35756: Correctly serialize patron's data in patron search popup/modal
We are incorrectly using encodeURIComponent in patron-search.inc.
When a new patron is selected, the info message is showing "Patron %s is already in the list"
or "Patron %s added". If the patron has space in their name, they will be substituted with %20.

We are using JSON for select, we can reuse it for add.

Test plan:
Have a patron with spaces in their name
Add users to a fund
Notice that the name is correctly displayed.

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>
(cherry picked from commit 6779e64d95)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 65460128f1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:20:58 +00:00
ddf41c2dba Bug 35504: Distinguish different RMaint and Topic Expert roles
This patch further splits up release maintanence and topic expert roles
so that they display with further, more accurate, detail in the
development team section.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2ce83fc784)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6f09a31a15)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:16:49 +00:00
48aa0f4994 Bug 35504: Add full maintainers list into development branch
On a stable branch the current maintainer of your running version is
listed at the top of the current maintanence team.. however when you're
on a development branch the RM is responsible for your branch and the
maintainers were missing from display.

This patch adds the maintainers list back to the bottom of the current
maintanence team section, just for the development branch.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7fd998c1e7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 74300e9908)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:16:49 +00:00
360e684a42 Bug 35504: Change 'Jenkins' to 'Continuous integration'
We were naming these roles differently between the 'current team' and
'past roles' display.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a26d4bdf95)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 149cc63818)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:16:49 +00:00
1c47afe807 Bug 35504: Corrections to wiki team
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a4061c3f14)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f302c50af3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:16:48 +00:00
935e51aed5 Bug 35504: Add ktd maintainer
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 29c1225bf8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3c3670142f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:16:48 +00:00
742e8a73ff Bug 35504: Corrections to team
Correction of 'advocate' to 'advocates' to ensure they appear in the
team.

Addition of 'website' and 'wiki' handling to ensure they also appear
in the team.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8190fdb5bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b301f79526)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:16:48 +00:00
21d079a497 Bug 35504: Typo fix
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b9da22b490)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ace0ac8f6b)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:16:48 +00:00
852e5fdf47 Bug 35504: New cycle, new team :)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b6cfef878b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f5d5ffef0e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:16:48 +00:00
3ad6c60f7f Bug 35774: Use itemnumber instead of biblioitemnumber
With Bug 33639 already pushed to master there should be NO change in behavior.

To test:
1. APPLY PATCH
2. Create one or more item groups for a bib if needed
3. Create a new item, and at the bottom of the 'Add item' screen, select the item group to which you want this item added. Save.
4. The item should succesffuly be added to the item group.
5. Add a new item and to the same record and this time try the 'Create a new item group' from the dropdown.
6. Name the new item group.
7. Make sure it is correctly added to the item group.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 95e19e758a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 71247b9a07)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:10:52 +00:00
60091d4f1d Bug 33639: Make add item to item group work from additem.pl
To test:

1, Create one or more item groups for a bib if needed
2. Create a new item, and at the bottom of the 'Add item' screen, select the item group to which you want this item added. Save.
3. On the Normal tab, see that the item has not been added to the item group you selected.
4. APPLY PATCH, restart_all
5. Try 1-3 again but this time the item should succesffuly be added to the item group.
6. Add a new item and to the same record and this time try the 'Create a new item group' from the dropdown.
7. Name the new item group.
8. Make sure it is correctly added to the item group.

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>
(cherry picked from commit 5b14f8b11a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1448ac0c26)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-02 16:09:07 +00:00
f6746b49bb Update release notes for the 23.05.08 release
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-24 18:06:00 +00:00
2a32a8b1e8 Increment version for 23.05.08 release
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-24 17:42:43 +00:00
6dbcc0f7e4 Bug 34893: Unit tests for C4::Auth::checkpw
This patch introduces some tests on the current (and new) behavior for
the `checkpw` function.

I needed it to better understand if an edge case was actually possible
(it wasn't).

Found a really minor annoyance for the internal check with expired
password not returning the $patron object for consistency with the other
use cases.

I think this method deserves (at least) changing the return value to a
sane data structure. But that's not target for backporting to stable
releases. So a separate bug.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-24 17:33:44 +00:00
11e2e86da6 Bug 34893: (QA follow-up) Tidy code for qa script
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-24 17:33:44 +00:00
2d8722c97d Bug 34893: Add checkpw change to REST API
This patch adds the checkpw return value change to the REST API
route for validating user identifiers and password.

Test plan:
0. Apply patch
1. prove t/db_dependent/api/v1/password_validation.t

Bonus points:
1. koha-plack --reload kohadev
2. Enable syspref RESTBasicAuth
3. curl -XPOST -H "Content-Type: application/json" \
-u <staff_userid>:<staff_password> \
-d '{"identifier":"<cardnumber>","password":"<password>"}' \
http://localhost:8081/api/v1/auth/password/validation
4. Validation doesn't fail. It gives you cardnumber, patron_id, userid

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-24 17:33:44 +00:00
38e1c2a951 Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron
Imagine we have a set of users. Some of those users have a NULL userid. We then call AuthenticatePatron from ILS-DI for a patron with a NULL userid, but a valid cardnumber. We call checkpw, which returns the cardnumber and userid. We then call Koha::Patrons->find on the userid *which is null*, meaning the borrowernumber returned is not the correct one, but instead the earliest patron inserted into the database that has a NULL userid.

Test Plan:
1) Give three patrons a userid and a password
2) From the database cli, set all patrons's userid to null
   Run this query: update borrowers set userid = null;
3) Call AuthenticatePatron with username being the 1st patron cardnumber,
   and password being the password you set for that patron
   http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=kohacard&password=koha
4) Note you get back a borrowernumber for a different patron. Refresh the page and the number is correct.
5) Do the same with the 2nd patron. Same issue at 1st and correct number after.
6) Apply this patch
7) Restart all the things!
8) Do the same with the 3rd patron.
9) Note you get the correct borrowernumber! :D
10) prove t/Auth.t t/db_dependent/Auth_with_ldap.t t/Auth_with_shibboleth.t t/db_dependent/Auth_with_cas.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-24 17:33:44 +00:00
1f50091a06 Bug 34893: Add unit tests
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-24 17:33:44 +00:00
Andrew Fuerste Henry
7c9a2beb9d Bug 25835: Include overdues with fines in overdues_report permission
To test:
1 - have a user with circulate_remaining_permissions but not
    overdues_report
2 - confirm user can see and run Overdues with Fines
3 - apply patch
4 - confirm user can no longer see links to Overdues with Fines or load
    the page directly by entering the url
5 - confirm a user with overdues_report or greate permission can see and
    use the tool

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 23de67a7e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9825c7ea36)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 22:37:52 +00:00
9051088ec0 Bug 32551: HTTP_ACCEPT_LANGUAGE legacy CGI variable not set in Mojolicious
This patch addresses the fact some of our code still relies on those CGI-era ENV variables.
In particular, C4::Laguages::getlanguage expects it to calculate the most suitable language.

As this is reported as required, I provide a fix.

I did a `git grep HTTP_` on the codebase, and the only other occurences are:

* C4::Output (HTTP_X_REQUESTED_WITH)
* C4::Context (HTTP_USER_AGENT, HTTP_X_FORWARDED_FOR)
* C4::Auth_with_shibboleth (using HTTP_ variables for matchpoints)
* Some handling on the 'Koha as a Mojo app' code
* Some .pl script not relevant to this report

I decided to limit this patch to the requested header which seems harmless. I leave the
other cases.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ qa -c 1
=> FAIL: Tests fail!
3. Apply this patch
4. Run:
  k$ qa -c 2
=> SUCCESS: Tests pass! All green!
5. Sign off :-D

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>
(cherry picked from commit d6e072fb5f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c1ba60ce4d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 22:35:50 +00:00
a9025d9d7c Bug 32551: Regression tests
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>
(cherry picked from commit 5292903dc1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0df6ad0aa9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 22:35:50 +00:00
Kevin Carnes
f002c47366 Bug 35567: Prevent translation of Host-item in "Show analytics" link
The "Show analytics" link is built using text which can be translated.

The following languages have already translated Host-item:
fa-Arab, fi-FI, nl-NL, pt-BR, ru-RU, sv-SE

To test:
 1. Install one of the affected languages:
    koha-translate --install sv-SE --dev kohadev
 2. Modify and save the following system preferences:
    language: enable the language
    OPACLanguages: enable the language
    opaclanguagesdisplay: Allow
    EasyAnalyticalRecords: Show
 3. View a record with holdings and copy the barcode of one the items
 4. Select the Edit dropdown menu above the record details and click
    "Link to host record"
 5. Paste the barcode, click Select, and click OK
 6. Return to Normal view of the record and reload the page
 7. There should now be a "Show analytics" link
 8. Hover over the link and note that the link contains "Host-item"
 9. Switch to one of the affected languages and note that "Host-item" is
    translated
10. View the record in the OPAC and confirm that the link is also translated
11. Apply the patch
12. Update the affected language:
    koha-translate --update sv-SE --dev kohadev
13. Restart Koha (restart_all)
14. Notice that the links are no longer translated
15. Sign off

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0f2c17e71d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3ce12b7dca)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 22:33:05 +00:00
Katrin Fischer
a4042a3c8c Bug 35713: Remove outdated debian/docs/LEEME.Debian file
This removes the LEEME.Debian README file from the docs
directory. We don't even have an English README here as
we usually refer to the wiki for installation instructions.
It makes sense to remove it from the codebase.

To test:
* Verify that the file is removed
* Verify that all references to the file have been removed as well
  Example: git grep LEEME

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>
(cherry picked from commit a18e4d0e62)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a3606493ad)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 20:59:50 +00:00
34cefad0ae Bug 35598: Fix selenium/authentication_2fa.t random failure
Jenkins is failing with
koha_1       | STRACE:	/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
koha_1       | 	/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
koha_1       | 	(eval 582):1 in Selenium::Remote::Driver::__ANON__
koha_1       | 	(eval 584):2 in Selenium::Remote::Driver::__ANON__
koha_1       | 	(eval 556):17 in Selenium::Remote::Driver::_execute_command
koha_1       | 	/usr/share/perl5/Selenium/Remote/WebElement.pm:125 in Selenium::Remote::WebElement::_execute_command
koha_1       | 	t/db_dependent/selenium/authentication_2fa.t:276 in Selenium::Remote::WebElement::send_keys
koha_1       | 	/usr/share/perl/5.32/Test/Builder.pm:334 in main::__ANON__
koha_1       | 	/usr/share/perl/5.32/Test/Builder.pm:334 in (eval)
koha_1       | 	/usr/share/perl/5.32/Test/More.pm:809 in Test::Builder::subtest
koha_1       | 	t/db_dependent/selenium/authentication_2fa.t:294 in Test::More::subtest
koha_1       |
selenium_1   | 1702911648831	Marionette	INFO	Stopped listening on port 41385
selenium_1   | JavaScript error: resource:///modules/Interactions.jsm, line 230: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIUserIdleService.removeIdleObserver]
selenium_1   | 15:00:49.452 INFO [ActiveSessions$1.onStop] - Removing session c3461b22-7a80-4b56-b177-653a53cc2651 (org.openqa.selenium.firefox.GeckoDriverService)
koha_1       |     # Looks like you planned 7 tests but ran 3.
koha_1       |
koha_1       | #   Failed test 'Enforce 2FA setup on first login'
koha_1       | #   at t/db_dependent/selenium/authentication_2fa.t line 294.
koha_1       | Error while executing command: element not interactable: Element <input id="pin_code" name="pin_code" type="text"> is not reachable by keyboard at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.

The error is: "Element <input id="pin_code" name="pin_code" type="text"> is not reachable by keyboard"

A guess is that the input is either 1. outside of the viewport, or 2. not
displayed yet.

1. We are hidding #registration-form then show it when we retrieved the
   info (after POST /api/v1/auth/two-factor/registration)
2. Couldn't there be a race condition?
In auth.tt
284                     success: function (data) {
292                         $("#registration-form").show();
And in the selenium test:
$s->wait_for_ajax; # There is an ajax request to populate the qr_code and the secret
Not sure this wait_for_ajax is waiting for the end of success, I don't
think so.

This patch is supposed to fix both theories.

Test plan:
0. Do not apply the patch
1. Edit auth.tt and sleep 1 second before showing the form:
290                         const sleep = ms => new Promise(r => setTimeout(r, ms));
291                         await sleep(1000);
292                         $("#registration-form").show();

You will also need to replace the following line (284):
  success: function (data) {
with
  success: async function (data) {

2. prove t/db_dependent/selenium/authentication_2fa.t
=> "is not reachable by keyboard" error!

3. Apply the patch, keep the sleep

4. prove t/db_dependent/selenium/authentication_2fa.t
=> Tests are passing

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit (tcohen): Tidied a bit to clear complaints
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3270d32191)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5aa213e210)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 20:53:11 +00:00