]> git.koha-community.org Git - koha.git/log
koha.git
15 months agoBug 33578: Fix controller when editing a restriction type
Jonathan Druart [Wed, 10 May 2023 11:53:20 +0000 (13:53 +0200)]
Bug 33578: Fix controller when editing a restriction type

Do not display a warning when we are editing a restriction type and no
other types with this description exists.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b5de15c4b8daccfb80718e82633553f7dbb8b623)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33578: Fix patron restriction types edition
Jonathan Druart [Wed, 10 May 2023 09:21:19 +0000 (11:21 +0200)]
Bug 33578: Fix patron restriction types edition

When editing an existing patron restriction type you'll always get an error on saving:

Label is already in use

To test:
* Activate use of patron restriction types
* Edit any of the system types
* Create new ones

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9e32945f208fa16c773dfc0867754649fcf820ca)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33894: Use template wrapper for tabs: OPAC search history
Owen Leonard [Thu, 1 Jun 2023 13:40:02 +0000 (13:40 +0000)]
Bug 33894: Use template wrapper for tabs: OPAC search history

This patch updates the OPAC search history page so that it uses
the new WRAPPER syntax to generate tabs markup.

To test, apply the patch and view the OPAC search history page. With the
OpacAuthorities system preference enabled you should see two tabs:
Catalog and Authority. Confirm that each tab shows the correct
information.

Deactivate OpacAuthorities and reload the search history page. The
bibliographic search history should display without tabs.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c6e64ba962474f5d2a109426c20256acdcd065c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33894: Restructuring: Use BLOCKs for biblio and authority sections
Owen Leonard [Thu, 1 Jun 2023 13:33:38 +0000 (13:33 +0000)]
Bug 33894: Restructuring: Use BLOCKs for biblio and authority sections

In order to make the conversion to the tab wrapper markup easier I'm
putting the biblio search history and authority search history sections
into blocks. This will make it easier to include or not include the
sections using template logic.

To test, apply the patch and, if necessary, perform some searches for
bibliographic and authority records. The OPAC search history page should
be unchanged, with the correct information showing under each tab and in
each section for current and previous searches.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f3def0d264d321d535ebc6cef1bcddba31dc38c3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 34013: Recalls awaiting pickup doesn't show count on each tab
Owen Leonard [Wed, 14 Jun 2023 17:23:40 +0000 (17:23 +0000)]
Bug 34013: Recalls awaiting pickup doesn't show count on each tab

This patch modifies recalls_waiting.pl so that it defines template
variables for 'recalls waiting' and 'recalls waiting over x days'
counts in the same way that waitingreserves.pl handles it.

To test you must have UseRecalls enabled, and some recalls data that
will allow you to see content under each tab.

Go to Circulation -> Recalls awaiting pickup and confirm that both tabs
show the correct count.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 44759b4be3aa4c3088edca77837d5d278de5cb1e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 34012: Use template wrapper for tabs: Recalls awaiting pickup
Owen Leonard [Wed, 14 Jun 2023 17:09:48 +0000 (17:09 +0000)]
Bug 34012: Use template wrapper for tabs: Recalls awaiting pickup

This patch updates the recalls awaiting pickup template so that it uses
the new WRAPPER directive to build tabbed navigation.

Note: this patch includes indentation changes, so check the diff
accordingly.

To test you must have UseRecalls enabled. Apply the patch and go to
Circulation -> Recalls awaiting pickup.

Both the "Recalls waiting" and "Recalls waiting over X days" tabs should
look correct and work correctly.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 309148160b34e5dbb6f2ca723d1c2aeb1400d6ba)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33896: Check whether index is defined before string match
Matt Blenkinsop [Mon, 5 Jun 2023 13:08:47 +0000 (13:08 +0000)]
Bug 33896: Check whether index is defined before string match

This patch checks that $indexes[$i] is defined before testing whether the string matches to remove the logged warning when searching

Test plan:
1) In the intranet, search the catalog from the top search bar
2) Check plack-intranet-error.log
3) There should be a warning "[WARN] Use of uninitialized value within @indexes in string eq"
4) Apply patch
5) restart_all and then re-try the search
6) The warning should no longer appear

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0c09d230ce46e9d085a970625408744814cbdc5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 31618: Fix typo in POD for C4::ImportBatch::RecordsFromMARCXMLFile
Sam Lau [Tue, 13 Jun 2023 15:00:21 +0000 (15:00 +0000)]
Bug 31618: Fix typo in POD for C4::ImportBatch::RecordsFromMARCXMLFile

To test:
1) Apply the patch
2) Visit C4::ImportBatch::RecordsFromMARCXMLFile
3) See that in the POD (mine was somewhere around line 1592) the line starting with '@PARAM1' now says '@PARAM1, String, absolute path to the MARCXML file.'
4) Sign off :)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 74bd33205193a6c4f957dccc9e540eacf507ccfc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33117: DBRev 23.05.01.002
Tomas Cohen Arazi [Fri, 23 Jun 2023 12:40:08 +0000 (09:40 -0300)]
Bug 33117: DBRev 23.05.01.002

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5f1c5a04faa3b4c38e3ca4d3372b3d7f612b6701)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33117: (follow-up) Rename preference
Martin Renvoize [Thu, 22 Jun 2023 11:38:04 +0000 (12:38 +0100)]
Bug 33117: (follow-up) Rename preference

As it's been requested that we keep the search defaults consistent, I
think this preference is better names DefaultPatronSearchMethod and
appear next to DefaultPatronSearchFields. This patch makes that change,
though actually applying it to the other search area's (outside of
autocomplete) has been left for another bug.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c50fab16b50850589017c4902138eee74c482caf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33117: Adding new PatronAutoCompleteSearchMethod system preference
Laura Escamilla [Fri, 26 May 2023 16:19:54 +0000 (16:19 +0000)]
Bug 33117: Adding new PatronAutoCompleteSearchMethod system preference

This patch adds a new system preference called "PatronAutoCompleteSearchMethod"
which allows staff to choose between "Starts with" or "Contains" when
searching for patrons.

The "Contains" option should be useful when searching for patrons that have
multiple surnames or when searching using a patron's middle name.

New Test Plan:
 0. Ensure system preference PatronAutoComplete is set to Try
 1. Create a patron that has a first name, middle name and two surnames.
    (i.e. Adela Maria, Hernandez Acosta).
 2. In patron or checkout search, enter their first name and first
    surname without submitting.
 3. Confirm that a record is found in the autocomplete results
 4. In patron or checkout search, enter their first name and second
    surname without submitting.
 5. Confirm that no record is found.
 6. Enter their middle name and first surname. Confirm that no record is
    found.
 7. Enter their middle name and second surname. Confirm that no record
    is found.
 8. Apply the patch, update database
 9. Under Administration > Global System Preferences > search for
    "PatronAutocompleteSearchMethod"
10. Choose "Contains" instead of "Starts with" for the system
    preference, reload your search page
11. Repeat steps 2-4. The patron record should appear for all search
    methods.
12. Sign off!

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7b675997b4ed5bd076ada5cedcbbc039e0fabe7b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 34052: Use root relative URL for subscription-detail.pl
David Cook [Mon, 19 Jun 2023 04:28:53 +0000 (04:28 +0000)]
Bug 34052: Use root relative URL for subscription-detail.pl

This patch replaces a same directory relative URL with a root
relative URL, so that the navigation to subscription-detail.pl
works correctly after deleting a serial.

