]> git.koha-community.org Git - koha.git/log
koha.git
12 months agoBug 34961: Add sort parameter to OPAC search results RSS feed link
Owen Leonard [Fri, 29 Sep 2023 18:33:59 +0000 (18:33 +0000)]
Bug 34961: Add sort parameter to OPAC search results RSS feed link

This patch corrects two RSS links in the OPAC search results template so
that they include the correct parameters, including the descending sort
by acquisition date.

To test, apply the patch and go to the OPAC.

- Perform a catalog search which will return search results.
- Next to the page heading "Your search returned X results" is an RSS
  link. Check the link to confirm that it has all the expected
  parameters:

  opac-search.pl?idx=kw&q=nude&count=50&sort_by=acqdate_dsc&format=rss

- Perform a search which will return no results and check the RSS link
  on that page. It should be the same.

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 1f730fb8665a53457ad709933d3518577c041a6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34891: Correct link on view restrictions button
Owen Leonard [Fri, 22 Sep 2023 16:31:08 +0000 (16:31 +0000)]
Bug 34891: Correct link on view restrictions button

This patch updates the button which appears on the circulation page
when a patron is restricted. Before this patch, clicking the button
would activate the restrictions tab but wouldn't scroll the page to make
the tab visible.

To test, apply the patch and check out to a patron who has one or more
restrictions.

- There should be a message on the page, "Restricted since..."
- Click the "View restrictions" button.
- The page should jump down so that the tabs are visible and the
  restrictions tab should be active.
- Test on the patron details page too.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ca2fdda34281fb65c65c8cee0715868825794cd0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 32676: Fix EDI message status case
Kyle Hall [Tue, 31 Jan 2023 17:42:46 +0000 (12:42 -0500)]
Bug 32676: Fix EDI message status case

Edifact status appear to vary between all lower case and being
capitalized. This breaks the switch in the edi_status block of the
basket.tt template. We should make this switch case-insensitive.

Test Plan:
1) View the basket for a sent EDI order, note the Sent status does not
   display.
2) Apply this patch
3) Reloate the page, note the status is now visible!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b0b33b382c5254db2b4d78ee4d00f03d589513ca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34945: Remove the use of event attributes from OPAC clubs tab
Owen Leonard [Thu, 28 Sep 2023 11:30:35 +0000 (11:30 +0000)]
Bug 34945: Remove the use of event attributes from OPAC clubs tab

This patch removes the use of event attributes (onclick) from the
template for the clubs tab shown in the OPAC to a logged-in user.
These events are defined now along with the other in-page JS.

The patch also makes some general improvements to the template for
consistency:

- Adding Bootstrap color classes to the "Enroll" and "Cancel enrollment"
  buttons.
- Enhancing the responsive configuration to the DataTable.

To test you should have a few patron clubs defined (Tools -> Patron
clubs).

- Apply the patch and log in to the OPAC.
- On the user summary page, click the "Clubs" tab.
- The "Enroll" and "Cancel enrollment" buttons should look correct and
  work as expected:
  - Click the "Enroll" button.
    - On the enrollment confirmation view, test both the "Finish
      enrollment" button and the "Cancel" link.
  - Test "Cancel enrollment" button.
- Test the responsive behavior of the page to confirm that it adjusts
  well to narrow browser widths.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3849909a98f286ffedead029aff5fc2b16a6c76)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 22873: Add comment to explain what disallow_overpayment is for
Kyle M Hall [Mon, 25 Sep 2023 14:11:03 +0000 (10:11 -0400)]
Bug 22873: Add comment to explain what disallow_overpayment is for

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 075876fe0530258eaa22c0a24e7f472896232d9d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34833: (follow-up): remove redundant spaces
Victor Grousset/tuxayo [Mon, 25 Sep 2023 06:47:36 +0000 (08:47 +0200)]
Bug 34833: (follow-up): remove redundant spaces

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dc140bdb2e4837dae5906f0e7e98a35c1ebe81b6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34833: Make "order number" in acq modal translatable
Katrin Fischer [Tue, 19 Sep 2023 19:53:38 +0000 (19:53 +0000)]
Bug 34833: Make "order number" in acq modal translatable

The 'order number' was not translatable when editing the
estimated delivery date or notes from basket summary or
when editing the estimated delivery date from late orders.

To get there:
0. Make sure you have budgets and vendors set up

1. Create a basket (skip this if you already have an open basket)
   1.1. Go to acquisitions
   1.2. Search for a vendor
   1.3. Click New > basket
   1.4. Enter a name for the basket
   1.5. To make the tests easier, choose to create items when : cataloging the record
   1.6. Click save

2. Add an order
   2.1. Click add to basket > From a new (empty) record
   2.2. Fill out the form, minimally
        - Enter a title
        - Enter a quantity
        - Choose a fund
        - Enter a vendor price
   2.3. Click Save

3. Next to the order line, click Edit under Estimated delivery date
4. Verify that the 'order number <ordernumber>' shows on top of the modal
5. Edit internal/vendor note, verify it shows there as well
6. Close basket
7. Go to late orders
8. Edit estimated delivery date, text should show there as well
9. Apply patch
10. Run translation update script
11. Verify the string now appears in po files
12. Translate it
13. Install translation
14. Verify it shows nicely translated in all 3 mentioned spots

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 2b1b7c9ce84683543267816f6e6d351fe3f891d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34511: Typo in manage_staged_records permission description
Caroline Cyr La Rose [Wed, 9 Aug 2023 20:22:39 +0000 (16:22 -0400)]
Bug 34511: Typo in manage_staged_records permission description

This patch corrects a typo in the description of the manage_staged_records permission. All other permission descriptions are in the present tense, but this one is in the past tense.

To test:
0. Apply the patch
1. Go to any patron record
2. Click More > Set permissions
3. Click Show details next to the Use all tools permission
4. Read the description for the manage_staged_records permission, make sure the spelling and grammar are correct

Signed-off-by: hebah <hebah@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 f91db88fcebeaa4b2ed0a58f4e2f2f9d1487178f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34679: Change description for RELTERMS authorized value category
Caroline Cyr La Rose [Thu, 31 Aug 2023 16:40:45 +0000 (12:40 -0400)]
Bug 34679: Change description for RELTERMS authorized value category

This patch changes the description of the RELTERMS authorized value
category to "List of relator codes and terms".

To test:
1. Apply patch
2. Go to Administration > Authorized values
3. Search for category RELTERMS
   --> The description should read "List of relator codes and terms"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8a45084b7f757e131f2cc1aa61b8bce16e0ea34c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34887: Merge with db_dependent Patron.t
Marcel de Rooy [Sat, 23 Sep 2023 07:08:27 +0000 (07:08 +0000)]
Bug 34887: Merge with db_dependent Patron.t

Test plan:
Run t/db_dependent/Koha/Patron.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch: Fixed QA failures
 FAIL   t/db_dependent/Koha/Patron.t
   FAIL   spelling
                 personnal ==> personal
                 personnal ==> personal
                 personnal ==> personal
                 personnal ==> personal
   WARN   tidiness
                The file is less tidy than before (bad/messy lines before: 361, now: 382)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 834365f4b4b2dea6eeb69ca500daea7d057155bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34887: Fix transactions in db dependent Patron.t
