Commit graph

50332 commits

Author SHA1 Message Date
e81e765d7d Bug 34650: Remove unnecessary CSRF check on edit_form
The op "edit_form" doesn't change state. It just renders the edit
form. Therefore, it doesn't need a CSRF token/check.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit caf962fbaa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:37:02 -10:00
1d23e46f8c Bug 34609: Add missing test for Koha::Hold->biblio
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7cab415f0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:35:37 -10:00
7ea252ffa0 Bug 34609: Add biblio method to Old::Hold
Test plan, clean k-t-d:

1) Add a reserve to koha/koha user, mysql run:
insert into reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, biblionumber)
VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 76);

2) Add an old_reserve to koha/koha user, mysql run:
insert into old_reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, reserve_id)
VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 1);

3) Visit holdshistory on either OPAC (requires OPACHoldsHistory sys pref) or STAFF
STAFF/cgi-bin/koha/members/holdshistory.pl?borrowernumber=1
OPAC//cgi-bin/koha/opac-holdshistory.pl

4) Notice it blows up with a 500 error
5) Repeat step 3

Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7b57163ef3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:35:37 -10:00
315927af8b Bug 34609: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eaa1a1d7e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:35:37 -10:00
0645519faf Bug 34466: Add listener to enable or disable clear filter button on KohaTable.vue
Test plan:
Apply only the cypress test patch
Run KohaTable_spec.ts
Notice it fails

Apply this patch, repeat

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5316b4c9cc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:33:53 -10:00
e4ddce3f98 Bug 34466: Cypress tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 68baf8a7c1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:33:53 -10:00
078324d151 Bug 34616: Move default server info outside the <fieldset>
Also DRY current default information dialog block

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fb47d04efd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:29:56 -10:00
197f258bfd Bug 34616: Fix showing default server info on edit SMTP server page
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0383e5f6a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:29:56 -10:00
dcdb047b03 Bug 34616: Add native bootstrap behaviour to default server dialog
Test plan:
Create a new SMTP server
Tick the 'default server' checkbox
Verify it now has a backdrop, closes if u click the backdrop or press 'esc'
The Yes and No buttons are now styled properly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b9d3997063)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:29:56 -10:00
10324fd587 Bug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.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 352a2afd0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:28:15 -10:00
Andreas Roussos
306ec5c3e7 Bug 31964: add a man page for koha-z3950-responder
The koha-z3950-responder command does not have a man page.

This patch fixes that.

Test plan:

1) Apply this patch.

2) Run the following command to generate the new man page:

   xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/manpages/docbook.xsl debian/docs/koha-z3950-responder.xml

3) View the generated man page with `man -l koha-z3950-responder.8`

   (KTD users may need to `apt-get install man-db` first as
   that package provides tools for reading manual pages)

4) Make sure this unit test passes:

   prove -v xt/verify-debian-docbook.t

Signed-off-by: Pedro Amorim <pedro.amorim@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 eb902d7a92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-07 14:27:39 -10:00
12969850e8 Bug 34066: Datatable options don't fully translate on list of saved reports
This patch corrects the DataTable option for defining an alternate
language string when no records are returned by a table filter. An
obsolete version of the option name was breaking the existing custom
option supplied by our datatables.js

To test, apply the patch and go to Reports -> Use saved..

 - In the DataTable of existing reports, all the DataTable controls
   should look correct.
 - In the filter field at the top of the table, enter a string which
   will not be found. You should see a message, "No matching reports
   found."
 - Install another language if necessary, and switch to that language.
 - The labels on all the DataTable controls should show the terms which
   have been translated for that language.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e26d7c783e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:24:12 -10:00
3fa6983a53 Bug 34465: Make KohaTable.vue actions column not sortable
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 60cf53cf79)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:22:55 -10:00
9feb62a703 Bug 34522: Pass the suggestion branchcode, not the suggester branchcode
To test:
1. Turn on OPACViewOthersSuggestions
2. Log into OPAC as patron of Branch A
3. Make purchase suggestion for Branch B
4. Refresh /cgi-bin/koha/opac-suggestions.pl and see that suggestion appears to have been made for Branch A
5. View suggestion from staff client - See that it accurately reflects suggestion having been made for Branch B
6. Apply patch and try steps 2 - 5 again, this time you should see the proper branch.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cb4db13612)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:22:26 -10:00
8237fdd32a Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors
This change replaces the onclick HTML attribute with a Javascript binding
to make it more in line with Koha conventions and make it CSP compatible.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=#
2. Try hiding/unhiding fields
3. Try cloning fields and hiding/unhiding those too
4. Note that everything works as expected
5. Do the same thing for authorities by going to
http://localhost:8081/cgi-bin/koha/authorities/authorities.pl?authtypecode=#

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 8341ffe13d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:20:50 -10:00
19c940c287 Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc()
This change removes the "onclick" attribute for the MARC doc
link in the cataloguing editor.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=#
2. Click on the question mark (?) next to any of the MARC fields
3. Press the "Repeat this tag" button
4. Click on the question mark (?) on the cloned MARC field
5. Note that both times it worked

