Commit graph

49480 commits

Author SHA1 Message Date
91211854c8 Bug 33817: (QA follow-up) Fix tidyness
This patch fixes some reported tidyness issues with the patches.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 927c5a8913)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6c381c20e2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 15:20:53 +00:00
4a8f592802 Bug 33817: (follow-up) Fix spec and messages
This patch should resolve the issues highlighted at signoff time by
Victor.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 34b704fb0b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ba57a9aa58)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 15:20:52 +00:00
9e71c42a1e Bug 33817: Enforce server-side
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 384de4a74a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e4ef4c5e3d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 15:20:52 +00:00
7db53f2275 Bug 33817: Prevent item bundle that is checked out to be modified
While an item bundle is checked out, we don't want any items to be
added or removed from the bundle.

To test:
* Create a record with LDR Pos. 7 = c
* Add an item for your bundle
* Add one or more existing items from other records to the bundle
* Check out the bundle item
* Verify it appears correctly on the patron account
* Verify you can still add/remove items from the bundle
* Apply patch set
* Verify that the add/remove links are now disabled (greyed out)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8cb2dd4e30)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a29fec1b4e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 15:20:51 +00:00
Phil Ringnalda
9fef2b809d Bug 34097: Prevent clicking ellipsis for dateaccessioned plugin from scrolling up
Test plan:
1. Find a record with several items (in ktd "MacLaren's Gaelic
   self-taught" will do nicely
2. Click the Edit button next to one of the items
3. Click the "..." to the right of "d - Date acquired" and verify that the
   page doesn't scroll up to the top, and that the current date is
   inserted in the field
4. Click the "..." to the right of "w - Price effective from" and verify
   that the page doesn't scroll up and the current date is inserted

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 3824547e5c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2d24f269f5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:47:45 +00:00
1e621efd8c Bug 33808: Add aria-labels in reports-toolbar.inc
This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8fac9067b2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit eba9d13660)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:47:15 +00:00
9482ae3655 Bug 33808: Add aria-labels in basket.tt
This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0813a3b3d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 12ee1fde0d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:47:15 +00:00
8d10483ea2 Bug 33808: Add aria-labels in opac-basket.tt
This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aa0f113f97)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b1ddaa0b15)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:47:14 +00:00
58b145b472 Bug 33808: Add aria-labels in opac-shelves.tt
This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 429f0d6dce)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c7ab9be9b0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:47:14 +00:00
d06fb74525 Bug 33974: (follow-up) Adapt the orders endpoint
In order to reduce the technical debt carried on the orders controller,
and to highlight the decisions made on the prior patch, I adapted the
list() orders controller using the new tools in town.