Marcel de Rooy [Fri, 22 Sep 2023 14:14:02 +0000 (14:14 +0000)]
Bug 34887: Fix transactions in db dependent Patron.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 53377edcc7351935f8ff8bec838616479d59e358)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34887: Remove Test::DBIx::Class from Patron.t
Marcel de Rooy [Fri, 22 Sep 2023 13:54:31 +0000 (13:54 +0000)]
Bug 34887: Remove Test::DBIx::Class from Patron.t

Moving all tests into one subtest with two underlying
subtests for checking accessors after new or set.
This will make it more easy to merge with the db
dependent counterpart.

Test plan:
Run t/Patron.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 a432dda3f4fc42c47e2ca7e2c68c2206dd5e2b5f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34825: Merge Letters.t into t/db/Letters.t
Marcel de Rooy [Tue, 19 Sep 2023 07:09:54 +0000 (07:09 +0000)]
Bug 34825: Merge Letters.t into t/db/Letters.t

Test plan:
Run t/db_dependent/Letters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5fd831755205fc3b3b7481103fbe2145b421a5ea)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34825: Remove Test::DBIx::Class from Letters.t
Marcel de Rooy [Tue, 19 Sep 2023 06:50:52 +0000 (06:50 +0000)]
Bug 34825: Remove Test::DBIx::Class from Letters.t

Includes a tidy.

Test plan:
Run t/Letters.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 22aee4db67280da3a92713dae93e57737a94b303)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34968: Remove unneeded module from Search.t
Marcel de Rooy [Sat, 30 Sep 2023 06:40:50 +0000 (06:40 +0000)]
Bug 34968: Remove unneeded module from Search.t

Test::DBIx::Class is not even used here.
Just like C4::Biblio.
We should remove TestBuilder too (this is t not t/db)!

Test plan:
Run t/Search.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 23a8497123e9898f48f7e23f1fe8c09158e19d88)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34969: Remove unneeded module from buildQuery.t
Marcel de Rooy [Sat, 30 Sep 2023 06:52:08 +0000 (06:52 +0000)]
Bug 34969: Remove unneeded module from buildQuery.t

Test plan:
Run t/Search/buildQuery.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit af093305b8c936f20c49fa707d5bc58fc9059ba8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t
Marcel de Rooy [Sat, 30 Sep 2023 06:58:23 +0000 (06:58 +0000)]
Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t

There is really no need for all those modules here.
What remains, is just a trivial test.

Test plan:
Run t/SuggestionEngine_AuthorityFile.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 80db256a4700c6a7eec78fe85dade334d8b05bec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34944: Remove the use of event attributes from OPAC full serial issue page
Owen Leonard [Thu, 28 Sep 2023 11:25:02 +0000 (11:25 +0000)]
Bug 34944: Remove the use of event attributes from OPAC full serial issue page

This patch removes the use of event attributes (onclick) from the OPAC's
full serial issues template. These events are defined now along with the
other in-page JS.

To test you must have a serial record with issues from multiple years.

- Locate the serial record and view the detail page.
- Click "More details" at the bottom of the "Subscriptions" tab.
- Click the "Full history" tab.
- Test the "Show year" controls to confirm that clicking each year
  correctly filters the table of issues to show only issues from that
  year.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 10ef1fe67226a09b15a563b04cde6cca266b87ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34912: Add 14 hours to 1970 date in Account(s).t
Marcel de Rooy [Tue, 26 Sep 2023 11:45:58 +0000 (01:45 +1400)]
Bug 34912: Add 14 hours to 1970 date in Account(s).t

This makes those tests pass in whatever timezone.

Test plan:
Do not yet apply patch.
Change timezone on commandline with: export TZ='Etc/GMT-14'
NOTE: GMT-14 is what we also call UTC+14 (sign reversed).
Run prove t/db_dependent/Accounts.t t/db_dependent/Koha/Account.t
This fails now.
Apply patch.
Rerun tests and verify that they pass now.
Bonus: Try some other time zone.

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 8d4b10fc846eb74aa381c809923d13bf258a9752)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34916: Fix wrong borrowernumber in ArticleRequests.t
Marcel de Rooy [Tue, 26 Sep 2023 13:45:35 +0000 (13:45 +0000)]
Bug 34916: Fix wrong borrowernumber in ArticleRequests.t

Simple fix: Send patron to userenv instead of library only.

Test plan:
Do not apply patch.
Remove borrowernumber 51.
Run t/db_dependent/Koha/ArticleRequests.t. (FAIL)
Apply patch, rerun test (PASS)

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 7d93d18548d02b1b634db09356caf18795a6ddbf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set
Lucas Gass [Wed, 27 Sep 2023 21:22:43 +0000 (21:22 +0000)]
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set

1. Find some places in the staff interface where data-flatpickr-enable-time is set to true. Examples: renew.tt or circulation.tt
2. Directly input a date in whatever date format you have specified in DateFormat but omit the hour/minute. Example: 12/12/2023
3. See that the hour/minute default to 00:00 if your TimeFormat is 24hr and 12:00 AM if your time format is 12hr
4. Apply patch, clear browser cache.
5. Try step again, setting a date like '12/12/2023'. The hour:minute should be added as 23:59.
6. With TimeFormat set to 24hr try entering a date with the hour:minute like '12/12/2023 11:22'. The hour:minute should be set to 11:22.
7. With TimeFormat set to 12hr try entering a date with the hour:minute like '12/12/2023 11:22 AM'. The hour:minute should be set to 11:22 AM.
8. Play with this in as many TimeFormat and DateFormat combonatinons as you can.

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
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 ff00e77f466bb217ed6235cec16047da5a620c75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34822: Process real time holds along with indexing
Nick Clemens [Mon, 18 Sep 2023 17:25:15 +0000 (17:25 +0000)]
Bug 34822: Process real time holds along with indexing

Current code already skips indexing when adding record to instead index in a single call. This patch pdates the code to do the same thing for real time holds queue updates.

Note: Newly added records do not need to be updated as they won't have holds yet.

To test:
1 - Have a marc file with several records that match records in your catalog
    You can export part of your catalog to generate one
2 - Set system preference:  RealTimeHoldsQueue to 'enable'
3 - Stage and import file, make sure you are matching and overlaying
4 - Go to Administration->Manage jobs
5 - Note a batch update for each updated record
6 - Apply patch
7 - Repeat
8 - Note a single job added for the entire batch containing only updated records

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 b50d43c14ee19b32c312a2955c888f48235fddc8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34689: Ignore itemnumber when creating item hash
Matt Blenkinsop [Fri, 29 Sep 2023 12:44:11 +0000 (12:44 +0000)]
Bug 34689: Ignore itemnumber when creating item hash

A primary key error can be thrown when an item number is included in a new title hash. We need the item creation to ignore an itemnumber even if it is included in a MARC Framework