Signed-off-by: Owen Leonard <oleonard@myacpl.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 0b992dd12e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:19:18 -10:00
Michael Hafen
e24304ccd5 Bug 34592: Patron Search filter fields needs to be at least an empty array
If buildPatronSearchQuery() doesn't return an empty array when it exits
early, then the code that adds the sort fields to the filters will fail.

Test plan:

- If there is not all ready a patron with a sort1 or sort2 value from
  the bSort1 or bSort2 authorized values, add an authorized value if
  necessary.
- Add a patron if necessary, and set the patrons sort field to the added
  value.
- In Tools -> Patron card creator start a new card batch.
- Click on Add Patron(s) to open the patron search window.
- Pick the value in either the sort1 or sort2 drop down.
- Submit the page.  The page will reload and there won't be results.
- Apply the patch, close the patron search window, clear the browser
  cache, reload the "New patron card batch" page, and open the patron
  search window again.
- Repeat the search. There will be results.

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 275197f405)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:18:11 -10:00
72364bb34c Bug 34115: Use a global tab select function for activating Bootstrap tabs based on location hash
This patch fixes automatic tab selection by location.hash in the MARC
subfield editor. This allows links which target a specific subfield to
open the page with the subfield tab selected.

I've put this into a global function since it can be reused in multiple
places: The about page and the checkout page have variations of this
functionality which can be replaced with this function.

The patch also corrects two links in Koha pointing to the About
page which included the wrong location hash (changed in the switch to
Bootstrap tab wrappers).

To test, apply the patch and go to Adminstration -> Bibliographic
frameworks.

- View the MARC structure for any framework.
  - In the "Search for tag" input field, submit a tag and subfield which
    will be found in that framework, e.g. "245$a"
  - When you submit the form you should be sent to the MARC subfield
   structure page for that tag with the subfield tab automatically
   selected.
- View the MARC subfield structure for any framework.
  - In the table of subfields, click the subfield link in the first
    column. You should be taken to the edit form with the corresponding
    tab selected.
- Go to Circulation and check out to a patron. Append a tab anchor to
  the URL, e.g. "#holds_panel" and submit. You may have to shift-reload
  the page to see the change. (As far as I know no links in Koha take
  advantage of this)
- Perform the same test on the patron detail page
- Go to the About page and perform the same test with a tab anchor like
  "#team_panel" or "#sysinfo_panel"

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 cb6dd4e82b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:16:42 -10:00
Laura Escamilla
f5e151c1f8 Bug 34095: Adjust logic so that shipment cost is empty if the receiving shipment cost is blank.
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a5cadff482)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:15:46 -10:00
216542e4a6 Bug 34445: Set default budget in addorderiso2709.pl
This patch allows the default budget to be used as a fallback if no budget is selected. Currently the default budget is set using lines 129-133 but then is never used.

QA follow-up:
- perl tidied
- budget_codes changed to budget_ids for consistency

Test plan:
1) Apply patch
2) restart_all
3) Follow the steps from the bug description
4) Order lines should be added properly

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Rearranged comments
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b3427f71ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:14:50 -10:00
e0098b4b58 Bug 34307: (follow-up) Use template wrapper for title tag
This patch updates the title tag to use a wrapper too, since Bug 33906
is in the process of getting fixed.

The patch also removes an extra <span> tag: Only the translatable string
needs the span, not the entire line.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 62a757acd1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:12:41 -10:00
d3e44a2e5e Bug 34307: (QA follow-up) add <span> to have cleaner strings for i18n
Cleaner strings are extracted this way.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a6ec493647)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:12:41 -10:00
65a0d63860 Bug 34307: Update plugin template to match master conventions
This change uses WRAPPER to build the breadcrumbs and
updates the plugin template to follow some other master conventions
like differentiating between Administration and Tools for plugins.