To test:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/serials/serials-home.pl
2. Click "New subscription"
3. Click "Search for a vendor"
4. Click "OK"
5. Click "Choose"
6. Click "Search for record"
7. Type "e" into "Keyword:" box
8. Click "Search"
9. Click "Choose" on top result
10. Click "Next"
11. Fill in "Serials planning" however you like, and click
"Test prediction pattern"
12. Click "Save subscription"
13. Click "Serial collection" in left nav menu
14. Click "Delete selected issues"
15. Click "Yes, delete"
16. Click the link under the "Subscription num." table column
17. Note that you're taken to the subscription detail page

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b7f89dcca3a2d0115ebc37bc34e2a5a3596105c1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33944: Don't fetch item object unless using recalls
Nick Clemens [Wed, 7 Jun 2023 18:03:07 +0000 (18:03 +0000)]
Bug 33944: Don't fetch item object unless using recalls

To test:
1 - Check someitems out to a patron
2 - View thier checkouts
3 - Apply patch, restart_all
4 - Confirm checkouts load as before
5 - Enable recalls
6 - Recall an item checked out to this patron
7 - Confirm recall shows as expected

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4610bc64eb6d36583ec7533bc2a624241653b0ed)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33973: Restore sorting on Vue tables
Jonathan Druart [Fri, 9 Jun 2023 14:36:43 +0000 (16:36 +0200)]
Bug 33973: Restore sorting on Vue tables

Regression from the KohaTable Vue component added by bug 33066.

_dt_default_ajax expects options.columns to contain the columns.

Test plan:
Add some agreements, go the the agreement list view and confirm that you
can now sort the agreements using the header columns.

Note that the CSS is not correct yet. My understanding is that the
DataTable Vue component keep the 'sorting' class on the th which display
the grey up/down icon over the blue icon which indicate the current sort
column.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7990f3e74142ab20c813534ea615586965524415)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32245: Fix delete news item from staff home page
Marcel de Rooy [Thu, 22 Jun 2023 13:30:10 +0000 (13:30 +0000)]
Bug 32245: Fix delete news item from staff home page

Simple fix: op was named incorrectly in URL.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a9389b60d371dc946e69782159bf1641626909ae)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 34010: Template corrections to recall pages
Owen Leonard [Wed, 14 Jun 2023 15:49:57 +0000 (15:49 +0000)]
Bug 34010: Template corrections to recall pages

This patch makes some corrections to recall pages:
- Update breadcrumbs menu to use wrapper.
- Add <div class="page-section"> where it is missing.
- Use biblio-title include to show links to bibliographic record titles.
- Correct Bootstrap button dropdown markup for consistent style
- Change some submit buttons to <button> elements for consistent style

To test you must have UseRecalls enabled. Having some sample recalls
data will help. Check the following pages to confirm that everything
looks correct:

- Circulation ->
  - Recalls queue
  - Recalls to pull
  - Overdue recalls
  - Recalls awaiting pickup
  - Old recalls
  - Existing recalls: View a bibliographic record with a recall and
    click "Recalls" in the sidebar.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ec6f8186ae39c4a23bad7af2d0feb1642b165f57)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 24517: Add missing 6th position to date-entered-on-file index
David Cook [Wed, 7 Jun 2023 03:13:24 +0000 (03:13 +0000)]
Bug 24517: Add missing 6th position to date-entered-on-file index

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Adding the biblio-zebra-indexdefs.xsl on same patch (as should
be generated with xsltproc).
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 12a986e6687424c00b0a14a627d8f694c6ef19c6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 31651: Replaced duplicate error message
Jacob O'Mara [Tue, 29 Nov 2022 10:19:24 +0000 (10:19 +0000)]
Bug 31651: Replaced duplicate error message

The duplicated error message on ln119 has now been replaced for clarity.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d6566f41e942fe260a7553c9ff0355ff48d221ef)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33500: Add tests for RecordLocalUseOnReturn
Lucas Gass [Wed, 14 Jun 2023 17:15:23 +0000 (17:15 +0000)]
Bug 33500: Add tests for RecordLocalUseOnReturn

To test:
1. Turn on RecordLocalUseOnReturn
2. prove -v /kohadevbox/koha/t/db_dependent/Circulation.t
3. Tests fail.
4. Apply patch
5. prove -v /kohadevbox/koha/t/db_dependent/Circulation.t
6. Tests pass.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2238d9f09639328a5f50315852566c6e2d286473)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33993: Add order_receive to GET orders endpoints
Martin Renvoize [Tue, 13 Jun 2023 08:45:24 +0000 (09:45 +0100)]
Bug 33993: Add order_receive to GET orders endpoints

This adds order_receive to the list of permissions that allow the
endpoint to return orders.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Sharon Dugdale <Sharon.Dugdale@cumberland.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1f0cd38d56ac3215a4b00865dd4a17ae702d2952)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33528: (RMaint follow-up) Restore original wording for maintanence
Martin Renvoize [Mon, 17 Jul 2023 12:36:20 +0000 (13:36 +0100)]
Bug 33528: (RMaint follow-up) Restore original wording for maintanence

We restore the wording so it's not a change in the maintanence branch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 31185: Link authorities automatically doesn't detect duplicate authorities
Adolfo Rodríguez [Fri, 5 May 2023 14:11:26 +0000 (16:11 +0200)]
Bug 31185: Link authorities automatically doesn't detect duplicate authorities

Signed-off-by: Rachael Laritz <rachael.laritz@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0360be7a73336ec82ed64aed952d0fb9c23a8c5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 31185: Unit test
Nick Clemens [Wed, 3 May 2023 17:20:51 +0000 (17:20 +0000)]
Bug 31185: Unit test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 30b06a6c006f89452cb23a19be4fdd7c10db3a81)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33820: (follow-up) Add hint to member-password.tt
Owen Leonard [Wed, 24 May 2023 15:16:37 +0000 (15:16 +0000)]
Bug 33820: (follow-up) Add hint to member-password.tt

This follow-up makes the same change to the "Change password" template.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 756de0f09a42245df72d9c85ed8487b898fc30cc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33820: Add hints to warn the librarian that they will be logged out if they chang...
Jonathan Druart [Wed, 24 May 2023 07:31:05 +0000 (09:31 +0200)]
Bug 33820: Add hints to warn the librarian that they will be logged out if they change their username

This patch adds some JavaScript to the patron entry form which adds a
hint if the logged-in librarian tries to change their own username. It
warns them that they will be logged out.

To test, apply the patch and log into the staff interface.

- Locate and edit your own patron record.
- In the "OPAC/Staff interface login" section, change the value in the
  username field. When focus leaves that form field a hint should
  appear, "You will be logged out if you modify your username."
- Change the username field back to your original username. The hint
  should disappear.
- Confirm that submitting a username change works correctly: You should
  be logged out, and when you log in again your username should be
  updated.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8e611b79f18d829a5aa70c18a50ca20438d0413a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 34051: Cache empty hashref for non-existent authorised values
David Cook [Mon, 19 Jun 2023 01:26:35 +0000 (01:26 +0000)]
Bug 34051: Cache empty hashref for non-existent authorised values

When fetching authorised value descriptions, we need to handle
scenarios where a value doesn't exist in the cache and doesn't
exist in the database. In this situation, we return an empty
hashref, and this patch makes us cache this empty hashref.