Test plan:
1) Edit the MARC framework relating to books (BKS in KTD)
2) In the 952$9 field (Koha itemnumber (autogenerated)), change the value of "Managed in tab" to "items (10)"
3) In the catalog, find a record that uses that MARC framework
4) Click "New" and choose to add a new item
5) Enter a barcode and click the "Add & duplicate" button
6) The page will refresh and an item will have been added
7) Enter a new barcode and click the same button again
8) An error will be thrown
9) Click the back button in the browser
10) Apply patch and restart_all
11) Click the add and duplicate button again
12) This time no error will be thrown and the page will refresh with another new item added
13) Sign off!

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 5b9dbe558f6b9c548786691f29b940e4f2f66b86)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34645: (follow-up) save sort1 and sort2 in order
Nick Clemens [Mon, 25 Sep 2023 13:12:40 +0000 (13:12 +0000)]
Bug 34645: (follow-up) save sort1 and sort2 in order

Signed-off-by: David Nind <david@davidnind.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 9f41a0fb979fabd70c1b1dc8ff6c54454969f818)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34645: always use discount, sort1, and sort2 from MarcFieldsToOrder
Nick Clemens [Mon, 18 Sep 2023 16:32:10 +0000 (16:32 +0000)]
Bug 34645: always use discount, sort1, and sort2 from MarcFieldsToOrder

These values are stored at the order level, not per item. This patch simply sets the order values from the values retrieved from MarcFieldsToOrder even inf MarcItemFields to order is being used for other fields

To test:
Setup -- Set systempreferences below

MarcFieldsToOrder:
price: 949$g
quantity: 949$k
budget_code: 949$l
discount: 949$m
sort1: 949$n
sort2: 949$q

MarcItemFieldsToOrder:
homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
price: 949$g
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l

Stage the attached bib-303.marcxml file
Add to basket from the staged file
Note that discount and sort1 and sort2 are not populated per the Marc
Apply patch, restart all
Stage and add to basket again
Confirm discount and sort1 and sort2 are populated correctly

Signed-off-by: David Nind <david@davidnind.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 f3bf1f3da5f82e9479ac1c39f0a5ab869e7a748c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34911: Test files from HEAD instead of 'master'
Jonathan Druart [Tue, 26 Sep 2023 08:27:57 +0000 (10:27 +0200)]
Bug 34911: Test files from HEAD instead of 'master'

Since bug 34303 the test suite (when ran on jenkins) is no longer testing Perl::Critic

koha_1       | fatal: Not a valid object name master
koha_1       | [14:58:14] t/00-testcritic.t

We are not cloning the whole repo and "master" is not available. Additionally we do not want to test master's files on stable branches anyway...

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7dd57db42932a45e1af9a5bc3f827e1178bec469)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34932: Patron.t - Pass borrowernumber of manager to userenv
Marcel de Rooy [Wed, 27 Sep 2023 12:48:27 +0000 (14:48 +0200)]
Bug 34932: Patron.t - Pass borrowernumber of manager to userenv

Test plan:
Make sure that you do not have borrowr 51.
Run t/db_dependent/Koha/Patron.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ca4da5e17ea7a65a473778f590c2703e8eecf7ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34967: Move to db_dependent
Marcel de Rooy [Fri, 29 Sep 2023 16:02:46 +0000 (16:02 +0000)]
Bug 34967: Move to db_dependent

No further changes.

Test plan:
Run t/db_dependent/Prices.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1628a576c4984c7b18990315d8e7084c4e3fb30d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34967: Add sample biblios and tidy some lines
Marcel de Rooy [Fri, 29 Sep 2023 16:01:13 +0000 (16:01 +0000)]
Bug 34967: Add sample biblios and tidy some lines

Test plan:
Run t/Prices.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e36b873a47dce9f21f19b25e4c617e330f31e1ff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34967: Remove Test::DBIx::Class
Marcel de Rooy [Fri, 29 Sep 2023 15:52:35 +0000 (15:52 +0000)]
Bug 34967: Remove Test::DBIx::Class

Move everything in one subtest

Test plan:
Run t/Prices.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7378865f4e5a8430f54169825e20e4d6c71fb2cd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34801: Fix incorrect use of __() in .tt and .inc files (bug 34038 follow-up)
Matt Blenkinsop [Fri, 15 Sep 2023 10:27:39 +0000 (10:27 +0000)]
Bug 34801: Fix incorrect use of __() in .tt and .inc files (bug 34038 follow-up)

__() should be used in .js files, not .tt files

To test, apply the patch and update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the strings are now in the .po file for translation. You
  should find the lines in the commit

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 3b190d625b378de451dd1ca6d1db636dc5f56741)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34917: Fix default sort column of table in suggestion.tt
Jacob O'Mara [Tue, 26 Sep 2023 14:19:45 +0000 (15:19 +0100)]
Bug 34917: Fix default sort column of table in suggestion.tt

Test plan:
1. Navigate to Acquisitions and load the suggestions management page
2. Ensure that there are some suggestions in the table
3. Observe that the default sort is on the "Suggester Category" column
4. Apply Patch
5. Observe that the default sort is now on the "Suggested on" column
   instead

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 20524530c8308ea44e27c44d7e75861b0b923cae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34942: Fix typo - 'brower' to 'browser'
David Nind [Sat, 30 Sep 2023 09:03:06 +0000 (09:03 +0000)]
Bug 34942: Fix typo - 'brower' to 'browser'

This fixes a typo in a message used in the advanced cataloguing
editor when macros are converted from being stored in the browser to
being stored in the database (bug 17268 - Advanced cataloging editor
- rancor - macros are lost when browser storage cleared).

Test plan:
1. Search for 'brower' in the codebase - there should be one occurance:
   grep -rn --exclude=*.po brower *
2. Apply the patch.
3. Run the search in step 1 again, there should now be no occurances.
4. Review the diff for the patch a nd make sure that the change makes
   sense.
5. Sign off! 8-)

Signed-off-by: David Nind <david@davidnind.com>
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 7ec0a8ae60190c1d2baf716bb4c922ded0ef24b7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34918: Fix userenv for safe_to_delete tests
Marcel de Rooy [Wed, 27 Sep 2023 10:43:04 +0000 (10:43 +0000)]
Bug 34918: Fix userenv for safe_to_delete tests

Instead of the fallback to 51, we pass a borrower that has
permission for editing items.

Test plan:
Do not apply patch.
Run test without a borrower 51 in db. (FAIL)
Apply patch.
Run test again. (PASS)

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 f8233f44a5e4871be38d9b850d97166dcf99c981)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34918: Fix hardcoded borrowernumber 42
Marcel de Rooy [Tue, 26 Sep 2023 14:42:08 +0000 (14:42 +0000)]
Bug 34918: Fix hardcoded borrowernumber 42

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

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 3298b2798520b9e9d7d37848739dc0b24b5f2e0d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34930: Change timezone in Koha/Object.t where tests assume it
Marcel de Rooy [Wed, 27 Sep 2023 11:57:49 +0000 (13:57 +0200)]
Bug 34930: Change timezone in Koha/Object.t where tests assume it

This is the case for subtest: attributes_from_api() tests.