Test plan:
0. Apply patch
1. Upload koha-plugin-test-wrapper
2. Enable the plugin
3. Click "Actions" and click "Run tool"
4. Note how the plugin page looks like a perfect Koha Tools page
5. Note that the plugin only contains 6 lines of template code
to achieve this effect

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e8a4805435)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:12:41 -10:00
Laura Escamilla
3dea2272e5 Bug 34340: Changed "Tendered" to the correct input id which is "Collected"
Must also apply bug 34332 - fixed a syntax error for the pos email template

To test:
1. Configure your Koha to enable the point of sale system (i.e. enable syspref,
   set up a register, set up an item to sell).
2. Complete a transaction in the POS system.
3. Click on the “Email receipt” button next to the “Print receipt” option and
   enter an email address and confirm that the email is sent.
4. Check the “Tendered” field. It is showing up as 0.00 and not reflecting the
   actual amount that was tendered.
5. Apply patch
6. Repeat steps 2 & 3
7. The emailed receipt is now showing the correct tendered amount.
8. Sign off!

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 f2ecb1e9be)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:07:33 -10:00
8fc3531e07 Bug 30362: Fix GetSoonestRenewDate to really return soonest renew date
This change fixes GetSoonestRenewDate so that it returns the soonest
renew date as calculated using "No Renewal Before" and "NoRenewalBeforePrecision".
In the past, it would only return the soonest renew date if "$now" was
lesser than it, which would typically only happen when using an "exact"
precision rather than a "date" precision.

Test plan:
0. Apply the patch
1. prove t/db_dependent/Circulation.t

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 f8c474019d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:06:00 -10:00
b0fa0150b8 Bug 30362: Fix unit test
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 95aa1c3da5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:06:00 -10:00
a419589998 Bug 30362: Unit test
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 145788398a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 10:06:00 -10:00
8e473cb69a Bug 34567: Correct colors for advanced cataloging editor status bar
This patch updates the advanced cataloging editor CSS so that the
"status bar" footer below the editor has colors consistent with the
staff interface redesign.

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

- Enable the EnableAdvancedCatalogingEditor preference if necessary.
- Go to Cataloging -> Advanced editor.
- At the bottom of the screen below the editor the "status bar" should
  have a green border that matches color in the header search bar.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3ed9168315)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 09:57:55 -10:00
0903deca22 Bug 34601: Fix wrong quote
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1e9d4dfdd5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 09:52:56 -10:00
Katrin Fischer
3ef289dcc6 Bug 34601: (QA follow-up) Fix edit/delete links in toolbar
We also need to fix the links in the toolbar visible when
'viewing' the suggestion.

1) Create a suggestion
2) Click on the title
3) Click edit > CSRF error
4) Click delete link in toolbar > CSRF error
5) Apply patch and repeat

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3b9de04b89)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 09:52:29 -10:00
770dd3bde1 Bug 34601: Fix edit/delete links on suggestion.tt
1. Make a suggestion
2. Try to edit, delete the suggestion.
3. Error:
4. Apply patch and restart_all
5. Try again and you should not get the error anymore.

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 b630dfcb08)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-30 09:51:33 -10:00
0b12a5fa84 Bug 34627: CMS pages do not correctly display the opaccredits footer
This patch corrects the page structure of CMS pages in the OPAC so that
the contents of the footer, including opaccredits, OpacKohaUrl, and the
language selection bar, are displayed correctly.

This patch contains indentation changes, so ignore whitespace when
viewing the diff.

To test you should have these settings:

- OpacKohaUrl enabled in system preferences
- Some content in the opaccredits HTML customization region
- Some content in the OpacNav HTML customization region
- At least one translation installed and enabled
- The opaclanguagesdisplay preference enabled
- The OpacLangSelectorMode set to "only footer" or "both top and footer"

- Apply the patch and go to Tools -> Pages and create a page with the
  display location "OPAC."
- Open the OPAC link for your newly-created page and confirm that the
  page looks correct:
  - The "main" region with the white background should contain the
    breadcrumb navigation, the sidebar OpacNav content, and the contents
    of your CMS page.
  - The opaccredits and OpacKohaUrl content should appear below that
    region.
  - The language selection footer should be at the bottom of the page.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7d5dc65867)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 21:18:07 -10:00