This is important because otherwise the function
Koha::AuthorisedValues->get_description_by_koha_field will
do a database call every time it encounters the same value that
doesn't exist in the authorised values table.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3a0aaec102b05fc5a5b0573e1888facd22a731f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 34033: (bug 30649 follow-up) Fix update typos
Nick Clemens [Fri, 16 Jun 2023 12:15:25 +0000 (12:15 +0000)]
Bug 34033: (bug 30649 follow-up) Fix update typos

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 96794db65956051b19df8240a14816e11f967ba6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33987: Combine multiple db updates one in BatchCommitRecords
Kyle M Hall [Mon, 12 Jun 2023 18:20:53 +0000 (14:20 -0400)]
Bug 33987: Combine multiple db updates one in BatchCommitRecords

When replacing existing records BatchCommitRecords will the table import_records will be updated three times for three different fields by three different queries. Not only is this inefficient ( especially for large batches ), it seems that this is causing the dreaded "Lock wait timeout exceeded; try restarting transaction" error on some mysql/mariadb configurations.

1) Test plan
2) Download a marc record from Koha
3) Modify the title of that same bib in Koha
4) Stage the downloaded record and overlay the existing record
5) Verify the title has reverted to the original title from the
   downloaded record!

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ab91409f7f3c18142e0694fab80effd7c0b35980)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32402: Add "Modification date" to OPAC Lists table
David Cook [Mon, 5 Dec 2022 05:34:12 +0000 (05:34 +0000)]
Bug 32402: Add "Modification date" to OPAC Lists table

This change adds a "Modification date" column to the
OPAC Lists table, so that you can see when a list was last modified.

Test plan:
1. Apply patch
2. Create a public list and a private list
3. Go to http://localhost:8080/cgi-bin/koha/opac-shelves.pl?op=list&public=1
4. Note that "Modification date" appears in the relevant date format
on both the "Your lists" and "Public lists" tabs

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit de49b8cd3a45941565f6d2bf7e856eeb6af75c8f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33868: Upgrade the Multiple Select plugin in the staff interface
Owen Leonard [Wed, 31 May 2023 12:08:27 +0000 (12:08 +0000)]
Bug 33868: Upgrade the Multiple Select plugin in the staff interface

This patch upgrades the Multiple Select plugin in the staff interface
and adds some minor adjustments to system preferences CSS to accommodate
the change. The listing on the about page is updated with current
information.

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

- Go to Administration -> System preferences.
- Test some preferences which use the plugin, e.g.
  - ApplyFrameworkDefaults
  - CoceProviders
  - OpacHiddenItemsExceptions
  - OPACAllowUserToChangeBranch
- Confirm that the menus look correct and work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fa809812be0bc6a3a524350b27785f65ff3533fa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33417: Fix translation in toolbar
Matt Blenkinsop [Wed, 5 Apr 2023 14:02:39 +0000 (14:02 +0000)]
Bug 33417: Fix translation in toolbar

This commit allows the string to be translated - tested using fr-FR and a dummy string in the .po file

Test plan as above

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 62b2609e86fea4048386437d4aa856a49c8b5935)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33417: Remove old components
Matt Blenkinsop [Wed, 5 Apr 2023 12:05:35 +0000 (12:05 +0000)]
Bug 33417: Remove old components

This commit deletes the old toolbar components as they are no longer
necessary

Test plan as above

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bd9255d84978ee7b3f1dc62ac53d9e320ea703e0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33417: Add toolbar imports and options
Matt Blenkinsop [Wed, 5 Apr 2023 12:04:20 +0000 (12:04 +0000)]
Bug 33417: Add toolbar imports and options

This commit amends the required files to import the toolbar and add the
correct options

Test plan as above

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c10d6c6b0045f78baa033048956d3ae9cd29d5d0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33417: Create standard toolbar component
Matt Blenkinsop [Wed, 5 Apr 2023 12:02:22 +0000 (12:02 +0000)]
Bug 33417: Create standard toolbar component

This commit introduces a standard Toolbar component that can be used
throughout ERM

Test plan:
1) Apply patch
2) Navigate to Agreements and click the "Add agreement" button - this
   should work as normal
3) Navigate to Licenses and repeat
4) Navigate to Local packages and repeat
5) Navigate to local titles - there should be two buttons, one to add and
   one to import. These should work as normal

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 09666ecf4e2eeabfc13ddc4d0b43311e35dbe0b5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33528: Fix basic_workflow.t
Tomas Cohen Arazi [Wed, 14 Jun 2023 15:46:45 +0000 (12:46 -0300)]
Bug 33528: Fix basic_workflow.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9f4e9f451bc596a2b0fac0fa9e1cb232804c1f61)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33528: (follow-up) Correct selector for event handler
Owen Leonard [Tue, 13 Jun 2023 11:49:44 +0000 (11:49 +0000)]
Bug 33528: (follow-up) Correct selector for event handler

The event handler for restriction deletion needs to be adjusted
according to the new container ID. Without this change the JavaScript
confirmation message didn't appear and restrictions were deleted without
confirmation.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 78431a983d6dabc5c5d2be655f8f959bdb79aaed)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33528: Use template wrapper for tabs: Patron details page
Owen Leonard [Tue, 9 May 2023 17:48:53 +0000 (17:48 +0000)]
Bug 33528: Use template wrapper for tabs: Patron details page

This patch updates the checkout and patron details templates so
that they use the new WRAPPER directive to build tabbed navigation.

The markup for the tab navigation and tab panels is moved into its own
include file since the templates were duplicating essentially the same
code.

To fully test you should have patrons with checkouts, fines, holds,
recalls, and article requests.

Apply the patch and go to the checkout page in the staff interface. With
each tab, test as much functionality as you can within that tab.

- Checkouts
- Holds
- Recalls (with UseRecalls enabled)
- Claims (with a LOST value defined in ClaimReturnedLostValue)
- Restrictions
- Article Requests (with ArticleRequests preference enabled)
- Clubs (with at least one club defined)
- Relatives' checkouts (patron must have a guarantee linked to their
  account).

Perform the same tests on the patron details page. Note that the
"Charges" tab is shown on the patron details page but not the checkout
page. This is not a change made by this patch.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 263196d194e06787b6c0d51ac603f0956d1fff6f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 26700: Remove occurrences in Makefile.PL
Jonathan Druart [Fri, 2 Jun 2023 05:23:53 +0000 (07:23 +0200)]
Bug 26700: Remove occurrences in Makefile.PL

As well as other 2 non existing paths

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 97afec9bc3a5e437ecf9fb3a451618c7a24d465d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 26700: Remove unused C4/SIP/t directory
David Cook [Fri, 2 Jun 2023 02:18:45 +0000 (02:18 +0000)]
Bug 26700: Remove unused C4/SIP/t directory

This patch removes the unused C4/SIP/t directory.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a83f798511661967abc40172ec76781da28ec18a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33961: DBRev 23.05.01.001
Tomas Cohen Arazi [Mon, 12 Jun 2023 18:45:41 +0000 (15:45 -0300)]
Bug 33961: DBRev 23.05.01.001

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2d1d69f3bc2f8b7e24989b86d88241db8266ac75)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33961: Remove built-in offline circ tool
Jonathan Druart [Thu, 8 Jun 2023 15:00:31 +0000 (17:00 +0200)]
Bug 33961: Remove built-in offline circ tool

The tool has not been updated and is no longer working with modern
browser.