Test plan:
export TZ='Europe/Amsterdam'
prove t/db_dependent/Koha/Object.t

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 0fb84e424e005179480faddb5d7d646bb594ea7b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34489: Fix timezone problem in Patrons.t
Marcel de Rooy [Wed, 27 Sep 2023 12:13:45 +0000 (14:13 +0200)]
Bug 34489: Fix timezone problem in Patrons.t

See also bug 34930. Using same approach.

Test plan:
export TZ='Europe/Amsterdam'
prove t/db_dependent/Koha/Patrons.t

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 6109a41ca607f826bb7bce5083009c74139d898a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34934: Remove the use of event attributes from OPAC lists page
Owen Leonard [Wed, 27 Sep 2023 15:42:26 +0000 (15:42 +0000)]
Bug 34934: Remove the use of event attributes from OPAC lists page

This patch removes the use of event attributes (onclick, onchange) from
the OPAC lists template. These events are defined now along with the
other in-page JS.

The patch also removes a "delete list" button which was only shown
when viewing an empty list and which was redundant.

To test, apply the patch and log into the OPAC.

- Go to Lists -> New list.
- Change the category to "Private" and the "Allow changes" dropdown to
  "Staff only."
  - You should see a message, 'The "Staff only" permission has no actual
    effect while this list is strictly private'
- Change the category to "Public." The message should disappear.

- View the contents of a list.
  - Click the "Send list" button at the top of the table of titles.
  - It should trigger the "Sending your list" popup window.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 56348379ec35bbccbb54e205cc180cc0bd4f9297)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34936: Remove the use of event attributes from OPAC detail page
Owen Leonard [Wed, 27 Sep 2023 16:26:03 +0000 (16:26 +0000)]
Bug 34936: Remove the use of event attributes from OPAC detail page

This patch removes the use of event attributes (onclick) from the OPAC's
bibliographic detail page template. These events are defined now along
with the other in-page JS.

The patch also adjusts the global "Dopop" function so that the popup
window is a litte bigger. The comments form did not fit well.

In checking for use of the "Dopop" function I found that it was being
redefined in opac-topissues.tt for no reason so I removed it.

To test you must have the OPACComments system preference enabled.

- Log in to the OPAC, locate a bibliographic record, and view the detail
  page.
- Under the "Comments" tab, click the "Post your comments on this title"
  link. It should trigger a popup window.
  - Submit your comment. When the detail page reloads, return to the
    "Comments" tab and click the "Edit" link on your comment. The same
    popup window should be triggered.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f03cf6cc108022a05d036d4c197760203d31468b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34836: Add patron check to isbd and marc detail pages
Pedro Amorim [Mon, 25 Sep 2023 10:21:36 +0000 (10:21 +0000)]
Bug 34836: Add patron check to isbd and marc detail pages

Test plan:
- Go to circulation rules and set On shelf holds allowed to If all unavailable
- Log out
- Visit a MARC detail or ISBD detail bib record on OPAC:
http://localhost:8080/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=76
http://localhost:8080/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=76
- Notice it blows up with error 500, on both occasions
- Apply patch. Repeat.

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 4fadf73a95f82ca7abd3d27f490a51825949f7b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 30843: Add unit test for Koha::Auth::TwoFactorAuth::verify
David Cook [Fri, 8 Sep 2023 01:53:38 +0000 (01:53 +0000)]
Bug 30843: Add unit test for Koha::Auth::TwoFactorAuth::verify

This change adds a unit test to test Koha::Auth::TwoFactorAuth::verify

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7ac91b24cfb49e094a1d13008bd0efda0b63e288)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 30843: Add mfa_range configuration option for TOTP
David Cook [Wed, 6 Sep 2023 05:12:50 +0000 (05:12 +0000)]
Bug 30843: Add mfa_range configuration option for TOTP

This change adds a mfa_range configuration option for TOTP
to koha-conf.xml, and overrides the "verify" method from
Auth::GoogleAuth in order to provide a new default for "range"

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=TwoFactorAuthentication
3. Change the syspref to "Enable"
4. Go to
http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51
5. Click "More" and "Manage two-factor authentication"
6. Register using an app
7. In an Incognito window, go to
http://localhost:8081/cgi-bin/koha/mainpage.pl
8. Sign in with the "koha" user
9. Note down a code from your Authenticator app
10. Wait until after 60 seconds and try it
11. Note it says "Invalid two-factor code"
12. Try a new code from the app
13. Note that it works

14. Add <mfa_range>10</mfa_range> to /etc/koha/sites/kohadev/koha-conf.xml
15. Clear memcached and koha-plack --restart kohadev
16. Sign in with the "koha" user
17. Note down a code from your Authenticator app
18. Wait 4 minutes and then try it
19. Note that it works

20. Disable your two-factor authentication and click to re-enable it
21. Use a code older than 60 seconds when registering for the two
factor authentication
22. Note that the code works

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6a0955946e06354ecd05f714057a878794314155)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34446: (QA follow-up) Add colons on delete confirm page
Katrin Fischer [Thu, 21 Sep 2023 21:37:08 +0000 (21:37 +0000)]
Bug 34446: (QA follow-up) Add colons on delete confirm page

This adds the missing colon on the 'confirm deletion' page.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f4ee7f2bb9bedfbe24073d0385cfcc67726b8054)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34446: Added missing colon to Can be guarantee
Laura Escamilla [Thu, 21 Sep 2023 20:59:13 +0000 (20:59 +0000)]
Bug 34446: Added missing colon to Can be guarantee

To test:

1. Go to Administration > patron categories and edit or create a new category. Notice that “Can be guarantee” does not have a colon.
2. Apply patch and refresh the page.
3. Can be guarantee now has a colon — yay!
4. Sign off and have a great day. :)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f9a4097200fdc9762593b674b4bf70bb76d33d53)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34885: Improve confusing pref description for OPACHoldsIfAvailableAtPickup
Marcel de Rooy [Fri, 22 Sep 2023 13:07:51 +0000 (13:07 +0000)]
Bug 34885: Improve confusing pref description for OPACHoldsIfAvailableAtPickup

Changes pref description and sysprefs.sql.
The change is not important enough for a dbrev.

Test plan:
Look at the changed text in Systempreferences.

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 1a398c5e9dab3a31d827ab7980899e0366353a37)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34804: Fix translations
Matt Blenkinsop [Fri, 15 Sep 2023 15:51:34 +0000 (15:51 +0000)]
Bug 34804: Fix translations

This patch fixes some translations in the ERM module

Translations should be wrapped in this.$__()

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7c736793cba2e763cca2dca1528e57a835bda817)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34781: Add a span tag in opac-memberentry
Marcel de Rooy [Wed, 13 Sep 2023 11:29:17 +0000 (11:29 +0000)]
Bug 34781: Add a span tag in opac-memberentry

Test plan:
Enable self registration and GDPR consent (privacy policy).
Look at selfreg page on OPAC. Scroll to bottom.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3db74c80866cb9252d13885d2cc09566e9c5a22c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34794: Fix typo in recalls_to_pull.tt
Matt Blenkinsop [Thu, 14 Sep 2023 15:17:54 +0000 (15:17 +0000)]
Bug 34794: Fix typo in recalls_to_pull.tt

Fixed typo - it's v its