22674a7ddf Bug 34505: Patron invalid age in search_for_data_inconsistencies.pl skip expired patrons
Bug 26311 added patron invalid age in search_for_data_inconsistencies.pl
But this is not relevant for expired patrons, especially in child categories.
Check should skip expired patrons

1) Set a non-expired patron with invalid age
2) Run misc/maintenance/search_for_data_inconsistencies.pl
=> Check you see the patron
3) Edit patron to be expired
4) Run misc/maintenance/search_for_data_inconsistencies.pl
=> Check you do not see the patron

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] If we do not want to test valid age for expired patrons, you should
obviously test expired first. Reversing the order in the test.
Putting it in the search criteria would be nicer but leads to more
complicated code.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c26dff61e7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 21:17:00 -10:00
06f09de19e Bug 34313: Add patron information in pass validation response
This patch makes the password validation response return the following
patron attributes to the API consumer:

* cardnumber
* userid

This will give hints on what was used to validate in the fallback
bahvior the endpoint has.

To test:
1. Apply the unit tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/password_validation.t
=> FAIL: The endpoint doesn't return this valuable data
3. Apply this patch
4. Repeat 2
=> SUCESS: Tests pass! We got the cardnumber and the userid!
5. Sign off :-D

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 749783debf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 21:09:30 -10:00
edda7a23cb Bug 34313: Unit tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eeef7839fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 21:09:30 -10:00
80cc0c03aa Bug 34356: Make sort order always default to correct column
To test:
1- Check out an item to a patron
2- View checkout history, default sort is on 'Date due'
3- Enable RecordStaffUserOnCheckout
4- View checkout history, default sort is on 'Checked out by'
5- Apply patch
6- Table should sort to 'Date due' no matter what the sys pref is set to

Signed-off-by: Jason <jrobb@sekls.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit edad82662c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 21:07:24 -10:00
2fb195eedf Bug 34386: Fix inconsistencies in Cities and tows page titles, breadcrumbs, and header
This patch updates the cities administration page so that page title,
breadcrumb navigation, and headings are consistent with each other and
with other parts of Koha.

To test, apply the patch and go to Administration -> Cities and towns.
Check each variation of the page to confirm that page title, breadcrumb
navigation, and heading are correct.

- Main page (listing cities)
- New city
- Edit city
- Delete city

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 8460158f6b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 21:02:56 -10:00
e67e3bdf73 Bug 34379: Fix label of new library group button
This patch corrects the label on the button for creating a new library
group, changing it from "Add group" to "New group" for consistency.

To test, apply the patch and go to Administration -> Library groups.
Confirm that the button is now labeled "New group" and that it
still works to trigger the library group creation modal.

Signed-off-by: Andrew <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 879f7db9e8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 21:00:02 -10:00
9c54bee813 Bug 34385: Correct page heading of transport cost matrix page
This patch corrects the main heading on the transport cost matrix page
so that it matches the page title and breadcrumb navigation.

To test, apply the patch and go to Administration -> Transport cost
matrix. Confirm that the page heading reads "Transport cost matrix."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c7daaa901b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:58:13 -10:00
b72c5e9465 Bug 25023: Claims returned dates not formatted according to dateformat preference
This patch updates the code for rendering the claims returned table on
the checkout and patron detail pages. Now the dates are formatted using
the global js-date-format.inc code.

To test, apply the patch and make sure the claims returned feature is
enabled by setting a value in the ClaimReturnedLostValue system
preference.

- Check out some items to a patron.
- Under the checkouts tab, mark several checkouts as "Claim returned."
- Open the claims tab.
- The dates in the "Created on" column should be formatted according to
  your dateformat system preference.
  - Change the dateformat preference and return to the checkouts page.
    Confirm that the claims tab shows dates formatted correctly.
- The "created on" and "updated on" columns should sort correctly with
  any dateformat setting. You may have to directly modify the dates in
  the database in order to have the right data for testing this.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1156b3683b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:52:28 -10:00