It should either be rewritten/adjusted or removed. Given that we didn't
get complains its non-functional status, bugs related to this tool
didn't get attention, and the community is lacking resources, I am
suggesting to remove it and redirect users to the koct FF plugin that
is known to be working.

Test plan:
See bug 10240 and use `git grep` to confirm that we are removing all
tracks of this feature.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3248afdc1256928cef749f927166e90e4ed5e4e3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33897: (QA follow-up) Correct code for tab selection
Owen Leonard [Fri, 9 Jun 2023 17:19:28 +0000 (17:19 +0000)]
Bug 33897: (QA follow-up) Correct code for tab selection

This patch corrects the code for selecting tabs other than the first
tab.

To test, apply the patch and view the bibliographic detail page for a
serial record and with various settings of the opacSerialDefaultTab
system preference.

If you select "subscriptions tab" the subscriptions tab should be active
by default.

You can also enable html5media and view a record with html5media
information and no holdings. The media tab should be displayed by
default.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5308697ab8080915e6b4a415e37056ccdfb6ec59)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33897: Use template wrapper for tabs: OPAC bibliographic detail page
Owen Leonard [Thu, 1 Jun 2023 15:32:43 +0000 (15:32 +0000)]
Bug 33897: Use template wrapper for tabs: OPAC bibliographic detail page

This patch updates the OPAC bibliographic detail page so that it uses
the new WRAPPER syntax to generate tabs markup.

To test, apply the patch and locate a bibliographic record. View the
detail page. Verify that tabs are working, including all the options:

  - Holdings
  - Other holdings (If OpacSeparateHoldings is enabled)
  - Descriptions (MARC notes)
  - Subscriptions
  - Serial collection (UNIMARC, untested)
  - Components (If ShowComponentRecords is enabled. See Bug 11175 for
    sample record)
  - Comments
  - Editions (OPACFRBRizeEditions)
  - Html5media (If HTML5MediaEnabled is on. See Bug 8377 for sample
    records)
  - Images (If OPACLocalCoverImages is enabled)
  - NovelistSelect
  - Author identifiers (Witgh OPACAuthorIdentifiers enabled, see Bug
    29897)

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 59c2a77ab78dfcfa57429cff1d8f6e0e994554c2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33176: Enforce bad values
Lucas Gass [Wed, 7 Jun 2023 18:40:48 +0000 (18:40 +0000)]
Bug 33176: Enforce bad values

1. Turn on RequirePaymentType
2. Create a manual invocie on a patron account
3. Go to pay it, 'Payment type:' is marked as required.
4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute.
5. You are able to make the payment without a payment type.
6. Apply patch and restart_all
7. Try 4-5 again. This time you should get a 500 error and the payment should not go through.
8. Try a paymnet again this time manipulate the DOM and change the value of 'CASH' to something else like 'SOMETHINGELSE'.
9. Try to submit the payment and again you will get a 500 error. The payment should not go through.
10. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful.
11. Make sure tests will pass

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 676d263687ad666184fce6d505af6d9672412732)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33176: Enforce RequirePaymentType with API
Lucas Gass [Thu, 13 Apr 2023 17:52:58 +0000 (17:52 +0000)]
Bug 33176: Enforce RequirePaymentType with API

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit df4285adb2f6669ad62b0e3b1eddb04f44761d16)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33176: Handle RequirePaymentType
Lucas Gass [Thu, 13 Apr 2023 17:28:24 +0000 (17:28 +0000)]
Bug 33176: Handle RequirePaymentType

Test plan:

1. Turn on RequirePaymentType
2. Create a manual invocie on a patron account
3. Go to pay it, 'Payment type:' is marked as required.
4. In the inscept the select input ( #payment_type ) with your browser's dev tools. Removed the required attribute.
5. You are able to make the payment without a payment type.
6. Apply patch and restart_all
7. Try 4-5 again. This time you should get a 500 error and the payment should not go through.
8. Turn RequirePaymentType off. Try a payment with a payment type, you shoud be successful.
9. Make sure tests will pass:

prove -v t/db_dependent/Koha/Account.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b15a15df9e2f579f984c804bdea4d2951ec75891)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoUpdate .mailmap
Tomas Cohen Arazi [Mon, 12 Jun 2023 14:05:19 +0000 (11:05 -0300)]
Update .mailmap

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cd5212ac2fef6fd0b9a435ebe9258ca1b13de014)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33806: Retain specified date when confirming item parts at checkin
Nick Clemens [Tue, 23 May 2023 12:54:34 +0000 (12:54 +0000)]
Bug 33806: Retain specified date when confirming item parts at checkin

This patch simply adds hidden inputs to the item parts confirm form
to ensure specified checkin date is retained

To test:
 1 - Find or add an item with subfield 3 - materials specified
 2 - Enable system preference CircConfirmItemParts
 3 - Go to Circulation->Checkin
 4 - Click the settings button in the input box and enter a checkin date and select the remeber check box
 5 - Check in some items, confirm date retained
 6 - Checkin the item with the materials specified
 7 - Confirm checkin
 8 - Note that checkin date is cleared
 9 - Apply patch
10 - Repeat 3-7
11 - Confirm date is retained

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9bca328d91acc6b010a44afea4403dd4d595cb98)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 30002: (QA follow-up) Add .perltidyrc to Makefile.PL mapping
Tomas Cohen Arazi [Fri, 9 Jun 2023 18:42:23 +0000 (15:42 -0300)]
Bug 30002: (QA follow-up) Add .perltidyrc to Makefile.PL mapping

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8040370e78c83b1a581cd10d61842b637fd8c279)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 30649: (follow-up) Improve database update
Martin Renvoize [Wed, 7 Jun 2023 11:42:01 +0000 (12:42 +0100)]
Bug 30649: (follow-up) Improve database update

This patch implements the proposed switch to use the standard DB handle
and only require Koha::Encryption if necessary.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f8d2291f2efc6e3f66b24b5152b6be6cd7ad50f9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33967: Add unit test to ensure SetEnv doesn't compromise $env
David Cook [Fri, 9 Jun 2023 06:46:43 +0000 (06:46 +0000)]
Bug 33967: Add unit test to ensure SetEnv doesn't compromise $env

This patch includes a unit test which checks the memory address
of the $env hashref in middlewares before and after
Koha::Middleware::Env is applied.

It succeeds when the same $env is maintained before and after
this middleware. It fails if the $env has been overwritten with
a new hashref (as evidenced by the new memory address for the
hash).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c7142fe940e7eed25afc814bb8afb017e5f90ea)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33967: Fix SetEnv middleware to preserve $env integrity
David Cook [Fri, 9 Jun 2023 03:59:28 +0000 (03:59 +0000)]
Bug 33967: Fix SetEnv middleware to preserve $env integrity

This patch fixes the Koha::Middleware::SetEnv, so that it
preserves the referential integrity of the $env hash
reference as it passes through the pre-process and post-process
stages of middleware wrapped around the core Koha Plack application.