Test plan:
Look at the bug patch and confirm the change is correct

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b385a2c36f433bc9fe1a2b5c6896eca28aae447)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34716: Fix typo
Matt Blenkinsop [Tue, 5 Sep 2023 13:40:07 +0000 (13:40 +0000)]
Bug 34716: Fix typo

Fixes a typo where "it's" should be "its"

Test plan:
1) Check the commit and observe that the change has been made correctly

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 b5540d8c949a2ea3f7e95667821e2a1668a58e18)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 months agoBug 34443: Spelling: Patron search pop-up Sort1: should be Sort 1
Owen Leonard [Fri, 8 Sep 2023 15:44:33 +0000 (15:44 +0000)]
Bug 34443: Spelling: Patron search pop-up Sort1: should be Sort 1

This patch instances of "Sort1" and "Sort2" being used
as labels in the interface, replacing the strings with "Sort 1" and
"Sort 2"

To test, apply the patch and test this page:

With the borrowerRelationship system preference populated, edit a
child record and click the "Add guarantor" button. There are two
fields in the form with the updated labels.

Signed-off-by: Laura Escamilla <laura.escamilla@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 93d4defeda79349d57be209bfb8fa4132cae3b77)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoUpdate release notes for 23.05.04 release v23.05.04
Fridolin Somers [Thu, 28 Sep 2023 18:42:43 +0000 (08:42 -1000)]
Update release notes for 23.05.04 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoIncrement version for 23.05.04 release
Fridolin Somers [Thu, 28 Sep 2023 18:06:57 +0000 (08:06 -1000)]
Increment version for 23.05.04 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoTranslation fixes for Koha 23.05.04
Fridolin Somers [Fri, 28 Jul 2023 21:08:22 +0000 (11:08 -1000)]
Translation fixes for Koha 23.05.04

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoMerge remote-tracking branch 'translate/23.05.04-translate-20230928' into 23.05.x...
Fridolin Somers [Thu, 28 Sep 2023 18:02:07 +0000 (08:02 -1000)]
Merge remote-tracking branch 'translate/23.05.04-translate-20230928' into 23.05.x-security

13 months agoTranslation updates for Koha 23.05.04
Koha translators [Thu, 28 Sep 2023 17:59:05 +0000 (14:59 -0300)]
Translation updates for Koha 23.05.04

13 months agoBug 34369: Fix 'Did you mean'
Jonathan Druart [Thu, 3 Aug 2023 08:01:32 +0000 (10:01 +0200)]
Bug 34369: Fix 'Did you mean'

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 ea91896f1531f2c042897849cf313e18aaa5bd64)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34369: Pass csrf token from syspref API client (for Vue app)
Jonathan Druart [Tue, 1 Aug 2023 07:12:10 +0000 (09:12 +0200)]
Bug 34369: Pass csrf token from syspref API client (for Vue app)

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 3c6dd02acbfc021c85b23e38d1ef605e09e65764)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34369: Require CSRF token for updating system preferences
David Cook [Tue, 1 Aug 2023 06:56:23 +0000 (06:56 +0000)]
Bug 34369: Require CSRF token for updating system preferences

This patch adds the requirements that updating a system preference
requires a CSRF token. (Also, adding and deleting local system preferences.)

0. Apply patch
1. koha-plack --reload kohadev
2. Add local system preference
3. Update local system preference
4. Delete local system preference
5. Update normal system preference
6. Note no errors

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 c6ef2aba6bf93b3f17b57b384859edee54f99a72)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34761: Prevent XSS for searches and saved search filters
David Cook [Wed, 13 Sep 2023 01:33:43 +0000 (01:33 +0000)]
Bug 34761: Prevent XSS for searches and saved search filters

</script> tags are interpreted in JSON strings as HTML, which can
lead to XSS attacks.

This patch puts HTML escaped JSON in the value of a hidden HTML element.
The Javascript then takes the value as a string, parses it as JSON,
and is able to use it to save search filters without triggering a
XSS attack.

This patch also adds DataTable's built-in HTML escaping for the query
and limits on the admin UI for the search filters.

Test plan:
0. Apply patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=SavedSearchFilters
2. Enable the system preference
3. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=e
4. Click "Save search as filter"
5. Checkbox "Show in staff interface?"
6. Type "E-TEST" into box and click 'Save'
7. Go to
http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=e
8. Click "E-TEST" under "Custom search filters"
9. Note that you see search results
10. Go to
http://localhost:8081/cgi-bin/koha/admin/search_filters.pl
11. Note that for "E-TEST" you see a "Query" like
{"operators":[],"operands":["e"],"indexes":[]}
12. Note that for "E-TEST" you see a "Limits" like
{"limits":[]}

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 4e32b761986f5de28df4f1125b5d16c6c2f24306)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34349: Validate/escape inputs for task scheduler
David Cook [Mon, 24 Jul 2023 04:31:15 +0000 (04:31 +0000)]
Bug 34349: Validate/escape inputs for task scheduler

This change validates and escapes inputs for task scheduler.

Test plan:
0. Apply patch
1. koha-plack --reload kohadev
2. Go to http://localhost:8081/cgi-bin/koha/tools/scheduler.pl
3. Input a time a minute in the future and leave the date blank
4. Choose an existing report and output format
5. Type a malicious string which is also a valid email address
into the Email field
6. Click "Save"
7. Note that the job is added but the Email is wrapped in single
quotes
8. Try using a non-malicious email address with a single quote.
9. Note that the single quote is escaped, so that it will still
be used by runreport.pl

JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed pars for $email =~ regex, removed old commented lines.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dcd698a4b4ed7f3a714ef35fe83c007fce9d52ae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34513: (QA follow-up) Tidy
Nick Clemens [Thu, 24 Aug 2023 18:19:37 +0000 (18:19 +0000)]
Bug 34513: (QA follow-up) Tidy

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 332b95b2507184e20cd70ddfb16c6f5a260d6dc0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34513: Add checkauth unit test for resetting auth state when changing users
David Cook [Wed, 16 Aug 2023 02:51:43 +0000 (02:51 +0000)]
Bug 34513: Add checkauth unit test for resetting auth state when changing users

Signed-off-by: Nick Clemens <nick@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 abbbc5924de287a73c7d91c0f8ab70f8d7461508)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34513: Add end-to-end test for authorization check after first failed authorization
David Cook [Wed, 16 Aug 2023 02:21:40 +0000 (02:21 +0000)]
Bug 34513: Add end-to-end test for authorization check after first failed authorization

Signed-off-by: Nick Clemens <nick@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 bb581fe78be9dacb9215366f3a54ab9b640f783f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34513: Set auth state correctly when changing auth sessions
David Cook [Fri, 11 Aug 2023 03:03:01 +0000 (03:03 +0000)]
Bug 34513: Set auth state correctly when changing auth sessions

This patch sets the $auth_state to failed when changing auth sessions,
so that the new login attempt gets processed correctly (instead
of skipping the authorization step).

Test plan:
0. Apply the patch
1. koha-plack --reload kohadev
2. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=baseurl
3. Log in as an OPAC user with 0 permissions
4. Note the auth screen "Error: You do not have permission to access this page"
5. Click "Log in"
6. Note that you're still shown a login screen (and that you've been logged out of
your previous authenticated session)