6f9dd5e449 Bug 34219: Allow getAll to receive additional URL parameters
It's not possible to pass additional URL parameters. We need it at least for bug 32474.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f1078daf8f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:51:27 -10:00
8103059faf Bug 34331: Use register from userenv if parameter not passed
To recreate:
1. Enable the "EnablePointofSale" syspref.
2. Set the "UseCashRegisters" syspref to use.
3. Create 3 new registers (Register A, B and C) with a float amount of $25.
4. Under POS, configure 3 new debit types (i.e. Copies, Earbuds, Friends Donation)
-- You can leave the default amounts blank, or add an amount if desired.
-- Set "Can be manually invoiced?" and "Can be sold?"
5. Under point of sale make a $5 sale of copies under Register A.
6. Under point of sale make a $10 sale of earbuds under Register B.
7. Under point of sale make a $100 sale of Friends Donation under Register C.
8. At circ/set-library.pl set your register to Register A.
9. Go back to POS and view the "Transaction history for Register A" - it shows the correct amount of $5 sold in copies.
10. Go back to circ/set-library.pl and change your register to Register B.
11. Go back to POS and view the "Transaction history for Register B" - it shows the incorrect transaction history. It is showing the transaction history for Register A.
12. Go back to circ/set-library.pl and change your register to Register C.
13. Go back to POS and view the "Transaction history for Register C" - it shows the incorrect transaction history. It is showing the transaction history for Register A.
14. Apply patch, repeat. The correct transactions should now show.

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 bd28eae578)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:49:55 -10:00
587f5b936f Bug 33759: Fix typo 'Thankyou' in sample notices
This fixes the typo 'Thankyou' in some of the sample notices.

To test:
* With the sample data
* Create and run a report:
  SELECT code,content FROM letter where content LIKE "%Thankyou%";
* Verify 3 notices contain 'Thankyou'
* Apply patch
* Drop your database
* Run the web installer
* Run report again, you should no longer get any results

Signed-off-by: Alexander Wagner <alexander.wagner@desy.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 004bde7950)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:48:49 -10:00
a6e5504aff Bug 34341: Revert Bug 34072: Holds queue search interface hidden on small screens
This patch undoes the changes made by 34072 because they have had a more
far-reaching effect than was expected. I have never been able to
reproduce Bug 34072 before the patch.

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

- Go to Circulation -> Holds queue
- Try adjusting the width of the browser window to confirm that it is
  responsive at various widths.
- When the viewport width is below 768 the page layout will adjust, and
  the contents of the sidebar will drop below the table of holds. This
  is consistent with other pages in the staff interface.
- Check that the corrected CSS has resulted in a correction to the
  layout of submit buttons in forms:
  - For example, in Administration -> Cities and towns -> New city.
  - Before the patch there was no padding between the submit button and
    the white fieldset containing the form fields.
  - After the patch the correct padding has been restored.

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 8d78ba7ff2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:48:02 -10:00
13bc2848a1 Bug 34533: jsdiff library missing from guided reports page
This patch restores the inclusion of the jsdiff JS library on the guided
reports page when displaying saved SQL reports. This fixes a JS error in
the browser console when the user tries to use our automatic update on
SQL reports which use an older syntax.

The patch also corrects a problem with svc/convert_report which was
causing an error when trying to display the diff information.

To test, apply the patch and restart services.

- Go to Reports -> Create from SQL.
- Add a report which is based on an older db structure. The example I
  found was:

  SELECT biblionumber,
  ExtractValue(marcxml,'//datafield/@tag/text()[substring(.,1,1) = "5"]') as 'notes'
  FROM biblioitems
  HAVING notes <> ''

- Save the report and go to the list of saved reports. There should be
  an "Update" column in the table, with a message about your newly-added
  report:

  "This report seems obsolete, it uses biblioitems.marcxml field."

- Clicking the "Update SQL" button should trigger a modal window that
  shows the before an after versions of the report. There should be
  no error in the browser console. Unfortunately the diff will not
  display because of a separate bug in svc/convert_report

Signed.off-by: Jessie Zairo <jzairo@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 f2be2cedc5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:46:54 -10:00
ae8937fb8d Bug 34565: Label mismatch in MARC21 006 and 008 cataloging plugins
This patch modifies the JS which builds the table of options for
populating MARC21 fields 006 and 008 when using the cataloging plugin.

To test, apply the patch and go to Cataloging -> New record.