Test plan:
0a. Apply the patch
0b. vi /etc/koha/sites/kohadev/koha-conf.xml
0c. Uncomment "koha_trusted_proxies"
0d. Add "172.0.0.0/8" to the end of the "koha_trusted_proxies"
0e. koha-plack --restart kohadev
1. vi /etc/apache2/sites-enabled/kohadev.conf
2. Add the following to the OPAC virtualhost:
SetEnv OVERRIDE_SYSPREF_LibraryName "The Best, Truly the Best, Koha Library"
RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName The Best\, Truly the Best\, Koha Library"
RequestHeader add X-Forwarded-For "192.168.100.100"
3. service apache2 restart
4. tail -f /var/log/koha/kohadev/plack.log
5. Go to http://localhost:8080/
6. Note that the plack.log lists 192.168.100.100 as the client IP address
7. Note that the title of the OPAC webpage is
"The Best, Truly the Best, Koha Library Library catalog"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 42823da209bbef2148eb4245c1bdfe215bf899ee)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33855: Clean up forms and page sections on 'manage MARC imports' page
Owen Leonard [Tue, 30 May 2023 13:02:51 +0000 (13:02 +0000)]
Bug 33855: Clean up forms and page sections on 'manage MARC imports' page

This patch makes minor changes to the structure of the "Manage MARC
imports" page so that sections are more clearly delineated and forms
have the correct structure.

The patch also shortens the new framework field labels and adds hints
for clarification.

To test, apply the patch and go to Cataloging -> Stage MARC records for
import.

- Import a batch of MARC records.
- Go to Cataloging -> Manage staged records.
- View the batch you just imported.
- You should see three sections:
  - A list of information about the batch
  - Options for changing the matching rules
  - Options for setting frameworks during import.
- Test that the form for applying different matching rules still works
  correctly.
  - Import a batch of records which contains matches (by, for example,
    exporting MARC records from Koha and then reimporting the same
    batch)
  - On the manage page for that batch try changing the matching rule
    applied, switching between "Do not look for matching records" and a
    matching rule which will catch the duplicate records.
- Test that your records are imported correctly according to the
  framework settings you select, both for new records and for replaced
  records.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33798: Improve consistency of the vendor display view
Jonathan Druart [Thu, 1 Jun 2023 07:08:08 +0000 (09:08 +0200)]
Bug 33798: Improve consistency of the vendor display view

It was not consistent: indentation, bold, etc.

This patch is suggesting a new style using .page-section and .rows

Is it what we want?

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4bd6abf9a2aa3a239ec3c8658e26d61ea198e84c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33798: Add colons after the labels on the edit form
Jonathan Druart [Thu, 1 Jun 2023 06:52:55 +0000 (08:52 +0200)]
Bug 33798: Add colons after the labels on the edit form

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5be54fc9e6dafea5110fa2fe286ac23e24dd9eb5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33957: Add normalized_oclc and only fetch when needed
Nick Clemens [Thu, 8 Jun 2023 11:15:27 +0000 (11:15 +0000)]
Bug 33957: Add normalized_oclc and only fetch when needed

opac-user.tt wants to normalized_oclc number if using syndetics or B&T images

We don't need to fetch it if not, but we need to pass it if so

To test:
1 - Switch all Syndetics prefs to 'Show' or 'Use' except
    SyndeticsClientCode = just enter 'test'
2 - Checkout some items to a patron, ensure the records have:
    - ISBN
    - UPC
    - OCLC number
3 - View opac-user.pl (sign in to opac as the user)
4 - View the network console tab (may need to reload)
5 - Note requests like:
    https://secure.syndetics.com/index.aspx?isbn=1780335792/MC.GIF&client=test&type=xw10&upc=&oclc=
6 - Note that oclc parameter is not filled for record with an oclc number
7 - Apply patch
8 - Reload
9 - Confirm the link now has oclc as expected
10 - Disable syndetics, enable google books or another source
11 - Confirm images display as expected

JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a59f757fd715600c21c9e7ceca87d1a24d5d694f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33901: (bug 30718 follow-up) Predition pattern - don't set end date to today
Jonathan Druart [Wed, 7 Jun 2023 09:49:41 +0000 (11:49 +0200)]
Bug 33901: (bug 30718 follow-up) Predition pattern - don't set end date to today

If the end date is not set we should not set it to today.
On bug 30718 the following change was wrong:
-$enddate = eval { output_pref( { str => $enddate, dateonly => 1, dateformat => 'iso' } ); };
+$enddate = dt_from_string($enddate)->ymd;

output_pref returns undef if str is empty
After the change we returned today's date.

Test plan:
1. Go to Serials > Manage numbering patterns
2. Click Edit next to one of the existing patterns (e.g. Number)
3. Enter information in the Test prediction pattern section
   -  Frequency: choose one (e.g. 1/month)
   -  First issue publication date: enter a date (e.g. 2023-06-01)
   -  Subscription length: issues + enter a number of issues (e.g. 12)
   -  Locale: leave empty
   -  Begins with: enter a number in the X column, e.g. 42
4. Click Test pattern
=> Without this patch only one issue is shown, no matter how many you enter in Subscription length
=> With this patch applied the end date is not set to today and the
prediction pattern list is correct

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c9a2cf948dc12d7f9ad6c7334232c2165857c4e1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33852: Add one more test
Jonathan Druart [Thu, 8 Jun 2023 12:32:53 +0000 (14:32 +0200)]
Bug 33852: Add one more test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 144efca99d09834839f89a88a6caeb928c32e2d4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33852: Make jobs.t test the only_current parameter
Tomas Cohen Arazi [Mon, 29 May 2023 13:30:06 +0000 (10:30 -0300)]
Bug 33852: Make jobs.t test the only_current parameter

This trivial patch adds a test to the only_current parameter.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/jobs.t
=> SUCCESS: New tests added, and pass
3. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 76983f5275edc9df8f41c4c62f20827c822cc344)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33937: Remove incorrect export in C4::Members
Jonathan Druart [Wed, 7 Jun 2023 10:14:53 +0000 (12:14 +0200)]
Bug 33937: Remove incorrect export in C4::Members

Bug 17600 re-add those exports, but the module does no longer have the
subroutines. We should remove these export.

Test plan:
git grep is your friend

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e7116af43822477961080218b5b7990793e9c76a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33880: Remove Version param from GB::Barcode->new
Jake Deery [Fri, 2 Jun 2023 13:13:47 +0000 (13:13 +0000)]
Bug 33880: Remove Version param from GB::Barcode->new

Looking at the code here
     if (Koha/Auth/TwoFactorAuth.pmoSelf->{Version}){        #--- auto version select
        for(->{Version}=1; ->{Version} <= 40; ++->{Version}) {
            last if ({->{Ecc}}->[->{Version}]
                        >=  + ->[->{Version}]);
        }
   }

in https://metacpan.org/release/KWITKNR/GD-Barcode-1.15/source/Barcode/QRcode.pm#L349

It appears the version parameter is not required, and will default to whatever version has the necessary bits for the input words given

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 20d22366813ddbd2c68fc72b609cee88e74e3872)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33899: Add the 23.11 release team
Martin Renvoize [Mon, 5 Jun 2023 14:53:12 +0000 (15:53 +0100)]
Bug 33899: Add the 23.11 release team

This patch updates the teams.yaml to include the voted in 23.11 release
team and also updates the release date of 22.11 to match the actual
release.