The result is this endpoint can now embed bibio, without needing to have
a custom piece of code.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/*.t
=> SUCCESS: Tests pass :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c07e43cf2a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 944c693925)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:45:00 +00:00
7b1a93295e Bug 33974: (follow-up) _order_by is not always an arrayref
The loop through the `_order_by` query parameter occurences introduced
by this patchset was naive regarding the possible scenarios.

When there's only one parameter passed, it shouldn't be expecting an
arrayref, but a scalar. This patch deals with that in the simplest way.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests are failing
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d90d264253)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a16356ae28)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:44:59 +00:00
e7211b502f Bug 33974: (follow-up) biblionumber column needs special handling
This patch makes a particular use case be handled correctly: i.e. no
context is passed (e.g. 'biblio' explicitly) and the query is done
against the `biblio_id` attribute. This results in the following DBIC
error:

[ERROR] GET /api/v1/biblios: unhandled exception (DBIx::Class::Exception)<<DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'biblionumber' in where clause is ambiguous at /kohadevbox/koha/Koha/Objects.pm line 394>>

With this patch, this is no longuer the case :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ba80c71e63)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 35d1f81277)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:44:58 +00:00
78033d20e2 Bug 33974: (QA follow-up) Remove superflous import
We don't actually need the Clone import.. it's not used in Biblios.pmt

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c7be846243)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b94aa599dd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:44:58 +00:00
83a1fbac24 Bug 33974: Make biblioitem columns searchable in a generic way
This patch makes biblioitem attributes be searchable on the biblios
endpoint. It does so by using the new method in Koha::Biblios, and by
adjusting objects.search(_rs) to accept a $query_fixer arrayref of
functions to be applied to each query or order_by parameters.

The result is cleaner code to write, but complex internals.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass! Searching for biblioitem attributes works on the
API!
3. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 353f328ad3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 21ebede0de)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:44:57 +00:00
bb9139ee0d Bug 33974: Add Koha::Biblios->api_query_fixer
This patch adds the `api_query_fixer` method to the class, and adds
tests to validate its behavior.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Biblios.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 60e8998e91)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 949ba13a6e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:44:57 +00:00
f906e1bb65 Bug 33573: Add public endpoint for cancelling holds
This patch introduces a public endpoint for cancelling holds.
Cancellation requests are generated when the hold is waiting and
configuration allows requesting cancellation, as the OPAC does right
now.

Tests cover all the use cases.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/patrons_holds.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 252753f84f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ef5422bbca)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:44:56 +00:00
d84e74c5a4 Bug 33573: Unit tests
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24d753cda1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f430c075c1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:44:55 +00:00
Katrin Fischer
ac5d866402 Bug 33946: (QA follow-up) Add spans and classes for styling and translatability
Adds back the spans around No title and more spans for
'No bibliographic record' with individual classes for each
to allow for styling later.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f91cc77a68)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7eabb2350b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:22 +00:00
bba812c6b9 Bug 33946: Resync opac/intranet includes
This patch resyncs the whitespace chomping in the opac include to match
that in the intranet include so aid in diffing between the two.

No changes should be visible in the UI but there may be cleaner markup
as a result.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 04814be829)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 36847ff51d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:21 +00:00
c0b92a6a30 Bug 33946: Do not display link to non-existing bibliographic record
If you use biblio-title.inc on a biblio that does not longer exist, "No title" is shown with a link to catalogue/detail?.pl?biblionumber=

We should at least remove the link.

We could even do better and display "No bibliographic record" if the biblio does not longer exist.

Test plan:
Edit mainpage.pl, add
$template->param( your_bib => Koha::Biblios->find(42) );
Edit intranet-main.tt, add
[% INCLUDE 'biblio-title.inc' biblio=your_bib link = 1 %]

Not hit the main page and see what's hapenning.
If you have a bibliographic record with biblionumber=42, its info will
be displayed.
Remove this record and try again => it's replaced with "No bibliographic record"
without a link

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f3e0abddff)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b1ae28e500)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:21 +00:00
d001745d69 Bug 34211: Add +strings for GET /api/v1/biblios/:biblio_id/items
Allow to embed stringified version of attributes for the "Get items for
a biblio" endpoint

Test plan:
curl -u koha:koha --request GET 'http://localhost:8081/api/v1/biblios/47/items' --header "Content-Type: application/json" --header "x-koha-embed: +strings" | jq

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2d27d02a4d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 246c616fa6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:21 +00:00
fa2b922934 Bug 34211: Add tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b86ad81bbf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d8326b64a3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:20 +00:00
62af3ce225 Bug 27824: Trim column headers
To support additional spaces.

Using the system for defining a column name placeholder (Bug 23390), if
there is a space inside the column name placeholder it won't work. The
SQL example in Bug 5697:

SELECT
i.itemnumber,
i.itemnumber as Exemplarnummber,
[[i.itemnumber| itemnumber for batch]],
CONCAT('<a
href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=',
i.biblionumber, '&itemnumber=', i.itemnumber, '#edititem', '\">',
i.itemnumber, '</a>' ) AS "itemnumber as edit link"
FROM items i

"[[i.itemnumber| itemnumber for batch]]" has a space before "itemnumber
for batch." With that space removed it works as expected.

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 2c73648f77)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 741f711d5e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:20 +00:00
21ac3587d1 Bug 27824: Add a test
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 a91e80af7d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5f6f595af5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:20 +00:00
Aleisha Amohia
028c371b4c Bug 31147: Recalls should not adjust due time for related checkouts
The current recalls behaviour adjusts the due date of the most appropriate checkout based on the 'recall due date interval' circulation rule. It also adjusts the due time, which is buggy behaviour. The due date should be adjusted based on the circulation rule, but the due time should remain the same.

To test:

1. Enable the UseRecalls system preference and configure recalls-related circulation and fines rules
2. Check out Item A to Patron A
3. Log into the database and check the due date for that checked out item, e.g.

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be YYYY-MM-DD 23:59:00

4. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be today + the number of days in your recall due date interval circulation rule, at the exact time you placed the recall. This is buggy behaviour.

5. Apply the patch and restart services
6. Check in Item A, do NOT fulfill the recall
7. Cancel the recall

8. Check out Item A to Patron A
9. Log into the database and check the due date for that checked out item, e.g.

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be YYYY-MM-DD 23:59:00

10. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be today + the number of days in your recall due date interval circulation rule, with time of 23:59:00.

11. Check in Item A, do NOT fulfill the recall
12. Cancel the recall

13. Check out Item A to Patron A. Specify a due date and change the due time so it isn't 23:59.
14. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be today + the number of days in your recall due date interval circulation rule, with time you set in Step 13.

15. Confirm tests pass t/db_dependent/Koha/Recalls.t

Sponsored-by: Catalyst IT
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 780d6ecb51)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 023cbfde02)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:19 +00:00
f97f9e85e9 Bug 33933: Only show use restriction once on OPAC detail page
This patch removes a regression from bug 32611 that caused the
use restriction text to be shown twice for "Available" items.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=29
2. Edit item and add "Restricted access" for "5 - Use restrictions"
3. Go to http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=29
4. Note that "Status" says "Available (Restricted access)" and there is no
duplicate "Restricted access" at the top of that table cell

Signed-off-by: ebal <eric.balluto@univ-lyon2.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0df163bfc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dac3791cb8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:19 +00:00
Phil Ringnalda
a5dbc98bd3 Bug 28196: Insert searchid in URL correctly, so it doesn't follow the hash
Test plan:
1. Search the catalog in the staff client for anything which will return
   at least two results
2. Click on any result to go to the bib detail page
3. Click the edit button for any item attached to the bib
4. Verify that the loaded URL contains &searchid=scs_(a number), and
   that the URL ends with #edititem
5. Make any change to the item, save, verify that your change was made

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 213392fd6b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c51968b603)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:18 +00:00
de70df82a7 Bug 34220: Only show biblio-view-menu.inc if their is an associated bib
To test:
- Go to Tools > Log viewer
- Uncheck All modules
- Check the 'Catalog' module
- Make sure "To screen in the browser" is the selected output
- Click Submit

After the page loads, instead of the tools side navbar appearing on the left, a 'catalog detail' type navbar (Normal, MARC, ISBD, etc.) is present with links that error out as there's no associated bibnumber.

-Apply patch
-Try again, you should not see the biblio-view-menu
-Try one more time but this time add a valid biblionumber to the Object: field. Now the biblio-view-menu should show with links to that particular bib.

Works as advertised.
Signed-off-by: Alexander Blanchard <alexander.blanchard@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 7118a01294)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dd7f705acc)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:23:13 +00:00
Katrin Fischer
cabc96f761 Bug 33581: Add sample patrons to patch and some hints
* Adds sample patrons to the new dependency checking JS
* Adds a hind "requires sample libraries" to sample patrons
  and sample holidays.

To test:
* Build CSS (yarn build)
* Veriy the checkbox for sample patrons works like the
  sample holidays one
* Verify the hint shows up as intended

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 b2f5c93621)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5d6e378e01)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:14:43 +00:00
dd8c487a50 Bug 33581: Disable sample holiday if libraries are not selected
If libraries are not selected we should not try to insert holidays, or
the installer will fail with a missing FK.

This patch simply disable and uncheck the checkbox when libraries are
not going to be inserted.

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 1137511e63)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit afb52c1eaa)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:14:43 +00:00
f23ca87c3d Bug 32801: Prevent 500 on /checkouts
If checked_in flag is passed we return the "old checkouts". But if the
item has been deleted we explode with
  "message":"Expected integer - got null.","path":"\/0\/item_id"

The specs should reflect that an item can have been deleted.

Test plan:
Hit the endpoint and confirm the above.
Can be done easily using curl:
  curl -u koha:koha --request GET 'http://localhost:8081/api/v1/checkouts?patron_id=5&checked_in=1' --header "Content-Type: application/json" | jq

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 c4cb183ae1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ac1febd685)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:14:43 +00:00
4fae89c4c2 Bug 32801: Add tests
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b157a2cd7f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4041d06124)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:14:42 +00:00
5161f6e966 Bug 34094: (follow-up) Fix failing unit test
The unit tests were written to assume we always do a 'contains' search,
but the new system preference allows for 'starts_with' or 'contains'.

As such, for the tests to pass, we need to explicitly mock the
preference to 'contains'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b787e66fef)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 26e4866c9d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:14:42 +00:00
932d7b8c0e Bug 33893: Use template wrapper for tabs: OPAC checkout history
This patch updates the OPAC checkout history page so that it uses
the new WRAPPER syntax to generate tabs markup.

This patch also updates tab WRAPPER directives in html_helpers.inc to
allow us to pass a custom id for tab links in situations like this one
where we have multiple tabs requiring unique IDs but they all point to
the same panel.

To test, apply the patch and make sure the OnSiteCheckouts system
preference is set to "disabled."

- Log into the OPAC as a patron with checkouts.
- View the checkout history page. The checkout history information
  should be displayed without any tabs.
- Enable the OnSiteCheckouts system preference and if necessary check
  out some on-site checkouts to your patron.
- On the OPAC history page there should now be three tabs: All,
  Checkouts, and On-site checokuts.
  - Switching between the tabs should filter the table accordingly.
- Test that the changes to the tab wrapper have not broken tabs on other
  pages, e.g. bibliographic details or user summary.

Signed-off-by: AlexanderBlanchardAC <alexander.blanchard@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 28d7108624)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a7e986e18b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:14:42 +00:00
0e821acf2a Bug 26862: Improve MARC21 530 display on detail pages
This makes some changes to the way we display field 530 in OPAC
and staff interface:

* Adds missing spaces before $u and between repeated $u subfields
* Adds a description/label before the output of the subfields
* Adds display to the staff interface (was OPAC only)
* Adds separators between repeated 530 fields:
  * OPAC: updates mark-up to use the new CSS driven separators
  * Staff interface: adds | with separator class

To test:
* Find or create a records with multiple 530 entries
* Repeat $u with multiple URLs
* Verify display in staff (missing) and OPAC
* Apply patch
* Verify display is improved :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2bed26db3b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 58c24ea165)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:14:41 +00:00
d23c69d5f3 Bug 34244: Improve contrast in staff interface main page layered icons
This patch adjusts CSS for the staff interface home page so that there
is better contrast with Font Awesome icons which are layered. The
main advanced search and item search links have two icons layered one on
top of the other, and the "lower" one needs to have better contrast
after the staff interface redesign.

To test, apply the patch and rebuild the staff interface CSS. Log into
the staff interface and confirm that the advanced search and item search
link icons are clear and distinguishable from each other.

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 f6b935a4ca)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 84422676d6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:06:52 +00:00
d9b29d5b11 Bug 34233: Move select2 include out of patron-search.inc
1. Apply patch
2. Place a hold and make sure the patron pickup locations are
   populating correctly again/
3. Work through the test plan on Bug 28726 to make sure it still works.
4. Enable ArticleRequests, make sure you can still do a patron search
   there.
5. Do a patron search from members.tt, make sure that still works.

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 c92c893c12)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 93877a3f8f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:06:51 +00:00
Thibaud Guillot
9dc601f30c Bug 34218: Send a record copy to avoid loss of information and display problems
As I wrote in the bug description, I encountered this problem in a particular case,
so I'll explain it in the test plan, but it's certainly likely to be encountered in different ways.

Test plan:

1) Link authorised values with  a field on a MARC framework, like a 942a related to branches
2) Set it on a record with no items
3) Activate syspref "AlternateHoldingsField" and set it to field 942a
4) Go to OPAC View and you will see "Holdings: " without any values
5) Apply this patch
6) Do step 4) again and now it's fixed

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 cbd0c15c87)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a4c53ebf7d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:06:51 +00:00
343f124276 Bug 34137: Requested cancellation date column missing from holds awaiting pickup table config
This patch adds an entry for the requested cancellation date column to
columns_settings.yml so that the column can be configured correctly in
table settings and on the fly.

To test you will need at least one hold with a cancellation request:

- Go to Administration -> Circulation and fine rules -> Default waiting
  hold cancellation policy
  - Add at least one rule allowing cancellation on waiting items.
- Place a hold for a patron which would fall under the rule you defined.
- Satisfy the hold by checking the item in at the hold's destination
  location.
- Cancel the hold, either by logging in to the OPAC as the patron with
  the hold, or in the staff client via the holds tab on the patron's
  record.

- Apply the patch and restart all services.
- Go to Circulation -> Holds awaiting pickup
- In the "Holds with cancellation requests" tab, confirm that there is a
  "Date cancellation requested" column and that it is one of the choices
  under the "Columns" button.
- Confirm that the correct columns are shown and hidden when making
  selections in the columns menu.
- Go to Administration -> Table settings -> Circulation -> Holds
  awaiting pickup.
   - Test setting "Is hidden by default" and "Cannot be toggled" for
     various columns in the table, including the "Date cancellation
     requested" column.

Signed-off-by: Quinn <quinn.morris@citruslibraries.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 836dc32d62)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8556ed9838)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:06:51 +00:00
b3a5ffa56d Bug 34116: Add page-sectioning to item search in label creator
This patch adds a "page-section" class to search results page seen when
adding items to a label batch. The patch also makes some minor changes
to markup around the search header to make it more consistent with other
search pages.

To test, apply the patch and go to Cataloging -> Label creator.

- Click New -> Label batch
- Without entering anything in the textarea, click the "Add item(s)"
  button"
- In the pop-up window, perform a search which will return multiple
  results.
- Confirm that everything looks correct and all controls work as they
  should.

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 a7db3895a7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4664ba3b25)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:06:50 +00:00
76baece363 Bug 33047: Return 404 instead of 500 when biblio does not exist
If the biblionumber or the itemnumber passed in parameter does not
exist we should return 404 instead of exploding with a 500.

Test plan:
Attach cover images to biblio and items
Notice that the UI is working correctly (staff and OPAC)
Hit catalogue/image.pl and opac/opac-image.pl with non-existent
biblionumber and imagenumber
Notice that you now get 404 instead of 500

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 5f43478512)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cf31471089)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:06:50 +00:00
e03ea17b97 Bug 34072: Remove float/clear from froms.scss
To test:
- go to /cgi-bin/koha/circ/view_holdsqueue.pl
- inspect something within the page to open the dev tools
- press ctrl-shift-m to show the device toolbar
- use the device toolbar to reduce the resolution of your window
- observe that the search controls are lost at smaller resolutions
- Apply patch, regerate CSS ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface ), clear browser cache
- Try again, you should now see the search controls
- Since this patch changes forms.scss try some other forms in Koha at different screen sizes to make sure they still look correct

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 72dd43c051)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 62930d5433)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:06:50 +00:00
cae4772552 Bug 34086: Show location on detail page when there is no permenant location
To test:
1. Have some items without a permanent location.
2. Go to the staff detail page.
3. In the 'Home library' column notice the span .shelvingloc is empty.
4. Add a permanent location, now the shelvingloc is populated
5. Apply patch
6. The location should now show even when there is no permenant location.

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 b5c6435fe8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ee71ace105)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 14:06:49 +00:00
Andreas Roussos
a8524b11c0 Bug 34005: Move button toggling code outside JS for loop
When OpacHighlightedWords is set to "Highlight", if you search
in the OPAC and the number of keywords is odd (1, 3, 5, etc.),
then the "Unhighlight" / "Highlight" button will stop working
after a couple of clicks. The relevant commit is 9cb89b4639
from v20.11.00, where the code responsible for toggling the
"Unhighlight" / "Highlight" button was moved inside the JS
for loop that cycles through each term in the array of search
terms. This explains why the toggling only works when an even
number of search terms is being used.

This patch fixes that, by placing the button toggling code in
its original position (outside the JavaScript for loop of the
highlightOn() function).

Test plan:

0) If required, set OpacHighlightedWords to "Highlight".

1) Search for "history" in the OPAC, and view the details page
   of one of the results. Click on the "Unhighlight" button a
   few times -- after a couple of clicks the button text will
   stop toggling and you won't be able to remove the keyword
   highlight any more.

2) Apply this patch.

3) Repeat step 1): this time you should be able to toggle the
   search keyword highlighting no matter how many times you
   click on the "Unhighlight" / "Highlight" button.

4) Repeat step 1), but this time search for "century history":
   you should be able to toggle search keyword highlighting in
   the details page on and off repeatedly without any problems.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 55f3eb3919)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3a550c39cb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:46:03 +00:00
18374cab19 Bug 34214: Make 'icon' configurable for Toolbar options
Bug 33417 added a generic 'Toolbar' Vue component but always add a 'plus' icon. We should make it configurable.

Test plan:
Regenerate the Vue app: `yarn js:build`
Go to the ERM module and confirm that the toolbar has the '+' icon.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Alexander Blanchard <alexander.blanchard@ptfs-europe.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f317247776)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c77bea6072)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:46:03 +00:00
b3c1e5d3c6 Bug 34201: Restore sorting indicator on ERM tables
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

Test plan:
Create several agreements, notice that the list view is having the
sorting indicators (blue arrows) in the top right of the first column.
Sort the columns: asc, desc, combined sort (shift+click) and confirm
that the indicators are correct

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 29063caca2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 64ed66d293)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:46:02 +00:00
33216808d6 Bug 33497: Don't get host items if the MARC record is invalid
When don't want to explode with "invalid data" later so we need to
condition the host_item search

call trace was
        Koha::Biblio::Metadata::record('Koha::Biblio::Metadata=HASH(0x55ab92e60120)') called at /kohadevbox/koha/Koha/Biblio.pm line 538
        Koha::Biblio::_host_itemnumbers('Koha::Biblio=HASH(0x55ab92e4d5c0)') called at /kohadevbox/koha/Koha/Biblio.pm line 498
        Koha::Biblio::items('Koha::Biblio=HASH(0x55ab92e4d5c0)', 'HASH(0x55ab934615d8)') called at /kohadevbox/koha/catalogue/detail.pl line 200

This is fixing t/db_dependent/selenium/regressions.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8bd5420312)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a4896e3832)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:46:02 +00:00
d1536ebc2d Bug 34074: Improve translations of strings on the about page
This patch makes a few simple changes to the about page template to
improve how the translation tool picks up strings to translate.

The patch also corrects a couple of lines where template tags contained
line breaks.

To test, apply the patch and view the about page in the staff interface.
Everything should look correct.

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 1b579868d5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7d63e807f8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:46:01 +00:00
e3c771b947 Bug 33781: Terminology: Item already issued to other borrower.
This patch updates a couple of error message strings so that they use
the correct terminology and read well.

"This item is on hold for another borrower." becomes "This item is on
hold for another patron."

"Item already issued to other borrower." becomes "This item is already
checked out to another patron."

To test, apply the patch and log into the OPAC as a patron who has items
checked out which are available for renewal.

In another tab, place a hold on one of those items on behalf of a
different patron.

Back in your OPAC tab, click the "Renew" link next to the title which is
now on hold. The page should reload and show the updated message, "This
item is on hold..."

I was not able to trigger the other message.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d20e4ebbde)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2817f6fc86)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:46:01 +00:00
a675e7d0cd Bug 33858: Format dates in offline circ
1 - check item 3999900000001 out to a patron
2 - upload the attached KOC file from bug 33838
3 - navigate to pending offline circ actions
4 - verify that the date is shown unformatted
5 - apply patch
6 - verify that the date is now shown formatted

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Univ Brest <cecile.lambour@univ-brest.fr>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3e15d728e5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6bb6b7797d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-18 13:46:01 +00:00