Signed-off-by: Nick Clemens <nick@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 16da12cbbc200d9ef07a87ee7f9bdf8e61ae06f3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34653: Make koha-foreach return the correct status code
Evan Giles [Fri, 1 Sep 2023 06:42:45 +0000 (18:42 +1200)]
Bug 34653: Make koha-foreach return the correct status code

I think the correct behavior for this script should be that koha-foreach
will return 0 (success) if all the commands it tried to run succeeded, but
1 (failure) if any of the commands failed.

To test:
1. $ koha-create --create-db test
2. $ vi test.sh
if [ $USER = 'kohadev-koha' ]; then
    echo "FAILED";
    exit 1;
else
    echo "SUCCESS";
    exit 0;
fi

3. $ debian/scripts/koha-foreach sh test.sh
FAILED
kohadev: 1 status returned by "sh test.sh"
SUCCESS
4. $ echo $?
5. Note that the exit status is 0 (success)

6. Apply patch

7. $ debian/scripts/koha-foreach sh test.sh
FAILED
kohadev: 1 status returned by "sh test.sh"
SUCCESS
8. $ echo $?
9. Note that the exit status is 1 (failure)

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 d9849aaa3aa777072c846526c772a896b5424cfb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34748: DBRev 23.05.03.005
Tomas Cohen Arazi [Mon, 25 Sep 2023 13:14:08 +0000 (10:14 -0300)]
Bug 34748: DBRev 23.05.03.005

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a06396c2826c604fc9dfe79c22256b6d69edc415)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34748: Fix column name in columns configuration for basket table
Katrin Fischer [Tue, 19 Sep 2023 21:33:00 +0000 (21:33 +0000)]
Bug 34748: Fix column name in columns configuration for basket table

The first column was named basket_number, but it's actually the
order_line.

To test:
* Edit column configuration for acquisition > basket
* Make sure to set at least one checkbox for 'basket_number'
* Apply patch, run database update
* Verify that the first column is now 'order_line', but your
  settings have been preserved

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 f9f9c3a7faeba4a36e233d867019dad495a09c25)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 21828: build $bib_heading_fields only once per invocation
Andreas Roussos [Tue, 1 Aug 2023 18:49:55 +0000 (20:49 +0200)]
Bug 21828: build $bib_heading_fields only once per invocation

In UNIMARC instances, the run time of link_bibs_to_authorities.pl
can be reduced by up to 80% and the number of DBI calls
can be reduced by up to 90% with a very simple fix that
optimises the constructor of the C4::Heading::UNIMARC object.

Currently, the constructor resets the $bib_heading_fields hash
*in each invocation* (i.e. for every field the bibliographic
record contains), then populating it again with the results
fetched from the database! This is inefficient.

The patch/fix is trivial: we take advantage of the fact that
$bib_heading_fields is declared at the top of the
C4::Heading::UNIMARC module and is thus a package variable
that is in scope for the entire execution of the program
(more info here: https://stackoverflow.com/q/75317862).

Placing the section that generates the $bib_heading_fields
hash inside a "unless ( defined $bib_heading_fields )" code
block is enough to cause a significant reduction in the
number of "expensive" SQL SELECT queries that must be run.

Test plan:

0) Have a UNIMARC instance with some sample data (the KTD one
   will do just fine for this experiment).

1) Run the following commands:

    $ ktd --shell
   k$ DBI_PROFILE=1 ./misc/link_bibs_to_authorities.pl -t

   Observe the output from the script and the DBI profiling info.
   [You may want to play with different DBI_PROFILE levels (such as
   2, 4, 6, 8, etc.) to see what's going on under the hood DBI-wise,
   for reference see: https://metacpan.org/pod/DBI::Profile]

2) Apply this patch.

3) Rerun the script from step 1), it should run a lot faster!

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 fe18b0569298502dc20ca1322d919baab5526281)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34302: (bug 28653 follow-up) Do not refresh the table if an error happened
Jonathan Druart [Thu, 27 Jul 2023 13:01:24 +0000 (15:01 +0200)]
Bug 34302: (bug 28653 follow-up) Do not refresh the table if an error happened

If checkin or renew failed, we should not refresh the table or it will
hide the error message.

Test plan:
Apply the DO NOT PUSH patch
Do a renew
=> No error in the table
Apply this patch
Do a renew
=> You see the error
Revert the DO NOT PUSH patch
Do a renew
=> The table is refreshed

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 7d80a1df25a1c4e726bcf148e1c2432ea8c9a007)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34835: Highlight logged-in library in patron searches fix for new staff interface
Fridolin Somers [Tue, 19 Sep 2023 22:20:43 +0000 (12:20 -1000)]
Bug 34835: Highlight logged-in library in patron searches fix for new staff interface

Since Bug 30952 the feature from Bug 10902 does not work anymore.
The class "currentlibrary" is there but no background color in CSS.
Bug 30952 removed it :
-    background-color: #E6FCB7;

This patch restores this rule plus '!important' that is used by
class 'ac-currentlibrary'

Test plan:
1) Perform a patrons search
2) Check you see green background color for patrons with same branch as
   currently logged in.

Signed-off-by: David Nind <david@davidnind.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 9f59ea2f61a4660a9e1f5c27a2ecca33bea89b0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34720: DBRev 23.05.03.004
Tomas Cohen Arazi [Fri, 22 Sep 2023 14:13:44 +0000 (11:13 -0300)]
Bug 34720: DBRev 23.05.03.004

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2ff3b14e935f4ebe016ab4b1924c6cfb11064b4b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34720: Say if syspref has been inserted
Jonathan Druart [Fri, 22 Sep 2023 06:30:35 +0000 (08:30 +0200)]
Bug 34720: Say if syspref has been inserted

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 cd79c78dbdbddb6b4de548b79975bc68828c4169)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34720: Fix bug 30403 atomic update
Emmi Takkinen [Thu, 21 Sep 2023 08:49:12 +0000 (11:49 +0300)]
Bug 34720: Fix bug 30403 atomic update

Bug 30403 had wrong syspref name in its
atomic update file. This patch fixes this in
db_rev 221200018.pl and adds new atomic
update file.

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 d91ea53e901a5bacfb42aa3923e37186cb41c877)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34848: (QA follow-up) Resolve warn on useless constant
Marcel de Rooy [Fri, 22 Sep 2023 08:51:59 +0000 (08:51 +0000)]
Bug 34848: (QA follow-up) Resolve warn on useless constant

Useless use of a constant ("Dies if sip user cannot be found") in void context at t/db_dependent/SIP/Message.t line 582.

We should remove the comma..

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b07842d243bd45b0c11fa7b4d0b02c0589ee44fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34848: Fix SIP/Message.t if DB has been upgraded
Jonathan Druart [Wed, 20 Sep 2023 14:00:08 +0000 (16:00 +0200)]
Bug 34848: Fix SIP/Message.t if DB has been upgraded

There were a lot of failures (in the context of bug 34841)