Test plan
1/ Check against https://wiki.koha-community.org/wiki/Release_Teams

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e70ef6b16b8f4292b47ae6c17c17d224799b21f8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 27424: (QA follow-up) Make db update idempotent
Kyle M Hall [Thu, 8 Jun 2023 13:45:18 +0000 (09:45 -0400)]
Bug 27424: (QA follow-up) Make db update idempotent

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f9002b96cd9e052a9332107cf05c43dadff8af78)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33951: (QA follow-up) Import GetNormalizedOCLCNumber
Nick Clemens [Thu, 8 Jun 2023 11:03:45 +0000 (11:03 +0000)]
Bug 33951: (QA follow-up) Import GetNormalizedOCLCNumber

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b10b8405774eea1113df2863d2d1b113b622da48)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33951: Set normalized_oclc in opac/opac-readingrecord.pl
Jonathan Druart [Thu, 8 Jun 2023 09:51:17 +0000 (11:51 +0200)]
Bug 33951: Set normalized_oclc in opac/opac-readingrecord.pl

normalized_oclc is used in the template to build the link to syndetics,
but it's not passed from the controller. Is this patch correct? Is
syndetics broken on this page? Should we remove it or keep it?
Is oclc parameter in the URL unecessary and should be removed?

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8e93668796fd579e4dcbbbdf01b316ed044bd5bc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32341: (follow-up) Making the label not showed twice when the tables are in respo...
Hammat Wele [Thu, 27 Apr 2023 21:52:52 +0000 (21:52 +0000)]
Bug 32341: (follow-up) Making the label not showed twice when the tables are in responsive mode

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b608c05fd47e018e0c7085fe7f3d6a4b0023b755)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32341: (follow-up) Add responsivity to Curbside pickups table and changing button...
Hammat Wele [Thu, 16 Feb 2023 18:06:56 +0000 (18:06 +0000)]
Bug 32341: (follow-up) Add responsivity to Curbside pickups table and changing button style for finestables

To activate Curbside pickups
    1- Enable the CurbsidePickup system preference
        1.1 Go to Administration > Global system preferences
        1.2 Search for CurbsidePickup
        1.3 Change the value for 'Enable'
        1.4 Click on 'Save all circulation preferences'
    2- Configure time slots for at least one library
        2.1 Go to Administration > Curbside pickup
        2.2 Fill out the form for Centerville (or another library)
            Enable: Check
            Pickup interval: 10 (or other)
            Maximum boss per interval: 3 (or other)
            Patron-scheduled pickup: Check
            Enable for waiting holds only: DO NOT check
        2.3 Add a time slot
            In 'New slot', enter
                Monday
                From: 10:00
                To: 12:00
            Click on 'Add'
    3- Make an appointment from the OPAC
        3.1 Go to OPAC
        3.2 Open mobile mode
        3.3 Connect with a user
        3.4 Click on 'Curbside pickups'
        3.5 Choose the library in 'Pick a library'
        3.6 Choose a date in 'Pickup date'
        3.7 Choose a time range in 'Select a time'
        3.8 Click on 'Schedule pickup'
            => Notice The table is not responsive
    4- Apply the patch
    5- Execute 'yarn build --view opac'
    6- Clean your cache or open your navigator on private mode (to load updated css files)
    7- Perform step 3.1, 3.2, 3.3, 3.4,
    8- click on 'Your pickups'
     => Confirm that the CurbsidePickup table are now displayed correctly and is now responsive.
    9- Click on 'Charges'
     => Confirm that the Charges table are now displayed correctly and is now responsive.

I correct a little bug. The "suspend_hold" button did not work anymore. This change resets it to it's original state.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 16008c24c5ec0838eb61b5e19603104b2071c004)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32341: (follow-up) Making the remains OPAC tables responsive
Hammat Wele [Mon, 6 Feb 2023 18:06:26 +0000 (18:06 +0000)]
Bug 32341: (follow-up) Making the remains OPAC tables responsive

Apply the patch and check for the responsivity of the following tables
1- Go to the OPAC
2- Open mobile mode
3- The following tables are not responsive
- Summary - Clubs
- Summary - Recalls
- Summary - Article requests
- Charges - (relative's)
- Search history - Authority
- Checkout history - All
- Checkout history - Checkouts
- Checkout history - On-site
- Recalls history
- Messaging
- Subscription (serial)
- Course reserves - Courses
- Course reserves - Reserves
- Authority search results
4- Apply the patch
5- Execute 'yarn build --view opac'
6- Clean your cache or open your navigator on private mode (to load updated css files)
7- Perform previous step (1-3)
8- Confirm that the tables are now displayed correctly and is now responsive.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6caeb1f6274ead6509b27edcdc701d1c6d1d3c9e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32341: (follow-up) Alternate button style
Owen Leonard [Mon, 9 Jan 2023 18:53:27 +0000 (18:53 +0000)]
Bug 32341: (follow-up) Alternate button style

This patch applies a different button style and does a couple of clean
up tasks: Removing the redundant sorting-related CSS and moving the
responsive button CSS to _common.scss where other DataTable-related
styles are found.

I think this different button style is more consistent with the OPAC's
design. It also eliminates untranslatable strings from the CSS.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9f277e625ee928246531189afcc511df64a703d2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32341: (Fix) Changing the placement of the button
Hammat Wele [Thu, 22 Dec 2022 21:54:37 +0000 (21:54 +0000)]
Bug 32341: (Fix) Changing the placement of the button

This attachment correct the placement of the responsive button. It is now in its own column at the last column and the '+' and '-' are remplaced by 'Expand' and 'Unexpand' to make it more clear.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 68c3ad5fac8241956ef46475a44db2a19759f620)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32341: Some OPAC tables are not displayed well in mobile mode
Hammat Wele [Mon, 12 Dec 2022 22:58:28 +0000 (22:58 +0000)]
Bug 32341: Some OPAC tables are not displayed well in mobile mode

Some OPAC tables are not displayed well in mobile mode, it is absolutely necessary to scroll to the right to read the content properly

This patch fix this problem by making the tables responsive

To test:
      1- Go to the OPAC
      2- Open mobile mode
      3- Go to a bibliographic record detail page in the OPAC (opac-detail.pl?biblionumber=X)
      4- Check the Holdings table
            --> the information is not presented in a table as it is when viewing on a laptop or PC browser screen.
            --> we see very narrow columns
            --> unreadable text
      5- Go to to the page 'Summary' (opac-user.pl)
      6- Check the 'Checked out' table
            --> the information is not presented in a table as it is when viewing on a laptop or PC browser screen.
            --> The columns are overflowing to the right
      7- Check the 'Overdue' table
            --> the information is not presented in a table as it is when viewing on a laptop or PC browser screen.
            --> The columns are overflowing to the right
      8- Go to the page 'Charges' (opac-account.pl)
      9- Click on 'Show all transactions'
            --> the information is not presented in a table as it is when viewing on a laptop or PC browser screen.
            --> The columns are overflowing to the right
      10- Go to the page 'Search history' (opac-search-history.pl)
            --> the information is not presented in a table as it is when viewing on a laptop or PC browser screen.
            --> The columns are overflowing to the right
      11- Apply the patch
      12- Execute 'yarn build --view opac'
      13- Clean your cache or open your navigator on private mode (to load updated css files)
      14- Perform previous step (1-10)
      15- Confirm that the tables are now displayed correctly and is now responsive.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb2e0c2efd52f7553cd0035e79c74e6f15a7a21d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 30002: Adjust perltidy
Jonathan Druart [Tue, 2 May 2023 12:37:01 +0000 (14:37 +0200)]
Bug 30002: Adjust perltidy

Remove the following 3 options that are not available in perltidy
v20190601 that is the version shipped with bullseye
--add-terminal-newline
--valign-exclusion-list
--extended-continuation-indentation

Extend max line length
--maximum-line-length=120