- Click the plugin trigger link next to the 006 input field (you may
  need to click the tag to expand it.
- In the table of input fields, test that clicking the label, e.g. "Type
  of material", "00 - Form of material," etc,  moves focus to the
  corresponding form field.
- Perform the same test on the plugin-popup for field 008.

Signed-off-by: Andrew <andrew.auld@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fb48155cc4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:45:31 -10:00
Andreas Roussos
f98e4faee2 Bug 29578: Upgrade the jQuery highlighter plugin
Under certain conditions, the jQuery term highlighter
can break and in the process make the "Highlight" /
"Unhighlight" button disappear altogether. This affects
catalog searches in both the OPAC and the Staff Client,
with UNIMARC-based instances affected the most as the
"Highlight" / "Unhighlight" button disappears if you
perform a specific OPAC search (see Test plan below).

This patch fixes that by upgrading the highlighter
plugin to its latest version for both the OPAC and
the Staff interface. Then, the changes from commit
2e4b574074 (Bug 5844) are applied to the plugin code.
Also, Koha uses "term" instead of "highlight" as the
class name for the <span> highlighting elements, so
the plugin code is modified for that aspect, too.
Finally, the plugin file is renamed to reflect the
version change (v3 -> v5) and all references to the
old filename in the Template files are updated.

Test plan:

0) In a UNIMARC instance, catalogue two books using
   the titles given below (Title subfield = 200$a):

   Book 1: Συλλογής των εν επιτομή τοῖς πάλαι γεωγραφηθέντων
   Book 2: Επιτομή της ιστορίας των Βαλκανικών Πολέμων (1912-1913)

1) OpacHighlightedWords and StaffHighlightedWords
   should both be set to "Highlight".

2) Search the OPAC for "επιτομή των" (without the
   quotes). In the results page, notice that:

   a) You get an Uncaught DOMException error in the
      web browswer's JavaScript Console (press F12):
      "Failed to execute 'splitText' on 'Text': The
      offset 3 is larger than the Text node's length."
   b) the "Highlight" / "Unhighlight" button vanishes
   c) some search terms matches are not highlighted
      (for example "των" in the 2nd Book)

3) Repeat the same search in the Staff interface.
   In the results page, notice that:

   a) You get an Uncaught DOMException error in the
      web browswer's JavaScript Console (press F12):
      "Failed to execute 'splitText' on 'Text': The
      offset 3 is larger than the Text node's length."
   b) Even though some terms are highlighted, the
      button still says "Highlight"
   c) some search terms matches are not highlighted
      (for example "των" in the 2nd Book)

4) Apply this patch.

5) Repeat the searches (you may have to press CTRL-F5
   to reload the JavaScript code). This time the
   "Highlight" / "Unhighlight" button is displayed
   in the OPAC, and all your search terms should be
   highlighted in yellow. Toggling the highlight
   should cause no problems, and there shouldn't be
   any errors logged in your browser's Console.

Signed-off-by: Christian Nelson <christian.nelson@uwasa.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bee56606a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:35:35 -10:00
Kevin Carnes
c3c0f9eb12 Bug 27496: Accessibility: Navigation buttons are poorly described by screen readers
This patch adds aria-haspopup and aria-expanded attributes to the language
    and welcome user buttons so that screen readers will know that they cause a
    popup menu to be displayed.

    To test:
    1. Use an installation with at least 2 active languages
    2. Log in the OPAC
    3. Use a screen reader (e.g. ChromeVox in Chrome) and use the tab key to
       navigate to the language and welcome user buttons while noticing that
       they are described as "Button collapsed" and "Button", respectively
    4. Alternatively, inspect the buttons and notice that they are missing
       aria-haspopup and aria-expanded attributes
    5. Apply the patch
    6. Observe that these buttons now are described as "Popup button collapsed"
       or that they contain the aria-haspopup and aria-expanded attributes like
       the lists button
    7. 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 e0007bf362)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:34:00 -10:00
f9cd9cca6a Bug 34509: Use select2 to load vendors on basket creation
This patch moves the dropdown to use select2 and avoids loading all
vendors at page load.

To test:
 1 - Create some extra vendors in your system, ideally over 20
 2 - Search for a vendor in acquisitions
 3 - Click 'New->basket'
 4 - Note the dropdown of all vendors
 5 - Choose a vendor and create a basket
 6 - Apply patch
 7 - Repeat
 8 - Note only a partial list of vendors is loaded
 9 - Search in the dropdown and confirm vendors are returned
10 - Select a vendor and create the basket

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 77ee1ca743)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 11:43:05 -10:00
66e1992d4e Bug 34518: Fix 'Renew all' button in OPAC
Test plan:
- Checkout an item to koha user (42)
- Log-in to OPAC and visit user summary to see check-outs
- Press 'Renew all' button at the bottom, notice it doesn't work.
- Apply patch. Repeat and verify it now works

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 b679c82211)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 11:41:24 -10:00