t/db_dependent/SIP/Message.t .. 2/16
    #   Failed test 'Found AH field as timestamp in response'
    #   at t/db_dependent/SIP/Message.t line 820.

    #   Failed test 'Found AH field as SQL date in response'
    #   at t/db_dependent/SIP/Message.t line 825.
    # Looks like you failed 2 tests of 8.
t/db_dependent/SIP/Message.t .. 3/16

    #   Failed test 'Desensitize flag was set for patron category not in inhouse_patron_categories'
    #   at t/db_dependent/SIP/Message.t line 1133.
    #          got: 'N'
    #     expected: 'Y'

    #   Failed test 'Desensitize flag was set for empty inhouse_patron_categories'
    #   at t/db_dependent/SIP/Message.t line 1139.
    #          got: 'N'
    #     expected: 'Y'

Because renewalsallowed is 0 for upgraded DB, when it's 5 for new
install.

We need to set the value.

This patch also adds some missing transaction

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 4fd7857e3fcc0314aba2fe851082e6e125a16650)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34843: DBRev 23.05.03.003
Tomas Cohen Arazi [Fri, 22 Sep 2023 14:12:00 +0000 (11:12 -0300)]
Bug 34843: DBRev 23.05.03.003

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aea9fce4b0320fa57bc729042286c655580735e3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34843: Fix database comment inconsistency on toc_request
Marcel de Rooy [Fri, 22 Sep 2023 07:33:57 +0000 (07:33 +0000)]
Bug 34843: Fix database comment inconsistency on toc_request

Bug 29093 had a dbrev without comment, but added comment to
kohastructure.

Test plan:
Check (or remove) comment on article_requests.toc_request.
Run dbrev.
Check if comment was added (if you removed).
Run t/db/Koha/Database/Commenter.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f809c272af42864b48d2d650ba5ddd0cf03d6b06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34054: Allow to embed biblio on GET /items
Jonathan Druart [Tue, 25 Apr 2023 10:06:07 +0000 (12:06 +0200)]
Bug 34054: Allow to embed biblio on GET /items

Test plan:
Request the /items REST API endpoint and ask for the biblio's info to be
embeded into the response passing x-koha-embed

curl -u koha:koha --request GET 'http://localhost:8081/api/v1/items' --header "x-koha-embed: biblio" --header "Content-Type: application/json"

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9afc411a150ab5bdf9337d73e82b2ac39e851e91)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34054: Add tests
Jonathan Druart [Mon, 19 Jun 2023 07:49:08 +0000 (09:49 +0200)]
Bug 34054: Add tests

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bd0380c272e83f7da60f24ab7205a65a693cab7d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34846: Fix SIP/ILS.t if DB has been upgraded
Jonathan Druart [Wed, 20 Sep 2023 14:13:40 +0000 (16:13 +0200)]
Bug 34846: Fix SIP/ILS.t if DB has been upgraded

t/db_dependent/SIP/ILS.t .. 12/15
    #   Failed test 'Renewal succeeded'
    #   at t/db_dependent/SIP/ILS.t line 346.
    #          got: '0'
    #     expected: '1'
    # Looks like you failed 1 test of 2.
t/db_dependent/SIP/ILS.t .. 15/15
 #   Failed test 'renew'
 #   at t/db_dependent/SIP/ILS.t line 348.
 # Looks like you failed 1 test of 15.

Because renewalsallowed is 0 for upgraded DB, when it's 5 for new
install.

We need to set the value.

Test plan:
perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only

prove t/db_dependent/SIP/ILS.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 5f55775f402d4f4b56ab82426588b202d6f327ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34844: DBRev 23.05.03.002
Tomas Cohen Arazi [Fri, 22 Sep 2023 13:43:50 +0000 (10:43 -0300)]
Bug 34844: DBRev 23.05.03.002

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aacbadb22f21dbb427e62ee2a2b6bb2da54012a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34844: Add db update file
Kyle M Hall [Thu, 21 Sep 2023 12:55:50 +0000 (08:55 -0400)]
Bug 34844: Add db update file

JD amended patch: tidy

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 7b46b319980cd236e85e75c88e8a1428e1bb8bbb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34844: Add manage_item_editor_templates to userpermissions.sql
Kyle M Hall [Wed, 20 Sep 2023 13:31:47 +0000 (09:31 -0400)]
Bug 34844: Add manage_item_editor_templates to userpermissions.sql

Test Plan:
1) perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only; prove t/Koha/Auth/Permissions.t
2) Note failure
3) Apply this patch
4) perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only; prove t/Koha/Auth/Permissions.t
5) Tests pass!

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 5d2f3ffe7d2dfb796a4ec7e0b4503a3266f3ee80)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34847: Fix t/db_dependent/Search.t
Jonathan Druart [Fri, 22 Sep 2023 12:33:31 +0000 (14:33 +0200)]
Bug 34847: Fix t/db_dependent/Search.t

If 01e still exists then the test will fail with
Truncated incorrect DECIMAL value: '01e' at t/db_dependent/Search.t line 945

Test plan:
% perl /kohadevbox/misc4dev/run_tests.pl --run-db-upgrade-only
% prove t/db_dependent/Search.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 ca3243d00ff094c86fcd02406543b6b3d06627ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34880: (follow-up) Make condition more specific
Katrin Fischer [Fri, 22 Sep 2023 08:53:23 +0000 (08:53 +0000)]
Bug 34880: (follow-up) Make condition more specific

To test (applies to both patches):

* Add a new basket as 'standing order' and with 'items created in cataloguing'
* Create an order line
* Receive shipment and create an invoice
* Receive your order
* Verify:
  * Quantity ordered: 1
  * Quantity received: 1 (pre-filled)
  * No item form on the right
* Confirm
* Receive error:
  Order X: No quantity to receive set. No items will be created.
* Verify no receive was processed (received orders remains empty)
* Apply patch
* Verify receive works as expected

Other possible combinations to test:

* Standing order, items on receive
* Standing order, items on order (no items are created)
* Standing order + order from subscription + any item setting (no items are created)
* No standing order + items in cataloguing
* No standing order + items on receive
* No standing order + items on order
* No standing oder + order from subscription + all item settings (no items are created)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e28ea9c4af380cae9b29b56ebe03ab0f244d2c47)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34880: Fix order receive for standing orders
Jonathan Druart [Fri, 22 Sep 2023 08:25:38 +0000 (10:25 +0200)]
Bug 34880: Fix order receive for standing orders

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9dd6fa2d8d015b16a60bb1f1cc6bda8dba3ce662)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34730: Add responsive behavior to more tables in the OPAC
Owen Leonard [Tue, 12 Sep 2023 14:52:30 +0000 (14:52 +0000)]
Bug 34730: Add responsive behavior to more tables in the OPAC

This patch adds responsiveness to several DataTables which were not
updated in 32341. The patch removes the CSS-based responsive styling
which was previously used for these tables.

This patch also adds some additional configuration to the tables on the
user home page so that the title column is always prioritized when
DataTables collapses columns in narrow views.

To test, apply the patch and rebuild the OPAC CSS. Ideally this should
be tested with a user who has checkouts, overdues, holds, tags, and a
checkout history.