Prevent perltidy to format lists (see bug 30002 comment 10)
--break-at-old-comma-breakpoints

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d46a959a696eb88bc99279ee38838d4bf6291b47)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 30002: Remove unused xt/perltidyrc
Julian Maurice [Fri, 31 Mar 2023 10:26:20 +0000 (12:26 +0200)]
Bug 30002: Remove unused xt/perltidyrc

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aae185cf5d533761b7aa7f280dacdd186d261691)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 30002: Add .perltidyrc
Julian Maurice [Fri, 31 Mar 2023 10:25:24 +0000 (12:25 +0200)]
Bug 30002: Add .perltidyrc

The options set in this file try to match the current code style without
deviating too much from perltidy's defaults.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dfe6767f60c5231fe244d66b067265631ed5a384)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33950: Don't get marcxml if not necessary - opac-readingrecord.pl
Jonathan Druart [Thu, 8 Jun 2023 08:14:33 +0000 (10:14 +0200)]
Bug 33950: Don't get marcxml if not necessary - opac-readingrecord.pl

We are retrieving normalized_upc from the MARC XML in the controller (opac-readingrec.pl)
for all issues to display, but this is only used if BakerTaylor or Syndetics are enabled.

Test plan:
Have some checkouts and confirm that the checkout history is displayed
the same before and after this patch.
You should also test BakerTaylor or Syndetics and see if they are
working correctly, but I have no idea how to test them!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c4e016f4dfdcce272524dfff5abffe01a276d25e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33900: Fix handling of due_digest
Pedro Amorim [Mon, 5 Jun 2023 15:38:58 +0000 (15:38 +0000)]
Bug 33900: Fix handling of due_digest

Test plan, on k-t-d
1) Go to 'my account'
2) On 'Patron messaging preferences', click 'Edit'
3) On the 'Item due' row, check the 'Email' and 'Digests only' checkboxes and save
4) On the top search bar, press 'Check out' and enter '42' (koha user cardnumber)
5) On the checkout input bar, enter a barcode e.g. 39999000001372 and press checkout
6) Run the following query to force the due_date to be equal to 'todays' date:
NOTE: change the YYYY-MM-DD below to whatever day it is you're running this test plan

UPDATE issues SET date_due = '2023-06-05 23:59:00' where issue_id = 1;

7) Run the cronjob:
./koha/misc/cronjobs/advance_notices.pl -c --digest-per-branch

8) Notice it hangs, it's stuck on an infinite loop on the 2nd while cycle after if ()
9) Cancel the cronjob script, apply patch
10) Run the cronjob script again (step 7), notice it finishes
11) Access patron's notices:
/cgi-bin/koha/members/notices.pl?borrowernumber=51

Check that the 'Item due reminder' notice is there.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fac7bb247a5a8430152f97727f2cbdd8b4b54e19)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33941: Fix wrong URL name in EBSCOPackagesList
Matt Blenkinsop [Wed, 7 Jun 2023 16:07:02 +0000 (16:07 +0000)]
Bug 33941: Fix wrong URL name in EBSCOPackagesList

This patch fixes a URL pointing to the wrong route which stops filtering from working in the table.

Note: To test you will need some EBSCO credentials

Test plan:
1) In ERM, go to EBSCO > Packages and search for a package
2) It should fail with a warning in the console saying that a required param "package_id" is missing
3) Apply patch
4) Repeat step 1
5) It should now successfully fetch packages

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ab5dc834009b846e3850ca8eb34c3fdb43f855a1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32894: (QA follow-up) Fix tests
Nick Clemens [Tue, 9 May 2023 11:49:48 +0000 (11:49 +0000)]
Bug 32894: (QA follow-up) Fix tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4d613494abef955c41479b2e0269481e73b99176)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32894: Make ->sharee looks like others
Jonathan Druart [Tue, 9 May 2023 09:02:30 +0000 (11:02 +0200)]
Bug 32894: Make ->sharee looks like others

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e84ef47018e5682764b64073c43b6f95f37c5b31)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32894: (follow-up) Koha::Item->last_returned_by
Jonathan Druart [Tue, 9 May 2023 09:00:48 +0000 (11:00 +0200)]
Bug 32894: (follow-up) Koha::Item->last_returned_by

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9ad94cf3e06836da81cfef272f65ae9d9fe9cf3e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32894: (QA follow-up) Fix typo
Martin Renvoize [Fri, 21 Apr 2023 10:24:04 +0000 (11:24 +0100)]
Bug 32894: (QA follow-up) Fix typo

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 70d7bb57d88a8ed6d26d85eacdea8c0cd6550ad7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32894: Remove incorrect caching from bundle_items
Martin Renvoize [Fri, 21 Apr 2023 10:18:35 +0000 (11:18 +0100)]
Bug 32894: Remove incorrect caching from bundle_items

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8e2d841a2950f3cd6008f296e67c362ebfe4b954)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32894: Fix test
Jonathan Druart [Tue, 28 Feb 2023 16:14:52 +0000 (17:14 +0100)]
Bug 32894: Fix test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 45d882de53058ebf49f9683e53bdc3751cd22e99)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32894: Koha::Biblio->biblioitem
Jonathan Druart [Tue, 28 Feb 2023 15:40:00 +0000 (16:40 +0100)]
Bug 32894: Koha::Biblio->biblioitem

Can we do better here?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 994132a60a2e4a12eb88cc8b9d1a89f28450a7bf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32894: Koha::Item->last_returned_by
Jonathan Druart [Tue, 28 Feb 2023 15:13:56 +0000 (16:13 +0100)]
Bug 32894: Koha::Item->last_returned_by

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3545292513453b2383c406e96c3d51a3a2f5e6c5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32894: Remove wrong caching from Koha:: methods - simple
Jonathan Druart [Tue, 28 Feb 2023 15:11:38 +0000 (16:11 +0100)]
Bug 32894: Remove wrong caching from Koha:: methods - simple

In some of our Koha:: objects we have methods that cache their result and return it in subsequent calls. However there is no invalidation of the cache if the object is modified.

For instance, in Koha/ArticleRequest.pm

sub biblio {
    my ($self) = @_;

    $self->{_biblio} ||= Koha::Biblios->find( $self->biblionumber() );

    return $self->{_biblio};
}

This pattern exists in several places.

It can lead to confusion and incorrect results, such as:

use Koha::ArticleRequests;
my $ar = Koha::ArticleRequest->new({
    borrowernumber => 42,
    biblionumber => 42,
})->store;
say $ar->biblio->biblionumber;               # Display 42, correct
$ar->set({ biblionumber => 24 })->store;
say $ar->biblio->biblionumber;               # Display 42, wrong
$ar->discard_changes;
say $ar->biblio->biblionumber;               # Display 42, wrong
$ar->delete;

We should remove those caching and rely on DBIC/DBMS caching mechanism instead.

This patch is adjusting the trivial occurrences

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 68216c541bfd9b5baf5e3fe97c0a99d193dfccce)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33493: (QA follow-up) Only bless the first transfer
Marcel de Rooy [Fri, 2 Jun 2023 09:10:01 +0000 (09:10 +0000)]
Bug 33493: (QA follow-up) Only bless the first transfer

No need to do a walk through on all the results.
Correcting two test descriptions on the way.

Test plan:
Run t/db_dependent/Koha/Item.t
Run t/db_dependent/Koha/Items.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7095ef2fa757cca641cd4236878cdec3bbaa8479)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33493: (follow-up) Rename relationship and add test
Nick Clemens [Wed, 31 May 2023 12:02:41 +0000 (12:02 +0000)]
Bug 33493: (follow-up) Rename relationship and add test

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 110d74f572748958720ee690ea68d666a7a0b477)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33493: Add a filter relationship for branchtransfers
Nick Clemens [Fri, 10 Mar 2023 16:14:50 +0000 (16:14 +0000)]
Bug 33493: Add a filter relationship for branchtransfers

Prefetching is useful, but we don't want to fetch all the inactive
transfers for an item. This patch adds a filtered relationship and
updates get_transfer(s) to use this

To test:
prove -v t/db_dependent/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6c2e092d5b120d251e161ab914ce342fddd35a5a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
16 months agoUpdate release notes for 23.05.01 release v23.05.01
Fridolin Somers [Wed, 28 Jun 2023 13:25:20 +0000 (15:25 +0200)]
Update release notes for 23.05.01 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
16 months agoIncrement version for 23.05.01 release
Fridolin Somers [Mon, 26 Jun 2023 13:33:33 +0000 (15:33 +0200)]
Increment version for 23.05.01 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
16 months agoTranslation updates for Koha 23.05.01
Koha translators [Mon, 26 Jun 2023 13:10:45 +0000 (10:10 -0300)]
Translation updates for Koha 23.05.01

16 months agoBug 33904: Fix 2FA registration when library name has non-latin characters
Jonathan Druart [Tue, 6 Jun 2023 08:42:20 +0000 (10:42 +0200)]
Bug 33904: Fix 2FA registration when library name has non-latin characters

If the library name contains non-latin characters, the 2FA registration
process will fail with a JS alert coming from a 500 server-side.

The problem is that Auth::GoogleAuth is expecting an already UTF8 encoded string.
We should set the encoding correctly to make Auth::GoogleAuth deal with
the URL escaping internally correctly, then decode on our own (in the
REST API controller)

Test plan:
* Modify your logged in library name and add some non-latin characters
(eg. "my ❤ library")
* Turn on TwoFactorAuthentication
* Go to your account > More > Manage 2FA
* Click the enable button
=> Notice that you see the QR code and that both "issuer" and "key id"
entries display the library name correctly.
* Test the whole 2FA process, confirm that the library name is correctly
displayed on the app you are using.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit deeb5ebdbd59956f5f6cf1bfa989ef41c9af9720)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
16 months agoBug 33904: Add tests
Jonathan Druart [Tue, 6 Jun 2023 08:40:03 +0000 (10:40 +0200)]
Bug 33904: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dfed7f235d2e079743a74bb2791db2d4ebd63b1d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
16 months agoBug 34028: Fix manual entry for two factor authentication
David Cook [Fri, 16 Jun 2023 06:04:37 +0000 (06:04 +0000)]
Bug 34028: Fix manual entry for two factor authentication

This patch changes the "Account" and "Key" display so that
you can manually enter two factor authentication details into
an authenticator app.

The details are the same as those provided by scanning the QR code.

Test plan:
0. Apply patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=TwoFactorAuthentication
2. Change setting to "Enable"
3. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
4. Click "More" on record toolbar and choose "Manage two-factor authentication"
5. Click "Enable two-factor authentication"
6. Scan the QR code into an authenticator app and note it creates an entry called
"Centerville: Centerville_koha"
7. Manually enter an entry into an authenticator app (like Google Authenticator)
7a. Add the "Account" as shown on the Koha screen
7b. Add the "Key" as shown on the Koha screen
8. Note that the entries added by QR code and manual entry have the same
label and both were accepted by the authenticator app

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7c05333914e3f54d66b9de6dde82b614ea83569a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
16 months agoBug 34093: Fix paths to jQuery for OAI XSLT
Nick Clemens [Thu, 22 Jun 2023 11:02:31 +0000 (11:02 +0000)]
Bug 34093: Fix paths to jQuery for OAI XSLT

To test:
1 - Enable OAI-PMH system preference
2 - Browse to:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml
3 - Click 'Metadata' button for a record
4 - Nothign happens
5 - Check the console:
    Loading failed for the <script> with source “http://localhost:8080/opac-tmpl/bootstrap/lib/jquery/jquery-migrate-3.3.2.min.js”.
    Loading failed for the <script> with source “http://localhost:8080/opac-tmpl/bootstrap/lib/jquery/jquery-3.6.0.min.js”.
    Loading failed for the <script> with source “http://localhost:8080/opac-tmpl/bootstrap/lib/bootstrap/js/bootstrap.bundle.min.js”.
6 - Apply patch
7 - Reload
8 - Console errors are gone
9 - Clicking 'Metadata' expands the record content

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bb8db3c7f6f14cb04312c49bd9b8b7ca6b74425c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
16 months agoBug 34022: Adjust items data structure
Tomas Cohen Arazi [Thu, 22 Jun 2023 19:06:11 +0000 (16:06 -0300)]
Bug 34022: Adjust items data structure

When creating items at receiving, the generated data structure didn't
match what the code expected, so this patch adapts the code to match the
new data structure introduced by bug 8179.

Once I fixed that, I noticed that the $.ajax request payload, when it
contains an array parameter, it renames it like `param[]`. So the
finishreceive.pl controller is adjusted to this behaviour for the 'on
receiving' use case.

To test:
1. Apply this patch
2. Create a basket with 'create items on receive'
3. Create an order line
4. Close basket
5. Receive shipment
6. Enter invoice number
7. Click on Receive link in the table
8. Fill out item form, make sure all mandatory fields are set
9. Save
10. Verify that the order line is marked as 'received'
11. Verify that there item is created on the record
=> SUCCESS: Works as expected
12. Sign off :-D

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a40c512bf083a1bb48daeecd2f407b4f5586d819)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
16 months agoBug 33888: (bug 22375 follow-up) Add missing USE KohaDates
Jonathan Druart [Wed, 7 Jun 2023 08:33:40 +0000 (10:33 +0200)]
Bug 33888: (bug 22375 follow-up) Add missing USE KohaDates

Bug 22375 added use of KohaDates without the USE statement.

Test plan:
Make sure you have overdues and go to circ/branchoverdues.pl
Without this patch you get a 500
  Template process failed: undef error - : filter not found at /kohadevbox/koha/C4/Templates.pm line 127
With this patch applied you can see the overdue list

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7eafb103b584dcc41b863c3920ee8ab4e94b2c06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
16 months agoBug 33885: Prevent JS crash if creator does no longer exist
Jonathan Druart [Wed, 7 Jun 2023 09:07:36 +0000 (11:07 +0200)]
Bug 33885: Prevent JS crash if creator does no longer exist

JS error in the console was
  Uncaught TypeError: row.creator is null

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 30d2ffd2953434eec112a403a0297e285fa4a76d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
16 months agoBug 33885: Make Koha::Acq::Order->creator return undef if no creator
Jonathan Druart [Wed, 7 Jun 2023 09:05:18 +0000 (11:05 +0200)]
Bug 33885: Make Koha::Acq::Order->creator return undef if no creator

If the account of the creator of an order has been deleted we should
return undef here, instead of crashing with
GET /api/v1/acquisitions/orders: unhandled exception (Mojo::Exception)<<DBIC result _type  isn't of the _type Borrower at /kohadevbox/koha/Koha/Objects.pm line 445.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c3a35418ea3defb50debbab4fd334bee4eb5229)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>