- Log in to the OPAC and test the user summary page. Check that each
  table adjusts well to narrow browser widths. In each case the column
  containing the title should never be hidden no matter how narrow the
  window:
  - Checkouts
  - Relatives' checkouts (requires that the user is a guarantor for a
    patron with checkouts and that the guarantee's account is set up to
    show checkouts to the guarantor).
  - Overdues
  - Holds
  - Article requests

The new places the responsive DataTables extension is being used:

- Checkout history
- Suggestions
- Tags (in the table of user-submitted tags)
- Most popular

Again, in each case the table should be responsive and the title column
should be prioritized so that it doesn't get hidden at narrow page
widths.

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 266194321453d096a1fd1a9f80195dfb77ad5258)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34760: Confirm session ID is set to save OPAC search history to logged in user
Aleisha Amohia [Mon, 11 Sep 2023 20:47:34 +0000 (20:47 +0000)]
Bug 34760: Confirm session ID is set to save OPAC search history to logged in user

This patch confirms that a session ID has been set before trying to save search history to a logged in user on the OPAC.

This depends on EnableOpacSearchHistory system preference being enabled.

Apply the patch and test that you don't see an Error 500 page at any point through this plan:

1. Do an OPAC search, ensure you are not logged in
2. Confirm your search was saved to search history
3. Do another search, then log in
4. Confirm you are brought back to the search results after logging in
5. Confirm all search history from the session is visible

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: Salah Ghedda <salah.ghedda@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 e7707b768ba50f2128e8efc50378ec3117962a60)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 33734: Remove incorrect URL escaping on search filters
David Cook [Wed, 13 Sep 2023 02:25:13 +0000 (02:25 +0000)]
Bug 33734: Remove incorrect URL escaping on search filters

This patch removes an incorrect URL escaping on search filter
facet URLs.

Without this patch, search filters using non-ASCII characters won't
return results.

To test:
0. Apply patch
1. Enable SavedSearchFilters syspref
2. Search for "the"
3. Save as search filter (to show on both OPAC and staff interface)
4. Search for "ü" in staff interface
5. Apply the "the" filter
6. Note that search results appear
7. Search for "ü" in OPAC
8. Apply the "the" filter
9. Note that search results appear

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 51e602e61cc5dc46188aa298f276e6410678fdf7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34732: (QA follow-up): tidy up code
Victor Grousset/tuxayo [Fri, 15 Sep 2023 18:36:38 +0000 (20:36 +0200)]
Bug 34732: (QA follow-up): tidy up code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 703ecab2c6911175f673565249d7c0c6f13bbe56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34732: For Code39, append or prepend asterisk if missing from barcode
David Cook [Fri, 8 Sep 2023 02:19:20 +0000 (02:19 +0000)]
Bug 34732: For Code39, append or prepend asterisk if missing from barcode

This patch appends or prepends an asterisk on Code39 barcodes if
they are missing from the input. This is so that they form correct
Code39 barcode images.

Test plan:
0. Apply the patch
1. koha-plack --reload kohadev
2. Go to http://localhost:8081/cgi-bin/koha/labels/barcode-print.pl
3. Type 39999000001310 into "Barcode" and click "Show barcode"
4. Note that the barcode text on the right includes asterisks around it
5. Type *39999000001310 into "Barcode" and click "Show barcode"
6. Note the same as above
7. Type 39999000001310* into "Barcode" and click "Show barcode"
8. Note the same as above
9. Type *39999000001310* into "Barcode" and click "Show barcode"
10. Note the same as above

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0f888f48fa0f839aa62eda7a457ed5c6f50c5a8a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 34622: Fix store default query
Pedro Amorim [Fri, 25 Aug 2023 16:26:10 +0000 (16:26 +0000)]
Bug 34622: Fix store default query

Exclude self smtp server from all the servers being updated to not default if self is_default

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6d54d2419f98d7d473c0a0ef888aea00be5f9eb7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 32942: (follow-up) Restore missing statuses
Martin Renvoize [Tue, 19 Sep 2023 15:37:08 +0000 (16:37 +0100)]
Bug 32942: (follow-up) Restore missing statuses

At some stage we lost some of the core statuses. This patch simply
adds them back into the list.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4e33042105435078222aab1b72a1e7a1d0a8ff56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 32942: (follow-up) Fix typo
Martin Renvoize [Tue, 19 Sep 2023 15:23:29 +0000 (16:23 +0100)]
Bug 32942: (follow-up) Fix typo

Spelling typo fix

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 07a602d995db1aec4067a47116cfa5d91800747f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 32942: (follow-up) Fix test
Martin Renvoize [Tue, 19 Sep 2023 15:19:53 +0000 (16:19 +0100)]
Bug 32942: (follow-up) Fix test

I missed a test case when doing follow-ups before.. this patch catches
that case and create the required authorized value to allow
ModSuggestion to succeed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 078e98a7a35d6e5f598c51cd7c94b917f68128d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 32942: (QA follow-up) Fix regression test
Martin Renvoize [Mon, 18 Sep 2023 11:59:50 +0000 (12:59 +0100)]
Bug 32942: (QA follow-up) Fix regression test

With the move to checking status during store, we broke the api
regression test introduced earlier in the patch set.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8eb27c40e6fd771e8d4c2bff28cc1a45838af712)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 32942: (QA follow-up) Moving Suggestion->STATUS check to Suggestion::store
Arthur Suzuki [Fri, 18 Aug 2023 11:16:53 +0000 (13:16 +0200)]
Bug 32942: (QA follow-up) Moving Suggestion->STATUS check to Suggestion::store

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 40ca7aa06c166b005fda5b6ff38f4cbf20b3d081)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 32942: (QA follow-up) Add tests for STATUS checking in Suggestion::store
Arthur Suzuki [Fri, 18 Aug 2023 11:11:45 +0000 (13:11 +0200)]
Bug 32942: (QA follow-up) Add tests for STATUS checking in Suggestion::store

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 672e8a9d715d144812329aeb07cea5c915c50377)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 32942: (QA follow-up) Document possible values
Tomas Cohen Arazi [Mon, 13 Feb 2023 18:11:17 +0000 (15:11 -0300)]
Bug 32942: (QA follow-up) Document possible values

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 54c8aa9471e83b380e455dafe2e8cbf208cb6f36)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
13 months agoBug 32942: Suggestion API route when non 'standard' status are present
Frédéric Demians [Fri, 10 Feb 2023 17:23:11 +0000 (18:23 +0100)]
Bug 32942: Suggestion API route when non 'standard' status are present

The API route for listing all suggestion:

/api/v1/suggestions

send back an error message when there is a suugestion with non standard
status (ASKED, CHECKED, ACCEPTED, REJECTED).

This patch fixes this too restrictive restriction.

TO TEST:

1. Add a status in SUGGEST_STATUS AV list.
2. Create a suggestion, and assign it to the previsous status.
3. Call /api/v1/suggestion
3. You get an error message:
   {
    "errors": [ {
      "message":"Not in enum list: ASKED, CHECKED, ACCEPTED, REJECTED.",
      "path":"\/1\/status"
    }],
    "status":200
   }
4. Apply the patch. Call /api/v1/suggestion

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3dc9bf900bd666eb17272060e071422a35267ada)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>